Now shows the heat of the multiblock
This commit is contained in:
parent
d70038b77f
commit
db62b7a8b8
4 changed files with 136 additions and 123 deletions
|
@ -90,4 +90,16 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
{
|
||||
return new TileMachineCasing();
|
||||
}
|
||||
|
||||
public static int getHeatFromMeta(int meta){
|
||||
switch (meta){
|
||||
case 0:
|
||||
return 1020;
|
||||
case 1:
|
||||
return 1700;
|
||||
case 2:
|
||||
return 2380;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public class GuiBlastFurnace extends GuiContainer {
|
|||
int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString("Blastfurnace", 60, 6, 4210752);
|
||||
this.fontRendererObj.drawString(blastfurnace.getHeat() + " heat", 75, 20, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.format("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
|
|
@ -1,164 +1,144 @@
|
|||
package techreborn.multiblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.util.LogHelper;
|
||||
import erogenousbeef.coreTR.multiblock.IMultiblockPart;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockControllerBase;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockValidationException;
|
||||
import erogenousbeef.coreTR.multiblock.rectangular.RectangularMultiblockControllerBase;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.util.LogHelper;
|
||||
|
||||
public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
||||
|
||||
public MultiBlockCasing(World world)
|
||||
{
|
||||
super(world);
|
||||
}
|
||||
public boolean hasLava;
|
||||
|
||||
@Override
|
||||
public void onAttachedPartWithMultiblockData(IMultiblockPart part,
|
||||
NBTTagCompound data)
|
||||
{
|
||||
public MultiBlockCasing(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onAttachedPartWithMultiblockData(IMultiblockPart part,
|
||||
NBTTagCompound data) {
|
||||
|
||||
@Override
|
||||
protected void onBlockAdded(IMultiblockPart newPart)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBlockRemoved(IMultiblockPart oldPart)
|
||||
{
|
||||
@Override
|
||||
protected void onBlockAdded(IMultiblockPart newPart) {
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onBlockRemoved(IMultiblockPart oldPart) {
|
||||
|
||||
@Override
|
||||
protected void onMachineAssembled()
|
||||
{
|
||||
LogHelper.warn("New multiblock created!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMachineRestored()
|
||||
{
|
||||
@Override
|
||||
protected void onMachineAssembled() {
|
||||
LogHelper.warn("New multiblock created!");
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onMachineRestored() {
|
||||
|
||||
@Override
|
||||
protected void onMachinePaused()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onMachinePaused() {
|
||||
|
||||
@Override
|
||||
protected void onMachineDisassembled()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onMachineDisassembled() {
|
||||
|
||||
@Override
|
||||
protected int getMinimumNumberOfBlocksForAssembledMachine()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaximumXSize()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
protected int getMinimumNumberOfBlocksForAssembledMachine() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaximumZSize()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
protected int getMaximumXSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaximumYSize()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@Override
|
||||
protected int getMaximumZSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMinimumXSize()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
protected int getMaximumYSize() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMinimumYSize()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@Override
|
||||
protected int getMinimumXSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMinimumZSize()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
protected int getMinimumYSize() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAssimilate(MultiblockControllerBase assimilated)
|
||||
{
|
||||
@Override
|
||||
protected int getMinimumZSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onAssimilate(MultiblockControllerBase assimilated) {
|
||||
|
||||
@Override
|
||||
protected void onAssimilated(MultiblockControllerBase assimilator)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onAssimilated(MultiblockControllerBase assimilator) {
|
||||
|
||||
@Override
|
||||
protected boolean updateServer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateClient()
|
||||
{
|
||||
@Override
|
||||
protected boolean updateServer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void updateClient() {
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data) {
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data) {
|
||||
|
||||
@Override
|
||||
public void formatDescriptionPacket(NBTTagCompound data)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void formatDescriptionPacket(NBTTagCompound data) {
|
||||
|
||||
@Override
|
||||
public void decodeDescriptionPacket(NBTTagCompound data)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void decodeDescriptionPacket(NBTTagCompound data) {
|
||||
|
||||
@Override
|
||||
protected void isBlockGoodForInterior(World world, int x, int y, int z)
|
||||
throws MultiblockValidationException
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block.getUnlocalizedName().equals("tile.lava")
|
||||
|| block.getUnlocalizedName().equals("tile.air"))
|
||||
{
|
||||
} else
|
||||
{
|
||||
super.isBlockGoodForInterior(world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void isBlockGoodForInterior(World world, int x, int y, int z)
|
||||
throws MultiblockValidationException {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
|
||||
if (block.getUnlocalizedName().equals("tile.air")) {
|
||||
|
||||
} else if (block.getUnlocalizedName().equals("tile.lava")) {
|
||||
hasLava = true;
|
||||
} else {
|
||||
super.isBlockGoodForInterior(world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,12 @@ import ic2.api.energy.prefab.BasicSink;
|
|||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileBlastFurnace extends TileMachineBase implements IWrenchable {
|
||||
|
@ -48,9 +53,24 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable {
|
|||
return new ItemStack(ModBlocks.BlastFurnace, 1);
|
||||
}
|
||||
|
||||
public boolean isComplete()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getHeat(){
|
||||
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 heat;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue