@Override public void endChore() { if (!owner.worldObj.isRemote) { PacketDispatcher.sendPacketToAllPlayers(PacketHelper.createSyncPacket(owner)); PacketDispatcher.sendPacketToAllPlayers(PacketHelper.createAddAIPacket(owner)); } else { PacketDispatcher.sendPacketToServer(PacketHelper.createAddAIPacket(owner)); } owner.addAI(); hasEnded = true; }
@Override public void beginChore() { if (MCA.instance.isDedicatedServer) { if (!MCA.instance.modPropertiesManager.modProperties.server_allowWoodcuttingChore) { // End the chore and sync all clients so that the chore is stopped everywhere. endChore(); PacketDispatcher.sendPacketToAllPlayers(PacketHelper.createSyncPacket(owner)); owner .worldObj .getPlayerEntityByName(owner.lastInteractingPlayer) .addChatMessage("\u00a7cChore disabled by the server administrator."); return; } } if (!owner.worldObj.isRemote) { owner.say( LanguageHelper.getString( owner.worldObj.getPlayerEntityByName(owner.lastInteractingPlayer), owner, "chore.start.woodcutting", true)); } owner.tasks.taskEntries.clear(); hasBegun = true; }