mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 11:29:29 +00:00
Network stuffs -> 1.7
This commit is contained in:
1 parent
bb98f77de4
commit
8cd760ea06
34 files changed
+527
-595
No files matched your search
@@ -108,7 +108,7 @@ public class DryingRack extends InventoryBlock
|
||||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.func_147471_g(x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
}
|
||||
else
|
||||
{
|
||||
//world.markBlockForUpdate(x, y, z);
|
||||
//world.func_147471_g(x, y, z);
|
||||
player.openGui(getModInstance(), integer, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandler, IFacingLogic//, ISwitchableMaster
|
||||
{
|
||||
@@ -164,17 +159,17 @@ public class AdaptiveDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
func_145841_b(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,26 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.*;
|
||||
import mantle.blocks.abstracts.AdaptiveInventoryLogic;
|
||||
import mantle.blocks.iface.*;
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.component.SmelteryComponent;
|
||||
import tconstruct.blocks.component.SmelteryScan;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.blocks.component.*;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.AdaptiveSmelteryContainer;
|
||||
import mantle.blocks.abstracts.AdaptiveInventoryLogic;
|
||||
import tconstruct.library.component.IComponentHolder;
|
||||
import tconstruct.library.component.LogicComponent;
|
||||
import tconstruct.library.component.MultiFluidTank;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
import mantle.blocks.iface.IServantLogic;
|
||||
import tconstruct.library.component.*;
|
||||
|
||||
public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IActiveLogic, IMasterLogic, IComponentHolder, IFluidHandler
|
||||
{
|
||||
@@ -160,7 +145,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
smeltery.adjustSize(structure.getAirSize(), true);
|
||||
multitank.setCapacity(structure.getAirSize() * (TConstruct.ingotLiquidValue * 18));
|
||||
smeltery.setActiveLavaTank(structure.lavaTanks.get(0));
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -420,7 +405,7 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
public void updateAir ()
|
||||
{
|
||||
for (CoordTuple loc : structure.airCoords)
|
||||
field_145850_b.markBlockForUpdate(loc.x, loc.y, loc.z);
|
||||
field_145850_b.func_147471_g(loc.x, loc.y, loc.z);
|
||||
}
|
||||
|
||||
class LiquidData
|
||||
@@ -571,17 +556,17 @@ public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IAc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readNetworkNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readNetworkNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeNetworkNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,18 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidEvent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFluidHandler, ISidedInventory
|
||||
{
|
||||
@@ -142,7 +135,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
castingDelay = recipe.coolTime;
|
||||
}
|
||||
renderOffset = copyLiquid.amount;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
this.liquid = copyLiquid;
|
||||
needsUpdate = true;
|
||||
}
|
||||
@@ -164,7 +157,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
renderOffset = roomInTank;
|
||||
castingDelay = TConstruct.basinCasting.getCastingDelay(this.liquid, inventory[0]);
|
||||
this.liquid.amount = this.capacity;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
return roomInTank;
|
||||
@@ -175,7 +168,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (doFill)
|
||||
{
|
||||
this.liquid.amount += resource.amount;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
return resource.amount;
|
||||
@@ -192,14 +185,14 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
public void onInventoryChanged () //Isn't actually called?
|
||||
{
|
||||
super.onInventoryChanged();
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize (int slot, int quantity)
|
||||
{
|
||||
ItemStack stack = super.decrStackSize(slot, quantity);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -312,7 +305,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (renderOffset > 0)
|
||||
{
|
||||
renderOffset -= 6;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
tick++;
|
||||
@@ -320,7 +313,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
{
|
||||
tick = 0;
|
||||
if (needsUpdate)
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +326,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (recipe.consumeCast)
|
||||
inventory[0] = null;
|
||||
liquid = null;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,18 +380,18 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
func_145841_b(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.HashMap;
|
||||
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidEvent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @author BluSunrize
|
||||
@@ -52,7 +44,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
if (this.pullingLiquids)
|
||||
pullLiquids();
|
||||
}
|
||||
//this.field_145850_b.markBlockForUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
//this.field_145850_b.func_147471_g(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
if (ticks == 20)
|
||||
{
|
||||
if (recentlyFilledDelay != 0)
|
||||
@@ -420,7 +412,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
|
||||
if (doFill)
|
||||
{
|
||||
this.field_145850_b.markBlockForUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
this.field_145850_b.func_147471_g(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
this.liquid = transfered;
|
||||
}
|
||||
recentlyFilledDelay = 2;
|
||||
@@ -437,7 +429,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
if ((doFill) && (spaceInTank > 0))
|
||||
{
|
||||
this.liquid.amount = this.fillMax;
|
||||
this.field_145850_b.markBlockForUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
this.field_145850_b.func_147471_g(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
}
|
||||
return spaceInTank;
|
||||
}
|
||||
@@ -445,7 +437,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
if (doFill)
|
||||
{
|
||||
this.liquid.amount += stack.amount;
|
||||
this.field_145850_b.markBlockForUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
this.field_145850_b.func_147471_g(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
}
|
||||
return stack.amount;
|
||||
}
|
||||
@@ -492,7 +484,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
}
|
||||
if (doDrain)
|
||||
{
|
||||
this.field_145850_b.markBlockForUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
this.field_145850_b.func_147471_g(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(drained, this.field_145850_b, this.field_145851_c, this.field_145848_d, this.field_145849_e, this));
|
||||
}
|
||||
return drained;
|
||||
@@ -563,18 +555,18 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(this.field_145851_c, this.field_145848_d, this.field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
this.field_145850_b.markBlockForRenderUpdate(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
this.field_145850_b.func_147479_m(this.field_145851_c, this.field_145848_d, this.field_145849_e);
|
||||
}
|
||||
|
||||
public int convertFDToInt (ForgeDirection dir)
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidEvent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFluidHandler, ISidedInventory
|
||||
{
|
||||
@@ -142,7 +135,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
castingDelay = recipe.coolTime;
|
||||
}
|
||||
renderOffset = copyLiquid.amount;
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
this.liquid = copyLiquid;
|
||||
needsUpdate = true;
|
||||
}
|
||||
@@ -164,7 +157,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
renderOffset = roomInTank;
|
||||
castingDelay = TConstruct.tableCasting.getCastingDelay(this.liquid, inventory[0]);
|
||||
this.liquid.amount = this.capacity;
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
return roomInTank;
|
||||
@@ -175,7 +168,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (doFill)
|
||||
{
|
||||
this.liquid.amount += resource.amount;
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
return resource.amount;
|
||||
@@ -192,14 +185,14 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
public void onInventoryChanged () //Isn't actually called?
|
||||
{
|
||||
super.onInventoryChanged();
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
needsUpdate = true;
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize (int slot, int quantity)
|
||||
{
|
||||
ItemStack stack = super.decrStackSize(slot, quantity);
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -311,7 +304,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (renderOffset > 0)
|
||||
{
|
||||
renderOffset -= 6;
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
tick++;
|
||||
@@ -319,7 +312,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
{
|
||||
tick = 0;
|
||||
if (needsUpdate)
|
||||
getWorld().markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +325,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
if (recipe.consumeCast)
|
||||
inventory[0] = null;
|
||||
liquid = null;
|
||||
getWorld().markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
getWorld().func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,18 +377,18 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
func_145839_a(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
getWorld().markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
getWorld().func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
|
||||
public class DryingRackLogic extends InventoryLogic
|
||||
{
|
||||
@@ -73,7 +71,7 @@ public class DryingRackLogic extends InventoryLogic
|
||||
maxTime = DryingRackRecipes.getDryingTime(inventory[0]);
|
||||
else
|
||||
maxTime = 0;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,18 +102,18 @@ public class DryingRackLogic extends InventoryLogic
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.iface.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogic, IFluidHandler
|
||||
{
|
||||
@@ -56,7 +51,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
{
|
||||
liquid = ((IFluidHandler) drainte).drain(getForgeDirection(), drained, true);
|
||||
((IFluidHandler) tankte).fill(ForgeDirection.UP, liquid, true);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -82,7 +77,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
if (!activateFaucet())
|
||||
{
|
||||
active = false;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,18 +164,18 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic
|
||||
public void setActive (boolean flag)
|
||||
{
|
||||
active = flag;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
/* Fuel gauge */
|
||||
|
||||
@@ -1,32 +1,24 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mantle.blocks.BlockUtils;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import mantle.blocks.iface.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.*;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.inventory.FurnaceContainer;
|
||||
import mantle.blocks.BlockUtils;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
/* Slots
|
||||
* 0: Input
|
||||
@@ -66,7 +58,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
public void setActive (boolean flag)
|
||||
{
|
||||
active = flag;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
/* Fuel gauge */
|
||||
@@ -285,18 +277,18 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeNetworkNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readNetworkNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readNetworkNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,16 +3,10 @@ package tconstruct.blocks.logic;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
{
|
||||
@@ -31,7 +25,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
if (amount > 0 && doFill)
|
||||
{
|
||||
renderOffset = resource.amount;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
return amount;
|
||||
@@ -44,7 +38,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
if (amount != null && doDrain)
|
||||
{
|
||||
renderOffset = -maxDrain;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
@@ -150,18 +144,18 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
/* Updating */
|
||||
@@ -176,7 +170,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
if (renderOffset > 0)
|
||||
{
|
||||
renderOffset -= 6;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class LiquidTextureLogic extends TileEntity
|
||||
@@ -18,7 +17,7 @@ public class LiquidTextureLogic extends TileEntity
|
||||
public void setLiquidType (int tex)
|
||||
{
|
||||
texturePos = tex;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
public int getLiquidType ()
|
||||
@@ -49,17 +48,17 @@ public class LiquidTextureLogic extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RedwireLogic extends TileEntity
|
||||
@@ -56,17 +55,17 @@ public class RedwireLogic extends TileEntity
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeCustomNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readCustomNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,14 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandler, IFacingLogic
|
||||
{
|
||||
@@ -170,17 +166,17 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
func_145841_b(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +1,34 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import java.util.*;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import java.util.*;
|
||||
import mantle.blocks.abstracts.*;
|
||||
import mantle.blocks.iface.*;
|
||||
import mantle.debug.DebugData;
|
||||
import mantle.world.CoordTuple;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.monster.EntityIronGolem;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.entity.monster.*;
|
||||
import net.minecraft.entity.passive.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.SmelteryContainer;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import mantle.blocks.iface.IActiveLogic;
|
||||
import mantle.blocks.iface.IFacingLogic;
|
||||
import mantle.blocks.abstracts.MultiServantLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
import mantle.blocks.iface.IServantLogic;
|
||||
import tconstruct.util.SmelteryDamageSource;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
/* Simple class for storing items in the block
|
||||
*/
|
||||
@@ -243,7 +226,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
public void setActive (boolean flag)
|
||||
{
|
||||
needsUpdate = true;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
public int getScaledFuelGague (int scale)
|
||||
@@ -295,7 +278,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (needsUpdate)
|
||||
{
|
||||
needsUpdate = false;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +401,9 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (itemAdded)
|
||||
{
|
||||
this.needsUpdate = true;
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), field_145850_b.provider.dimensionId);
|
||||
//TODO check if the below method functions as intended
|
||||
//Old code: PacketDispatcher.sendPacketToAllInDimension(func_145844_m(), field_145850_b.provider.dimensionId);
|
||||
FMLCommonHandler.instance().getClientToServerNetworkManager().func_150725_a(func_145844_m());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,8 +659,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
updateEntity();
|
||||
super.onInventoryChanged();
|
||||
needsUpdate = true;
|
||||
//field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
//field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
//field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
//field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@@ -770,7 +755,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
internalTemp = 800;
|
||||
activeLavaTank = lavaTanks.get(0);
|
||||
adjustLayers(checkLayers, false);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
validStructure = true;
|
||||
}
|
||||
else
|
||||
@@ -982,7 +967,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
{
|
||||
//liquid = null;
|
||||
moltenMetal.remove(liquid);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
currentLiquid = 0;
|
||||
needsUpdate = true;
|
||||
}
|
||||
@@ -993,7 +978,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
if (doDrain && maxDrain > 0)
|
||||
{
|
||||
liquid.amount -= maxDrain;
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
currentLiquid -= maxDrain;
|
||||
needsUpdate = true;
|
||||
}
|
||||
@@ -1027,7 +1012,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
needsUpdate = true;
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
@@ -1144,19 +1129,19 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
|
||||
/* Packets */
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
func_145839_a(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
onInventoryChanged();
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
this.needsUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import mantle.blocks.iface.*;
|
||||
import mantle.world.*;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.component.TankAirComponent;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import mantle.world.CoordTuple;
|
||||
import mantle.world.WorldHelper;
|
||||
import mantle.blocks.iface.IMasterLogic;
|
||||
import mantle.blocks.iface.IServantLogic;
|
||||
|
||||
public class TankAirLogic extends InventoryLogic implements IServantLogic, ISidedInventory
|
||||
{
|
||||
@@ -35,7 +28,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
public void overrideFluids (ArrayList<FluidStack> fluids)
|
||||
{
|
||||
/*multitank.overrideFluids(fluids);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);*/
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);*/
|
||||
}
|
||||
|
||||
public boolean hasItem ()
|
||||
@@ -61,7 +54,7 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
field_145850_b.setBlockMetadataWithNotify(field_145851_c, field_145848_d, field_145849_e, itemstack.getItemDamage(), 3);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -178,19 +171,19 @@ public class TankAirLogic extends InventoryLogic implements IServantLogic, ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
readNetworkNBT(packet.data);
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
readNetworkNBT(packet.func_148857_g());
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeNetworkNBT(tag);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,16 +2,11 @@ package tconstruct.blocks.logic;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -97,17 +92,17 @@ public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
public Packet func_145844_m ()
|
||||
{
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
func_145841_b(nbt);
|
||||
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 0, nbt);
|
||||
return new S35PacketUpdateTileEntity(field_145851_c, field_145848_d, field_145849_e, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (NetworkManager net, Packet132TileEntityData packet)
|
||||
public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
func_145839_a(packet.data);
|
||||
func_145839_a(packet.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,7 +224,7 @@ public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
public void onInventoryChanged ()
|
||||
{
|
||||
super.onInventoryChanged();
|
||||
this.field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
this.field_145850_b.func_147471_g(field_145851_c, field_145848_d, field_145849_e);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -259,7 +254,7 @@ public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
{
|
||||
if (shouldUpdateLogic)
|
||||
{
|
||||
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
|
||||
field_145850_b.func_147479_m(field_145851_c, field_145848_d, field_145849_e);
|
||||
shouldUpdateLogic = false;
|
||||
}
|
||||
if (soundcountything > 0)
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.*;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.gui.inventory.*;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.potion.Potion;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.client.event.EventCloakRender;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import tconstruct.util.network.packet.PacketDoubleJump;
|
||||
|
||||
public class TControls extends TKeyHandler
|
||||
{
|
||||
@@ -233,11 +228,14 @@ public class TControls extends TKeyHandler
|
||||
|
||||
static void updateServer (ByteArrayOutputStream bos)
|
||||
{
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
/*Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "TConstruct";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
//TODO Find out what packet should be used here
|
||||
TConstruct.packetPipeline.sendToServer(new PacketDoubleJump());
|
||||
}
|
||||
}
|
||||
@@ -502,6 +502,6 @@ public class AdaptiveSmelteryGui extends NewContainerGui
|
||||
public void onGuiClosed ()
|
||||
{
|
||||
super.onGuiClosed();
|
||||
logic.getWorld().markBlockForUpdate(logic.field_145851_c, logic.field_145848_d, logic.field_145849_e);
|
||||
logic.getWorld().func_147471_g(logic.field_145851_c, logic.field_145848_d, logic.field_145849_e);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,19 @@
|
||||
package tconstruct.client.gui;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
import tconstruct.inventory.*;
|
||||
import tconstruct.util.network.packet.PacketSmeltery;
|
||||
|
||||
public class SmelteryGui extends NewContainerGui
|
||||
{
|
||||
@@ -449,9 +441,10 @@ public class SmelteryGui extends NewContainerGui
|
||||
int sizeY = liquidSize;
|
||||
if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY)
|
||||
{
|
||||
//TODO Update fluid stuff
|
||||
fluidToBeBroughtUp = liquid.fluidID;
|
||||
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
/*Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
DataOutputStream dos = new DataOutputStream(bos);
|
||||
@@ -478,7 +471,9 @@ public class SmelteryGui extends NewContainerGui
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new PacketSmeltery(logic.getWorld().provider.dimensionId, logic.field_145851_c, logic.field_145848_d, logic.field_145849_e, this.func_146272_n(), fluidToBeBroughtUp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
package tconstruct.client.gui;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.StencilTableLogic;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.inventory.PatternShaperContainer;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import tconstruct.util.network.packet.PacketStencilTable;
|
||||
|
||||
public class StencilTableGui extends GuiContainer
|
||||
{
|
||||
@@ -122,7 +114,7 @@ public class StencilTableGui extends GuiContainer
|
||||
|
||||
void updateServer (ItemStack stack)
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
/*ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
@@ -144,6 +136,8 @@ public class StencilTableGui extends GuiContainer
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new PacketStencilTable(logic.field_145851_c, logic.field_145848_d, logic.field_145849_e, stack));
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,23 @@
|
||||
package tconstruct.client.gui;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import java.util.*;
|
||||
import net.minecraft.client.gui.*;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import tconstruct.inventory.ActiveContainer;
|
||||
import tconstruct.inventory.ToolStationContainer;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
import tconstruct.library.client.ToolGuiElement;
|
||||
import tconstruct.inventory.*;
|
||||
import tconstruct.library.client.*;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.util.network.packet.PacketToolStation;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ToolStationGui extends NewContainerGui
|
||||
@@ -482,7 +470,7 @@ public class ToolStationGui extends NewContainerGui
|
||||
|
||||
void updateServer (String name)
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
/*ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
try
|
||||
{
|
||||
@@ -503,7 +491,9 @@ public class ToolStationGui extends NewContainerGui
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);
|
||||
PacketDispatcher.sendPacketToServer(packet);*/
|
||||
|
||||
TConstruct.packetPipeline.sendToServer(new PacketToolStation(logic.field_145851_c, logic.field_145848_d, logic.field_145849_e, name));
|
||||
}
|
||||
|
||||
/*protected void mouseClicked(int par1, int par2, int par3)
|
||||
|
||||
@@ -461,7 +461,7 @@ public class TankLayerScan extends LogicComponent
|
||||
if (servant instanceof IServantLogic)
|
||||
((IServantLogic) servant).invalidateMaster(imaster, world, master.field_145851_c, master.field_145848_d, master.field_145849_e);
|
||||
}
|
||||
master.func_145831_w().markBlockForUpdate(master.field_145851_c, master.field_145848_d, master.field_145849_e);
|
||||
master.func_145831_w().func_147471_g(master.field_145851_c, master.field_145848_d, master.field_145849_e);
|
||||
}
|
||||
|
||||
protected void invalidateBlocksAbove (int height)
|
||||
|
||||
@@ -75,12 +75,12 @@ public class MiningExplosion extends Explosion
|
||||
if (k1 != Blocks.air)
|
||||
{
|
||||
Block block = k1;
|
||||
float f3 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.world, l, i1, j1, block) : block.getExplosionResistance(this.exploder, world,
|
||||
float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.world, l, i1, j1, block) : block.getExplosionResistance(this.exploder, world,
|
||||
l, i1, j1, explosionX, explosionY, explosionZ);
|
||||
f1 -= (f3 + 0.8F) * f2 * 0.25f;
|
||||
}
|
||||
|
||||
if (f1 > 0.0F && (this.exploder == null || this.exploder.shouldExplodeBlock(this, this.world, l, i1, j1, k1, f1)))
|
||||
if (f1 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.world, l, i1, j1, k1, f1)))
|
||||
{
|
||||
hashset.add(new ChunkPosition(l, i1, j1));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.*;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
|
||||
public class SmelteryDamageSource extends DamageSource
|
||||
{
|
||||
@@ -13,7 +13,8 @@ public class SmelteryDamageSource extends DamageSource
|
||||
super("smeltery");
|
||||
}
|
||||
|
||||
public String getDeathMessage (EntityLiving par1EntityLiving)
|
||||
@Override
|
||||
public IChatComponent func_151519_b (EntityLivingBase par1EntityLiving)
|
||||
{
|
||||
String type = "";
|
||||
switch (AbilityHelper.random.nextInt(4))
|
||||
@@ -34,8 +35,6 @@ public class SmelteryDamageSource extends DamageSource
|
||||
EntityLivingBase entityliving1 = par1EntityLiving.func_94060_bK();
|
||||
String s = "death." + type + this.damageType;
|
||||
String s1 = s + ".player";
|
||||
return entityliving1 != null && StatCollector.func_94522_b(s1) ? StatCollector.translateToLocalFormatted(s1,
|
||||
new Object[] { par1EntityLiving.getTranslatedEntityName(), entityliving1.getTranslatedEntityName() }) : StatCollector.translateToLocalFormatted(s,
|
||||
new Object[] { par1EntityLiving.getTranslatedEntityName() });
|
||||
return entityliving1 != null && StatCollector.func_94522_b(s1) ? new ChatComponentTranslation(s1, new Object[] {par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_()}): new ChatComponentTranslation(s, new Object[] {par1EntityLiving.func_145748_c_()});
|
||||
}
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
package tconstruct.util.network;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
import tconstruct.blocks.logic.ToolForgeLogic;
|
||||
import tconstruct.blocks.logic.ToolStationLogic;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.IPacketHandler;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class TPacketHandler// implements IPacketHandler
|
||||
{
|
||||
//1.7 uses netty... commenting this out as it might be needed for reference updating to new packets
|
||||
/*
|
||||
@Override
|
||||
public void onPacketData (NetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
|
||||
if (packet.channel.equals("TConstruct"))
|
||||
{
|
||||
if (side == Side.SERVER)
|
||||
handleServerPacket(packet, (EntityPlayerMP) player);
|
||||
else
|
||||
handleClientPacket(packet, (EntityPlayer) player);
|
||||
}
|
||||
}
|
||||
|
||||
void handleClientPacket (Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
|
||||
byte packetID;
|
||||
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.warn("Failed at reading client packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
void handleServerPacket (Packet250CustomPayload packet, EntityPlayerMP player)
|
||||
{
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
|
||||
byte packetID;
|
||||
|
||||
try
|
||||
{
|
||||
packetID = inputStream.readByte();
|
||||
|
||||
if (packetID == 1) //Tool Station
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
String toolName = inputStream.readUTF();
|
||||
if (te instanceof ToolStationLogic)
|
||||
{
|
||||
((ToolStationLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolForgeLogic)
|
||||
{
|
||||
((ToolForgeLogic) te).setToolname(toolName);
|
||||
}
|
||||
}
|
||||
else if (packetID == 2) //Stencil Table
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
Short itemID = inputStream.readShort();
|
||||
Short itemDamage = inputStream.readShort();
|
||||
if (te instanceof InventoryLogic)
|
||||
{
|
||||
((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage));
|
||||
}
|
||||
}
|
||||
|
||||
else if (packetID == 3) //Armor
|
||||
{
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
switch (inputStream.readByte())
|
||||
{
|
||||
case 0:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 1:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 2:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (packetID == 10) //Double jump
|
||||
{
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
|
||||
else if (packetID == 11) //Smeltery
|
||||
{
|
||||
int dimension = inputStream.readInt();
|
||||
World world = DimensionManager.getWorld(dimension);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
|
||||
boolean isShiftPressed = inputStream.readBoolean();
|
||||
int fluidID = inputStream.readInt();
|
||||
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
if (te instanceof SmelteryLogic)
|
||||
{
|
||||
FluidStack temp = null;
|
||||
|
||||
for (FluidStack liquid : ((SmelteryLogic) te).moltenMetal)
|
||||
{
|
||||
if (liquid.fluidID == fluidID)
|
||||
{
|
||||
temp = liquid;
|
||||
}
|
||||
}
|
||||
|
||||
if (temp != null)
|
||||
{
|
||||
((SmelteryLogic) te).moltenMetal.remove(temp);
|
||||
if (isShiftPressed)
|
||||
((SmelteryLogic) te).moltenMetal.add(temp);
|
||||
else
|
||||
((SmelteryLogic) te).moltenMetal.add(0, temp);
|
||||
}
|
||||
PacketDispatcher.sendPacketToAllInDimension(te.getDescriptionPacket(), dimension);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
TConstruct.logger.warn("Failed at reading server packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Entity getEntity (World world, int id)
|
||||
{
|
||||
for (Object o : world.loadedEntityList)
|
||||
{
|
||||
if (((Entity) o).entityId == id)
|
||||
return (Entity) o;
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class PacketDoubleJump extends AbstractPacket {
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide(EntityPlayer player) {
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class PacketExtendedInventory extends AbstractPacket {
|
||||
|
||||
byte type;
|
||||
|
||||
public PacketExtendedInventory() {
|
||||
|
||||
}
|
||||
|
||||
public PacketExtendedInventory(byte type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
buffer.writeByte(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
type = buffer.readByte();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide(EntityPlayer player) {
|
||||
//String user = inputStream.readUTF();
|
||||
//EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
|
||||
switch (type) {
|
||||
case 0:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 1:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case 2:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -102,8 +102,17 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Abstra
|
||||
// Method to call from FMLInitializationEvent
|
||||
public void initalise() {
|
||||
this.channels = NetworkRegistry.INSTANCE.newChannel("TConstruct", this);
|
||||
registerPackets();
|
||||
}
|
||||
|
||||
public void registerPackets(){
|
||||
registerPacket(PacketDoubleJump.class);
|
||||
registerPacket(PacketExtendedInventory.class);
|
||||
registerPacket(PacketSmeltery.class);
|
||||
registerPacket(PacketStencilTable.class);
|
||||
registerPacket(PacketToolStation.class);
|
||||
}
|
||||
|
||||
// Method to call from FMLPostInitializationEvent
|
||||
// Ensures that packet discriminators are common between server and client by using logical sorting
|
||||
public void postInitialise() {
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import net.minecraft.network.NetworkManager;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
|
||||
public class PacketSmeltery extends AbstractPacket {
|
||||
|
||||
int dimension, x, y, z, fluidID;
|
||||
boolean isShiftPressed;
|
||||
|
||||
public PacketSmeltery(){
|
||||
|
||||
}
|
||||
|
||||
public PacketSmeltery(int dimension, int x, int y, int z, boolean isShiftPressed, int fluidID){
|
||||
this.dimension = dimension;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.isShiftPressed = isShiftPressed;
|
||||
this.fluidID = fluidID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
buffer.writeInt(dimension);
|
||||
buffer.writeInt(x);
|
||||
buffer.writeInt(y);
|
||||
buffer.writeInt(z);
|
||||
buffer.writeBoolean(isShiftPressed);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
dimension = buffer.readInt();
|
||||
x = buffer.readInt();
|
||||
y = buffer.readInt();
|
||||
z = buffer.readInt();
|
||||
isShiftPressed = buffer.readBoolean();
|
||||
fluidID = buffer.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide(EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
if (te instanceof SmelteryLogic)
|
||||
{
|
||||
FluidStack temp = null;
|
||||
|
||||
for (FluidStack liquid : ((SmelteryLogic) te).moltenMetal)
|
||||
{//TODO update fluid stuffs
|
||||
if (liquid.fluidID == fluidID)
|
||||
{
|
||||
temp = liquid;
|
||||
}
|
||||
}
|
||||
|
||||
if (temp != null)
|
||||
{
|
||||
((SmelteryLogic) te).moltenMetal.remove(temp);
|
||||
if (isShiftPressed)
|
||||
((SmelteryLogic) te).moltenMetal.add(temp);
|
||||
else
|
||||
((SmelteryLogic) te).moltenMetal.add(0, temp);
|
||||
}
|
||||
//TODO check if this works like it should
|
||||
//Old code: PacketDispatcher.sendPacketToAllInDimension(te.func_145844_m(), dimension);
|
||||
FMLCommonHandler.instance().getClientToServerNetworkManager().func_150725_a(te.func_145844_m());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PacketStencilTable extends AbstractPacket {
|
||||
|
||||
int x, y, z;
|
||||
ItemStack contents;
|
||||
|
||||
public PacketStencilTable() {
|
||||
|
||||
}
|
||||
|
||||
public PacketStencilTable(int x, int y, int z, ItemStack contents) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
buffer.writeInt(x);
|
||||
buffer.writeInt(y);
|
||||
buffer.writeInt(z);
|
||||
ByteBufUtils.writeItemStack(buffer, contents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
x = buffer.readInt();
|
||||
y = buffer.readInt();
|
||||
z = buffer.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide(EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
if (te instanceof InventoryLogic) {
|
||||
((InventoryLogic) te).setInventorySlotContents(1, contents);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import mantle.util.network.StringEncoder;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -13,22 +12,23 @@ public class PacketToolStation extends AbstractPacket {
|
||||
|
||||
private int x, y, z;
|
||||
private String toolName;
|
||||
|
||||
public PacketToolStation(){}
|
||||
|
||||
public PacketToolStation(int x, int y, int z, String toolName){
|
||||
|
||||
public PacketToolStation() {
|
||||
}
|
||||
|
||||
public PacketToolStation(int x, int y, int z, String toolName) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.toolName = toolName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
|
||||
buffer.writeInt(x);
|
||||
buffer.writeInt(y);
|
||||
buffer.writeInt(z);
|
||||
StringEncoder.encodeString(buffer, toolName);
|
||||
ByteBufUtils.writeUTF8String(buffer, toolName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -36,25 +36,24 @@ public class PacketToolStation extends AbstractPacket {
|
||||
x = buffer.readInt();
|
||||
y = buffer.readInt();
|
||||
z = buffer.readInt();
|
||||
toolName = StringEncoder.decodeString(buffer);
|
||||
toolName = ByteBufUtils.readUTF8String(buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide(EntityPlayer player) {}
|
||||
public void handleClientSide(EntityPlayer player) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide(EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
World world = player.worldObj;
|
||||
TileEntity te = world.func_147438_o(x, y, z);
|
||||
|
||||
if (te instanceof ToolStationLogic)
|
||||
{
|
||||
((ToolStationLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolForgeLogic)
|
||||
{
|
||||
((ToolForgeLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolStationLogic) {
|
||||
((ToolStationLogic) te).setToolname(toolName);
|
||||
}
|
||||
if (te instanceof ToolForgeLogic) {
|
||||
((ToolForgeLogic) te).setToolname(toolName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +1,26 @@
|
||||
package tconstruct.util.player;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mantle.player.PlayerUtils;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.Entity.EnumEntitySize;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.nbt.*;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.IPlayerTracker;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import tconstruct.util.network.packet.PacketDoubleJump;
|
||||
|
||||
public class TPlayerHandler implements IPlayerTracker
|
||||
{
|
||||
@@ -131,12 +124,17 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
|
||||
void updateClientPlayer (ByteArrayOutputStream bos, EntityPlayer player)
|
||||
{
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
/*Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "TConstruct";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
|
||||
PacketDispatcher.sendPacketToPlayer(packet, (Player) player);
|
||||
*/
|
||||
//TODO find out what packet needs to be used here (and make sure that player actually is a playerMP and this gets called)
|
||||
if(player instanceof EntityPlayerMP){
|
||||
TConstruct.packetPipeline.sendTo(new PacketDoubleJump(), (EntityPlayerMP)player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user