Added villager watcher
This commit is contained in:
parent
f9c3bbcf10
commit
fd243d196c
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user