From b4e6298056ba96a6a2541f86a1aaf6bcac3ec9dc Mon Sep 17 00:00:00 2001 From: Lildirt Date: Fri, 19 Jul 2024 12:46:30 -0400 Subject: [PATCH] bucket events feedback --- .../core/events/drivers/PlayerEvents.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java b/src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java index 72c7a9a72..ad4f94940 100644 --- a/src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java +++ b/src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java @@ -2814,10 +2814,13 @@ public Map evaluate(BindableEvent event) throws EventException { ret.put("player", new CString(e.getPlayer().getName(), t)); ret.put("location", ObjectGenerator.GetGenerator().location(e.getBlock().getLocation(), false)); - if(e.getHand() == MCEquipmentSlot.WEAPON) { - ret.put("hand", new CString("main_hand", t)); - } else { - ret.put("hand", new CString("off_hand", t)); + + if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_19_2)) { + if(e.getHand() == MCEquipmentSlot.WEAPON) { + ret.put("hand", new CString("main_hand", t)); + } else { + ret.put("hand", new CString("off_hand", t)); + } } ret.put("item", ObjectGenerator.GetGenerator().item(e.getItemStack(), t)); @@ -2840,9 +2843,9 @@ public String getName() { public String docs() { return "{} " + "Fired when a player fills a bucket in their hand from the world." - + " { player: the player who used the bucket. " + + " { player: the player who used the bucket." + " | location: where the bucket was filled from." - + " | hand: hand the player was holding the bucket in. " + + " | hand: hand the player was holding the bucket in, either main_hand or off_hand (MC 1.19.2+)." + " | item: the bucket item the player ended up with. }" + "{} " + "{} " @@ -2871,10 +2874,10 @@ public String getName() { @Override public String docs() { return "{} " - + "Fired when a player empties a bucket in their hand to the world." - + " { player: the player who used the bucket. " + + "Fired when a player empties a bucket in their hand into the world." + + " { player: the player who used the bucket." + " | location: where the bucket was emptied to." - + " | hand: hand the player was holding the bucket in. " + + " | hand: hand the player was holding the bucket in, either main_hand or off_hand (MC 1.19.2+)." + " | item: the bucket item the player ended up with. }" + "{} " + "{} "