Coder Social home page Coder Social logo

ergor / hsrails Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 6.0 15.99 MB

Spigot/bukkit plugin to make minecarts worth building again

Home Page: https://dev.bukkit.org/projects/hsrails

License: GNU General Public License v3.0

Java 100.00%
spigot bukkit plugin minecraft minecart rails

hsrails's Introduction

hsrails

High Speed Rails

A spigot/bukkit plugin to make minecarts worth building again.

For Minecraft version 1.14 and tested working on 1.15, 1.16.3, 1.19. Will most likely work just fine on newer versions as well.

Place a powered rail on a boost block (redstone block by default) to build high-speed rail. Place on any other block to get a regular powered rail.

scrot

High-speed rails are by default 4x faster than regular powered rails, ie. 32 m/s, or 115 km/h. This is as fast as rocket powered elytra flight.

The high-speed rail multiplier can be temporarily changed with the /hsrails command, or permanently changed in the config. The boost block is also configurable. See Usage section for commands and config options.

To help cope with the higher speeds, there is also a hard brake block available (obsidian by default). If you place an unpowered power rail on a hard brake block, the cart will decelerate faster than default. See Usage section for configuration options.

Note: please read the Design sections on how to keep your carts from derailing at high speeds.

Note: there seems to be a game limitation for speed but not momentum, and it seems to be around multiplier of 4x. Multipliers higher than 4x usually result in increased momentum, but not higher top speeds. That means the carts will coast for longer, even though they appear to have the same top speed.

Usage

Commands

Use /hsrails <multiplier> to tweak how fast high-speed rails are. Multiplier must be between 0 and 8.

Example: set multiplier to 4

/hsrails 4

Config

This is the default HsRails/config.yml:

speedMultiplier: 4.0
boostBlock: "minecraft:redstone_block"
hardBrakeMultiplier: 8.0
hardBrakeBlock: "minecraft:obsidian"

Allowed values are:

  • speedMultiplier:
    • > 0
    • <= 8
  • boostBlock:
    • Namespaced block. Look up the ID name in the id list and prefix it with minecraft:. For example, type in "minecraft:stone" for stone block as boost block.
    • If you type in "any", every powered rail will be a high speed powered rail.
  • hardBrakeMultiplier:
    • >= 1
  • hardBrakeBlock:
    • Any namespaced block (see info on boostBlock for details). any is not allowed here.

Design considerations

You must be aware of a couple of things while building high-speed tracks:

  • Acceleration is not instantaneous.
  • Entering turns at high speed will derail you.
  • Entering/exiting slopes at high speed will derail you.
  • While traveling at high speeds, a regular powered rail will slow you down.

Derailing at high speeds is a limitation of the game itself, and is probably the reason why rails are so slow in vanilla Minecraft. Thus, when designing your high-speed tracks, you will have to design them like real high-speed train tracks: long stretches with smooth turns.

Design guidelines

These are my recommendations for building efficient high-speed tracks:

  • Allow room for acceleration: it takes a while to reach top speed. Place several high-speed rail sections close together at the start of your track.
  • Minimize number of turns: you only need at most one turn to get to any destination. An optimal track looks like an L from above.
  • Minimize number of slopes: build tunnels, bridges, etc. to stay on the same level.
  • Before turns and slopes, put one (or sometimes a couple of) regular powered rails to slow down and avoid derailment.
  • After turns and slopes, allow room for acceleration again.

To maintain high speeds you must of course build your tracks out of high-speed rails, because regular powered rails will slow you down. Only mix in regular powered rails in turns and slopes as mentioned above.

If you want to stop a high speed cart quickly, for example if you have stations/stops on your route, you can use hard brake blocks with unpowered powered rails.

Compiling

This is a maven project made in intellij idea. To compile, simply run mvn package

Credits

Adapted from varesa's Minecart Speedplus.

Thanks to LordNinka for discovering the effects of speed vs. momentum at high multipliers.

Thanks to TheWallaceman105 for bringing forth the idea of hard brake blocks and helping during development by testing.

hsrails's People

Contributors

ergor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hsrails's Issues

Lower the multiplier cap

Tests have shown that servers cannot handle 50x speed multiplier. They just cannot process it fast enough, at least with the current plugin implementation.

Lower the upper limit to lower the expectations.
Probably about 8x max should suffice. In tests I have done, the server seems to be struggling at 5/6 x and cannot go any faster.

Remember to update config code to gracefully handle old config files with multiplier > 8x.

Minecart gets too much momentum

It seems that after passing a high speed rail section, the minecart takes a lot of time to slow down. It gets way too much momentum.
Minecraft version 1.19 PaperMC build 8.

Config option to ignore hopper/chest minecarts

Some farms rely on the default max speed of minecarts to ensure even item distribution/pickup. Even though it is possible to achieve normal speed by not using a redstone block, it would be nice to have an option in the config to ignore the high speed rail for certain minecart types.

This way farms don't "randomly" break, for players who aren't aware the plugin is installed.

Hsrails 1.20

Does the plugin work in 1.20 or when will it be updated?

New implementation for higher max speeds

The current implementation is limited by server processing speeds, and results in max speed of about 5x.
Is it possible to squeeze more out of the server with a new implementation?

Configurable high speed block

Add a config option to use lapis block for high speed rails instead of redstone block.
This is from a user request:

The problem I have is that a lot of places use redstoneblock but do not need the high speed feature as these courses are all timed pistons with redstoneblocks with rail and lava etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.