Added villager watcher

This commit is contained in:
Andrew 2013-05-21 00:27:28 +12:00
parent f9c3bbcf10
commit fd243d196c
2 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,23 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class ZombieWatcher extends FlagWatcher {
public ZombieWatcher(int entityId) {
super(entityId);
setValue(13, (byte) 0);
}
public void setVillager(boolean villager) {
if (isVillager() != villager) {
setValue(13, (byte) (villager ? 1 : 0));
sendData(13);
}
}
public boolean isVillager() {
return (Byte) getValue(13) == 1;
}
}

View File

@ -3,7 +3,6 @@ package me.libraryaddict.disguise;
import java.util.List; import java.util.List;
import me.libraryaddict.disguise.DisguiseTypes.Disguise; import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.DisguiseType;
import me.libraryaddict.disguise.DisguiseTypes.PlayerDisguise; import me.libraryaddict.disguise.DisguiseTypes.PlayerDisguise;
import net.minecraft.server.v1_5_R3.WatchableObject; import net.minecraft.server.v1_5_R3.WatchableObject;
@ -20,7 +19,6 @@ import com.comphenix.protocol.reflect.StructureModifier;
public class LibsDisguises extends JavaPlugin { public class LibsDisguises extends JavaPlugin {
@Override
public void onEnable() { public void onEnable() {
getCommand("disguise").setExecutor(new DisguiseCommand()); getCommand("disguise").setExecutor(new DisguiseCommand());
ProtocolLibrary.getProtocolManager().addPacketListener( ProtocolLibrary.getProtocolManager().addPacketListener(