Skip to content

Commit

Permalink
Removes what should be an unnecessary client sync packet
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Apr 16, 2015
1 parent a15dde8 commit 4a612ef
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 121 deletions.
3 changes: 0 additions & 3 deletions src/com/jaquadro/minecraft/storagedrawers/StorageDrawers.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.jaquadro.minecraft.storagedrawers.core.*;
import com.jaquadro.minecraft.storagedrawers.integration.IntegrationRegistry;
import com.jaquadro.minecraft.storagedrawers.network.BlockClickMessage;
import com.jaquadro.minecraft.storagedrawers.network.ControllerUpdateMessage;
import com.jaquadro.minecraft.storagedrawers.network.CountUpdateMessage;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
Expand Down Expand Up @@ -59,11 +58,9 @@ public void preInit (FMLPreInitializationEvent event) {

if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
network.registerMessage(CountUpdateMessage.Handler.class, CountUpdateMessage.class, 1, Side.CLIENT);
network.registerMessage(ControllerUpdateMessage.Handler.class, ControllerUpdateMessage.class, 2, Side.CLIENT);
}
else {
network.registerMessage(CountUpdateMessage.HandlerStub.class, CountUpdateMessage.class, 1, Side.CLIENT);
network.registerMessage(ControllerUpdateMessage.HandlerStub.class, ControllerUpdateMessage.class, 2, Side.CLIENT);
}

compRegistry = new CompTierRegistry();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.jaquadro.minecraft.storagedrawers.block.tile;

import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.api.inventory.IDrawerInventory;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroupInteractive;
import com.jaquadro.minecraft.storagedrawers.network.ControllerUpdateMessage;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -183,21 +179,11 @@ public void updateCache () {
}
}

/*int validSlotCount = 0;
for (int i = 0, n = invBlockList.size(); i < n; i++) {
if (invBlockList.get(i) != null)
validSlotCount++;
}*/

inventorySlots = new int[invBlockList.size()];
for (int i = 0, j = 0, n = invBlockList.size(); i < n; i++) {
//if (invBlockList.get(i) != null)
inventorySlots[j++] = i;
}

if (!worldObj.isRemote)
syncClient();

if (preCount != inventorySlots.length && (preCount == 0 || inventorySlots.length == 0)) {
if (!worldObj.isRemote)
markDirty();
Expand Down Expand Up @@ -370,18 +356,6 @@ public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity pkt) {
getWorldObj().func_147479_m(xCoord, yCoord, zCoord); // markBlockForRenderUpdate
}

private void syncClient () {
IMessage message = new ControllerUpdateMessage(xCoord, yCoord, zCoord, inventorySlots);
NetworkRegistry.TargetPoint targetPoint = new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 500);

StorageDrawers.network.sendToAllAround(message, targetPoint);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
}

public void clientUpdate (int[] inventorySlots) {
this.inventorySlots = inventorySlots;
}

@Override
public IDrawerInventory getDrawerInventory () {
return null;
Expand Down

This file was deleted.

0 comments on commit 4a612ef

Please sign in to comment.