Skip to content

Commit

Permalink
Ability to turn off vehicle mechanics by setting it's material to
Browse files Browse the repository at this point in the history
something less than 0.

Signed-off-by: me4502 <mnmiller1@hotmail.com>
  • Loading branch information
me4502 committed Nov 6, 2012
1 parent d7ddc62 commit a4bf43f
Showing 1 changed file with 24 additions and 12 deletions.
Expand Up @@ -28,18 +28,30 @@ public MinecartManager(VehiclesPlugin plugin) {
public void reloadConfiguration(VehiclesConfiguration cfg) {

mechanisms = new HashMap<Integer, CartMechanism>();
mechanisms.put(cfg.matBoostMax, new CartBooster(100));
mechanisms.put(cfg.matBoost25x, new CartBooster(1.25));
mechanisms.put(cfg.matSlow20x, new CartBooster(0.8));
mechanisms.put(cfg.matSlow50x, new CartBooster(0.5));
mechanisms.put(cfg.matReverse, new CartReverser());
mechanisms.put(cfg.matSorter, new CartSorter());
mechanisms.put(cfg.matStation, new CartStation());
mechanisms.put(cfg.matEjector, new CartEjector());
mechanisms.put(cfg.matDeposit, new CartDeposit());
mechanisms.put(cfg.matTeleport, new CartTeleporter());
mechanisms.put(cfg.matDispenser, new CartDispenser());
mechanisms.put(cfg.matMessager, new CartMessager(plugin));
if(cfg.matBoostMax > 0)
mechanisms.put(cfg.matBoostMax, new CartBooster(100));
if(cfg.matBoost25x > 0)
mechanisms.put(cfg.matBoost25x, new CartBooster(1.25));
if(cfg.matSlow20x > 0)
mechanisms.put(cfg.matSlow20x, new CartBooster(0.8));
if(cfg.matSlow50x > 0)
mechanisms.put(cfg.matSlow50x, new CartBooster(0.5));
if(cfg.matReverse > 0)
mechanisms.put(cfg.matReverse, new CartReverser());
if(cfg.matSorter > 0)
mechanisms.put(cfg.matSorter, new CartSorter());
if(cfg.matStation > 0)
mechanisms.put(cfg.matStation, new CartStation());
if(cfg.matEjector > 0)
mechanisms.put(cfg.matEjector, new CartEjector());
if(cfg.matDeposit > 0)
mechanisms.put(cfg.matDeposit, new CartDeposit());
if(cfg.matTeleport > 0)
mechanisms.put(cfg.matTeleport, new CartTeleporter());
if(cfg.matDispenser > 0)
mechanisms.put(cfg.matDispenser, new CartDispenser());
if(cfg.matMessager > 0)
mechanisms.put(cfg.matMessager, new CartMessager(plugin));
for (Map.Entry<Integer, CartMechanism> ent : mechanisms.entrySet()) {
ent.getValue().setMaterial(ent.getKey());
}
Expand Down

0 comments on commit a4bf43f

Please sign in to comment.