diff --git a/vehicles/src/main/java/com/sk89q/craftbook/cart/MinecartManager.java b/vehicles/src/main/java/com/sk89q/craftbook/cart/MinecartManager.java index 6c13fe12f1..67619730e7 100644 --- a/vehicles/src/main/java/com/sk89q/craftbook/cart/MinecartManager.java +++ b/vehicles/src/main/java/com/sk89q/craftbook/cart/MinecartManager.java @@ -28,18 +28,30 @@ public MinecartManager(VehiclesPlugin plugin) { public void reloadConfiguration(VehiclesConfiguration cfg) { mechanisms = new HashMap(); - 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 ent : mechanisms.entrySet()) { ent.getValue().setMaterial(ent.getKey()); }