Skip to content

Commit

Permalink
Port Elevator to CraftBook 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Jan 8, 2021
1 parent bec20ca commit 7366f8b
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 385 deletions.
Expand Up @@ -85,19 +85,6 @@ public class LanguageManager {
put("mech.hiddenswitch.key", "The key did not fit!");
put("mech.hiddenswitch.toggle", "You hear the muffled click of a switch!");

put("mech.lift.target-sign-created", "Elevator target sign created.");
put("mech.lift.down-sign-created", "Elevator down sign created.");
put("mech.lift.up-sign-created", "Elevator up sign created.");
put("mech.lift.obstruct", "Your destination is obstructed!");
put("mech.lift.no-floor", "There is no floor at your destination!");
put("mech.lift.floor", "Floor");
put("mech.lift.up", "You went up a floor!");
put("mech.lift.down", "You went down a floor!");
put("mech.lift.leave", "You have left the elevator!");
put("mech.lift.no-destination", "This lift has no destination.");
put("mech.lift.no-depart", "Cannot depart from this lift (can only arrive).");
put("mech.lift.busy", "Elevator Busy!");

put("mech.lightswitch.create", "Light Switch Created!");

put("mech.map.create", "Map Changer Created!");
Expand Down
Expand Up @@ -98,7 +98,7 @@ public void onPlayerInteract(final PlayerInteractEvent event) {
signClickTimer.put(event.getPlayer().getUniqueId(), System.currentTimeMillis());
}
}
SignClickEvent ev = new SignClickEvent(event.getPlayer(), action, event.getItem(), block, event.getBlockFace());
SignClickEvent ev = new SignClickEvent(event.getPlayer(), action, event.getItem(), block, event.getBlockFace(), event.getHand(), event.getInteractionPoint());
CraftBookPlugin.inst().getServer().getPluginManager().callEvent(ev);
if (ev.isCancelled()) {
event.setCancelled(true);
Expand Down
Expand Up @@ -350,6 +350,15 @@ public void setup() {
.category(MechanicCategory.MINECART)
.buildAndRegister();

MechanicType.Builder
.create()
.id("elevator")
.name("Elevator")
.description(TranslatableComponent.of("craftbook.elevator.description"))
.className("org.enginehub.craftbook.mechanics.Elevator")
.category(MechanicCategory.GENERAL)
.buildAndRegister();

// TODO CommandItems needs to load early (after variables).
}

Expand Down

0 comments on commit 7366f8b

Please sign in to comment.