baby steps
@ -830,6 +830,8 @@ public class ModBlocks {
|
||||
public static Block drone_crate_provider;
|
||||
public static Block drone_crate_requester;
|
||||
|
||||
public static Block pneumatic_tube;
|
||||
|
||||
public static Block fan;
|
||||
|
||||
public static Block piston_inserter;
|
||||
@ -989,6 +991,7 @@ public class ModBlocks {
|
||||
public static Block machine_liquefactor;
|
||||
public static Block machine_solidifier;
|
||||
public static Block machine_compressor;
|
||||
public static Block machine_compressor_compact;
|
||||
|
||||
public static Block machine_chungus;
|
||||
public static Block machine_condenser;
|
||||
@ -1959,6 +1962,8 @@ public class ModBlocks {
|
||||
drone_crate_provider = new DroneDock().setBlockName("drone_crate_provider").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_crate_provider");
|
||||
drone_crate_requester = new DroneDock().setBlockName("drone_crate_requester").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_crate_requester");
|
||||
|
||||
pneumatic_tube = new PneumoTube().setBlockName("pneumatic_tube").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pneumatic_tube");
|
||||
|
||||
chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain");
|
||||
|
||||
ladder_sturdy = new BlockNTMLadder().setBlockName("ladder_sturdy").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_sturdy");
|
||||
@ -2262,6 +2267,7 @@ public class ModBlocks {
|
||||
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
machine_solidifier = new MachineSolidifier().setBlockName("machine_solidifier").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
machine_compressor = new MachineCompressor().setBlockName("machine_compressor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
machine_compressor_compact = new MachineCompressorCompact().setBlockName("machine_compressor_compact").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_electrolyser = new MachineElectrolyser().setBlockName("machine_electrolyser").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
@ -3216,6 +3222,7 @@ public class ModBlocks {
|
||||
register(drone_dock);
|
||||
register(drone_crate_provider);
|
||||
register(drone_crate_requester);
|
||||
register(pneumatic_tube);
|
||||
register(fan);
|
||||
register(piston_inserter);
|
||||
|
||||
@ -3285,6 +3292,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
|
||||
register(machine_compressor);
|
||||
register(machine_compressor_compact);
|
||||
GameRegistry.registerBlock(machine_electrolyser, machine_electrolyser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_waste_drum, machine_waste_drum.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_storage_drum, machine_storage_drum.getUnlocalizedName());
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressorCompact;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCompressorCompact extends BlockDummyable {
|
||||
|
||||
public MachineCompressorCompact() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineCompressorCompact();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {2, 0, 1, 1, 3, 3}; }
|
||||
@Override public int getOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x = x + dir.offsetX * o;
|
||||
z = z + dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 3, y + 1, z + rot.offsetZ * 3);
|
||||
this.makeExtra(world, x - rot.offsetX * 3, y + 1, z - rot.offsetZ * 3);
|
||||
this.makeExtra(world, x + dir.offsetX + rot.offsetX, y + 1, z + dir.offsetZ + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX - rot.offsetX, y + 1, z + dir.offsetZ - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX, y + 1, z - dir.offsetZ + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX, y + 1, z - dir.offsetZ - rot.offsetZ);
|
||||
}
|
||||
}
|
||||
20
src/main/java/com/hbm/blocks/network/PneumoTube.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.tileentity.network.TileEntityPneumoTube;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PneumoTube extends BlockContainer {
|
||||
|
||||
public PneumoTube() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityPneumoTube();
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stg77, 1), new Object[] { " D ", "BRS", "GGM", 'D', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "PPP", "BSR", "G M", 'P', BIGMT.plate(), 'B', BIGMT.heavyBarrel(), 'S', BIGMT.shell(), 'R', BIGMT.heavyReceiver(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tau, 1), new Object[] { " RD", "CTT", "GMS", 'D', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'C', CU.pipe(), 'T', ModItems.coil_advanced_torus, 'G', ANY_HARDPLASTIC.grip(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'S', ANY_HARDPLASTIC.stock() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { " LC", "BRS", "MG ", 'L', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { "DLC", "BRS", "MG ", 'D', ModItems.crystal_redstone, 'L', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.gun_double_barrel_sacred_dragon, 1), new Object[] { ModItems.gun_double_barrel, DictFrame.fromOne(ModItems.item_secret, EnumSecretType.SELENIUM_STEEL) });
|
||||
|
||||
//SEDNA Ammo
|
||||
@ -130,6 +130,9 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SKIN_SATURNITE.ordinal()), new Object[] { "BRM", " P ", 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'P', BIGMT.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.STACK_MAG.ordinal()), new Object[] { "P P", "P P", "PMP", 'P', WEAPONSTEEL.plate(), 'M', BIGMT.mechanism() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.BAYONET.ordinal()), new Object[] { " P", "BBB", 'P', WEAPONSTEEL.plate(), 'B', STEEL.bolt() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.LAS_SHOTGUN.ordinal()), new Object[] { "PPP", "RCR", "PPP", 'P', ANY_HARDPLASTIC.ingot(), 'R', ModItems.crystal_redstone, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.LAS_CAPACITOR.ordinal()), new Object[] { "CCC", "PIP", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR_TANTALIUM), 'P', ANY_HARDPLASTIC.ingot(), 'I', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP_BISMOID) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.LAS_AUTO.ordinal()), new Object[] { " C ", "RFR", " C ", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP_BISMOID), 'R', ModItems.crystal_redstone, 'F', ANY_BISMOIDBRONZE.heavyReceiver() });
|
||||
|
||||
//Nitra!
|
||||
CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP), ModItems.nitra });
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressor;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressorBase;
|
||||
|
||||
import api.hbm.energymk2.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -12,9 +12,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerCompressor extends Container {
|
||||
|
||||
private TileEntityMachineCompressor compressor;
|
||||
private TileEntityMachineCompressorBase compressor;
|
||||
|
||||
public ContainerCompressor(InventoryPlayer playerInv, TileEntityMachineCompressor tile) {
|
||||
public ContainerCompressor(InventoryPlayer playerInv, TileEntityMachineCompressorBase tile) {
|
||||
compressor = tile;
|
||||
|
||||
//Fluid ID
|
||||
|
||||
@ -6,7 +6,7 @@ import com.hbm.inventory.container.ContainerCompressor;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressor;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressorBase;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
@ -18,9 +18,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
public class GUICompressor extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_compressor.png");
|
||||
private TileEntityMachineCompressor compressor;
|
||||
private TileEntityMachineCompressorBase compressor;
|
||||
|
||||
public GUICompressor(InventoryPlayer invPlayer, TileEntityMachineCompressor tedf) {
|
||||
public GUICompressor(InventoryPlayer invPlayer, TileEntityMachineCompressorBase tedf) {
|
||||
super(new ContainerCompressor(invPlayer, tedf));
|
||||
compressor = tedf;
|
||||
|
||||
|
||||
@ -144,8 +144,8 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setAutogen(CASTPLATE, HEAVYBARREL, HEAVYRECEIVER).m();
|
||||
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setAutogen(DUST, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
|
||||
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setAutogen(CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
|
||||
public static final NTMMaterial MAT_BBRONZE = makeSmeltable(_AS + 16, BBRONZE, 0xE19A69, 0x485353, 0x987D65).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER).m();
|
||||
public static final NTMMaterial MAT_ABRONZE = makeSmeltable(_AS + 17, ABRONZE, 0xDB9462, 0x203331, 0x77644D).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER).m();
|
||||
public static final NTMMaterial MAT_BBRONZE = makeSmeltable(_AS + 16, BBRONZE, 0xE19A69, 0x485353, 0x987D65).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
|
||||
public static final NTMMaterial MAT_ABRONZE = makeSmeltable(_AS + 17, ABRONZE, 0xDB9462, 0x203331, 0x77644D).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
|
||||
public static final NTMMaterial MAT_BSCCO = makeSmeltable(_AS + 18, BSCCO, 0x767BF1, 0x000000, 0x5E62C0).setAutogen(DENSEWIRE).m();
|
||||
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 8, MAGTUNG, 0x22A2A2, 0x0F0F0F, 0x22A2A2).setAutogen(WIRE, DUST, DENSEWIRE, BLOCK).m();
|
||||
public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4, 0x000011, 0x6F6FB4).setAutogen(DUST, PLATE, CASTPLATE, WELDEDPLATE, BLOCK).m();
|
||||
|
||||
@ -918,6 +918,13 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
new ComparableStack(ModItems.motor, 3),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ANALOG)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_compressor_compact, 1), new AStack[] {
|
||||
new OreDictStack(STEEL.plateCast(), 8),
|
||||
new OreDictStack(TI.shell(), 4),
|
||||
new OreDictStack(CU.pipe(), 4),
|
||||
new ComparableStack(ModItems.motor, 2),
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_electrolyser, 1), new AStack[] {
|
||||
!exp ? new OreDictStack(STEEL.plateCast(), 8) : new OreDictStack(STEEL.heavyComp(), 2),
|
||||
|
||||
@ -309,6 +309,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLiquefactor.class, new RenderLiquefactor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSolidifier.class, new RenderSolidifier());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCompressor.class, new RenderCompressor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCompressorCompact.class, new RenderCompressorCompact());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineDrain.class, new RenderDrain());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadiolysis.class, new RenderRadiolysis());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectrolyser.class, new RenderElectrolyser());
|
||||
|
||||
@ -494,6 +494,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png");
|
||||
public static final ResourceLocation solidifier_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/solidifier.png");
|
||||
public static final ResourceLocation compressor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/compressor.png");
|
||||
public static final ResourceLocation compressor_compact_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/compressor_compact.png");
|
||||
public static final ResourceLocation coker_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/coker.png");
|
||||
public static final ResourceLocation pyrooven_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/pyrooven.png");
|
||||
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressorCompact;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderCompressorCompact extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@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);
|
||||
|
||||
switch(tileEntity.getBlockMetadata() - 10) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
TileEntityMachineCompressorCompact compressor = (TileEntityMachineCompressorCompact) tileEntity;
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.compressor_compact_tex);
|
||||
ResourceManager.condenser.renderPart("Condenser");
|
||||
|
||||
float rot = compressor.prevFanSpin + (compressor.fanSpin - compressor.prevFanSpin) * f;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0,1.5, 0);
|
||||
GL11.glRotatef(rot, 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.condenser.renderPart("Fan1");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0,1.5, 0);
|
||||
GL11.glRotatef(rot, -1, 0, 0);
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
ResourceManager.condenser.renderPart("Fan2");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_compressor_compact);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(-1, -1, 0);
|
||||
GL11.glScaled(2.75, 2.75, 2.75);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.compressor_compact_tex); ResourceManager.condenser.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -331,6 +331,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineLiquefactor.class, "tileentity_liquefactor");
|
||||
put(TileEntityMachineSolidifier.class, "tileentity_solidifier");
|
||||
put(TileEntityMachineCompressor.class, "tileentity_compressor");
|
||||
put(TileEntityMachineCompressorCompact.class, "tileentity_compressor_compact");
|
||||
put(TileEntityElectrolyser.class, "tileentity_electrolyser");
|
||||
put(TileEntityMachineMixer.class, "tileentity_mixer");
|
||||
put(TileEntityMachineArcWelder.class, "tileentity_arc_welder");
|
||||
@ -421,6 +422,8 @@ public class TileMappings {
|
||||
put(TileEntityFan.class, "tileentity_fan");
|
||||
put(TileEntityPistonInserter.class, "tileentity_piston_inserter");
|
||||
|
||||
put(TileEntityPneumoTube.class, "tileentity_pneumatic_tube");
|
||||
|
||||
put(TileEntityRadioTorchSender.class, "tileentity_rtty_sender");
|
||||
put(TileEntityRadioTorchReceiver.class, "tileentity_rtty_rec");
|
||||
put(TileEntityRadioTorchCounter.class, "tileentity_rtty_counter");
|
||||
|
||||
@ -1,129 +1,27 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.UpgradeManagerNT;
|
||||
import com.hbm.inventory.container.ContainerCompressor;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICompressor;
|
||||
import com.hbm.inventory.recipes.CompressorRecipes;
|
||||
import com.hbm.inventory.recipes.CompressorRecipes.CompressorRecipe;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.*;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IEnergyReceiverMK2, IFluidStandardTransceiver, IUpgradeInfoProvider, IFluidCopiable {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public long power;
|
||||
public static final long maxPower = 100_000;
|
||||
public boolean isOn;
|
||||
public int progress;
|
||||
public int processTime = 100;
|
||||
public static final int processTimeBase = 100;
|
||||
public int powerRequirement;
|
||||
public static final int powerRequirementBase = 2_500;
|
||||
public class TileEntityMachineCompressor extends TileEntityMachineCompressorBase {
|
||||
|
||||
public float fanSpin;
|
||||
public float prevFanSpin;
|
||||
public float piston;
|
||||
public float prevPiston;
|
||||
public boolean pistonDir;
|
||||
|
||||
public UpgradeManagerNT upgradeManager = new UpgradeManagerNT();
|
||||
|
||||
public TileEntityMachineCompressor() {
|
||||
super(4);
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.NONE, 16_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.NONE, 16_000).withPressure(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineCompressor";
|
||||
}
|
||||
private float randSpeed = 0.1F;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
this.updateConnections();
|
||||
}
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
this.tanks[0].setType(0, slots);
|
||||
this.setupTanks();
|
||||
|
||||
upgradeManager.checkSlots(this, slots, 1, 3);
|
||||
|
||||
int speedLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
||||
int powerLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
||||
int overLevel = upgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||
|
||||
CompressorRecipe rec = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
int timeBase = this.processTimeBase;
|
||||
if(rec != null) timeBase = rec.duration;
|
||||
|
||||
//there is a reason to do this but i'm not telling you
|
||||
// ^ a few months later i have to wonder what the fuck this guy was on about, and if i ever see him i will punch him in the nuts
|
||||
if(rec == null) this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : timeBase;
|
||||
else this.processTime = timeBase / (speedLevel + 1);
|
||||
this.powerRequirement = this.powerRequirementBase / (powerLevel + 1);
|
||||
this.processTime = this.processTime / (overLevel + 1);
|
||||
this.powerRequirement = this.powerRequirement * ((overLevel * 2) + 1);
|
||||
|
||||
if(processTime <= 0) processTime = 1;
|
||||
|
||||
if(canProcess()) {
|
||||
this.progress++;
|
||||
this.isOn = true;
|
||||
this.power -= powerRequirement;
|
||||
|
||||
if(progress >= this.processTime) {
|
||||
progress = 0;
|
||||
this.process();
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
} else {
|
||||
this.progress = 0;
|
||||
this.isOn = false;
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
this.networkPackNT(100);
|
||||
|
||||
} else {
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
this.prevFanSpin = this.fanSpin;
|
||||
this.prevPiston = this.piston;
|
||||
@ -155,39 +53,7 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement
|
||||
}
|
||||
}
|
||||
|
||||
private float randSpeed = 0.1F;
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeInt(this.progress);
|
||||
buf.writeInt(this.processTime);
|
||||
buf.writeInt(this.powerRequirement);
|
||||
buf.writeLong(this.power);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
buf.writeBoolean(this.isOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.progress = buf.readInt();
|
||||
this.processTime = buf.readInt();
|
||||
this.powerRequirement = buf.readInt();
|
||||
this.power = buf.readLong();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
this.isOn = buf.readBoolean();
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
@ -199,126 +65,6 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement
|
||||
};
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(this.power <= powerRequirement) return false;
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
return tanks[0].getFill() >= 1000 && tanks[1].getFill() + 1000 <= tanks[1].getMaxFill();
|
||||
}
|
||||
|
||||
return tanks[0].getFill() > recipe.inputAmount && tanks[1].getFill() + recipe.output.fill <= tanks[1].getMaxFill();
|
||||
}
|
||||
|
||||
public void process() {
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[0].setFill(tanks[0].getFill() - 1_000);
|
||||
tanks[1].setFill(tanks[1].getFill() + 1_000);
|
||||
} else {
|
||||
tanks[0].setFill(tanks[0].getFill() - recipe.inputAmount);
|
||||
tanks[1].setFill(tanks[1].getFill() + recipe.output.fill);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setupTanks() {
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[1].withPressure(tanks[0].getPressure() + 1).setTankType(tanks[0].getTankType());
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
power = nbt.getLong("power");
|
||||
progress = nbt.getInteger("progress");
|
||||
tanks[0].readFromNBT(nbt, "0");
|
||||
tanks[1].readFromNBT(nbt, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setInteger("progress", progress);
|
||||
tanks[0].writeToNBT(nbt, "0");
|
||||
tanks[1].writeToNBT(nbt, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerCompressor(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICompressor(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return this.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
int compression = data.getInteger("compression");
|
||||
|
||||
if(compression != tanks[0].getPressure()) {
|
||||
tanks[0].withPressure(compression);
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), compression));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[1].withPressure(compression + 1);
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
|
||||
this.markChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[1]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0]};
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
@ -337,69 +83,4 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_compressor));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + "Generic compression: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level == 3 ? 90 : level == 2 ? 80 : level == 1 ? 40 : 0) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + "Recipe: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<UpgradeType, Integer> getValidUpgrades() {
|
||||
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
||||
upgrades.put(UpgradeType.SPEED, 3);
|
||||
upgrades.put(UpgradeType.POWER, 3);
|
||||
upgrades.put(UpgradeType.OVERDRIVE, 9);
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getSettings(World world, int x, int y, int z) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setIntArray("fluidID", getFluidIDToCopy());
|
||||
tag.setInteger("compression", tanks[0].getPressure());
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
if(nbt.hasKey("compression")) {
|
||||
int compression = nbt.getInteger("compression");
|
||||
|
||||
if (compression != tanks[0].getPressure()) {
|
||||
tanks[0].withPressure(compression);
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), compression));
|
||||
|
||||
if (recipe == null) {
|
||||
tanks[1].withPressure(compression + 1);
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
|
||||
this.markChanged();
|
||||
}
|
||||
}
|
||||
IFluidCopiable.super.pasteSettings(nbt, index, world, player, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,338 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.UpgradeManagerNT;
|
||||
import com.hbm.inventory.container.ContainerCompressor;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICompressor;
|
||||
import com.hbm.inventory.recipes.CompressorRecipes;
|
||||
import com.hbm.inventory.recipes.CompressorRecipes.CompressorRecipe;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IFluidCopiable;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class TileEntityMachineCompressorBase extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IFluidCopiable {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public long power;
|
||||
public static final long maxPower = 100_000;
|
||||
public boolean isOn;
|
||||
public int progress;
|
||||
public int processTime = 100;
|
||||
public static final int processTimeBase = 100;
|
||||
public int powerRequirement;
|
||||
public static final int powerRequirementBase = 2_500;
|
||||
|
||||
public UpgradeManagerNT upgradeManager = new UpgradeManagerNT();
|
||||
|
||||
public TileEntityMachineCompressorBase() {
|
||||
super(4);
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.NONE, 16_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.NONE, 16_000).withPressure(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineCompressor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
this.updateConnections();
|
||||
}
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
this.tanks[0].setType(0, slots);
|
||||
this.setupTanks();
|
||||
|
||||
upgradeManager.checkSlots(this, slots, 1, 3);
|
||||
|
||||
int speedLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
||||
int powerLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
||||
int overLevel = upgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||
|
||||
CompressorRecipe rec = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
int timeBase = this.processTimeBase;
|
||||
if(rec != null) timeBase = rec.duration;
|
||||
|
||||
//there is a reason to do this but i'm not telling you
|
||||
// ^ a few months later i have to wonder what the fuck this guy was on about, and if i ever see him i will punch him in the nuts
|
||||
if(rec == null) this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : timeBase;
|
||||
else this.processTime = timeBase / (speedLevel + 1);
|
||||
this.powerRequirement = this.powerRequirementBase / (powerLevel + 1);
|
||||
this.processTime = this.processTime / (overLevel + 1);
|
||||
this.powerRequirement = this.powerRequirement * ((overLevel * 2) + 1);
|
||||
|
||||
if(processTime <= 0) processTime = 1;
|
||||
|
||||
if(canProcess()) {
|
||||
this.progress++;
|
||||
this.isOn = true;
|
||||
this.power -= powerRequirement;
|
||||
|
||||
if(progress >= this.processTime) {
|
||||
progress = 0;
|
||||
this.process();
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
} else {
|
||||
this.progress = 0;
|
||||
this.isOn = false;
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.tryProvide(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
this.networkPackNT(100);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeInt(this.progress);
|
||||
buf.writeInt(this.processTime);
|
||||
buf.writeInt(this.powerRequirement);
|
||||
buf.writeLong(this.power);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
buf.writeBoolean(this.isOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.progress = buf.readInt();
|
||||
this.processTime = buf.readInt();
|
||||
this.powerRequirement = buf.readInt();
|
||||
this.power = buf.readLong();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
this.isOn = buf.readBoolean();
|
||||
}
|
||||
|
||||
protected void updateConnections() {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
public abstract DirPos[] getConPos();
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(this.power <= powerRequirement) return false;
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
return tanks[0].getFill() >= 1000 && tanks[1].getFill() + 1000 <= tanks[1].getMaxFill();
|
||||
}
|
||||
|
||||
return tanks[0].getFill() > recipe.inputAmount && tanks[1].getFill() + recipe.output.fill <= tanks[1].getMaxFill();
|
||||
}
|
||||
|
||||
public void process() {
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[0].setFill(tanks[0].getFill() - 1_000);
|
||||
tanks[1].setFill(tanks[1].getFill() + 1_000);
|
||||
} else {
|
||||
tanks[0].setFill(tanks[0].getFill() - recipe.inputAmount);
|
||||
tanks[1].setFill(tanks[1].getFill() + recipe.output.fill);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setupTanks() {
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure()));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[1].withPressure(tanks[0].getPressure() + 1).setTankType(tanks[0].getTankType());
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
power = nbt.getLong("power");
|
||||
progress = nbt.getInteger("progress");
|
||||
tanks[0].readFromNBT(nbt, "0");
|
||||
tanks[1].readFromNBT(nbt, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setInteger("progress", progress);
|
||||
tanks[0].writeToNBT(nbt, "0");
|
||||
tanks[1].writeToNBT(nbt, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerCompressor(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICompressor(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return this.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
int compression = data.getInteger("compression");
|
||||
|
||||
if(compression != tanks[0].getPressure()) {
|
||||
tanks[0].withPressure(compression);
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), compression));
|
||||
|
||||
if(recipe == null) {
|
||||
tanks[1].withPressure(compression + 1);
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
|
||||
this.markChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[1]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0]};
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_compressor));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + "Generic compression: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level == 3 ? 90 : level == 2 ? 80 : level == 1 ? 40 : 0) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + "Recipe: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<UpgradeType, Integer> getValidUpgrades() {
|
||||
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
||||
upgrades.put(UpgradeType.SPEED, 3);
|
||||
upgrades.put(UpgradeType.POWER, 3);
|
||||
upgrades.put(UpgradeType.OVERDRIVE, 9);
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getSettings(World world, int x, int y, int z) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setIntArray("fluidID", getFluidIDToCopy());
|
||||
tag.setInteger("compression", tanks[0].getPressure());
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
if(nbt.hasKey("compression")) {
|
||||
int compression = nbt.getInteger("compression");
|
||||
|
||||
if (compression != tanks[0].getPressure()) {
|
||||
tanks[0].withPressure(compression);
|
||||
|
||||
CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), compression));
|
||||
|
||||
if (recipe == null) {
|
||||
tanks[1].withPressure(compression + 1);
|
||||
} else {
|
||||
tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type);
|
||||
}
|
||||
|
||||
this.markChanged();
|
||||
}
|
||||
}
|
||||
IFluidCopiable.super.pasteSettings(nbt, index, world, player, x, y, z);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCompressorCompact extends TileEntityMachineCompressorBase {
|
||||
|
||||
public float fanSpin;
|
||||
public float prevFanSpin;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
this.prevFanSpin = this.fanSpin;
|
||||
|
||||
if(this.isOn) {
|
||||
this.fanSpin += 15;
|
||||
|
||||
if(this.fanSpin >= 360) {
|
||||
this.prevFanSpin -= 360;
|
||||
this.fanSpin -= 360;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + rot.offsetX * 4, yCoord + 1, zCoord + rot.offsetZ * 4, rot),
|
||||
new DirPos(xCoord - rot.offsetX * 4, yCoord + 1, zCoord - rot.offsetZ * 4, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX * 2 - rot.offsetX, yCoord + 1, zCoord + dir.offsetZ * 2 - rot.offsetZ, dir),
|
||||
new DirPos(xCoord + dir.offsetX * 2 + rot.offsetX, yCoord + 1, zCoord + dir.offsetZ * 2 + rot.offsetZ, dir),
|
||||
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX, yCoord + 1, zCoord - dir.offsetZ * 2 - rot.offsetZ, dir.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX * 2 + rot.offsetX, yCoord + 1, zCoord - dir.offsetZ * 2 + rot.offsetZ, dir.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 3,
|
||||
yCoord,
|
||||
zCoord - 3,
|
||||
xCoord + 4,
|
||||
yCoord + 3,
|
||||
zCoord + 4
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityPneumoTube extends TileEntity {
|
||||
|
||||
}
|
||||
@ -4478,6 +4478,7 @@ tile.machine_coker.desc=Verkokt Öl, erzeugt fluides Nebenprodukt.$Benötigt ext
|
||||
tile.machine_combine_factory.name=CMB-Stahl Hochofen
|
||||
tile.machine_combustion_engine.name=Industrieller Verbrennungsmotor
|
||||
tile.machine_compressor.name=Kompressor
|
||||
tile.machine_compressor_compact.name=Kompakt-Kompressor
|
||||
tile.machine_condenser.name=Dampfkondensierer
|
||||
tile.machine_condenser_powered.name=Hochleistungs-Dampfkondensierer
|
||||
tile.machine_controller.name=Reaktorfernsteuerung
|
||||
|
||||
@ -5611,6 +5611,7 @@ tile.machine_coker.desc=Cokes oil, creating fluid byproducts.$Requires external
|
||||
tile.machine_combine_factory.name=CMB Steel Furnace
|
||||
tile.machine_combustion_engine.name=Industrial Combustion Engine
|
||||
tile.machine_compressor.name=Compressor
|
||||
tile.machine_compressor_compact.name=Compact Compressor
|
||||
tile.machine_condenser.name=Steam Condenser
|
||||
tile.machine_condenser_powered.name=High-Power Steam Condenser
|
||||
tile.machine_controller.name=Reactor Remote Control Block
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/pneumatic_pipe.png
Normal file
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 277 B |
|
After Width: | Height: | Size: 182 B |
|
After Width: | Height: | Size: 334 B |
|
After Width: | Height: | Size: 352 B |
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |