Fixed client side check for TileMechanical packet handling

This commit is contained in:
Robert S 2014-06-10 10:11:08 -04:00
parent ac4d930aac
commit f02912e7a4
2 changed files with 2 additions and 18 deletions

View file

@ -40,7 +40,6 @@ public abstract class TileMechanical extends TileBase implements INodeProvider,
public TileMechanical(Material material) public TileMechanical(Material material)
{ {
super(material); super(material);
mechanicalNode = new MechanicalNode(this).setLoad(0.5f);
} }
@Override @Override
@ -64,7 +63,7 @@ public abstract class TileMechanical extends TileBase implements INodeProvider,
mechanicalNode.update(); mechanicalNode.update();
if (!this.getWorldObj().isRemote) if (!this.getWorldObj().isRemote)
{ {
if (mechanicalNode.markRotationUpdate && ticks % 10 == 0) if (mechanicalNode.markRotationUpdate && ticks % 3 == 0)
{ {
sendRotationPacket(); sendRotationPacket();
mechanicalNode.markRotationUpdate = false; mechanicalNode.markRotationUpdate = false;
@ -98,7 +97,7 @@ public abstract class TileMechanical extends TileBase implements INodeProvider,
{ {
try try
{ {
if (!world().isRemote) if (world().isRemote)
{ {
if (id == PACKET_NBT) if (id == PACKET_NBT)
{ {

View file

@ -1,29 +1,16 @@
package resonantinduction.mechanical.energy.turbine; package resonantinduction.mechanical.energy.turbine;
import java.io.IOException;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import com.google.common.io.ByteArrayDataInput;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import resonant.api.grid.INode;
import resonant.api.grid.INodeProvider; import resonant.api.grid.INodeProvider;
import resonant.lib.References;
import resonant.lib.content.module.TileBase;
import resonant.lib.multiblock.IMultiBlockStructure; import resonant.lib.multiblock.IMultiBlockStructure;
import resonant.lib.network.IPacketReceiverWithID; import resonant.lib.network.IPacketReceiverWithID;
import resonant.lib.network.PacketHandler;
import resonant.lib.network.Synced;
import resonant.lib.network.Synced.SyncedInput;
import resonant.lib.network.Synced.SyncedOutput;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
import resonantinduction.mechanical.energy.grid.TileMechanical; import resonantinduction.mechanical.energy.grid.TileMechanical;
import universalelectricity.api.vector.Vector3; import universalelectricity.api.vector.Vector3;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -102,7 +89,6 @@ public class TileTurbine extends TileMechanical implements IMultiBlockStructure<
/** Reads a tile entity from NBT. */ /** Reads a tile entity from NBT. */
@Override @Override
@SyncedInput
public void readFromNBT(NBTTagCompound nbt) public void readFromNBT(NBTTagCompound nbt)
{ {
super.readFromNBT(nbt); super.readFromNBT(nbt);
@ -113,7 +99,6 @@ public class TileTurbine extends TileMechanical implements IMultiBlockStructure<
/** Writes a tile entity to NBT. */ /** Writes a tile entity to NBT. */
@Override @Override
@SyncedOutput
public void writeToNBT(NBTTagCompound nbt) public void writeToNBT(NBTTagCompound nbt)
{ {
super.writeToNBT(nbt); super.writeToNBT(nbt);