Grinder now requires multiblock

This commit is contained in:
Gig 2015-06-25 16:40:39 +01:00
parent 7a4ac3e610
commit 8da3e8323a

View file

@ -8,12 +8,15 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.*; import net.minecraftforge.fluids.*;
import techreborn.api.recipe.RecipeCrafter; import techreborn.api.recipe.RecipeCrafter;
import techreborn.blocks.BlockMachineCasing;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.init.ModFluids; import techreborn.init.ModFluids;
import techreborn.lib.Location;
import techreborn.util.FluidUtils; import techreborn.util.FluidUtils;
import techreborn.util.Inventory; import techreborn.util.Inventory;
import techreborn.util.Tank; import techreborn.util.Tank;
@ -76,12 +79,34 @@ public class TileGrinder extends TileMachineBase implements IWrenchable, IEnergy
public boolean isComplete() { public boolean isComplete() {
return false; return false;
} }
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 @Override
public void updateEntity() { public void updateEntity() {
super.updateEntity(); super.updateEntity();
energy.updateEntity(); if(getMutliBlock())
crafter.updateEntity(); {
energy.updateEntity();
crafter.updateEntity();
}
} }
@Override @Override