Fixed a client issue with conveyor belts
Due to a packet issue belts were not moving when a player logged in.
This commit is contained in:
parent
0f3408ec5d
commit
7d1f9c0dd6
2 changed files with 24 additions and 24 deletions
|
@ -62,7 +62,6 @@ public abstract class TileEntityAssembly extends TileEntityEnergyMachine impleme
|
|||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
||||
if (ticks % updateTick == 0)
|
||||
{
|
||||
this.updateTick = (random.nextInt(1 + refresh_diff) + refresh_min_rate);
|
||||
|
|
|
@ -115,9 +115,31 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt,
|
|||
{
|
||||
if (this.slantType != SlantType.NONE)
|
||||
{
|
||||
return PacketHandler.instance().getTilePacket(this.getChannel(), this, slantPacketID, this.slantType.ordinal());
|
||||
return PacketHandler.instance().getTilePacket(this.getChannel(), this, slantPacketID, this.isFunctioning(), this.slantType.ordinal());
|
||||
}
|
||||
return null;
|
||||
return super.getDescriptionPacket();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean simplePacket(String id, ByteArrayDataInput dis, Player player)
|
||||
{
|
||||
if (!super.simplePacket(id, dis, player) && this.worldObj.isRemote)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id.equalsIgnoreCase(slantPacketID))
|
||||
{
|
||||
this.functioning = dis.readBoolean();
|
||||
this.slantType = SlantType.values()[dis.readInt()];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public SlantType getSlant()
|
||||
|
@ -175,27 +197,6 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IBelt,
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean simplePacket(String id, ByteArrayDataInput dis, Player player)
|
||||
{
|
||||
if (!super.simplePacket(id, dis, player) && this.worldObj.isRemote)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id.equalsIgnoreCase(slantPacketID))
|
||||
{
|
||||
this.slantType = SlantType.values()[dis.readInt()];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirection(ForgeDirection facingDirection)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue