Replace !Proxies.common.isSimulating(world) with standard world.isRemote

This commit is contained in:
mezz committed 2015-09-25 15:18:24 -07:00
1 parent 1e89bab556
commit 4234c38d69
44 files changed
+66 -102

No files matched your search

@@ -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;
}
@@ -59,7 +59,7 @@ public class ContainerLetter extends ContainerItemInventory<LetterInventory> {
}
// 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<LetterInventory> {
@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<LetterInventory> {
/* 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;
}
@@ -53,7 +53,7 @@ public class ContainerMailbox extends ContainerTile<TileMailbox> {
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);
}
@@ -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);
}
@@ -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 {
@@ -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();
}
@@ -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();
}