13
0
geforkt von Mirrors/Paper

Added event for endermen picking up and placing blocks and methods to get/set what an enderman is holding.

By: Wizjany <wizjany@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2011-09-17 20:16:18 -04:00
Ursprung c3a23bd4e1
Commit 118ab48313

Datei anzeigen

@ -1,8 +1,11 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityEnderman;
import org.bukkit.Material;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Enderman;
import org.bukkit.material.MaterialData;
public class CraftEnderman extends CraftMonster implements Enderman {
public CraftEnderman(CraftServer server, EntityEnderman entity) {
@ -18,4 +21,13 @@ public class CraftEnderman extends CraftMonster implements Enderman {
public String toString() {
return "CraftEnderman";
}
public MaterialData getCarriedMaterial() {
return Material.getMaterial(getHandle().getCarriedId()).getNewData((byte) getHandle().getCarriedData());
}
public void setCarriedMaterial(MaterialData data) {
getHandle().setCarriedId(data.getItemTypeId());
getHandle().setCarriedData(data.getData());
}
}