mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
explodable refinery yeah
This commit is contained in:
parent
344dd55dfa
commit
f5ceaddfbb
@ -1271,8 +1271,6 @@ public class ModBlocks {
|
||||
public static Block dummy_port_drill;
|
||||
public static Block dummy_block_assembler;
|
||||
public static Block dummy_port_assembler;
|
||||
public static Block dummy_block_refinery;
|
||||
public static Block dummy_port_refinery;
|
||||
public static Block dummy_block_turbofan;
|
||||
public static Block dummy_port_turbofan;
|
||||
public static Block dummy_block_ams_limiter;
|
||||
@ -2232,7 +2230,7 @@ public class ModBlocks {
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
|
||||
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_refinery");
|
||||
machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_refinery");
|
||||
machine_fraction_tower = new MachineFractionTower(Material.iron).setBlockName("machine_fraction_tower").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
fraction_spacer = new FractionSpacer(Material.iron).setBlockName("fraction_spacer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_cracker = new MachineCatalyticCracker(Material.iron).setBlockName("machine_catalytic_cracker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2388,8 +2386,6 @@ public class ModBlocks {
|
||||
dummy_port_drill = new DummyBlockDrill(Material.iron, true).setBlockName("dummy_port_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
dummy_block_assembler = new DummyBlockAssembler(Material.iron, false).setBlockName("dummy_block_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_assembler = new DummyBlockAssembler(Material.iron, true).setBlockName("dummy_port_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_refinery = new DummyBlockRefinery(Material.iron, false).setBlockName("dummy_block_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_refinery = new DummyBlockRefinery(Material.iron, true).setBlockName("dummy_port_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_turbofan = new DummyBlockTurbofan(Material.iron, false).setBlockName("dummy_block_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_turbofan = new DummyBlockTurbofan(Material.iron, true).setBlockName("dummy_port_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
@ -3280,7 +3276,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_pumpjack, machine_pumpjack.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fracking_tower, machine_fracking_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_flare, ItemBlockBase.class, machine_flare.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_refinery, machine_refinery.getUnlocalizedName());
|
||||
register(machine_refinery);
|
||||
GameRegistry.registerBlock(machine_fraction_tower, machine_fraction_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fraction_spacer, fraction_spacer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_catalytic_cracker, machine_catalytic_cracker.getUnlocalizedName());
|
||||
@ -3446,8 +3442,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(dummy_port_drill, dummy_port_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_assembler, dummy_block_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_assembler, dummy_port_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_refinery, dummy_block_refinery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_refinery, dummy_port_refinery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_turbofan, dummy_block_turbofan.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_turbofan, dummy_port_turbofan.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_ams_limiter, dummy_block_ams_limiter.getUnlocalizedName());
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -21,7 +20,6 @@ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -151,23 +149,6 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
List<AStack> materials = IRepairable.getRepairMaterials(world, x, y, z, this, Minecraft.getMinecraft().thePlayer);
|
||||
|
||||
if(materials == null) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GOLD + "Repair with:");
|
||||
|
||||
for(AStack stack : materials) {
|
||||
try {
|
||||
ItemStack display = stack.extractForCyclingDisplay(20);
|
||||
text.add("- " + display.getDisplayName() + " x" + display.stackSize);
|
||||
} catch(Exception ex) {
|
||||
text.add(EnumChatFormatting.RED + "- ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
IRepairable.addGenericOverlay(event, world, x, y, z, this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,177 +1,146 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class MachineRefinery extends BlockContainer implements IMultiblock {
|
||||
public class MachineRefinery extends BlockDummyable implements IPersistentInfoProvider, IToolable, ILookOverlay {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private Random rand;
|
||||
private static boolean keepInventory;
|
||||
|
||||
public MachineRefinery(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_refinery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
public MachineRefinery(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineRefinery();
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineRefinery();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntityMachineRefinery entity = (TileEntityMachineRefinery) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_refinery, world, x, y, z);
|
||||
}
|
||||
} else if(!player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineRefinery tank = (TileEntityMachineRefinery) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(tank.hasExploded) return false;
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_refinery, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {8, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
TileEntityMachineRefinery tileentityfurnace = (TileEntityMachineRefinery)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.refineryDimensions)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.refineryDimensions, ModBlocks.dummy_block_refinery);
|
||||
|
||||
//
|
||||
DummyBlockRefinery.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z + 1, ModBlocks.dummy_port_refinery);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 1, ModBlocks.dummy_port_refinery);
|
||||
TileEntity te2 = world.getTileEntity(x + 1, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z - 1, ModBlocks.dummy_port_refinery);
|
||||
TileEntity te3 = world.getTileEntity(x - 1, y, z - 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 1, ModBlocks.dummy_port_refinery);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockRefinery.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDropFromExplosion(Explosion explosion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
TileEntity core = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(core instanceof TileEntityMachineRefinery)) return;
|
||||
|
||||
TileEntityMachineRefinery refinery = (TileEntityMachineRefinery) core;
|
||||
if(refinery.lastExplosion == explosion) return;
|
||||
refinery.lastExplosion = explosion;
|
||||
|
||||
if(!refinery.hasExploded) {
|
||||
refinery.explode(world, x, y, z);
|
||||
} else {
|
||||
world.setBlock(pos[0], pos[1], pos[2], Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.TORCH) return false;
|
||||
return IRepairable.tryRepairMultiblock(world, x, y, z, this, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
IRepairable.addGenericOverlay(event, world, x, y, z, this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ public class Fluids {
|
||||
SOLVENT = new FluidType("SOLVENT", 0xE4E3EF, 2, 3, 0, EnumSymbol.NONE).addContainers(0xE4E3EF, ExtContainer.CANISTER).addTraits(LIQUID);
|
||||
BLOOD = new FluidType("BLOOD", 0xB22424, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
BLOOD_HOT = new FluidType("BLOOD_HOT", 0xE4E3EF, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID).setTemp(666); //it's funny because it's the satan number
|
||||
SYNGAS = new FluidType("SYNGAS", 0xffffff, 3, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||
SYNGAS = new FluidType("SYNGAS", 0x131313, 3, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||
OXYHYDROGEN = new FluidType(87, "OXYHYDROGEN", 0x483FC1, 3, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||
|
||||
|
||||
@ -427,8 +427,8 @@ public class Fluids {
|
||||
|
||||
registerCalculatedFuel(SOLVENT, 100_000, 0, null); // flammable, sure, but not combustable
|
||||
|
||||
registerCalculatedFuel(SYNGAS, coalHeat * 10 * flammabilityNormal * demandMedium * complexityChemplant, 1.25, FuelGrade.GAS); //1:1 same base stats as coal oil but with combustability and higher processing bonuses
|
||||
registerCalculatedFuel(OXYHYDROGEN, 5_000, 3, FuelGrade.GAS); // TODO: figure out how well that works with hydrogen production costs
|
||||
registerCalculatedFuel(SYNGAS, (coalHeat * (1000 /* bucket */ / 100 /* mB per coal */) * flammabilityLow * demandLow * complexityChemplant) * 1.5, 1.25, FuelGrade.GAS); //same as coal oil, +50% bonus
|
||||
registerCalculatedFuel(OXYHYDROGEN, 5_000, 3, FuelGrade.GAS); // whatever
|
||||
}
|
||||
|
||||
private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) {
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -167,7 +167,6 @@ public class Library {
|
||||
return true;
|
||||
if((tileentity != null && (tileentity instanceof IFluidAcceptor ||
|
||||
tileentity instanceof IFluidSource)) ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan ||
|
||||
world.getBlock(x, y, z) == ModBlocks.reactor_hatch ||
|
||||
world.getBlock(x, y, z) == ModBlocks.reactor_conductor ||
|
||||
@ -395,11 +394,6 @@ public class Library {
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
TileEntity tileentity = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
//Refinery
|
||||
if(block == ModBlocks.dummy_port_refinery)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//Turbofan
|
||||
if(block == ModBlocks.dummy_port_turbofan)
|
||||
{
|
||||
|
||||
@ -1008,6 +1008,8 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.blades_gold");
|
||||
ignoreMappings.add("hbm:item.blades_iron");
|
||||
ignoreMappings.add("hbm:item.cap_aluminium");
|
||||
ignoreMappings.add("hbm:tile.dummy_block_refinery");
|
||||
ignoreMappings.add("hbm:tile.dummy_port_refinery");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -95,7 +95,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
}
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_assembler));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_refinery));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_turbofan));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_emitter));
|
||||
@ -106,7 +105,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_puf6));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_assembler));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_refinery));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_turbofan));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_emitter));
|
||||
|
||||
@ -68,6 +68,7 @@ public class ResourceManager {
|
||||
|
||||
//Refinery
|
||||
public static final IModelCustom refinery = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/refinery.obj"));
|
||||
public static final IModelCustom refinery_exploded = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/refinery_exploded.obj"));
|
||||
public static final IModelCustom fraction_tower = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_tower.obj"));
|
||||
public static final IModelCustom fraction_spacer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_spacer.obj"));
|
||||
public static final IModelCustom cracking_tower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/cracking_tower.obj"));
|
||||
|
||||
@ -3,27 +3,35 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderRefinery extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
|
||||
bindTexture(ResourceManager.refinery_tex);
|
||||
bindTexture(ResourceManager.refinery_tex);
|
||||
|
||||
TileEntityMachineRefinery refinery = (TileEntityMachineRefinery) tileEntity;
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.refinery.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if(refinery.hasExploded) {
|
||||
ResourceManager.refinery_exploded.renderAll();
|
||||
} else {
|
||||
ResourceManager.refinery.renderAll();
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,24 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.items.tool.ItemBlowtorch;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public interface IRepairable {
|
||||
|
||||
@ -54,4 +62,26 @@ public interface IRepairable {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void addGenericOverlay(Pre event, World world, int x, int y, int z, BlockDummyable dummyable) {
|
||||
|
||||
List<AStack> materials = IRepairable.getRepairMaterials(world, x, y, z, dummyable, Minecraft.getMinecraft().thePlayer);
|
||||
|
||||
if(materials == null) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GOLD + "Repair with:");
|
||||
|
||||
for(AStack stack : materials) {
|
||||
try {
|
||||
ItemStack display = stack.extractForCyclingDisplay(20);
|
||||
text.add("- " + display.getDisplayName() + " x" + display.stackSize);
|
||||
} catch(Exception ex) {
|
||||
text.add(EnumChatFormatting.RED + "- ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(dummyable.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcc
|
||||
if(power > maxPower) power = maxPower;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
this.sendPower(worldObj, xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir);
|
||||
this.sendPower(worldObj, xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite());
|
||||
|
||||
for(DirPos pos : this.getConPos()) {
|
||||
this.sendFluid(tanks[1].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
|
||||
@ -26,7 +26,6 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
@ -59,6 +58,8 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
|
||||
static {
|
||||
fuelMaxCons.put(Fluids.GAS, 50D);
|
||||
fuelMaxCons.put(Fluids.SYNGAS, 10D);
|
||||
fuelMaxCons.put(Fluids.OXYHYDROGEN, 100D);
|
||||
//fuelMaxCons.put(Fluids.PETROLEUM, 5D);
|
||||
//fuelMaxCons.put(Fluids.LPG, 5D);
|
||||
|
||||
@ -502,13 +503,21 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) return bb;
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 5,
|
||||
yCoord,
|
||||
zCoord - 5,
|
||||
xCoord + 6,
|
||||
yCoord + 3,
|
||||
zCoord + 6
|
||||
);
|
||||
}
|
||||
|
||||
this.bb = AxisAlignedBB.getBoundingBox(xCoord - 10, yCoord, zCoord - 10, xCoord + 10, yCoord + 3, zCoord + 10);
|
||||
return bb;
|
||||
}
|
||||
|
||||
|
||||
@ -2,18 +2,31 @@ package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IOverpressurable;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
@ -21,14 +34,18 @@ import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineRefinery extends TileEntityMachineBase implements IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineRefinery extends TileEntityMachineBase implements IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IOverpressurable, IPersistentNBT, IRepairable, IFluidStandardTransceiver {
|
||||
|
||||
public long power = 0;
|
||||
public int sulfur = 0;
|
||||
@ -39,6 +56,9 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
public List<IFluidAcceptor> list3 = new ArrayList();
|
||||
public List<IFluidAcceptor> list4 = new ArrayList();
|
||||
|
||||
public boolean hasExploded = false;
|
||||
public Explosion lastExplosion = null;
|
||||
|
||||
private static final int[] slot_access = new int[] {11};
|
||||
|
||||
@ -73,6 +93,7 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
tanks[3].readFromNBT(nbt, "light");
|
||||
tanks[4].readFromNBT(nbt, "petroleum");
|
||||
sulfur = nbt.getInteger("sulfur");
|
||||
hasExploded = nbt.getBoolean("exploded");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -86,6 +107,7 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
tanks[3].writeToNBT(nbt, "light");
|
||||
tanks[4].writeToNBT(nbt, "petroleum");
|
||||
nbt.setInteger("sulfur", sulfur);
|
||||
nbt.setBoolean("exploded", hasExploded);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -108,47 +130,77 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
fillFluidInit(tanks[3].getTankType());
|
||||
fillFluidInit(tanks[4].getTankType());
|
||||
if(this.getBlockMetadata() < 12) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getRotation(ForgeDirection.DOWN);
|
||||
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.machine_fluidtank, dir.ordinal() + 10, 3);
|
||||
MultiblockHandlerXR.fillSpace(worldObj, xCoord, yCoord, zCoord, ((BlockDummyable) ModBlocks.machine_refinery).getDimensions(), ModBlocks.machine_refinery, dir);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
this.writeToNBT(data);
|
||||
worldObj.getTileEntity(xCoord, yCoord, zCoord).readFromNBT(data);
|
||||
return;
|
||||
}
|
||||
|
||||
tanks[0].loadTank(1, 2, slots);
|
||||
|
||||
refine();
|
||||
|
||||
tanks[1].unloadTank(3, 4, slots);
|
||||
tanks[2].unloadTank(5, 6, slots);
|
||||
tanks[3].unloadTank(7, 8, slots);
|
||||
tanks[4].unloadTank(9, 10, slots);
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
for(int i = 1; i < 5; i++) {
|
||||
if(tanks[i].getFill() > 0) {
|
||||
this.sendFluid(tanks[i].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
if(!this.hasExploded) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
fillFluidInit(tanks[3].getTankType());
|
||||
fillFluidInit(tanks[4].getTankType());
|
||||
}
|
||||
|
||||
tanks[0].loadTank(1, 2, slots);
|
||||
|
||||
refine();
|
||||
|
||||
tanks[1].unloadTank(3, 4, slots);
|
||||
tanks[2].unloadTank(5, 6, slots);
|
||||
tanks[3].unloadTank(7, 8, slots);
|
||||
tanks[4].unloadTank(9, 10, slots);
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
for(int i = 1; i < 5; i++) {
|
||||
if(tanks[i].getFill() > 0) {
|
||||
this.sendFluid(tanks[i].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
boolean isBurning = false;
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if(tanks[i].getFill() > 0) {
|
||||
tanks[i].setFill(Math.max(tanks[i].getFill() - 10, 0));
|
||||
isBurning = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(isBurning) {
|
||||
List<Entity> affected = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(xCoord - 1.5, yCoord, zCoord - 1.5, xCoord + 2.5, yCoord + 8, zCoord + 2.5));
|
||||
for(Entity e : affected) e.setFire(5);
|
||||
Random rand = worldObj.rand;
|
||||
ParticleUtil.spawnGasFlame(worldObj, xCoord + rand.nextDouble(), yCoord + 1.5 + rand.nextDouble() * 3, zCoord + rand.nextDouble(), rand.nextGaussian() * 0.05, 0.1, rand.nextGaussian() * 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
this.networkPack(data, 50);
|
||||
for(int i = 0; i < 5; i++) tanks[i].writeToNBT(data, "" + i);
|
||||
data.setBoolean("exploded", hasExploded);
|
||||
this.networkPack(data, 150);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
for(int i = 0; i < 5; i++) tanks[i].readFromNBT(nbt, "" + i);
|
||||
this.hasExploded = nbt.getBoolean("exploded");
|
||||
}
|
||||
|
||||
private void refine() {
|
||||
@ -228,7 +280,6 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -371,4 +422,52 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(World world, int x, int y, int z) {
|
||||
|
||||
if(this.hasExploded) return;
|
||||
|
||||
this.hasExploded = true;
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDamaged() {
|
||||
return this.hasExploded;
|
||||
}
|
||||
|
||||
List<AStack> repair = new ArrayList();
|
||||
@Override
|
||||
public List<AStack> getRepairMaterials() {
|
||||
|
||||
if(!repair.isEmpty())
|
||||
return repair;
|
||||
|
||||
repair.add(new OreDictStack(OreDictManager.STEEL.plate(), 8));
|
||||
repair.add(new ComparableStack(ModItems.ducttape, 4));
|
||||
return repair;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repair() {
|
||||
this.hasExploded = false;
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
if(tanks[0].getFill() == 0 && tanks[1].getFill() == 0 && tanks[2].getFill() == 0 && tanks[3].getFill() == 0 && tanks[4].getFill() == 0 && !this.hasExploded) return;
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
for(int i = 0; i < 5; i++) this.tanks[i].writeToNBT(data, "" + i);
|
||||
data.setBoolean("hasExploded", hasExploded);
|
||||
nbt.setTag(NBT_PERSISTENT_KEY, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = nbt.getCompoundTag(NBT_PERSISTENT_KEY);
|
||||
for(int i = 0; i < 5; i++) this.tanks[i].readFromNBT(data, "" + i);
|
||||
this.hasExploded = data.getBoolean("hasExploded");
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
//meta below 121 means that it's an old multiblock configuration
|
||||
//meta below 12 means that it's an old multiblock configuration
|
||||
if(this.getBlockMetadata() < 12) {
|
||||
//get old direction
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getRotation(ForgeDirection.DOWN);
|
||||
@ -316,6 +316,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
|
||||
mode = nbt.getShort("mode");
|
||||
tank.readFromNBT(nbt, "tank");
|
||||
hasExploded = nbt.getBoolean("exploded");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -324,6 +325,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
|
||||
nbt.setShort("mode", mode);
|
||||
tank.writeToNBT(nbt, "tank");
|
||||
nbt.setBoolean("exploded", hasExploded);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
3007
src/main/resources/assets/hbm/models/refinery_exploded.obj
Normal file
3007
src/main/resources/assets/hbm/models/refinery_exploded.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user