Skip to content

Commit

Permalink
bucket events feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Lildirt committed Jul 19, 2024
1 parent 8a37e78 commit b4e6298
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2814,10 +2814,13 @@ public Map<String, Mixed> 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));

Expand All @@ -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. }"
+ "{} "
+ "{} "
Expand Down Expand Up @@ -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. }"
+ "{} "
+ "{} "
Expand Down

0 comments on commit b4e6298

Please sign in to comment.