3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 06:20:06 +01:00

Add BlockDispenseArmorEvent

Dieser Commit ist enthalten in:
Parker Hawke 2018-09-08 00:15:33 -04:00 committet von md_5
Ursprung cd367fa4d8
Commit 226db0eae7

Datei anzeigen

@ -6,7 +6,7 @@
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.event.block.BlockDispenseArmorEvent;
+// CraftBukkit end +// CraftBukkit end
+ +
public class ItemArmor extends Item { public class ItemArmor extends Item {
@ -21,7 +21,7 @@
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
+ CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
+ +
+ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + BlockDispenseArmorEvent event = new BlockDispenseArmorEvent(block, craftItem.clone(), (org.bukkit.craftbukkit.entity.CraftLivingEntity) entityliving.bukkitEntity);
+ if (!BlockDispenser.eventFired) { + if (!BlockDispenser.eventFired) {
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);
+ } + }