added it for all the machines, can you test? Im about to give up on it ;(

This commit is contained in:
modmuss50 2015-05-27 12:28:13 +01:00
parent bed71bd732
commit 046b7d7375
16 changed files with 95 additions and 113 deletions

View file

@ -91,13 +91,6 @@ public class TileAlloySmelter extends TileMachineBase implements IWrenchable, IE
crafter.writeToNBT(tagCompound);
}
@Override
public void readSyncFromNBT(NBTTagCompound tagCompound) {
super.readSyncFromNBT(tagCompound);
energy.readFromNBT(tagCompound);
crafter.readFromNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);

View file

@ -102,6 +102,14 @@ public class TileAssemblingMachine extends TileMachineBase implements IWrenchabl
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -109,6 +109,14 @@ public class TileCentrifuge extends TileMachineBase implements IWrenchable, IEn
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -102,6 +102,14 @@ public class TileChemicalReactor extends TileMachineBase implements IWrenchable,
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -99,6 +99,15 @@ public class TileGrinder extends TileMachineBase implements IWrenchable, IEnergy
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
tank.writeToNBT(tagCompound);
}
@Override
public void invalidate() {
energy.invalidate();

View file

@ -122,8 +122,15 @@ public class TileHeatGenerator extends TileMachineBase implements IWrenchable, I
super.writeToNBT(tagCompound);
energy.writeToNBT(tagCompound);
}
@Override
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);

View file

@ -94,8 +94,16 @@ public class TileImplosionCompressor extends TileMachineBase implements IWrencha
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);

View file

@ -100,6 +100,14 @@ public class TileIndustrialElectrolyzer extends TileMachineBase implements IWren
energy.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -104,6 +104,14 @@ public class TileIndustrialSawmill extends TileMachineBase implements IWrenchabl
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -101,6 +101,14 @@ public class TileLathe extends TileMachineBase implements IWrenchable, IEnergyTi
crafter.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -8,8 +8,6 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import techreborn.packets.PacketHandler;
import techreborn.packets.PacketSync;
import techreborn.packets.SimplePacket;
import java.util.List;
@ -35,8 +33,7 @@ public class TileMachineBase extends TileEntity {
public void syncWithAll() {
if (!worldObj.isRemote) {
//PacketHandler.sendPacketToAllPlayers(getSyncPacket());
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket2(),
PacketHandler.sendPacketToAllPlayers(getSyncPacket(),
worldObj);
} else {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
@ -45,19 +42,13 @@ public class TileMachineBase extends TileEntity {
ticksSinceLastSync = 0;
}
public Packet getDescriptionPacket2() {
public Packet getSyncPacket() {
NBTTagCompound nbtTag = new NBTTagCompound();
writeSyncToNBT(nbtTag);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord,
this.zCoord, 1, nbtTag);
}
public SimplePacket getSyncPacket() {
NBTTagCompound nbtTag = new NBTTagCompound();
writeSyncToNBT(nbtTag);
return new PacketSync(nbtTag, xCoord, yCoord, zCoord);
}
public Packet getDescriptionPacket() {
NBTTagCompound nbtTag = new NBTTagCompound();
writeToNBT(nbtTag);
@ -72,10 +63,6 @@ public class TileMachineBase extends TileEntity {
readFromNBT(packet.func_148857_g());
}
public void readSyncFromNBT(NBTTagCompound tagCompound) {
}
public void writeSyncToNBT(NBTTagCompound tagCompound) {
}

View file

@ -83,6 +83,13 @@ public class TileMatterFabricator extends TileMachineBase implements IWrenchable
energy.writeToNBT(tagCompound);
}
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
}
@Override
public void invalidate()
{

View file

@ -100,8 +100,16 @@ public class TilePlateCuttingMachine extends TileMachineBase implements IWrencha
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
@Override
public void writeSyncToNBT(NBTTagCompound tagCompound) {
super.writeSyncToNBT(tagCompound);
energy.writeToNBT(tagCompound);
crafter.writeToNBT(tagCompound);
}
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);