ImplosionCompressor now requires multiblock

This commit is contained in:
Gig 2015-06-25 16:33:56 +01:00
parent 17c8f4d253
commit 7a4ac3e610

View file

@ -8,9 +8,12 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.blocks.BlockMachineCasing;
import techreborn.init.ModBlocks;
import techreborn.lib.Location;
import techreborn.util.Inventory;
import java.util.List;
@ -72,13 +75,36 @@ public class TileImplosionCompressor extends TileMachineBase implements IWrencha
{
return new ItemStack(ModBlocks.ImplosionCompressor, 1);
}
public boolean getMutliBlock() {
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
TileEntity tileEntity = worldObj.getTileEntity(xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ);
if (tileEntity instanceof TileMachineCasing) {
if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
int heat;
heat = BlockMachineCasing.getHeatFromMeta(tileEntity.getBlockMetadata());
Location location = new Location(xCoord, yCoord, zCoord, direction);
location.modifyPositionFromSide(direction, 1);
if (worldObj.getBlock(location.getX(), location.getY(), location.getZ()).getUnlocalizedName().equals("tile.lava")) {
heat += 500;
}
return true;
}
}
}
return false;
}
@Override
public void updateEntity() {
super.updateEntity();
crafter.updateEntity();
energy.updateEntity();
if(getMutliBlock())
{
crafter.updateEntity();
energy.updateEntity();
}
}
@Override
public void readFromNBT(NBTTagCompound tagCompound)