mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixes and fusion power ports
This commit is contained in:
parent
0a017e9672
commit
2952e175b5
@ -97,7 +97,7 @@ public abstract class ToolAbility {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int refMeta = world.getBlockMetadata(refX, refY, refZ);
|
||||
|
||||
if(b != ref)
|
||||
if(!isSameBlock(b, ref))
|
||||
return;
|
||||
|
||||
if(meta != refMeta)
|
||||
@ -122,6 +122,14 @@ public abstract class ToolAbility {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSameBlock(Block b1, Block b2) {
|
||||
|
||||
if(b1 == b2) return true;
|
||||
if((b1 == Blocks.redstone_ore && b2 == Blocks.lit_redstone_ore) || (b1 == Blocks.lit_redstone_ore && b2 == Blocks.redstone_ore)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
@ -3,13 +3,11 @@ package com.hbm.tileentity.machine;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerFurnaceIron;
|
||||
import com.hbm.inventory.gui.GUIFurnaceIron;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.module.ModuleBurnTime;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -18,7 +16,6 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -180,6 +177,24 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return i == 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.maxBurnTime = nbt.getInteger("maxBurnTime");
|
||||
this.burnTime = nbt.getInteger("burnTime");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setInteger("maxBurnTime", maxBurnTime);
|
||||
nbt.setInteger("burnTime", burnTime);
|
||||
nbt.setInteger("progress", progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
|
||||
@ -82,6 +82,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
if (age == 9 || age == 19)
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
|
||||
this.updateConnections();
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
/// START Processing part ///
|
||||
@ -165,9 +166,6 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
|
||||
this.networkPack(data, 250);
|
||||
/// END Notif packets ///
|
||||
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord, ForgeDirection.UP);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord, ForgeDirection.DOWN);
|
||||
|
||||
} else {
|
||||
|
||||
@ -185,6 +183,20 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
}
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord, ForgeDirection.UP);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord, ForgeDirection.DOWN);
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(5.75, 0, 0);
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
vec.rotateAroundY((float) (Math.PI / 8));
|
||||
this.trySubscribe(worldObj, xCoord + (int)vec.xCoord, yCoord + 3, zCoord + (int)vec.zCoord, ForgeDirection.UP);
|
||||
this.trySubscribe(worldObj, xCoord + (int)vec.xCoord, yCoord - 3, zCoord + (int)vec.zCoord, ForgeDirection.DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
this.disassemble();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user