mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 14:34:22 +00:00
Fix merge conflicts
This commit is contained in:
commit
856b31361d
199 files changed
+947
-322
No files matched your search
@@ -1,5 +1,12 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import tconstruct.blocks.logic.EquipLogic;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.library.blocks.InventoryLogic;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
@@ -115,6 +122,54 @@ public class EquipBlock extends InventoryBlock
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, newMeta, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock (World par1World, int x, int y, int z, int par5, int meta){
|
||||
TileEntity te = par1World.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (te != null && te instanceof EquipLogic)
|
||||
{
|
||||
EquipLogic logic = (EquipLogic) te;
|
||||
for (int iter = 0; iter < logic.getSizeInventory(); ++iter)
|
||||
{
|
||||
ItemStack stack = iter == 0 ? logic.getEquipmentItem() : logic.getStackInSlot(iter);
|
||||
|
||||
if (stack != null && logic.canDropInventorySlot(iter))
|
||||
{
|
||||
float jumpX = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float jumpY = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float jumpZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (stack.stackSize > 0)
|
||||
{
|
||||
int itemSize = rand.nextInt(21) + 10;
|
||||
|
||||
if (itemSize > stack.stackSize)
|
||||
{
|
||||
itemSize = stack.stackSize;
|
||||
}
|
||||
|
||||
stack.stackSize -= itemSize;
|
||||
EntityItem entityitem = new EntityItem(par1World, (double) ((float) x + jumpX), (double) ((float) y + jumpY), (double) ((float) z + jumpZ), new ItemStack(stack.itemID,
|
||||
itemSize, stack.getItemDamage()));
|
||||
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float offset = 0.05F;
|
||||
entityitem.motionX = (double) ((float) rand.nextGaussian() * offset);
|
||||
entityitem.motionY = (double) ((float) rand.nextGaussian() * offset + 0.2F);
|
||||
entityitem.motionZ = (double) ((float) rand.nextGaussian() * offset);
|
||||
par1World.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, x, y, z, par5, meta);
|
||||
}
|
||||
|
||||
public int getLightValue (IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return !isActive(world, x, y, z) ? 0 : 9;
|
||||
|
||||
@@ -397,7 +397,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +571,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFlui
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
this.worldObj.markBlockForRenderUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ public class CastingTableLogic extends InventoryLogic implements IFluidTank, IFl
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public class DryingRackLogic extends InventoryLogic
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,20 +32,23 @@ public abstract class EquipLogic extends InventoryLogic
|
||||
return inventory[0];
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack){
|
||||
if(slot == 0){
|
||||
return;
|
||||
}else{
|
||||
super.setInventorySlotContents(slot, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return inventory[slot +1];
|
||||
return slot != 0 ? inventory[slot] : null;
|
||||
}
|
||||
|
||||
public boolean isStackInSlot(int slot)
|
||||
{
|
||||
return inventory[slot +1] != null;
|
||||
return slot != 0 ? inventory[slot] != null : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inventory.length - 1;
|
||||
}*/
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ public class FirestarterLogic extends TileEntity implements IFacingLogic, IActiv
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class GolemCoreLogic extends InventoryLogic implements IInventory
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public class LavaTankLogic extends MultiServantLogic implements IFluidHandler
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LiquidTextureLogic extends TileEntity
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class MultiServantLogic extends TileEntity implements IServantLogic
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class RedwireLogic extends TileEntity
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readCustomNBT(packet.customParam1);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import tconstruct.library.util.IFacingLogic;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -22,38 +23,10 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
return false;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public FluidStack getLiquid ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity ()
|
||||
{
|
||||
if (!hasMaster)
|
||||
return 0;
|
||||
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
return smeltery.getCapacity();
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public int fill (FluidStack resource, boolean doFill)
|
||||
{
|
||||
|
||||
}*/
|
||||
|
||||
/*@Override
|
||||
public FluidStack drain (int maxDrain, boolean doDrain)
|
||||
{
|
||||
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public int fill (ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if (hasMaster && resource != null)
|
||||
if (hasValidMaster() && resource != null && canFill(from, resource.getFluid()))
|
||||
{
|
||||
if (doFill)
|
||||
{
|
||||
@@ -74,7 +47,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
@Override
|
||||
public FluidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
if (hasValidMaster())
|
||||
if (hasValidMaster() && canDrain(from, null))
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
return smeltery.drain(maxDrain, doDrain);
|
||||
@@ -88,51 +61,45 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
@Override
|
||||
public FluidStack drain (ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill (ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return false;
|
||||
return from == getForgeDirection().getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain (ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return false;
|
||||
// Check that the drain is coming from the from the front of the block
|
||||
// and that the fluid to be drained is in the smeltery.
|
||||
boolean containsFluid = fluid == null;
|
||||
if(fluid!=null){
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
for (FluidStack fstack : smeltery.moltenMetal){
|
||||
if(fstack.fluidID == fluid.getID()){
|
||||
containsFluid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return from == getForgeDirection() && containsFluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo (ForgeDirection from)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@Override
|
||||
public ILiquidTank[] getTanks (ForgeDirection direction)
|
||||
{
|
||||
if (hasValidMaster())
|
||||
if (hasValidMaster() && (from==getForgeDirection() || from == getForgeDirection().getOpposite() || from == ForgeDirection.UNKNOWN))
|
||||
{
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
return new ILiquidTank[] { smeltery };
|
||||
return new FluidTankInfo[] { smeltery.getInfo() };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILiquidTank getTank (ForgeDirection direction, FluidStack type)
|
||||
{
|
||||
if (hasValidMaster())
|
||||
{
|
||||
return (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public byte getRenderDirection ()
|
||||
{
|
||||
@@ -207,7 +174,7 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
{
|
||||
if (currentLiquid + 25 < maxLiquid)
|
||||
{
|
||||
this.addMoltenMetal(new FluidStack(TContent.moltenEnder.blockID, 25), false);
|
||||
this.addMoltenMetal(new FluidStack(TContent.moltenEnderFluid, 25), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -986,8 +986,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
@Override
|
||||
public FluidTankInfo getInfo ()
|
||||
{
|
||||
//TODO: This
|
||||
return null;
|
||||
return new FluidTankInfo(this);
|
||||
}
|
||||
|
||||
/* NBT */
|
||||
@@ -1076,7 +1075,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class TileEntityLandmine extends TileEntity implements IInventory
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
readFromNBT(packet.data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory
|
||||
if (this.worldObj != null)
|
||||
{
|
||||
this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user