diff --git a/src/main/java/forestry/apiculture/gui/ContainerImprinter.java b/src/main/java/forestry/apiculture/gui/ContainerImprinter.java index bb6ec36b6..18574653b 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerImprinter.java +++ b/src/main/java/forestry/apiculture/gui/ContainerImprinter.java @@ -41,7 +41,7 @@ public class ContainerImprinter extends ContainerItemInventory boolean blockRemovedByPlayer(T block, World world, EntityPlayer player, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); - if (Proxies.common.isSimulating(world) && block.canHarvestBlock(player, meta) && !player.capabilities.isCreativeMode) { + if (!world.isRemote && block.canHarvestBlock(player, meta) && !player.capabilities.isCreativeMode) { TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileWood) { diff --git a/src/main/java/forestry/core/blocks/BlockBase.java b/src/main/java/forestry/core/blocks/BlockBase.java index 76c48e3af..92e397407 100644 --- a/src/main/java/forestry/core/blocks/BlockBase.java +++ b/src/main/java/forestry/core/blocks/BlockBase.java @@ -204,7 +204,7 @@ public class BlockBase extends BlockForestry { } } - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return true; } @@ -224,7 +224,7 @@ public class BlockBase extends BlockForestry { @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/core/blocks/BlockForestry.java b/src/main/java/forestry/core/blocks/BlockForestry.java index 9a45d1edd..da81f2bd4 100644 --- a/src/main/java/forestry/core/blocks/BlockForestry.java +++ b/src/main/java/forestry/core/blocks/BlockForestry.java @@ -25,7 +25,6 @@ import com.mojang.authlib.GameProfile; import forestry.core.CreativeTabForestry; import forestry.core.access.IOwnable; -import forestry.core.proxy.Proxies; import forestry.core.tiles.IRestrictedAccessTile; import forestry.core.tiles.TileForestry; import forestry.core.utils.Log; @@ -55,7 +54,7 @@ public abstract class BlockForestry extends BlockContainer { @Override public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack itemstack) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/core/blocks/BlockSoil.java b/src/main/java/forestry/core/blocks/BlockSoil.java index dff79cb70..1eb1b2d75 100644 --- a/src/main/java/forestry/core/blocks/BlockSoil.java +++ b/src/main/java/forestry/core/blocks/BlockSoil.java @@ -36,7 +36,6 @@ import forestry.core.CreativeTabForestry; import forestry.core.config.Constants; import forestry.core.config.ForestryBlock; import forestry.core.config.ForestryItem; -import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; /** @@ -88,7 +87,7 @@ public class BlockSoil extends Block implements IItemTyped { @Override public void updateTick(World world, int i, int j, int k, Random random) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/core/blocks/BlockStructure.java b/src/main/java/forestry/core/blocks/BlockStructure.java index 2f9245424..bdfc71df0 100644 --- a/src/main/java/forestry/core/blocks/BlockStructure.java +++ b/src/main/java/forestry/core/blocks/BlockStructure.java @@ -21,7 +21,6 @@ import net.minecraft.world.World; import forestry.core.circuits.ISocketable; import forestry.core.multiblock.MultiblockControllerBase; import forestry.core.multiblock.MultiblockTileEntityBase; -import forestry.core.proxy.Proxies; import forestry.core.utils.InventoryUtil; public abstract class BlockStructure extends BlockForestry { @@ -88,7 +87,7 @@ public abstract class BlockStructure extends BlockForestry { @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/core/circuits/ItemSolderingIron.java b/src/main/java/forestry/core/circuits/ItemSolderingIron.java index 471b1d8f6..f886043a7 100755 --- a/src/main/java/forestry/core/circuits/ItemSolderingIron.java +++ b/src/main/java/forestry/core/circuits/ItemSolderingIron.java @@ -31,7 +31,6 @@ import forestry.core.errors.EnumErrorCode; import forestry.core.inventory.ItemInventory; import forestry.core.items.ItemForestry; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.core.utils.datastructures.RevolvingList; public class ItemSolderingIron extends ItemForestry implements ISolderingIron { @@ -283,7 +282,7 @@ public class ItemSolderingIron extends ItemForestry implements ISolderingIron { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(world)) { + if (!world.isRemote) { entityplayer.openGui(ForestryAPI.instance, GuiId.SolderingIronGUI.ordinal(), world, (int) entityplayer.posX, (int) entityplayer.posY, (int) entityplayer.posZ); } diff --git a/src/main/java/forestry/core/genetics/ItemResearchNote.java b/src/main/java/forestry/core/genetics/ItemResearchNote.java index 116c3f070..deb3f408e 100755 --- a/src/main/java/forestry/core/genetics/ItemResearchNote.java +++ b/src/main/java/forestry/core/genetics/ItemResearchNote.java @@ -282,7 +282,7 @@ public class ItemResearchNote extends ItemForestry { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return itemstack; } diff --git a/src/main/java/forestry/core/gui/ContainerAlyzer.java b/src/main/java/forestry/core/gui/ContainerAlyzer.java index 9b20cb65b..b96d9521d 100644 --- a/src/main/java/forestry/core/gui/ContainerAlyzer.java +++ b/src/main/java/forestry/core/gui/ContainerAlyzer.java @@ -31,7 +31,7 @@ public class ContainerAlyzer extends ContainerItemInventory drops = getDrops(world, x, y, z, 0, 0); for (ItemStack drop : drops) { ItemStackUtil.dropItemStackAsEntity(drop, world, x, y, z); diff --git a/src/main/java/forestry/farming/blocks/BlockMushroom.java b/src/main/java/forestry/farming/blocks/BlockMushroom.java index 722b12524..b3f21c661 100644 --- a/src/main/java/forestry/farming/blocks/BlockMushroom.java +++ b/src/main/java/forestry/farming/blocks/BlockMushroom.java @@ -30,7 +30,6 @@ import cpw.mods.fml.relauncher.SideOnly; import forestry.core.blocks.IItemTyped; import forestry.core.config.Constants; -import forestry.core.proxy.Proxies; import forestry.farming.worldgen.WorldGenBigMushroom; public class BlockMushroom extends BlockSapling implements IItemTyped { @@ -76,7 +75,7 @@ public class BlockMushroom extends BlockSapling implements IItemTyped { @Override public void updateTick(World world, int i, int j, int k, Random random) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/food/gui/ContainerInfuser.java b/src/main/java/forestry/food/gui/ContainerInfuser.java index f06eb22f6..d7d7e4a60 100755 --- a/src/main/java/forestry/food/gui/ContainerInfuser.java +++ b/src/main/java/forestry/food/gui/ContainerInfuser.java @@ -41,7 +41,7 @@ public class ContainerInfuser extends ContainerItemInventory { @Override public void onContainerClosed(EntityPlayer entityplayer) { - if (!Proxies.common.isSimulating(entityplayer.worldObj)) { + if (entityplayer.worldObj.isRemote) { return; } diff --git a/src/main/java/forestry/food/items/ItemBeverage.java b/src/main/java/forestry/food/items/ItemBeverage.java index 089570da4..37717825c 100755 --- a/src/main/java/forestry/food/items/ItemBeverage.java +++ b/src/main/java/forestry/food/items/ItemBeverage.java @@ -32,7 +32,6 @@ import forestry.api.food.BeverageManager; import forestry.api.food.IBeverageEffect; import forestry.core.config.Config; import forestry.core.items.ItemForestryFood; -import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; public class ItemBeverage extends ItemForestryFood { @@ -142,7 +141,7 @@ public class ItemBeverage extends ItemForestryFood { entityplayer.getFoodStats().func_151686_a(this, itemstack); world.playSoundAtEntity(entityplayer, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return itemstack; } diff --git a/src/main/java/forestry/food/items/ItemInfuser.java b/src/main/java/forestry/food/items/ItemInfuser.java index 47456c3d6..d6009abf5 100755 --- a/src/main/java/forestry/food/items/ItemInfuser.java +++ b/src/main/java/forestry/food/items/ItemInfuser.java @@ -28,7 +28,6 @@ import forestry.core.config.ForestryItem; import forestry.core.inventory.ItemInventory; import forestry.core.items.ItemForestry; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.food.BeverageEffect; import forestry.plugins.PluginManager; @@ -334,7 +333,7 @@ public class ItemInfuser extends ItemForestry { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(world)) { + if (!world.isRemote) { entityplayer.openGui(ForestryAPI.instance, GuiId.InfuserGUI.ordinal(), world, (int) entityplayer.posX, (int) entityplayer.posY, (int) entityplayer.posZ); } diff --git a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java index 460bf8cb0..37c238a8d 100755 --- a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java +++ b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java @@ -44,7 +44,6 @@ import forestry.api.lepidopterology.EnumFlutterType; import forestry.api.lepidopterology.IAlleleButterflySpecies; import forestry.api.lepidopterology.IButterfly; import forestry.api.lepidopterology.IEntityButterfly; -import forestry.core.proxy.Proxies; import forestry.core.utils.ItemStackUtil; import forestry.lepidopterology.genetics.Butterfly; import forestry.lepidopterology.render.RenderButterflyItem; @@ -333,7 +332,7 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly @Override public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { - if (Proxies.common.isSimulating(worldObj)) { + if (!worldObj.isRemote) { setIndividual(contained); } return data; @@ -407,7 +406,7 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly return false; } - if (Proxies.common.isSimulating(worldObj)) { + if (!worldObj.isRemote) { contained.getGenome().getPrimary().getRoot().getBreedingTracker(worldObj, player.getGameProfile()).registerCatch(contained); ItemStackUtil.dropItemStackAsEntity(PluginLepidopterology.butterflyInterface.getMemberStack(contained.copy(), EnumFlutterType.BUTTERFLY.ordinal()), worldObj, posX, posY, posZ); setDead(); @@ -436,7 +435,7 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly super.onUpdate(); // Update stuff client side - if (!Proxies.common.isSimulating(worldObj)) { + if (worldObj.isRemote) { if (species == null || dataWatcher.hasChanges()) { scale = (float) dataWatcher.getWatchableObjectInt(DATAWATCHER_ID_SCALE) / 100; String uid = dataWatcher.getWatchableObjectString(DATAWATCHER_ID_SPECIES); diff --git a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java index 6713298eb..cadf22505 100755 --- a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java +++ b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java @@ -113,7 +113,7 @@ public class ItemButterflyGE extends ItemGE { if (type != EnumFlutterType.BUTTERFLY) { return false; } - if (!Proxies.common.isSimulating(entityItem.worldObj) || entityItem.ticksExisted < 80) { + if (entityItem.worldObj.isRemote || entityItem.ticksExisted < 80) { return false; } if (rand.nextInt(24) != 0) { @@ -207,7 +207,7 @@ public class ItemButterflyGE extends ItemGE { @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float facingX, float facingY, float facingZ) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return false; } diff --git a/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java b/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java index 0b1628626..ec4a421d1 100755 --- a/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java +++ b/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java @@ -22,7 +22,6 @@ import forestry.core.config.Config; import forestry.core.gui.IHintSource; import forestry.core.items.ItemAlyzer; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.plugins.PluginLepidopterology; public class ItemFlutterlyzer extends ItemAlyzer { @@ -96,7 +95,7 @@ public class ItemFlutterlyzer extends ItemAlyzer { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(world)) { + if (!world.isRemote) { entityplayer.openGui(ForestryAPI.instance, GuiId.FlutterlyzerGUI.ordinal(), world, (int) entityplayer.posX, (int) entityplayer.posY, (int) entityplayer.posZ); } diff --git a/src/main/java/forestry/mail/gui/ContainerCatalogue.java b/src/main/java/forestry/mail/gui/ContainerCatalogue.java index cd5f53e91..07f3b3ead 100755 --- a/src/main/java/forestry/mail/gui/ContainerCatalogue.java +++ b/src/main/java/forestry/mail/gui/ContainerCatalogue.java @@ -67,7 +67,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { public ContainerCatalogue(EntityPlayer player) { this.player = player; - if (Proxies.common.isSimulating(player.worldObj)) { + if (!player.worldObj.isRemote) { rebuildStationsList(); } } @@ -104,7 +104,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { } public void nextPage() { - if (!Proxies.common.isSimulating(player.worldObj)) { + if (player.worldObj.isRemote) { sendSelection(true); return; } @@ -117,7 +117,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { } public void previousPage() { - if (!Proxies.common.isSimulating(player.worldObj)) { + if (player.worldObj.isRemote) { sendSelection(false); return; } @@ -130,7 +130,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { } public void cycleFilter() { - if (!Proxies.common.isSimulating(player.worldObj)) { + if (player.worldObj.isRemote) { PacketGuiSelect packet = new PacketGuiSelect(PacketId.GUI_SELECTION_CHANGE, 2, 0); Proxies.net.sendToServer(packet); return; @@ -150,7 +150,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { /* Managing Trade info */ private void updateTradeInfo() { // Updating is done by the server. - if (!Proxies.common.isSimulating(player.worldObj)) { + if (player.worldObj.isRemote) { return; } diff --git a/src/main/java/forestry/mail/gui/ContainerLetter.java b/src/main/java/forestry/mail/gui/ContainerLetter.java index 31d13afec..1dccb3f0a 100755 --- a/src/main/java/forestry/mail/gui/ContainerLetter.java +++ b/src/main/java/forestry/mail/gui/ContainerLetter.java @@ -59,7 +59,7 @@ public class ContainerLetter extends ContainerItemInventory { } // Rip open delivered mails - if (Proxies.common.isSimulating(player.worldObj)) { + if (!player.worldObj.isRemote) { if (inventory.getLetter().isProcessed()) { inventory.onLetterOpened(); } @@ -78,7 +78,7 @@ public class ContainerLetter extends ContainerItemInventory { @Override public void onContainerClosed(EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(entityplayer.worldObj)) { + if (!entityplayer.worldObj.isRemote) { ILetter letter = inventory.getLetter(); if (!letter.isProcessed()) { IMailAddress sender = PostManager.postRegistry.getMailAddress(entityplayer.getGameProfile()); @@ -183,7 +183,7 @@ public class ContainerLetter extends ContainerItemInventory { /* Managing Trade info */ private void updateTradeInfo(World world, IMailAddress address) { // Updating is done by the server. - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return; } diff --git a/src/main/java/forestry/mail/gui/ContainerMailbox.java b/src/main/java/forestry/mail/gui/ContainerMailbox.java index 7a7ac8ce2..310d5abb4 100755 --- a/src/main/java/forestry/mail/gui/ContainerMailbox.java +++ b/src/main/java/forestry/mail/gui/ContainerMailbox.java @@ -53,7 +53,7 @@ public class ContainerMailbox extends ContainerTile { ItemStack stack = super.slotClick(slotIndex, button, par3, player); if (SlotUtil.isSlotInRange(slotIndex, SLOT_LETTERS, SLOT_LETTERS_COUNT)) { - if (Proxies.common.isSimulating(player.worldObj) && mailInventory != null) { + if (!player.worldObj.isRemote && mailInventory != null) { POBoxInfo info = mailInventory.getPOBoxInfo(); Proxies.net.sendToPlayer(new PacketPOBoxInfo(info), player); } diff --git a/src/main/java/forestry/mail/items/ItemCatalogue.java b/src/main/java/forestry/mail/items/ItemCatalogue.java index c6491939b..064411f4f 100755 --- a/src/main/java/forestry/mail/items/ItemCatalogue.java +++ b/src/main/java/forestry/mail/items/ItemCatalogue.java @@ -17,7 +17,6 @@ import net.minecraft.world.World; import forestry.api.core.ForestryAPI; import forestry.core.items.ItemForestry; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; public class ItemCatalogue extends ItemForestry { @@ -28,7 +27,7 @@ public class ItemCatalogue extends ItemForestry { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(world)) { + if (!world.isRemote) { entityplayer.openGui(ForestryAPI.instance, GuiId.CatalogueGUI.ordinal(), world, (int) entityplayer.posX, (int) entityplayer.posY, (int) entityplayer.posZ); } diff --git a/src/main/java/forestry/mail/items/ItemLetter.java b/src/main/java/forestry/mail/items/ItemLetter.java index 6bf2423e5..528bd9ec7 100755 --- a/src/main/java/forestry/mail/items/ItemLetter.java +++ b/src/main/java/forestry/mail/items/ItemLetter.java @@ -37,7 +37,6 @@ import forestry.core.gui.IHintSource; import forestry.core.inventory.ItemInventory; import forestry.core.items.ItemInventoried; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; import forestry.core.utils.SlotUtil; import forestry.core.utils.StringUtil; @@ -61,7 +60,7 @@ public class ItemLetter extends ItemInventoried { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (Proxies.common.isSimulating(world)) { + if (!world.isRemote) { if (itemstack.stackSize == 1) { entityplayer.openGui(ForestryAPI.instance, GuiId.LetterGUI.ordinal(), world, (int) entityplayer.posX, (int) entityplayer.posY, (int) entityplayer.posZ); } else { diff --git a/src/main/java/forestry/mail/tiles/TileMailbox.java b/src/main/java/forestry/mail/tiles/TileMailbox.java index 7566ac19e..f7d11a0f7 100644 --- a/src/main/java/forestry/mail/tiles/TileMailbox.java +++ b/src/main/java/forestry/mail/tiles/TileMailbox.java @@ -34,7 +34,6 @@ import forestry.api.mail.PostManager; import forestry.core.config.Config; import forestry.core.inventory.InventoryAdapter; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.core.tiles.TileBase; import forestry.mail.EnumDeliveryState; import forestry.mail.POBox; @@ -56,7 +55,7 @@ public class TileMailbox extends TileBase implements IMailContainer { @Override public void openGui(EntityPlayer player) { - if (!Proxies.common.isSimulating(worldObj)) { + if (worldObj.isRemote) { return; } @@ -86,7 +85,7 @@ public class TileMailbox extends TileBase implements IMailContainer { /* MAIL HANDLING */ public IInventory getOrCreateMailInventory(World world, GameProfile playerProfile) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return getInternalInventory(); } diff --git a/src/main/java/forestry/mail/tiles/TileTrader.java b/src/main/java/forestry/mail/tiles/TileTrader.java index fbcd0bc8f..ad6a1d854 100644 --- a/src/main/java/forestry/mail/tiles/TileTrader.java +++ b/src/main/java/forestry/mail/tiles/TileTrader.java @@ -280,7 +280,7 @@ public class TileTrader extends TileBase { return; } - if (Proxies.common.isSimulating(worldObj)) { + if (!worldObj.isRemote) { IErrorLogic errorLogic = getErrorLogic(); boolean hasValidTradeAddress = PostManager.postRegistry.isValidTradeAddress(worldObj, address); @@ -301,7 +301,7 @@ public class TileTrader extends TileBase { @Override public IInventoryAdapter getInternalInventory() { // Handle client side - if (!Proxies.common.isSimulating(worldObj) || !address.isValid()) { + if (worldObj.isRemote || !address.isValid()) { return super.getInternalInventory(); } diff --git a/src/main/java/forestry/storage/items/ItemBackpack.java b/src/main/java/forestry/storage/items/ItemBackpack.java index e34486cd8..3c70f2c3b 100755 --- a/src/main/java/forestry/storage/items/ItemBackpack.java +++ b/src/main/java/forestry/storage/items/ItemBackpack.java @@ -40,7 +40,6 @@ import forestry.core.inventory.wrappers.IInvSlot; import forestry.core.inventory.wrappers.InventoryIterator; import forestry.core.items.ItemInventoried; import forestry.core.network.GuiId; -import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; import forestry.core.tiles.TileUtil; import forestry.core.utils.InventoryUtil; @@ -75,7 +74,7 @@ public class ItemBackpack extends ItemInventoried { @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return itemstack; } @@ -96,7 +95,7 @@ public class ItemBackpack extends ItemInventoried { @Override public boolean onItemUseFirst(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if (!Proxies.common.isSimulating(world)) { + if (world.isRemote) { return false; }