mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'HbmMods/master'
This commit is contained in:
commit
efd1325e8f
@ -485,6 +485,7 @@ public class ModBlocks {
|
||||
public static Block crashed_balefire;
|
||||
public static Block rejuvinator;
|
||||
public static Block fireworks;
|
||||
public static Block dynamite;
|
||||
|
||||
public static Block charge_dynamite;
|
||||
public static Block charge_miner;
|
||||
@ -1697,6 +1698,7 @@ public class ModBlocks {
|
||||
mine_he = new Landmine(Material.iron).setBlockName("mine_he").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":mine_he");
|
||||
mine_shrap = new Landmine(Material.iron).setBlockName("mine_shrap").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":mine_shrap");
|
||||
mine_fat = new Landmine(Material.iron).setBlockName("mine_fat").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":mine_fat");
|
||||
dynamite = new BlockDynamite().setBlockName("dynamite").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":dynamite");
|
||||
|
||||
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -2663,6 +2665,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(bomb_multi, bomb_multi.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crashed_balefire, crashed_balefire.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fireworks, fireworks.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dynamite, dynamite.getUnlocalizedName());
|
||||
|
||||
//Turrets
|
||||
GameRegistry.registerBlock(turret_light, turret_light.getUnlocalizedName());
|
||||
|
||||
@ -8,6 +8,7 @@ import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockContainerBase;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
@ -18,6 +19,7 @@ import api.hbm.block.IToolable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@ -55,6 +57,11 @@ public abstract class BlockChargeBase extends BlockContainerBase implements IBom
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
|
||||
13
src/main/java/com/hbm/blocks/bomb/BlockDynamite.java
Normal file
13
src/main/java/com/hbm/blocks/bomb/BlockDynamite.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDynamite extends BlockTNTBase {
|
||||
|
||||
@Override
|
||||
public void explodeEntity(World world, double x, double y, double z, EntityTNTPrimedBase entity) {
|
||||
world.createExplosion(entity, x, y, z, 8F, true);
|
||||
}
|
||||
}
|
||||
125
src/main/java/com/hbm/blocks/bomb/BlockTNTBase.java
Normal file
125
src/main/java/com/hbm/blocks/bomb/BlockTNTBase.java
Normal file
@ -0,0 +1,125 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockTNTBase extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
public BlockTNTBase() {
|
||||
super(Material.tnt);
|
||||
this.setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 0 ? this.bottomIcon : (side == 1 ? this.topIcon : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
this.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
this.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) {
|
||||
if(!world.isRemote) {
|
||||
EntityTNTPrimedBase entitytntprimed = new EntityTNTPrimedBase(world, x + 0.5D, y + 0.5D, z + 0.5D, explosion.getExplosivePlacedBy(), this);
|
||||
entitytntprimed.fuse = world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
|
||||
world.spawnEntityInWorld(entitytntprimed);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
|
||||
this.prime(world, x, y, z, meta, (EntityLivingBase) null);
|
||||
}
|
||||
|
||||
public void prime(World world, int x, int y, int z, int meta, EntityLivingBase living) {
|
||||
if(!world.isRemote) {
|
||||
if((meta & 1) == 1) {
|
||||
EntityTNTPrimedBase entitytntprimed = new EntityTNTPrimedBase(world, x + 0.5D, y + 0.5D, z + 0.5D, living, this);
|
||||
world.spawnEntityInWorld(entitytntprimed);
|
||||
world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) {
|
||||
this.prime(world, x, y, z, 1, player);
|
||||
world.setBlockToAir(x, y, z);
|
||||
player.getCurrentEquippedItem().damageItem(1, player);
|
||||
return true;
|
||||
} else {
|
||||
return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if(entity instanceof EntityArrow && !world.isRemote) {
|
||||
EntityArrow entityarrow = (EntityArrow) entity;
|
||||
|
||||
if(entityarrow.isBurning()) {
|
||||
this.prime(world, x, y, z, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase) entityarrow.shootingEntity : null);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDropFromExplosion(Explosion explosion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void explodeEntity(World world, double x, double y, double z, EntityTNTPrimedBase entity);
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
|
||||
this.topIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top");
|
||||
this.bottomIcon = p_149651_1_.registerIcon(this.getTextureName() + "_bottom");
|
||||
}
|
||||
}
|
||||
@ -26,6 +26,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -54,6 +55,18 @@ public class BlockBobble extends BlockContainer {
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
|
||||
TileEntityBobble entity = (TileEntityBobble) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity != null) {
|
||||
return new ItemStack(this, 1, entity.type.ordinal());
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
@ -7,11 +7,11 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateSteel;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
|
||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||
import com.hbm.tileentity.machine.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -4,7 +4,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
|
||||
@ -6,7 +6,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IDummy;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -6,7 +6,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDiFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -5,7 +5,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBAT9000;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@ -12,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -75,7 +76,7 @@ public class MachineFractionTower extends BlockDummyable {
|
||||
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
|
||||
frac.tanks[0].setTankType(type);
|
||||
frac.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Changed type to " + type + "!"));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -4,7 +4,7 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineOrbus;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePuF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachinePuF6Tank;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -7,7 +7,7 @@ import org.lwjgl.input.Keyboard;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSolidifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineUF6Tank;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@ -4,7 +4,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzCapsule;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@ -82,6 +82,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(ModItems.powder_lithium, new ItemStack(ModItems.lithium), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_dura_steel, new ItemStack(ModItems.ingot_dura_steel), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_polymer, new ItemStack(ModItems.ingot_polymer), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_bakelite, new ItemStack(ModItems.ingot_bakelite), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_lanthanium, new ItemStack(ModItems.ingot_lanthanium), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_actinium, new ItemStack(ModItems.ingot_actinium), 1.0F);
|
||||
GameRegistry.addSmelting(ModItems.powder_boron, new ItemStack(ModItems.ingot_boron), 1.0F);
|
||||
|
||||
113
src/main/java/com/hbm/entity/item/EntityTNTPrimedBase.java
Normal file
113
src/main/java/com/hbm/entity/item/EntityTNTPrimedBase.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.hbm.entity.item;
|
||||
|
||||
import com.hbm.blocks.bomb.BlockTNTBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTNTPrimedBase extends Entity {
|
||||
|
||||
public int fuse;
|
||||
private EntityLivingBase tntPlacedBy;
|
||||
|
||||
public EntityTNTPrimedBase(World world) {
|
||||
super(world);
|
||||
this.preventEntitySpawning = true;
|
||||
this.setSize(0.98F, 0.98F);
|
||||
this.yOffset = this.height / 2.0F;
|
||||
this.fuse = 80;
|
||||
}
|
||||
|
||||
public EntityTNTPrimedBase(World world, double x, double y, double z, EntityLivingBase entity, BlockTNTBase bomb) {
|
||||
this(world);
|
||||
this.setPosition(x, y, z);
|
||||
float f = (float) (Math.random() * Math.PI * 2.0D);
|
||||
this.motionX = (double) (-((float) Math.sin((double) f)) * 0.02F);
|
||||
this.motionY = 0.2D;
|
||||
this.motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
|
||||
this.prevPosX = x;
|
||||
this.prevPosY = y;
|
||||
this.prevPosZ = z;
|
||||
this.tntPlacedBy = entity;
|
||||
this.dataWatcher.updateObject(12, Block.getIdFromBlock(bomb));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(12, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
return !this.isDead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.motionY -= 0.04D;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.98D;
|
||||
this.motionY *= 0.98D;
|
||||
this.motionZ *= 0.98D;
|
||||
|
||||
if(this.onGround) {
|
||||
this.motionX *= 0.7D;
|
||||
this.motionZ *= 0.7D;
|
||||
this.motionY *= -0.5D;
|
||||
}
|
||||
|
||||
if(this.fuse-- <= 0) {
|
||||
this.setDead();
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.explode();
|
||||
}
|
||||
} else {
|
||||
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
this.getBomb().explodeEntity(worldObj, posX, posY, posZ, this);
|
||||
}
|
||||
|
||||
public BlockTNTBase getBomb() {
|
||||
return (BlockTNTBase) Block.getBlockById(this.dataWatcher.getWatchableObjectInt(12));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
nbt.setByte("Fuse", (byte) this.fuse);
|
||||
nbt.setInteger("Tile", this.dataWatcher.getWatchableObjectInt(12));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
this.fuse = nbt.getByte("Fuse");
|
||||
this.dataWatcher.updateObject(12, nbt.getInteger("Tile"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public EntityLivingBase getTntPlacedBy() {
|
||||
return this.tntPlacedBy;
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ package com.hbm.entity.missile;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzCapsule;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@ -167,13 +167,21 @@ public abstract class EntityUFOBase extends EntityFlying implements IMob {
|
||||
int wX = (int)Math.floor(this.target.posX - vec.xCoord / length * overshoot);
|
||||
int wZ = (int)Math.floor(this.target.posZ - vec.zCoord / length * overshoot);
|
||||
|
||||
this.setWaypoint(wX, Math.max(this.worldObj.getHeightValue(wX, wZ) + 2 + rand.nextInt(2), (int) this.target.posY + rand.nextInt(3)), wZ);
|
||||
this.setWaypoint(wX, Math.max(this.worldObj.getHeightValue(wX, wZ), (int) this.target.posY) + targetHeightOffset(), wZ);
|
||||
}
|
||||
|
||||
protected int targetHeightOffset() {
|
||||
return 2 + rand.nextInt(2);
|
||||
}
|
||||
|
||||
protected int wanderHeightOffset() {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
|
||||
protected void setCourseWithoutTaget() {
|
||||
int x = (int) Math.floor(posX + rand.nextGaussian() * 5);
|
||||
int z = (int) Math.floor(posZ + rand.nextGaussian() * 5);
|
||||
this.setWaypoint(x, this.worldObj.getHeightValue(x, z) + 2 + rand.nextInt(3), z);
|
||||
this.setWaypoint(x, this.worldObj.getHeightValue(x, z) + wanderHeightOffset(), z);
|
||||
}
|
||||
|
||||
public void setWaypoint(int x, int y, int z) {
|
||||
|
||||
@ -1,30 +1,49 @@
|
||||
package com.hbm.entity.mob.siege;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.mob.EntityUFOBase;
|
||||
import com.hbm.entity.projectile.EntitySiegeLaser;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntitySiegeCraft extends EntityUFOBase implements IBossDisplayData {
|
||||
|
||||
private int attackCooldown;
|
||||
private int beamCountdown;
|
||||
|
||||
public EntitySiegeCraft(World world) {
|
||||
super(world);
|
||||
this.setSize(7F, 1F);
|
||||
this.isImmuneToFire = true;
|
||||
this.ignoreFrustumCheck = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.getDataWatcher().addObject(12, (int) 0);
|
||||
this.getDataWatcher().addObject(13, 0F);
|
||||
this.getDataWatcher().addObject(14, 0F);
|
||||
this.getDataWatcher().addObject(15, 0F);
|
||||
this.getDataWatcher().addObject(16, (byte) 0);
|
||||
}
|
||||
|
||||
public void setTier(SiegeTier tier) {
|
||||
@ -39,6 +58,38 @@ public class EntitySiegeCraft extends EntityUFOBase implements IBossDisplayData
|
||||
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
|
||||
return tier != null ? tier : SiegeTier.CLAY;
|
||||
}
|
||||
|
||||
public void setBeam(boolean beam) {
|
||||
this.getDataWatcher().updateObject(16, beam ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
public boolean getBeam() {
|
||||
return this.getDataWatcher().getWatchableObjectByte(16) == 1;
|
||||
}
|
||||
|
||||
public void setLockon(double x, double y, double z) {
|
||||
this.getDataWatcher().updateObject(13, (float) x);
|
||||
this.getDataWatcher().updateObject(14, (float) y);
|
||||
this.getDataWatcher().updateObject(15, (float) z);
|
||||
}
|
||||
|
||||
public Vec3 getLockon() {
|
||||
return Vec3.createVectorHelper(
|
||||
this.getDataWatcher().getWatchableObjectFloat(13),
|
||||
this.getDataWatcher().getWatchableObjectFloat(14),
|
||||
this.getDataWatcher().getWatchableObjectFloat(15)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int targetHeightOffset() {
|
||||
return 7 + rand.nextInt(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int wanderHeightOffset() {
|
||||
return 10 + rand.nextInt(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateEntityActionState() {
|
||||
@ -55,9 +106,80 @@ public class EntitySiegeCraft extends EntityUFOBase implements IBossDisplayData
|
||||
if(this.attackCooldown > 0) {
|
||||
this.attackCooldown--;
|
||||
}
|
||||
if(this.beamCountdown > 0) {
|
||||
this.beamCountdown--;
|
||||
}
|
||||
|
||||
if(rand.nextInt(50) == 0) {
|
||||
|
||||
NBTTagCompound dPart = new NBTTagCompound();
|
||||
dPart.setString("type", "tau");
|
||||
dPart.setByte("count", (byte)(2 + rand.nextInt(3)));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(dPart, posX + rand.nextGaussian() * 2, posY + rand.nextGaussian(), posZ + rand.nextGaussian() * 2), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 50));
|
||||
}
|
||||
|
||||
boolean beam = false;
|
||||
|
||||
if(this.target == null || this.beamCountdown <= 0) {
|
||||
this.beamCountdown = 300; //200 - 100: nothing, 100 - 40: update lockon, 40 - 20: fix lockon, 20 - 0: beam
|
||||
} else {
|
||||
|
||||
if(this.beamCountdown >= 60 && this.beamCountdown < 120) {
|
||||
double x = this.target.posX;
|
||||
double y = this.target.posY + this.target.height * 0.5;
|
||||
double z = this.target.posZ;
|
||||
this.setLockon(x, y, z);
|
||||
}
|
||||
|
||||
if(this.beamCountdown >= 40 && this.beamCountdown < 100) {
|
||||
|
||||
Vec3 lockon = this.getLockon();
|
||||
NBTTagCompound fx = new NBTTagCompound();
|
||||
fx.setString("type", "vanillaburst");
|
||||
fx.setString("mode", "reddust");
|
||||
fx.setDouble("motion", 0.2D);
|
||||
fx.setInteger("count", 5);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(fx, lockon.xCoord, lockon.yCoord, lockon.zCoord), new TargetPoint(this.dimension, lockon.xCoord, lockon.yCoord, lockon.zCoord, 100));
|
||||
}
|
||||
|
||||
if(this.beamCountdown < 40) {
|
||||
|
||||
Vec3 lockon = this.getLockon();
|
||||
|
||||
if(this.beamCountdown == 39) {
|
||||
worldObj.playSoundEffect(lockon.xCoord, lockon.yCoord, lockon.zCoord, "hbm:entity.ufoBlast", 5.0F, 0.9F + worldObj.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
|
||||
List<Entity> entities = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(lockon.xCoord, lockon.yCoord, lockon.zCoord, lockon.xCoord, lockon.yCoord, lockon.zCoord).expand(2, 2, 2));
|
||||
|
||||
for(Entity e : entities) {
|
||||
if(this.canAttackClass(e.getClass())) {
|
||||
e.attackEntityFrom(ModDamageSource.causeCombineDamage(this, e), 1000F);
|
||||
e.setFire(5);
|
||||
|
||||
if(e instanceof EntityLivingBase)
|
||||
ContaminationUtil.contaminate((EntityLivingBase)e, HazardType.RADIATION, ContaminationType.CREATIVE, 5F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "plasmablast");
|
||||
data.setFloat("r", 0.0F);
|
||||
data.setFloat("g", 0.75F);
|
||||
data.setFloat("b", 1.0F);
|
||||
data.setFloat("pitch", -90 + rand.nextFloat() * 180);
|
||||
data.setFloat("yaw", rand.nextFloat() * 180F);
|
||||
data.setFloat("scale", 5F);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, lockon.xCoord, lockon.yCoord, lockon.zCoord), new TargetPoint(dimension, lockon.xCoord, lockon.yCoord, lockon.zCoord, 150));
|
||||
beam = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.setBeam(beam);
|
||||
|
||||
if(this.attackCooldown == 0 && this.target != null) {
|
||||
this.attackCooldown = 20 + rand.nextInt(5);
|
||||
this.attackCooldown = 30 + rand.nextInt(10);
|
||||
|
||||
double x = posX;
|
||||
double y = posY;
|
||||
@ -66,15 +188,29 @@ public class EntitySiegeCraft extends EntityUFOBase implements IBossDisplayData
|
||||
Vec3 vec = Vec3.createVectorHelper(target.posX - x, target.posY + target.height * 0.5 - y, target.posZ - z).normalize();
|
||||
SiegeTier tier = this.getTier();
|
||||
|
||||
EntitySiegeLaser laser = new EntitySiegeLaser(worldObj, this);
|
||||
laser.setPosition(x, y, z);
|
||||
laser.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, 1F, 0.15F);
|
||||
laser.setColor(0x808080);
|
||||
laser.setDamage(tier.damageMod);
|
||||
laser.setExplosive(tier.laserExplosive);
|
||||
laser.setBreakChance(tier.laserBreak);
|
||||
if(tier.laserIncendiary) laser.setIncendiary();
|
||||
worldObj.spawnEntityInWorld(laser);
|
||||
float health = getHealth() / getMaxHealth();
|
||||
|
||||
int r = (int)(0xff * (1 - health));
|
||||
int g = (int)(0xff * health);
|
||||
int b = 0;
|
||||
int color = (r << 16) | (g << 8) | b;
|
||||
|
||||
for(int i = 0; i < 7; i++) {
|
||||
|
||||
Vec3 copy = Vec3.createVectorHelper(vec.xCoord, vec.yCoord, vec.zCoord);
|
||||
|
||||
copy.rotateAroundY((float)Math.PI / 180F * (i - 3) * 5F);
|
||||
|
||||
EntitySiegeLaser laser = new EntitySiegeLaser(worldObj, this);
|
||||
laser.setPosition(x, y, z);
|
||||
laser.setThrowableHeading(copy.xCoord, copy.yCoord, copy.zCoord, 1F, 0.0F);
|
||||
laser.setColor(color);
|
||||
laser.setDamage(tier.damageMod);
|
||||
laser.setBreakChance(tier.laserBreak * 2);
|
||||
if(tier.laserIncendiary) laser.setIncendiary();
|
||||
worldObj.spawnEntityInWorld(laser);
|
||||
}
|
||||
|
||||
this.playSound("hbm:weapon.ballsLaser", 2.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ import net.minecraft.world.World;
|
||||
//well it ain't fucking funny
|
||||
//this stupid fucking random ass bullshit is the P R E C I S E reason i loathe working with entities
|
||||
//honest to fucking god was the entire mojang dev team on crack when they wrote this?
|
||||
public class EntitySiegeTunneler extends EntityMob {
|
||||
public class EntitySiegeTunneler extends EntityBurrowingSwingingBase {
|
||||
|
||||
public EntitySiegeTunneler(World world) {
|
||||
super(world);
|
||||
@ -30,44 +30,44 @@ public class EntitySiegeTunneler extends EntityMob {
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
//this.getDataWatcher().addObject(12, (int) 0);
|
||||
this.getDataWatcher().addObject(12, (int) 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
//this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
|
||||
//this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
|
||||
}
|
||||
|
||||
public void setTier(SiegeTier tier) {
|
||||
//this.getDataWatcher().updateObject(12, tier.id);
|
||||
this.getDataWatcher().updateObject(12, tier.id);
|
||||
|
||||
//this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
|
||||
//this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
|
||||
//this.setHealth(this.getMaxHealth());
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
|
||||
this.setHealth(this.getMaxHealth());
|
||||
}
|
||||
|
||||
public SiegeTier getTier() {
|
||||
//SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
|
||||
return /*tier != null ? tier :*/ SiegeTier.CLAY;
|
||||
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
|
||||
return tier != null ? tier : SiegeTier.CLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
super.writeEntityToNBT(nbt);
|
||||
//nbt.setInteger("siegeTier", this.getTier().id);
|
||||
nbt.setInteger("siegeTier", this.getTier().id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
//this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
|
||||
this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
|
||||
//this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
|
||||
this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
|
||||
return super.onSpawnWithEgg(data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,10 +10,9 @@ import com.hbm.inventory.inv.InventoryLeadBox;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityOilDrillBase;
|
||||
import com.hbm.tileentity.machine.oil.*;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -89,6 +89,12 @@ public class BulletConfigFactory {
|
||||
|
||||
return bullet;
|
||||
}
|
||||
public static BulletConfiguration standardPistolConfig() {
|
||||
BulletConfiguration bullet = standardBulletConfig();
|
||||
bullet.style = BulletConfiguration.STYLE_PISTOL;
|
||||
bullet.plink = BulletConfiguration.PLINK_BULLET;
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public static BulletConfiguration standardBuckshotConfig() {
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public class Gun22LRFactory {
|
||||
static float inaccuracy = 5;
|
||||
public static BulletConfiguration get22LRConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_22lr;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -73,7 +73,7 @@ public class Gun22LRFactory {
|
||||
|
||||
public static BulletConfiguration get22LRAPConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_22lr_ap;
|
||||
bullet.spread *= inaccuracy;
|
||||
|
||||
@ -193,7 +193,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevIronConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_iron_ammo;
|
||||
bullet.dmgMin = 8;
|
||||
@ -204,7 +204,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevSteelConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_ammo;
|
||||
bullet.dmgMin = 18;
|
||||
@ -215,7 +215,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevLeadConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_lead_ammo;
|
||||
bullet.dmgMin = 10;
|
||||
@ -229,7 +229,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevGoldConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_gold_ammo;
|
||||
bullet.dmgMin = 25;
|
||||
@ -240,7 +240,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevDeshConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_357_desh;
|
||||
bullet.dmgMin = 30;
|
||||
@ -251,7 +251,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevSchrabidiumConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_schrabidium_ammo;
|
||||
bullet.dmgMin = 10000;
|
||||
@ -263,7 +263,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevCursedConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_cursed_ammo;
|
||||
bullet.dmgMin = 18;
|
||||
@ -274,7 +274,7 @@ public class Gun357MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getRevNightmareConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.gun_revolver_nightmare_ammo;
|
||||
bullet.dmgMin = 1;
|
||||
|
||||
@ -169,7 +169,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getNoPipConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44;
|
||||
bullet.dmgMin = 18;
|
||||
@ -180,7 +180,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getNoPipAPConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_ap;
|
||||
bullet.dmgMin = 25;
|
||||
@ -193,7 +193,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getNoPipDUConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_du;
|
||||
bullet.dmgMin = 28;
|
||||
@ -206,7 +206,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getPhosphorusConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_phosphorus;
|
||||
bullet.dmgMin = 18;
|
||||
@ -240,7 +240,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getNoPipStarConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_star;
|
||||
bullet.dmgMin = 42;
|
||||
@ -253,7 +253,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getPipConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_pip;
|
||||
bullet.dmgMin = 30;
|
||||
@ -290,7 +290,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getBJConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_bj;
|
||||
bullet.dmgMin = 30;
|
||||
@ -328,7 +328,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
public static BulletConfiguration getSilverStormConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_44_silver;
|
||||
bullet.dmgMin = 30;
|
||||
|
||||
@ -54,7 +54,7 @@ public class Gun50AEFactory {
|
||||
static float inaccuracy = 0.0005F;
|
||||
public static BulletConfiguration get50AEConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_50ae;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -66,7 +66,7 @@ public class Gun50AEFactory {
|
||||
|
||||
public static BulletConfiguration get50APConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_50ae_ap;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -80,7 +80,7 @@ public class Gun50AEFactory {
|
||||
|
||||
public static BulletConfiguration get50DUConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_50ae_du;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -94,7 +94,7 @@ public class Gun50AEFactory {
|
||||
|
||||
public static BulletConfiguration get50StarConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_50ae_star;
|
||||
bullet.spread *= inaccuracy;
|
||||
|
||||
@ -77,7 +77,7 @@ public class Gun9mmFactory {
|
||||
static float inaccuracy = 5;
|
||||
public static BulletConfiguration get9mmConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_9mm;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -89,7 +89,7 @@ public class Gun9mmFactory {
|
||||
|
||||
public static BulletConfiguration get9mmAPConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_9mm_ap;
|
||||
bullet.spread *= inaccuracy;
|
||||
@ -103,7 +103,7 @@ public class Gun9mmFactory {
|
||||
|
||||
public static BulletConfiguration get9mmDUConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
|
||||
|
||||
bullet.ammo = ModItems.ammo_9mm_du;
|
||||
bullet.spread *= inaccuracy;
|
||||
|
||||
@ -11,4 +11,9 @@ public class FluidStack {
|
||||
this.fill = fill;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public FluidStack(FluidType type, int fill) {
|
||||
this.fill = fill;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ package com.hbm.inventory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.interfaces.IPartiallyFillable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -261,7 +263,9 @@ public class FluidTank {
|
||||
*/
|
||||
//TODO: add a directional parameter to allow tanks to grow horizontally
|
||||
public void renderTank(int x, int y, double z, int width, int height) {
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
y -= height;
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(type.getTexture());
|
||||
@ -285,6 +289,8 @@ public class FluidTank {
|
||||
tessellator.addVertexWithUV(maxX, minY, z, maxU, minV);
|
||||
tessellator.addVertexWithUV(minX, minY, z, minU, minV);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
public void renderTankInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) {
|
||||
@ -293,24 +299,8 @@ public class FluidTank {
|
||||
List<String> list = new ArrayList();
|
||||
list.add(I18n.format(this.type.getUnlocalizedName()));
|
||||
list.add(fluid + "/" + maxFluid + "mB");
|
||||
|
||||
/*if(type.temperature < 0)
|
||||
list.add(EnumChatFormatting.BLUE + "" + type.temperature + "°C");
|
||||
if(type.temperature > 0)
|
||||
list.add(EnumChatFormatting.RED + "" + type.temperature + "°C");
|
||||
if(type.isAntimatter())
|
||||
list.add(EnumChatFormatting.DARK_RED + "Antimatter");
|
||||
if(type.traits.contains(FluidTrait.CORROSIVE))
|
||||
list.add(EnumChatFormatting.YELLOW + "Corrosive");
|
||||
if(type.traits.contains(FluidTrait.CORROSIVE_2))
|
||||
list.add(EnumChatFormatting.GOLD + "Strongly Corrosive");
|
||||
if(type.traits.contains(FluidTrait.NO_CONTAINER))
|
||||
list.add(EnumChatFormatting.RED + "Cannot be stored in any universal tank");
|
||||
if(type.traits.contains(FluidTrait.LEAD_CONTAINER))
|
||||
list.add(EnumChatFormatting.YELLOW + "Requires hazardous material tank to hold");*/
|
||||
|
||||
type.addInfo(list);
|
||||
|
||||
gui.drawFluidInfo(list.toArray(new String[0]), mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
@ -329,7 +319,7 @@ public class FluidTank {
|
||||
if(max > 0)
|
||||
maxFluid = nbt.getInteger(s + "_max");
|
||||
|
||||
type = FluidType.getEnumFromName(nbt.getString(s + "_type")); //compat
|
||||
type = Fluids.fromName(nbt.getString(s + "_type")); //compat
|
||||
if(type == Fluids.NONE)
|
||||
type = Fluids.fromID(nbt.getInteger(s + "_type"));
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityCrateSteel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotUpgrade;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePuF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachinePuF6Tank;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotUpgrade;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSolidifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzCapsule;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineUF6Tank;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
@ -79,6 +79,7 @@ public class Fluids {
|
||||
public static FluidType DEATH; //osmiridium solution
|
||||
public static FluidType ETHANOL;
|
||||
public static FluidType HEAVYWATER;
|
||||
public static FluidType SALIENT;
|
||||
|
||||
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
|
||||
private static final HashMap<String, FluidType> nameMapping = new HashMap();
|
||||
@ -168,6 +169,7 @@ public class Fluids {
|
||||
DIESEL_CRACK = new FluidTypeCombustible( "DIESEL_CRACK", 0xf2eed5, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 450_000);
|
||||
AROMATICS = new FluidTypeFlammable( "AROMATICS", 0xfffeed, 1, 4, 1, EnumSymbol.NONE);
|
||||
UNSATURATEDS = new FluidTypeFlammable( "UNSATURATEDS", 0xfffeed, 1, 4, 1, EnumSymbol.NONE);
|
||||
SALIENT = new FluidType( "SALIENT", 0x457F2D, 0, 0, 0, EnumSymbol.NONE);
|
||||
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
@ -205,7 +207,6 @@ public class Fluids {
|
||||
metaOrder.add(COALOIL);
|
||||
metaOrder.add(HOTOIL);
|
||||
metaOrder.add(HOTCRACKOIL);
|
||||
//metaOrder.add(HOTCOALOIL);
|
||||
metaOrder.add(HEAVYOIL);
|
||||
metaOrder.add(NAPHTHA);
|
||||
metaOrder.add(NAPHTHA_CRACK);
|
||||
@ -233,6 +234,7 @@ public class Fluids {
|
||||
metaOrder.add(NITAN);
|
||||
metaOrder.add(BALEFIRE);
|
||||
//processing fluids
|
||||
metaOrder.add(SALIENT);
|
||||
metaOrder.add(ACID);
|
||||
metaOrder.add(UF6);
|
||||
metaOrder.add(PUF6);
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.inventory.container.ContainerBarrel;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
|
||||
@ -4,7 +4,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCrateIron;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCrateSteel;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateSteel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCrateTungsten;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCrateTungsten;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerLiquefactor;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
@ -13,7 +13,7 @@ import com.hbm.inventory.container.ContainerMachineBattery;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
public class GUIMachineBattery extends GuiInfoContainer {
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.inventory.container.ContainerMachineFluidTank;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerPuF6Tank;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePuF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachinePuF6Tank;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
@ -4,17 +4,22 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineRefinery;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.NBTControlPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_refinery.png");
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_refinery.png");
|
||||
private TileEntityMachineRefinery refinery;
|
||||
|
||||
public GUIMachineRefinery(InventoryPlayer invPlayer, TileEntityMachineRefinery tedf) {
|
||||
@ -36,6 +41,18 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 70 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 64 <= x && guiLeft + 76 > x && guiTop + 20 < y && guiTop + 46 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("toggle", true); //we only need to send one bit, so boolean it is
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, refinery.xCoord, refinery.yCoord, refinery.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
@ -50,6 +67,9 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(refinery.tanks[0].getTankType() == Fluids.HOTCRACKOIL)
|
||||
drawTexturedModalRect(guiLeft + 64, guiTop + 20, 192, 0, 12, 26);
|
||||
|
||||
int j = (int)refinery.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 176, 52 - j, 16, j);
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerUF6Tank;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineUF6Tank;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerSafe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
@ -14,6 +14,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemCassette;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate.EnumChemistryTemplate;
|
||||
import com.hbm.items.machine.ItemStamp.StampType;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.ItemFolderPacket;
|
||||
@ -80,7 +81,10 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
||||
}
|
||||
// Chemistry Templates
|
||||
for(int i = 0; i < ItemChemistryTemplate.EnumChemistryTemplate.values().length; i++) {
|
||||
allStacks.add(new ItemStack(ModItems.chemistry_template, 1, i));
|
||||
EnumChemistryTemplate chem = EnumChemistryTemplate.getEnum(i);
|
||||
if(!chem.isDisabled()) {
|
||||
allStacks.add(new ItemStack(ModItems.chemistry_template, 1, i));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerSolidifier;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSolidifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerSoyuzCapsule;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzCapsule;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
@ -930,6 +930,17 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.inf_water_mk2, 2)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_solidifier), new AStack[] {
|
||||
new OreDictStack(ANY_CONCRETE.any(), 8),
|
||||
new OreDictStack(NB.ingot(), 2),
|
||||
new OreDictStack(AL.plate(), 12),
|
||||
new OreDictStack(ANY_PLASTIC.ingot(), 4),
|
||||
new ComparableStack(ModItems.hull_big_steel, 3),
|
||||
new ComparableStack(ModItems.catalyst_clay, 4),
|
||||
new ComparableStack(ModItems.coil_copper, 4),
|
||||
new ComparableStack(ModItems.tank_steel, 2)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radiolysis), new AStack[] {
|
||||
new OreDictStack(STEEL.ingot(), 8),
|
||||
new OreDictStack(TCALLOY.ingot(), 4),
|
||||
|
||||
@ -9,10 +9,12 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LiquefactionRecipes {
|
||||
@ -36,6 +38,9 @@ public class LiquefactionRecipes {
|
||||
recipes.put(new ComparableStack(Blocks.snow), new FluidStack(500, Fluids.WATER));
|
||||
recipes.put(new ComparableStack(Blocks.ice), new FluidStack(1000, Fluids.WATER));
|
||||
recipes.put(new ComparableStack(Blocks.packed_ice), new FluidStack(1000, Fluids.WATER));
|
||||
|
||||
recipes.put(new ComparableStack(Items.sugar), new FluidStack(150, Fluids.ETHANOL));
|
||||
recipes.put(new ComparableStack(ModItems.biomass), new FluidStack(250, Fluids.BIOGAS));
|
||||
|
||||
//TODO: more recipes as the crack oil derivatives are added
|
||||
}
|
||||
@ -58,6 +63,12 @@ public class LiquefactionRecipes {
|
||||
return recipes.get(key);
|
||||
}
|
||||
|
||||
if(stack.getItem() instanceof ItemFood) {
|
||||
ItemFood food = (ItemFood) stack.getItem();
|
||||
float saturation = food.func_150905_g(stack) * food.func_150906_h(stack) * 20; //food val * saturation mod * 2 (constant) * 10 (quanta)
|
||||
return new FluidStack(Fluids.SALIENT, (int) saturation);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -428,6 +428,8 @@ public class MachineRecipes {
|
||||
getFurnaceOutput(new ItemStack(ModItems.ingot_saturnite), new ItemStack(ModItems.powder_meteorite)).copy());
|
||||
recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.nugget_technetium) },
|
||||
getFurnaceOutput(new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.nugget_technetium)).copy());
|
||||
recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_cobalt), new ItemStack(ModBlocks.block_meteor) },
|
||||
getFurnaceOutput(new ItemStack(ModItems.ingot_cobalt), new ItemStack(ModBlocks.block_meteor)).copy());
|
||||
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
recipes.put(new ItemStack[] { new ItemStack(ModItems.canister_empty), new ItemStack(Items.coal) },
|
||||
@ -1190,8 +1192,12 @@ public class MachineRecipes {
|
||||
return null;
|
||||
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
switch(ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage())) {
|
||||
if(chem.isDisabled())
|
||||
return list;
|
||||
|
||||
switch(chem) {
|
||||
case CC_OIL:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 8));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
@ -1381,7 +1387,12 @@ public class MachineRecipes {
|
||||
|
||||
FluidStack[] input = new FluidStack[2];
|
||||
|
||||
switch(ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage())) {
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return input;
|
||||
|
||||
switch(chem) {
|
||||
case FP_HEAVYOIL:
|
||||
input[0] = new FluidStack(1000, Fluids.HEAVYOIL);
|
||||
break;
|
||||
@ -1639,7 +1650,12 @@ public class MachineRecipes {
|
||||
|
||||
ItemStack[] output = new ItemStack[4];
|
||||
|
||||
switch(ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage())) {
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return output;
|
||||
|
||||
switch(chem) {
|
||||
case ASPHALT:
|
||||
output[0] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
output[1] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
@ -1808,7 +1824,12 @@ public class MachineRecipes {
|
||||
|
||||
FluidStack[] output = new FluidStack[2];
|
||||
|
||||
switch(ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage())) {
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return output;
|
||||
|
||||
switch(chem) {
|
||||
case FP_HEAVYOIL:
|
||||
output[0] = new FluidStack(RefineryRecipes.heavy_frac_bitu * 10, Fluids.BITUMEN);
|
||||
output[1] = new FluidStack(RefineryRecipes.heavy_frac_smear * 10, Fluids.SMEAR);
|
||||
|
||||
@ -52,25 +52,14 @@ public class RadiolysisRecipes {
|
||||
|
||||
//automatically add cracking recipes to the radiolysis recipe list
|
||||
//we want the numbers and types to stay consistent anyway and this will save us a lot of headache later on
|
||||
Map<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> cracking = RefineryRecipes.getCrackingRecipes();
|
||||
Map<FluidType, Pair<FluidStack, FluidStack>> cracking = RefineryRecipes.getCrackingRecipes();
|
||||
|
||||
if(cracking.isEmpty()) {
|
||||
throw new IllegalStateException("RefineryRecipes.getCrackingRecipes has yielded an empty map while registering the radiolysis recipes! Either the load order is broken or cracking recipes have been removed!");
|
||||
}
|
||||
|
||||
for(Entry<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> recipe : cracking.entrySet()) {
|
||||
FluidType input = recipe.getKey();
|
||||
FluidType out1 = recipe.getValue().getW();
|
||||
FluidType out2 = recipe.getValue().getX();
|
||||
int amount1 = recipe.getValue().getY();
|
||||
int amount2 = recipe.getValue().getZ();
|
||||
|
||||
radiolysis.put(input,
|
||||
new Pair(
|
||||
new FluidStack(amount1, out1),
|
||||
new FluidStack(amount2, out2)
|
||||
)
|
||||
);
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : cracking.entrySet()) {
|
||||
radiolysis.put(recipe.getKey(), recipe.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,14 +2,18 @@ package com.hbm.inventory.recipes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -38,8 +42,8 @@ public class RefineryRecipes {
|
||||
public static final int ncrack_frac_diesel = 70;
|
||||
public static final int lcrack_frac_kero = 70;
|
||||
public static final int lcrack_frac_petro = 30;
|
||||
public static final int coal_frac_coalgas = 70;
|
||||
public static final int coal_frac_natgas = 30;
|
||||
public static final int coal_frac_coalgas = 30;
|
||||
public static final int coal_frac_oil = 70;
|
||||
|
||||
//cracking in percent
|
||||
public static final int oil_crack_oil = 80;
|
||||
@ -54,69 +58,80 @@ public class RefineryRecipes {
|
||||
public static final int diesel_crack_petro = 30;
|
||||
public static final int kero_crack_petro = 60;
|
||||
|
||||
//why didn't i use fluid stacks here? was there a reason?
|
||||
private static Map<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> fractions = new HashMap();
|
||||
private static Map<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> cracking = new HashMap();
|
||||
private static Map<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> refinery = new HashMap();
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> fractions = new HashMap();
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> cracking = new HashMap();
|
||||
|
||||
public static Map<Object, Object[]> getRefineryRecipe() {
|
||||
|
||||
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
|
||||
recipes.put(ItemFluidIcon.make(Fluids.HOTOIL, 1000),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(Fluids.HEAVYOIL, oil_frac_heavy * 10),
|
||||
ItemFluidIcon.make(Fluids.NAPHTHA, oil_frac_naph * 10),
|
||||
ItemFluidIcon.make(Fluids.LIGHTOIL, oil_frac_light * 10),
|
||||
ItemFluidIcon.make(Fluids.PETROLEUM, oil_frac_petro * 10),
|
||||
new ItemStack(ModItems.sulfur, 1) });
|
||||
|
||||
recipes.put(ItemFluidIcon.make(Fluids.HOTCRACKOIL, 1000),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(Fluids.NAPHTHA_CRACK, crack_frac_naph * 10),
|
||||
ItemFluidIcon.make(Fluids.LIGHTOIL_CRACK, crack_frac_light * 10),
|
||||
ItemFluidIcon.make(Fluids.AROMATICS, crack_frac_aroma * 10),
|
||||
ItemFluidIcon.make(Fluids.UNSATURATEDS, crack_frac_unsat * 10),
|
||||
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK) });
|
||||
|
||||
/*recipes.put(ItemFluidIcon.make(Fluids.HOTCRACKOIL, 1000),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(Fluids.NAPHTHA_CRACK, oil_frac_heavy * 10), //fractionates into crack diesel and heating oil
|
||||
ItemFluidIcon.make(Fluids.LIGHTOIL_CRACK, oil_frac_naph * 10), //fractionates into kerosene and petroleum
|
||||
ItemFluidIcon.make(Fluids.AROMATICS, oil_frac_light * 10), //used for making bakelite and TNT
|
||||
ItemFluidIcon.make(Fluids.UNSATURATEDS, oil_frac_petro * 10), //for bakelite and perhaps acetylene torches
|
||||
DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM) });*/
|
||||
for(Entry<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> recipe : refinery.entrySet()) {
|
||||
|
||||
Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> fluids = recipe.getValue();
|
||||
|
||||
recipes.put(ItemFluidIcon.make(recipe.getKey(), 1000),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(fluids.getV().type, fluids.getV().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getW().type, fluids.getW().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getX().type, fluids.getX().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getY().type, fluids.getY().fill * 10),
|
||||
ItemStackUtil.carefulCopy(fluids.getZ()) });
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static void registerRefinery() {
|
||||
refinery.put(Fluids.HOTOIL, new Quintet(
|
||||
new FluidStack(Fluids.HEAVYOIL, oil_frac_heavy),
|
||||
new FluidStack(Fluids.NAPHTHA, oil_frac_naph),
|
||||
new FluidStack(Fluids.LIGHTOIL, oil_frac_light),
|
||||
new FluidStack(Fluids.PETROLEUM, oil_frac_petro),
|
||||
new ItemStack(ModItems.sulfur)
|
||||
));
|
||||
refinery.put(Fluids.HOTCRACKOIL, new Quintet(
|
||||
new FluidStack(Fluids.NAPHTHA_CRACK, crack_frac_naph),
|
||||
new FluidStack(Fluids.LIGHTOIL_CRACK, crack_frac_light),
|
||||
new FluidStack(Fluids.AROMATICS, crack_frac_aroma),
|
||||
new FluidStack(Fluids.UNSATURATEDS, crack_frac_unsat),
|
||||
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)
|
||||
));
|
||||
}
|
||||
|
||||
public static void registerFractions() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Quartet(Fluids.BITUMEN, Fluids.SMEAR, heavy_frac_bitu, heavy_frac_smear));
|
||||
fractions.put(Fluids.SMEAR, new Quartet(Fluids.HEATINGOIL, Fluids.LUBRICANT, smear_frac_heat, smear_frac_lube));
|
||||
fractions.put(Fluids.NAPHTHA, new Quartet(Fluids.HEATINGOIL, Fluids.DIESEL, napht_frac_heat, napht_frac_diesel));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Quartet(Fluids.HEATINGOIL, Fluids.DIESEL_CRACK, ncrack_frac_heat, ncrack_frac_diesel));
|
||||
fractions.put(Fluids.LIGHTOIL, new Quartet(Fluids.DIESEL, Fluids.KEROSENE, light_frac_diesel, light_frac_kero));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Quartet(Fluids.KEROSENE, Fluids.PETROLEUM, lcrack_frac_kero, lcrack_frac_petro));
|
||||
fractions.put(Fluids.COALOIL, new Quartet(Fluids.COALGAS, Fluids.GAS, coal_frac_coalgas, coal_frac_natgas));
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
}
|
||||
|
||||
public static void registerCracking() {
|
||||
cracking.put(Fluids.OIL, new Quartet(Fluids.CRACKOIL, Fluids.PETROLEUM, oil_crack_oil, oil_crack_petro));
|
||||
cracking.put(Fluids.BITUMEN, new Quartet(Fluids.OIL, Fluids.AROMATICS, bitumen_crack_oil, bitumen_crack_aroma));
|
||||
cracking.put(Fluids.SMEAR, new Quartet(Fluids.NAPHTHA, Fluids.PETROLEUM, smear_crack_napht, smear_crack_petro));
|
||||
cracking.put(Fluids.GAS, new Quartet(Fluids.PETROLEUM, Fluids.UNSATURATEDS, gas_crack_petro, gas_crack_unsat));
|
||||
cracking.put(Fluids.DIESEL, new Quartet(Fluids.KEROSENE, Fluids.PETROLEUM, diesel_crack_kero, diesel_crack_petro));
|
||||
cracking.put(Fluids.KEROSENE, new Quartet(Fluids.PETROLEUM, Fluids.NONE, kero_crack_petro, 0));
|
||||
cracking.put(Fluids.OIL, new Pair(new FluidStack(Fluids.CRACKOIL, oil_crack_oil), new FluidStack(Fluids.PETROLEUM, oil_crack_petro)));
|
||||
cracking.put(Fluids.BITUMEN, new Pair(new FluidStack(Fluids.OIL, bitumen_crack_oil), new FluidStack(Fluids.AROMATICS, bitumen_crack_aroma)));
|
||||
cracking.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.NAPHTHA, smear_crack_napht), new FluidStack(Fluids.PETROLEUM, smear_crack_petro)));
|
||||
cracking.put(Fluids.GAS, new Pair(new FluidStack(Fluids.PETROLEUM, gas_crack_petro), new FluidStack(Fluids.UNSATURATEDS, gas_crack_unsat)));
|
||||
cracking.put(Fluids.DIESEL, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.DIESEL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, diesel_crack_kero), new FluidStack(Fluids.PETROLEUM, diesel_crack_petro)));
|
||||
cracking.put(Fluids.KEROSENE, new Pair(new FluidStack(Fluids.PETROLEUM, kero_crack_petro), new FluidStack(Fluids.NONE, 0)));
|
||||
}
|
||||
|
||||
public static Quartet<FluidType, FluidType, Integer, Integer> getFractions(FluidType oil) {
|
||||
public static Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> getRefinery(FluidType oil) {
|
||||
return refinery.get(oil);
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
return fractions.get(oil);
|
||||
}
|
||||
|
||||
public static Quartet<FluidType, FluidType, Integer, Integer> getCracking(FluidType oil) {
|
||||
public static Pair<FluidStack, FluidStack> getCracking(FluidType oil) {
|
||||
return cracking.get(oil);
|
||||
}
|
||||
|
||||
protected static Map<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> getCrackingRecipes() {
|
||||
protected static Map<FluidType, Pair<FluidStack, FluidStack>> getCrackingRecipes() {
|
||||
return cracking;
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,6 +51,9 @@ public class SolidificationRecipes {
|
||||
|
||||
registerRecipe(WATER, 1000, Blocks.ice);
|
||||
registerRecipe(LAVA, 1000, Blocks.obsidian);
|
||||
registerRecipe(MERCURY, 125, ModItems.ingot_mercury);
|
||||
registerRecipe(BIOGAS, 250, ModItems.biomass_compressed);
|
||||
registerRecipe(SALIENT, 1280, new ItemStack(ModItems.bio_wafer, 8)); //4 (food val) * 2 (sat mod) * 2 (constant) * 10 (quanta) * 8 (batch size)
|
||||
|
||||
registerRecipe(OIL, SF_OIL, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE));
|
||||
registerRecipe(CRACKOIL, SF_OIL, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK));
|
||||
@ -75,7 +78,6 @@ public class SolidificationRecipes {
|
||||
registerRecipe(LPG, SF_LPG, ModItems.solid_fuel);
|
||||
registerRecipe(BIOGAS, SF_BIOGAS, ModItems.solid_fuel);
|
||||
registerRecipe(BIOFUEL, SF_BIOFUEL, ModItems.solid_fuel);
|
||||
registerRecipe(COALOIL, SF_COALOIL, ModItems.solid_fuel);
|
||||
registerRecipe(AROMATICS, SF_AROMA, ModItems.solid_fuel);
|
||||
registerRecipe(UNSATURATEDS, SF_UNSAT, ModItems.solid_fuel);
|
||||
}
|
||||
|
||||
@ -492,6 +492,7 @@ public class ModItems {
|
||||
|
||||
public static Item biomass;
|
||||
public static Item biomass_compressed;
|
||||
public static Item bio_wafer;
|
||||
|
||||
public static Item coil_copper;
|
||||
public static Item coil_copper_torus;
|
||||
@ -2688,8 +2689,8 @@ public class ModItems {
|
||||
ingot_saturnite = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("ingot_saturnite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_saturnite");
|
||||
plate_saturnite = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("plate_saturnite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_saturnite");
|
||||
ingot_fiberglass = new ItemCustomLore().setUnlocalizedName("ingot_fiberglass").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_fiberglass");
|
||||
ingot_asbestos = new Item().setUnlocalizedName("ingot_asbestos").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_asbestos");
|
||||
powder_asbestos = new Item().setUnlocalizedName("powder_asbestos").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_asbestos");
|
||||
ingot_asbestos = new ItemCustomLore().setUnlocalizedName("ingot_asbestos").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_asbestos");
|
||||
powder_asbestos = new ItemCustomLore().setUnlocalizedName("powder_asbestos").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_asbestos");
|
||||
ingot_electronium = new ItemCustomLore().setUnlocalizedName("ingot_electronium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_electronium");
|
||||
nugget_zirconium = new ItemCustomLore().setUnlocalizedName("nugget_zirconium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_zirconium");
|
||||
nugget_mercury = new Item().setUnlocalizedName("nugget_mercury_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_mercury_tiny");
|
||||
@ -2938,6 +2939,7 @@ public class ModItems {
|
||||
|
||||
biomass = new Item().setUnlocalizedName("biomass").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":biomass");
|
||||
biomass_compressed = new Item().setUnlocalizedName("biomass_compressed").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":biomass_compressed");
|
||||
bio_wafer = new ItemLemon(4, 2F, false).setUnlocalizedName("bio_wafer").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":bio_wafer");
|
||||
|
||||
coil_copper = new Item().setUnlocalizedName("coil_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_copper");
|
||||
coil_copper_torus = new Item().setUnlocalizedName("coil_copper_torus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_copper_torus");
|
||||
@ -5884,6 +5886,8 @@ public class ModItems {
|
||||
//Things that look like rotten flesh but aren't
|
||||
GameRegistry.registerItem(biomass, biomass.getUnlocalizedName());
|
||||
GameRegistry.registerItem(biomass_compressed, biomass_compressed.getUnlocalizedName());
|
||||
//delicious!
|
||||
GameRegistry.registerItem(bio_wafer, bio_wafer.getUnlocalizedName());
|
||||
|
||||
//Nuggets
|
||||
GameRegistry.registerItem(nugget_uranium, nugget_uranium.getUnlocalizedName());
|
||||
|
||||
@ -36,31 +36,31 @@ public class ItemChemistryTemplate extends Item {
|
||||
FP_LIGHTOIL,
|
||||
FR_REOIL,
|
||||
FR_PETROIL,
|
||||
FC_BITUMEN,
|
||||
FC_I_NAPHTHA,
|
||||
FC_GAS_PETROLEUM,
|
||||
FC_DIESEL_KEROSENE,
|
||||
FC_KEROSENE_PETROLEUM,
|
||||
CC_OIL,
|
||||
CC_I,
|
||||
CC_HEATING,
|
||||
CC_HEAVY,
|
||||
CC_NAPHTHA,
|
||||
SF_OIL,
|
||||
SF_HEAVYOIL,
|
||||
SF_SMEAR,
|
||||
SF_HEATINGOIL,
|
||||
SF_RECLAIMED,
|
||||
SF_PETROIL,
|
||||
SF_LUBRICANT,
|
||||
SF_NAPHTHA,
|
||||
SF_DIESEL,
|
||||
SF_LIGHTOIL,
|
||||
SF_KEROSENE,
|
||||
SF_GAS,
|
||||
SF_PETROLEUM,
|
||||
SF_BIOGAS,
|
||||
SF_BIOFUEL,
|
||||
FC_BITUMEN(true),
|
||||
FC_I_NAPHTHA(true),
|
||||
FC_GAS_PETROLEUM(true),
|
||||
FC_DIESEL_KEROSENE(true),
|
||||
FC_KEROSENE_PETROLEUM(true),
|
||||
CC_OIL(true),
|
||||
CC_I(true),
|
||||
CC_HEATING(true),
|
||||
CC_HEAVY(true),
|
||||
CC_NAPHTHA(true),
|
||||
SF_OIL(true),
|
||||
SF_HEAVYOIL(true),
|
||||
SF_SMEAR(true),
|
||||
SF_HEATINGOIL(true),
|
||||
SF_RECLAIMED(true),
|
||||
SF_PETROIL(true),
|
||||
SF_LUBRICANT(true),
|
||||
SF_NAPHTHA(true),
|
||||
SF_DIESEL(true),
|
||||
SF_LIGHTOIL(true),
|
||||
SF_KEROSENE(true),
|
||||
SF_GAS(true),
|
||||
SF_PETROLEUM(true),
|
||||
SF_BIOGAS(true),
|
||||
SF_BIOFUEL(true),
|
||||
BP_BIOGAS,
|
||||
BP_BIOFUEL,
|
||||
LPG,
|
||||
@ -111,6 +111,15 @@ public class ItemChemistryTemplate extends Item {
|
||||
HEAVY_ELECTROLYSIS,
|
||||
DUCRETE;
|
||||
|
||||
private boolean disabled = false;
|
||||
|
||||
private EnumChemistryTemplate() { }
|
||||
|
||||
/** Alternate ctor for disabling recipes to prevent recipe shifting armageddon */
|
||||
private EnumChemistryTemplate(boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public static EnumChemistryTemplate getEnum(int i) {
|
||||
if(i < EnumChemistryTemplate.values().length)
|
||||
return EnumChemistryTemplate.values()[i];
|
||||
@ -121,252 +130,183 @@ public class ItemChemistryTemplate extends Item {
|
||||
public String getName() {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
public boolean isDisabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemChemistryTemplate()
|
||||
{
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
public ItemChemistryTemplate() {
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + EnumChemistryTemplate.getEnum(stack.getItemDamage()).name())).trim();
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(enum1.isDisabled()) {
|
||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||
} else {
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + enum1.name())).trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
if (s1 != null)
|
||||
{
|
||||
s = s + " " + s1;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (int i = 0; i < EnumChemistryTemplate.values().length; ++i)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public static int getProcessTime(ItemStack stack) {
|
||||
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return 100;
|
||||
|
||||
int i = stack.getItemDamage();
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(i);
|
||||
|
||||
switch (enum1) {
|
||||
case FP_HEAVYOIL:
|
||||
return 50;
|
||||
case FP_SMEAR:
|
||||
return 50;
|
||||
case FP_NAPHTHA:
|
||||
return 50;
|
||||
case FP_LIGHTOIL:
|
||||
return 50;
|
||||
case FR_REOIL:
|
||||
return 30;
|
||||
case FR_PETROIL:
|
||||
return 30;
|
||||
case OIL_SAND:
|
||||
return 200;
|
||||
case FC_BITUMEN:
|
||||
return 100;
|
||||
case FC_I_NAPHTHA:
|
||||
return 150;
|
||||
case FC_GAS_PETROLEUM:
|
||||
return 100;
|
||||
case FC_DIESEL_KEROSENE:
|
||||
return 150;
|
||||
case FC_KEROSENE_PETROLEUM:
|
||||
return 150;
|
||||
case CC_OIL:
|
||||
return 150;
|
||||
case CC_I:
|
||||
return 200;
|
||||
case CC_HEATING:
|
||||
return 250;
|
||||
case CC_HEAVY:
|
||||
return 200;
|
||||
case CC_NAPHTHA:
|
||||
return 300;
|
||||
case ASPHALT:
|
||||
return 100;
|
||||
case COOLANT:
|
||||
return 50;
|
||||
case CRYOGEL:
|
||||
return 50;
|
||||
case DESH:
|
||||
return 300;
|
||||
case NITAN:
|
||||
return 50;
|
||||
case PEROXIDE:
|
||||
return 50;
|
||||
case CIRCUIT_4:
|
||||
return 200;
|
||||
case CIRCUIT_5:
|
||||
return 250;
|
||||
case SF_OIL:
|
||||
return 20;
|
||||
case SF_HEAVYOIL:
|
||||
return 20;
|
||||
case SF_SMEAR:
|
||||
return 20;
|
||||
case SF_HEATINGOIL:
|
||||
return 20;
|
||||
case SF_RECLAIMED:
|
||||
return 20;
|
||||
case SF_PETROIL:
|
||||
return 20;
|
||||
case SF_LUBRICANT:
|
||||
return 20;
|
||||
case SF_NAPHTHA:
|
||||
return 20;
|
||||
case SF_DIESEL:
|
||||
return 20;
|
||||
case SF_LIGHTOIL:
|
||||
return 20;
|
||||
case SF_KEROSENE:
|
||||
return 20;
|
||||
case SF_GAS:
|
||||
return 20;
|
||||
case SF_PETROLEUM:
|
||||
return 20;
|
||||
case SF_BIOGAS:
|
||||
return 20;
|
||||
case SF_BIOFUEL:
|
||||
return 20;
|
||||
case POLYMER:
|
||||
return 100;
|
||||
case DEUTERIUM:
|
||||
return 200;
|
||||
case STEAM:
|
||||
return 20;
|
||||
case BP_BIOGAS:
|
||||
return 200;
|
||||
case BP_BIOFUEL:
|
||||
return 100;
|
||||
case LPG:
|
||||
return 100;
|
||||
case YELLOWCAKE:
|
||||
return 250;
|
||||
case UF6:
|
||||
return 100;
|
||||
case PUF6:
|
||||
return 150;
|
||||
case SAS3:
|
||||
return 200;
|
||||
case DYN_SCHRAB:
|
||||
return 1*60*20;
|
||||
case DYN_EUPH:
|
||||
return 3*60*20;
|
||||
case DYN_DNT:
|
||||
return 5*60*20;
|
||||
case CORDITE:
|
||||
return 40;
|
||||
case KEVLAR:
|
||||
return 40;
|
||||
case CONCRETE:
|
||||
return 100;
|
||||
case CONCRETE_ASBESTOS:
|
||||
return 100;
|
||||
case SOLID_FUEL:
|
||||
return 200;
|
||||
case ELECTROLYSIS:
|
||||
return 150;
|
||||
case XENON:
|
||||
return 300;
|
||||
case XENON_OXY:
|
||||
return 20;
|
||||
case SATURN:
|
||||
return 60;
|
||||
case BALEFIRE:
|
||||
return 100;
|
||||
case SCHRABIDIC:
|
||||
return 100;
|
||||
case SCHRABIDATE:
|
||||
return 150;
|
||||
case COLTAN_CLEANING:
|
||||
return 60;
|
||||
case COLTAN_PAIN:
|
||||
return 120;
|
||||
case COLTAN_CRYSTAL:
|
||||
return 80;
|
||||
case VIT_LIQUID:
|
||||
return 100;
|
||||
case VIT_GAS:
|
||||
return 100;
|
||||
case TEL:
|
||||
return 40;
|
||||
case GASOLINE:
|
||||
return 40;
|
||||
case FRACKSOL:
|
||||
return 20;
|
||||
case HELIUM3:
|
||||
return 200;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
return 240;
|
||||
case ETHANOL:
|
||||
return 50;
|
||||
case METH:
|
||||
return 30;
|
||||
case CO2:
|
||||
return 60;
|
||||
case HEAVY_ELECTROLYSIS:
|
||||
return 150;
|
||||
case DUCRETE:
|
||||
return 150;
|
||||
default:
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||
for(int i = 0; i < EnumChemistryTemplate.values().length; ++i) {
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(i);
|
||||
|
||||
if(!enum1.isDisabled()) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getProcessTime(ItemStack stack) {
|
||||
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return 100;
|
||||
|
||||
int i = stack.getItemDamage();
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(i);
|
||||
|
||||
switch(enum1) {
|
||||
case FP_HEAVYOIL: return 50;
|
||||
case FP_SMEAR: return 50;
|
||||
case FP_NAPHTHA: return 50;
|
||||
case FP_LIGHTOIL: return 50;
|
||||
case FR_REOIL: return 30;
|
||||
case FR_PETROIL: return 30;
|
||||
case OIL_SAND: return 200;
|
||||
case FC_BITUMEN: return 100;
|
||||
case FC_I_NAPHTHA: return 150;
|
||||
case FC_GAS_PETROLEUM: return 100;
|
||||
case FC_DIESEL_KEROSENE: return 150;
|
||||
case FC_KEROSENE_PETROLEUM: return 150;
|
||||
case CC_OIL: return 150;
|
||||
case CC_I: return 200;
|
||||
case CC_HEATING: return 250;
|
||||
case CC_HEAVY: return 200;
|
||||
case CC_NAPHTHA: return 300;
|
||||
case ASPHALT: return 100;
|
||||
case COOLANT: return 50;
|
||||
case CRYOGEL: return 50;
|
||||
case DESH: return 300;
|
||||
case NITAN: return 50;
|
||||
case PEROXIDE: return 50;
|
||||
case CIRCUIT_4: return 200;
|
||||
case CIRCUIT_5: return 250;
|
||||
case SF_OIL: return 20;
|
||||
case SF_HEAVYOIL: return 20;
|
||||
case SF_SMEAR: return 20;
|
||||
case SF_HEATINGOIL: return 20;
|
||||
case SF_RECLAIMED: return 20;
|
||||
case SF_PETROIL: return 20;
|
||||
case SF_LUBRICANT: return 20;
|
||||
case SF_NAPHTHA: return 20;
|
||||
case SF_DIESEL: return 20;
|
||||
case SF_LIGHTOIL: return 20;
|
||||
case SF_KEROSENE: return 20;
|
||||
case SF_GAS: return 20;
|
||||
case SF_PETROLEUM: return 20;
|
||||
case SF_BIOGAS: return 20;
|
||||
case SF_BIOFUEL: return 20;
|
||||
case POLYMER: return 100;
|
||||
case DEUTERIUM: return 200;
|
||||
case STEAM: return 20;
|
||||
case BP_BIOGAS: return 200;
|
||||
case BP_BIOFUEL: return 100;
|
||||
case LPG: return 100;
|
||||
case YELLOWCAKE: return 250;
|
||||
case UF6: return 100;
|
||||
case PUF6: return 150;
|
||||
case SAS3: return 200;
|
||||
case DYN_SCHRAB: return 1 * 60 * 20;
|
||||
case DYN_EUPH: return 3 * 60 * 20;
|
||||
case DYN_DNT: return 5 * 60 * 20;
|
||||
case CORDITE: return 40;
|
||||
case KEVLAR: return 40;
|
||||
case CONCRETE: return 100;
|
||||
case CONCRETE_ASBESTOS: return 100;
|
||||
case SOLID_FUEL: return 200;
|
||||
case ELECTROLYSIS: return 150;
|
||||
case XENON: return 300;
|
||||
case XENON_OXY: return 20;
|
||||
case SATURN: return 60;
|
||||
case BALEFIRE: return 100;
|
||||
case SCHRABIDIC: return 100;
|
||||
case SCHRABIDATE: return 150;
|
||||
case COLTAN_CLEANING: return 60;
|
||||
case COLTAN_PAIN: return 120;
|
||||
case COLTAN_CRYSTAL: return 80;
|
||||
case VIT_LIQUID: return 100;
|
||||
case VIT_GAS: return 100;
|
||||
case TEL: return 40;
|
||||
case GASOLINE: return 40;
|
||||
case FRACKSOL: return 20;
|
||||
case HELIUM3: return 200;
|
||||
case OSMIRIDIUM_DEATH: return 240;
|
||||
case ETHANOL: return 50;
|
||||
case METH: return 30;
|
||||
case CO2: return 60;
|
||||
case HEAVY_ELECTROLYSIS: return 150;
|
||||
case DUCRETE: return 150;
|
||||
default: return 100;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return;
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return;
|
||||
|
||||
if(EnumChemistryTemplate.getEnum(stack.getItemDamage()).isDisabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemStack> stacks = MachineRecipes.getChemInputFromTempate(stack);
|
||||
FluidStack[] inF = MachineRecipes.getFluidInputFromTempate(stack);
|
||||
ItemStack[] out = MachineRecipes.getChemOutputFromTempate(stack);
|
||||
FluidStack[] outF = MachineRecipes.getFluidOutputFromTempate(stack);
|
||||
|
||||
List<ItemStack> stacks = MachineRecipes.getChemInputFromTempate(stack);
|
||||
FluidStack[] inF = MachineRecipes.getFluidInputFromTempate(stack);
|
||||
ItemStack[] out = MachineRecipes.getChemOutputFromTempate(stack);
|
||||
FluidStack[] outF = MachineRecipes.getFluidOutputFromTempate(stack);
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("info.templatefolder", I18nUtil.resolveKey(ModItems.template_folder.getUnlocalizedName() + ".name")));
|
||||
list.add("");
|
||||
|
||||
try {
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_out_p"));
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(out[i] != null)
|
||||
list.add(out[i].stackSize + "x " + out[i].getDisplayName());
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(outF[i] != null)
|
||||
list.add(outF[i].fill + "mB " + I18n.format(outF[i].type.getUnlocalizedName()));
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_in_p"));
|
||||
|
||||
if(stacks != null)
|
||||
for(int i = 0; i < stacks.size(); i++)
|
||||
list.add(stacks.get(i).stackSize + "x " + stacks.get(i).getDisplayName());
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(inF[i] != null)
|
||||
list.add(inF[i].fill + "mB " + I18n.format(inF[i].type.getUnlocalizedName()));
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_time"));
|
||||
list.add(Math.floor((float)(getProcessTime(stack)) / 20 * 100) / 100 + " " + I18nUtil.resolveKey("info.template_seconds"));
|
||||
} catch(Exception e) {
|
||||
list.add("###INVALID###");
|
||||
list.add("0x334077-0x6A298F-0xDF3795-0x334077");
|
||||
}
|
||||
try {
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_out_p"));
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(out[i] != null)
|
||||
list.add(out[i].stackSize + "x " + out[i].getDisplayName());
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(outF[i] != null)
|
||||
list.add(outF[i].fill + "mB " + I18n.format(outF[i].type.getUnlocalizedName()));
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_in_p"));
|
||||
|
||||
if(stacks != null)
|
||||
for(int i = 0; i < stacks.size(); i++)
|
||||
list.add(stacks.get(i).stackSize + "x " + stacks.get(i).getDisplayName());
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(inF[i] != null)
|
||||
list.add(inF[i].fill + "mB " + I18n.format(inF[i].type.getUnlocalizedName()));
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_time"));
|
||||
list.add(Math.floor((float) (getProcessTime(stack)) / 20 * 100) / 100 + " " + I18nUtil.resolveKey("info.template_seconds"));
|
||||
} catch(Exception e) {
|
||||
list.add("###INVALID###");
|
||||
list.add("0x334077-0x6A298F-0xDF3795-0x334077");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.mob.siege.EntitySiegeTunneler;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemKitCustom;
|
||||
import com.hbm.lib.Library;
|
||||
@ -26,14 +27,9 @@ public class ItemWandD extends Item {
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
List<EntityLiving> list = world.getEntitiesWithinAABB(EntityLiving.class, player.boundingBox.expand(150, 150, 150));
|
||||
|
||||
for(EntityLiving e : list) {
|
||||
e.setRevengeTarget(player);
|
||||
e.setAttackTarget(player);
|
||||
e.setLastAttacker(player);
|
||||
e.getNavigator().tryMoveToXYZ(player.posX, player.posY, player.posZ, 2);
|
||||
}
|
||||
EntitySiegeTunneler tunneler = new EntitySiegeTunneler(world);
|
||||
tunneler.setPosition(pos.blockX, pos.blockY + 1, pos.blockZ);
|
||||
world.spawnEntityInWorld(tunneler);
|
||||
|
||||
//CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand);
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzCapsule;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySoyuzCapsule;
|
||||
import com.hbm.world.dungeon.AncientTomb;
|
||||
import com.hbm.world.dungeon.Antenna;
|
||||
import com.hbm.world.dungeon.ArcticVault;
|
||||
|
||||
@ -664,13 +664,6 @@ public class Library {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public static ItemStack carefulCopy(ItemStack stack) {
|
||||
if(stack == null)
|
||||
return null;
|
||||
else
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
public static boolean isObstructed(World world, double x, double y, double z, double a, double b, double c) {
|
||||
|
||||
MovingObjectPosition pos = world.rayTraceBlocks(Vec3.createVectorHelper(x, y, z), Vec3.createVectorHelper(a, b, c));
|
||||
|
||||
@ -41,9 +41,7 @@ import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.entity.effect.*;
|
||||
import com.hbm.entity.grenade.*;
|
||||
import com.hbm.entity.item.EntityFireworks;
|
||||
import com.hbm.entity.item.EntityMinecartTest;
|
||||
import com.hbm.entity.item.EntityMovingItem;
|
||||
import com.hbm.entity.item.*;
|
||||
import com.hbm.entity.logic.*;
|
||||
import com.hbm.entity.missile.*;
|
||||
import com.hbm.entity.mob.*;
|
||||
@ -79,6 +77,7 @@ import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.*;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
import com.hbm.tileentity.network.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
|
||||
@ -574,6 +573,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinecartTest.class, new RenderMinecartTest());
|
||||
//items
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingItem.class, new RenderMovingItem());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
|
||||
//mobs
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNuclearCreeper.class, new RenderNuclearCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintedCreeper.class, new RenderTaintedCreeper());
|
||||
@ -1299,8 +1299,8 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
|
||||
if("ufo".equals(type)) {
|
||||
|
||||
ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, 0, 0, 0);
|
||||
double motion = data.getDouble("motion");
|
||||
ParticleMukeCloud cloud = new ParticleMukeCloud(man, world, x, y, z, rand.nextGaussian() * motion, 0, rand.nextGaussian() * motion);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(cloud);
|
||||
}
|
||||
|
||||
|
||||
@ -468,6 +468,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.emp_bomb, 1), new Object[] { "LML", "LCL", "LML", 'L', PB.plate(), 'M', ModItems.magnetron, 'C', ModItems.circuit_gold });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.charge_dynamite, 1), new Object[] { ModItems.stick_dynamite, ModItems.stick_dynamite, ModItems.stick_dynamite, ModItems.ducttape });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.charge_miner, 1), new Object[] { " F ", "FCF", " F ", 'F', Items.flint, 'C', ModBlocks.charge_dynamite });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dynamite, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_dynamite, 'S', Items.string });
|
||||
|
||||
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_generic), new Object[] { " A ", "PRP", "PRP", 'A', ModItems.wire_aluminium, 'P', AL.plate(), 'R', REDSTONE.dust() });
|
||||
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_advanced), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', CU.plate(), 'S', "sulfur", 'L', PB.dust() });
|
||||
|
||||
@ -480,6 +480,7 @@ public class MainRegistry {
|
||||
EntityRegistry.registerModEntity(EntityGrenadeDynamite.class, "entity_grenade_dynamite", 163, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntitySiegeLaser.class, "entity_ntm_siege_laser", 164, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntitySiegeDropship.class, "entity_ntm_siege_dropship", 165, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityTNTPrimedBase.class, "entity_ntm_tnt_primed", 166, this, 1000, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);
|
||||
@ -496,7 +497,8 @@ public class MainRegistry {
|
||||
EntityRegistry.registerGlobalEntityID(EntitySiegeSkeleton.class, "entity_meme_skeleton", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x000080);
|
||||
EntityRegistry.registerGlobalEntityID(EntitySiegeUFO.class, "entity_meme_ufo", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x800000);
|
||||
EntityRegistry.registerGlobalEntityID(EntitySiegeCraft.class, "entity_meme_craft", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x808000);
|
||||
EntityRegistry.registerGlobalEntityID(EntitySiegeTunneler.class, "entity_meme_tunneler", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x008080);
|
||||
EntityRegistry.registerModEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 167, this, 1000, 1, true); //how about you have a taste of my fucking scrotum?
|
||||
//EntityRegistry.registerGlobalEntityID(EntitySiegeTunneler.class, "entity_meme_tunneler", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x008080);
|
||||
|
||||
EntityRegistry.registerModEntity(EntitySPV.class, "entity_self_propelled_vehicle_mark_1", 160, this, 1000, 1, true);
|
||||
|
||||
@ -947,6 +949,7 @@ public class MainRegistry {
|
||||
SILEXRecipes.register();
|
||||
AnvilRecipes.register();
|
||||
PressRecipes.register();
|
||||
RefineryRecipes.registerRefinery();
|
||||
RefineryRecipes.registerFractions();
|
||||
RefineryRecipes.registerCracking();
|
||||
RadiolysisRecipes.registerRadiolysis();
|
||||
|
||||
@ -8,17 +8,17 @@ import com.hbm.items.weapon.ItemMissile.PartSize;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.TileEntityTickingBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchTable;
|
||||
import com.hbm.tileentity.machine.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.TileEntityCoreEmitter;
|
||||
import com.hbm.tileentity.machine.TileEntityCoreStabilizer;
|
||||
import com.hbm.tileentity.machine.TileEntityForceField;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningLaser;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzLauncher;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.hbm.render.entity.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderTNTPrimedBase extends Render {
|
||||
|
||||
private RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public RenderTNTPrimedBase() {
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
||||
public void doRender(EntityTNTPrimedBase tnt, double x, double y, double z, float f0, float f1) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
float f2;
|
||||
|
||||
if((float) tnt.fuse - f1 + 1.0F < 10.0F) {
|
||||
f2 = 1.0F - ((float) tnt.fuse - f1 + 1.0F) / 10.0F;
|
||||
|
||||
if(f2 < 0.0F) {
|
||||
f2 = 0.0F;
|
||||
}
|
||||
|
||||
if(f2 > 1.0F) {
|
||||
f2 = 1.0F;
|
||||
}
|
||||
|
||||
f2 *= f2;
|
||||
f2 *= f2;
|
||||
float scale = 1.0F + f2 * 0.3F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
}
|
||||
|
||||
f2 = (1.0F - ((float) tnt.fuse - f1 + 1.0F) / 100.0F) * 0.8F;
|
||||
this.bindEntityTexture(tnt);
|
||||
this.blockRenderer.renderBlockAsItem(tnt.getBomb(), 0, tnt.getBrightness(f1));
|
||||
|
||||
if(tnt.fuse / 5 % 2 == 0) {
|
||||
|
||||
GL11.glScaled(1.01, 1.01, 1.01);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
|
||||
boolean prev = this.blockRenderer.useInventoryTint;
|
||||
this.blockRenderer.useInventoryTint = false;
|
||||
this.blockRenderer.renderBlockAsItem(tnt.getBomb(), 0, 1.0F);
|
||||
this.blockRenderer.useInventoryTint = prev;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntityTNTPrimedBase tnt) {
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return this.getEntityTexture((EntityTNTPrimedBase) entity);
|
||||
}
|
||||
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
this.doRender((EntityTNTPrimedBase) entity, x, y, z, f0, f1);
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ import com.hbm.entity.mob.siege.SiegeTier;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.RenderMiscEffects;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
|
||||
@ -25,6 +26,7 @@ public class RenderSiegeCraft extends Render {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y + 0.5, z);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
EntitySiegeCraft ufo = (EntitySiegeCraft) entity;
|
||||
//BossStatus.setBossStatus(ufo, false);
|
||||
@ -58,6 +60,11 @@ public class RenderSiegeCraft extends Render {
|
||||
GL11.glPopAttrib();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
if(ufo.getBeam()) {
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/misc/glintBF.png"));
|
||||
RenderMiscEffects.renderClassicGlint(ufo.worldObj, f1, ResourceManager.siege_ufo, "UFO", 0.5F, 1.0F, 1.0F, 5, 1F);
|
||||
}
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
Random rand = new Random(entity.ticksExisted / 4);
|
||||
@ -65,7 +72,7 @@ public class RenderSiegeCraft extends Render {
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 8; i++) {
|
||||
GL11.glRotated(45D, 0, 1, 0);
|
||||
if(rand.nextInt(5) == 0) {
|
||||
if(rand.nextInt(5) == 0 || ufo.getBeam()) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(4, 0, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(-1.125, 0, 2.875), EnumWaveType.RANDOM, EnumBeamType.LINE, 0x80d0ff, 0xffffff, (int)(System.currentTimeMillis() % 1000) / 50, 15, 0.125F, 1, 0);
|
||||
@ -73,6 +80,18 @@ public class RenderSiegeCraft extends Render {
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(ufo.getBeam()) {
|
||||
GL11.glPushMatrix();
|
||||
Vec3 delta = ufo.getLockon().addVector(-ufo.posX, -ufo.posY, -ufo.posZ);
|
||||
double length = delta.lengthVector();
|
||||
double scale = 0.1D;
|
||||
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x101020, 0x101020, entity.ticksExisted / 6, (int)(length / 2 + 1), (float)scale * 1F, 4, 0.25F);
|
||||
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 2, (int)(length / 2 + 1), (float)scale * 7F, 2, 0.0625F);
|
||||
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 4, (int)(length / 2 + 1), (float)scale * 7F, 2, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@ -31,7 +31,9 @@ public class RenderSiegeTunneler extends Render {
|
||||
this.bindEntityTexture(entity);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
body.renderAll();
|
||||
body.renderPart("Body");
|
||||
GL11.glRotated(System.currentTimeMillis() / 3L % 360, 0, -1, 0);
|
||||
body.renderPart("Drill");
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.DiamondPronter;
|
||||
import com.hbm.render.util.EnumSymbol;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBAT9000;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
@ -6,7 +6,7 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.render.util.DiamondPronter;
|
||||
import com.hbm.render.util.EnumSymbol;
|
||||
import com.hbm.tileentity.machine.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
||||
@ -4,7 +4,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineOrbus;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSolidifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
@ -42,9 +42,9 @@ public class RenderSolidifier extends TileEntitySpecialRenderer {
|
||||
|
||||
double height = (double)liq.tank.getFill() / (double)liq.tank.getMaxFill();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
GL11.glTranslated(0, 1.25, 0);
|
||||
GL11.glScaled(1, height, 1);
|
||||
GL11.glTranslated(0, -1, 0);
|
||||
GL11.glTranslated(0, -1.25, 0);
|
||||
ResourceManager.solidifier.renderPart("Fluid");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.*;
|
||||
import com.hbm.tileentity.machine.pile.*;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
import com.hbm.tileentity.network.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
|
||||
|
||||
@ -19,6 +19,8 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEAssemblerPacket;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
@ -22,6 +23,9 @@ import com.hbm.packet.AuxParticlePacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEChemplantPacket;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -580,34 +584,35 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
tanks[1].setFill(tanks[1].getFill() - fluids[1].fill);
|
||||
}
|
||||
|
||||
@Spaghetti("what the fuck am i looking at")
|
||||
public boolean hasSpaceForItems(ItemStack[] stacks) {
|
||||
if(stacks == null)
|
||||
return true;
|
||||
if(stacks != null && Library.isArrayEmpty(stacks))
|
||||
return true;
|
||||
|
||||
ItemStack sta0 = Library.carefulCopy(slots[5]);
|
||||
ItemStack sta0 = ItemStackUtil.carefulCopy(slots[5]);
|
||||
if(sta0 != null)
|
||||
sta0.stackSize = 1;
|
||||
ItemStack sta1 = Library.carefulCopy(stacks[0]);
|
||||
ItemStack sta1 = ItemStackUtil.carefulCopy(stacks[0]);
|
||||
if(sta1 != null)
|
||||
sta1.stackSize = 1;
|
||||
ItemStack sta2 = Library.carefulCopy(slots[6]);
|
||||
ItemStack sta2 = ItemStackUtil.carefulCopy(slots[6]);
|
||||
if(sta2 != null)
|
||||
sta2.stackSize = 1;
|
||||
ItemStack sta3 = Library.carefulCopy(stacks[1]);
|
||||
ItemStack sta3 = ItemStackUtil.carefulCopy(stacks[1]);
|
||||
if(sta3 != null)
|
||||
sta3.stackSize = 1;
|
||||
ItemStack sta4 = Library.carefulCopy(slots[7]);
|
||||
ItemStack sta4 = ItemStackUtil.carefulCopy(slots[7]);
|
||||
if(sta4 != null)
|
||||
sta4.stackSize = 1;
|
||||
ItemStack sta5 = Library.carefulCopy(stacks[2]);
|
||||
ItemStack sta5 = ItemStackUtil.carefulCopy(stacks[2]);
|
||||
if(sta5 != null)
|
||||
sta5.stackSize = 1;
|
||||
ItemStack sta6 = Library.carefulCopy(slots[8]);
|
||||
ItemStack sta6 = ItemStackUtil.carefulCopy(slots[8]);
|
||||
if(sta6 != null)
|
||||
sta6.stackSize = 1;
|
||||
ItemStack sta7 = Library.carefulCopy(stacks[3]);
|
||||
ItemStack sta7 = ItemStackUtil.carefulCopy(stacks[3]);
|
||||
if(sta7 != null)
|
||||
sta7.stackSize = 1;
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
|
||||
@ -14,6 +14,7 @@ import com.hbm.lib.Library;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
@ -139,6 +140,22 @@ public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor,
|
||||
public void clearFluidList(FluidType type) {
|
||||
list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.water.readFromNBT(nbt, "water");
|
||||
this.steam.readFromNBT(nbt, "steam");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
this.water.writeToNBT(nbt, "water");
|
||||
this.steam.writeToNBT(nbt, "steam");
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -7,11 +7,13 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -56,12 +58,12 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
|
||||
private void crack() {
|
||||
|
||||
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
|
||||
int left = quart.getY();
|
||||
int right = quart.getZ();
|
||||
int left = quart.getKey().fill;
|
||||
int right = quart.getValue().fill;
|
||||
|
||||
if(tanks[0].getFill() >= 100 && tanks[1].getFill() >= 100 && hasSpace(left, right)) {
|
||||
tanks[0].setFill(tanks[0].getFill() - 100);
|
||||
@ -78,12 +80,12 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
|
||||
private void setupTanks() {
|
||||
|
||||
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getCracking(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
tanks[1].setTankType(Fluids.STEAM);
|
||||
tanks[2].setTankType(quart.getW());
|
||||
tanks[3].setTankType(quart.getX());
|
||||
tanks[2].setTankType(quart.getKey().type);
|
||||
tanks[3].setTankType(quart.getValue().type);
|
||||
} else {
|
||||
tanks[0].setTankType(Fluids.NONE);
|
||||
tanks[1].setTankType(Fluids.NONE);
|
||||
@ -182,19 +184,15 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return list1;
|
||||
if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return list2;
|
||||
if(type == tanks[2].getTankType()) return list1;
|
||||
if(type == tanks[3].getTankType()) return list2;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
list1.clear();
|
||||
if(type.name().equals(tanks[3].getTankType().name()))
|
||||
list2.clear();
|
||||
if(type == tanks[2].getTankType()) list1.clear();
|
||||
if(type == tanks[3].getTankType()) list2.clear();
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@ -5,11 +5,13 @@ import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -77,11 +79,11 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
|
||||
private void setupTanks() {
|
||||
|
||||
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
tanks[1].setTankType(quart.getW());
|
||||
tanks[2].setTankType(quart.getX());
|
||||
tanks[1].setTankType(quart.getKey().type);
|
||||
tanks[2].setTankType(quart.getValue().type);
|
||||
} else {
|
||||
tanks[0].setTankType(Fluids.NONE);
|
||||
tanks[1].setTankType(Fluids.NONE);
|
||||
@ -91,12 +93,12 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
|
||||
private void fractionate() {
|
||||
|
||||
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
Pair<FluidStack, FluidStack> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
|
||||
|
||||
if(quart != null) {
|
||||
|
||||
int left = quart.getY();
|
||||
int right = quart.getZ();
|
||||
int left = quart.getKey().fill;
|
||||
int right = quart.getValue().fill;
|
||||
|
||||
if(tanks[0].getFill() >= 100 && hasSpace(left, right)) {
|
||||
tanks[0].setFill(tanks[0].getFill() - 100);
|
||||
@ -163,7 +165,7 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else
|
||||
return 0;
|
||||
@ -190,19 +192,15 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return list1;
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return list2;
|
||||
if(type == tanks[1].getTankType()) return list1;
|
||||
if(type == tanks[2].getTankType()) return list2;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
list1.clear();
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
list2.clear();
|
||||
if(type == tanks[1].getTankType()) list1.clear();
|
||||
if(type == tanks[2].getTankType()) list2.clear();
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -7,9 +7,11 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.LiquefactionRecipes;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
@ -24,9 +26,11 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
public static final int usage = 500;
|
||||
public static final int usageBase = 500;
|
||||
public int usage;
|
||||
public int progress;
|
||||
public static final int processTime = 200;
|
||||
public static final int processTimeBase = 200;
|
||||
public int processTime;
|
||||
|
||||
public FluidTank tank;
|
||||
|
||||
@ -47,10 +51,19 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
tank.updateTank(this);
|
||||
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 4, zCoord, Library.POS_Y);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
|
||||
this.trySubscribe(worldObj, xCoord + 2, yCoord + 1, zCoord, Library.POS_X);
|
||||
this.trySubscribe(worldObj, xCoord - 2, yCoord + 1, zCoord, Library.NEG_X);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord - 2, Library.NEG_Z);
|
||||
|
||||
UpgradeManager.eval(slots, 2, 3);
|
||||
int speed = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
int power = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
|
||||
|
||||
this.processTime = processTimeBase - (processTimeBase / 4) * speed;
|
||||
this.usage = usageBase - (usageBase / 4) * speed;
|
||||
|
||||
if(this.canProcess())
|
||||
this.process();
|
||||
@ -64,6 +77,8 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
data.setInteger("progress", this.progress);
|
||||
data.setInteger("usage", this.usage);
|
||||
data.setInteger("processTime", this.processTime);
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
@ -123,6 +138,8 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.usage = nbt.getInteger("usage");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -3,55 +3,45 @@ package com.hbm.tileentity.machine.oil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class TileEntityMachineRefinery extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource {
|
||||
|
||||
private ItemStack slots[];
|
||||
public class TileEntityMachineRefinery extends TileEntityMachineBase implements IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver {
|
||||
|
||||
public long power = 0;
|
||||
public int sulfur = 0;
|
||||
public static final int maxSulfur = 100;
|
||||
public static final long maxPower = 1000;
|
||||
public int age = 0;
|
||||
public FluidTank[] tanks;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
public List<IFluidAcceptor> list3 = new ArrayList();
|
||||
public List<IFluidAcceptor> list4 = new ArrayList();
|
||||
|
||||
private static final int[] slots_top = new int[] { 1 };
|
||||
private static final int[] slots_bottom = new int[] { 0, 2, 4, 6, 8, 10, 11};
|
||||
private static final int[] slots_side = new int[] { 0, 3, 5, 7, 9 };
|
||||
|
||||
private String customName;
|
||||
private static final int[] slot_access = new int[] {11};
|
||||
|
||||
public TileEntityMachineRefinery() {
|
||||
slots = new ItemStack[12];
|
||||
super(12);
|
||||
tanks = new FluidTank[5];
|
||||
tanks[0] = new FluidTank(Fluids.HOTOIL, 64000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEAVYOIL, 16000, 1);
|
||||
@ -61,117 +51,18 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
public String getName() {
|
||||
return "container.machineRefinery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.machineRefinery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=128;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 0 && stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
if(i == 1 && FluidContainerRegistry.getFluidContent(stack, Fluids.HOTOIL) > 0)
|
||||
return true;
|
||||
if(stack.getItem() == ModItems.canister_empty) {
|
||||
if(i == 3)
|
||||
return true;
|
||||
if(i == 5)
|
||||
return true;
|
||||
if(i == 7)
|
||||
return true;
|
||||
if(i == 9)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
power = nbt.getLong("power");
|
||||
tanks[0].readFromNBT(nbt, "input");
|
||||
@ -180,22 +71,12 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
tanks[3].readFromNBT(nbt, "light");
|
||||
tanks[4].readFromNBT(nbt, "petroleum");
|
||||
sulfur = nbt.getInteger("sulfur");
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setLong("power", power);
|
||||
tanks[0].writeToNBT(nbt, "input");
|
||||
tanks[1].writeToNBT(nbt, "heavy");
|
||||
@ -203,26 +84,12 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
tanks[3].writeToNBT(nbt, "light");
|
||||
tanks[4].writeToNBT(nbt, "petroleum");
|
||||
nbt.setInteger("sulfur", sulfur);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slot_access;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
@ -231,41 +98,19 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
return true;
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 6)
|
||||
return true;
|
||||
if(i == 8)
|
||||
return true;
|
||||
if(i == 10)
|
||||
return true;
|
||||
if(i == 11)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return i == 11;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
age++;
|
||||
if(age >= 20)
|
||||
{
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if(age == 9 || age == 19) {
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
fillFluidInit(tanks[3].getTankType());
|
||||
@ -274,25 +119,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
|
||||
tanks[0].loadTank(1, 2, slots);
|
||||
|
||||
int ho = RefineryRecipes.oil_frac_heavy;
|
||||
int nt = RefineryRecipes.oil_frac_naph;
|
||||
int lo = RefineryRecipes.oil_frac_light;
|
||||
int pe = RefineryRecipes.oil_frac_petro;
|
||||
|
||||
if(power >= 5 && tanks[0].getFill() >= 100 &&
|
||||
tanks[1].getFill() + ho <= tanks[1].getMaxFill() &&
|
||||
tanks[2].getFill() + nt <= tanks[2].getMaxFill() &&
|
||||
tanks[3].getFill() + lo <= tanks[3].getMaxFill() &&
|
||||
tanks[4].getFill() + pe <= tanks[4].getMaxFill()) {
|
||||
|
||||
tanks[0].setFill(tanks[0].getFill() - 100);
|
||||
tanks[1].setFill(tanks[1].getFill() + ho);
|
||||
tanks[2].setFill(tanks[2].getFill() + nt);
|
||||
tanks[3].setFill(tanks[3].getFill() + lo);
|
||||
tanks[4].setFill(tanks[4].getFill() + pe);
|
||||
sulfur += 1;
|
||||
power -= 5;
|
||||
}
|
||||
refine();
|
||||
|
||||
tanks[1].unloadTank(3, 4, slots);
|
||||
tanks[2].unloadTank(5, 6, slots);
|
||||
@ -303,17 +130,65 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
if(sulfur >= maxSulfur) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
}
|
||||
|
||||
private void refine() {
|
||||
Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> refinery = RefineryRecipes.getRefinery(tanks[0].getTankType());
|
||||
|
||||
if(refinery == null) //usually not possible
|
||||
return;
|
||||
|
||||
FluidStack[] stacks = new FluidStack[] {refinery.getV(), refinery.getW(), refinery.getX(), refinery.getY()};
|
||||
|
||||
for(int i = 0; i < stacks.length; i++)
|
||||
tanks[i + 1].setTankType(stacks[i].type);
|
||||
|
||||
if(power < 5 || tanks[0].getFill() < 100)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < stacks.length; i++) {
|
||||
if(tanks[i + 1].getFill() + stacks[i].fill > tanks[i + 1].getMaxFill()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tanks[0].setFill(tanks[0].getFill() - 100);
|
||||
|
||||
for(int i = 0; i < stacks.length; i++)
|
||||
tanks[i + 1].setFill(tanks[i + 1].getFill() + stacks[i].fill);
|
||||
|
||||
this.sulfur++;
|
||||
|
||||
if(this.sulfur >= maxSulfur) {
|
||||
this.sulfur -= maxSulfur;
|
||||
|
||||
ItemStack out = refinery.getZ();
|
||||
|
||||
if(out != null) {
|
||||
|
||||
if(slots[11] == null) {
|
||||
slots[11] = new ItemStack(ModItems.sulfur);
|
||||
sulfur -= maxSulfur;
|
||||
} else if(slots[11] != null && slots[11].getItem() == ModItems.sulfur && slots[11].stackSize < slots[11].getMaxStackSize()) {
|
||||
slots[11].stackSize++;
|
||||
sulfur -= maxSulfur;
|
||||
slots[11] = out.copy();
|
||||
} else {
|
||||
|
||||
if(out.getItem() == slots[11].getItem() && out.getItemDamage() == slots[11].getItemDamage() && slots[11].stackSize + out.stackSize <= slots[11].getMaxStackSize()) {
|
||||
slots[11].stackSize += out.stackSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
this.power -= 5;
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
@ -368,71 +243,51 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if (age >= 0 && age < 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getFill();
|
||||
else if(type.name().equals(tanks[4].getTankType().name()))
|
||||
return tanks[4].getFill();
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if(type == tanks[i].getTankType()) {
|
||||
return tanks[i].getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
tanks[2].setFill(i);
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
tanks[3].setFill(i);
|
||||
else if(type.name().equals(tanks[4].getTankType().name()))
|
||||
tanks[4].setFill(i);
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if(type == tanks[i].getTankType()) {
|
||||
tanks[i].setFill(fill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return list1;
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return list2;
|
||||
if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return list3;
|
||||
if(type.name().equals(tanks[4].getTankType().name()))
|
||||
return list4;
|
||||
if(type == tanks[1].getTankType()) return list1;
|
||||
if(type == tanks[2].getTankType()) return list2;
|
||||
if(type == tanks[3].getTankType()) return list3;
|
||||
if(type == tanks[4].getTankType()) return list4;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
list1.clear();
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
list2.clear();
|
||||
if(type.name().equals(tanks[3].getTankType().name()))
|
||||
list3.clear();
|
||||
if(type.name().equals(tanks[4].getTankType().name()))
|
||||
list4.clear();
|
||||
if(type == tanks[1].getTankType()) list1.clear();
|
||||
if(type == tanks[2].getTankType()) list2.clear();
|
||||
if(type == tanks[3].getTankType()) list3.clear();
|
||||
if(type == tanks[4].getTankType()) list4.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else
|
||||
return 0;
|
||||
@ -472,4 +327,22 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
|
||||
if(data.hasKey("toggle")) {
|
||||
|
||||
if(tanks[0].getTankType() == Fluids.HOTOIL) {
|
||||
tanks[0].setTankType(Fluids.HOTCRACKOIL);
|
||||
} else {
|
||||
tanks[0].setTankType(Fluids.HOTOIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.SolidificationRecipes;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -23,9 +25,11 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
public static final int usage = 500;
|
||||
public static final int usageBase = 500;
|
||||
public int usage;
|
||||
public int progress;
|
||||
public static final int processTime = 200;
|
||||
public static final int processTimeBase = 200;
|
||||
public int processTime;
|
||||
|
||||
public FluidTank tank;
|
||||
|
||||
@ -47,10 +51,19 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
tank.setType(4, slots);
|
||||
tank.updateTank(this);
|
||||
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 4, zCoord, Library.POS_Y);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
|
||||
this.trySubscribe(worldObj, xCoord + 2, yCoord + 1, zCoord, Library.POS_X);
|
||||
this.trySubscribe(worldObj, xCoord - 2, yCoord + 1, zCoord, Library.NEG_X);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord - 2, Library.NEG_Z);
|
||||
|
||||
UpgradeManager.eval(slots, 2, 3);
|
||||
int speed = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
int power = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
|
||||
|
||||
this.processTime = processTimeBase - (processTimeBase / 4) * speed;
|
||||
this.usage = usageBase - (usageBase / 4) * speed;
|
||||
|
||||
if(this.canProcess())
|
||||
this.process();
|
||||
@ -60,6 +73,8 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
data.setInteger("progress", this.progress);
|
||||
data.setInteger("usage", this.usage);
|
||||
data.setInteger("processTime", this.processTime);
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
@ -134,6 +149,8 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.usage = nbt.getInteger("usage");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -286,19 +286,15 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return this.list1;
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return this.list2;
|
||||
if(type == tanks[0].getTankType()) return this.list1;
|
||||
if(type == tanks[1].getTankType()) return this.list2;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
list1.clear();
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
list2.clear();
|
||||
if(type == tanks[0].getTankType()) list1.clear();
|
||||
if(type == tanks[1].getTankType()) list2.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -137,7 +137,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
if(mode == 2 || mode == 3)
|
||||
return 0;
|
||||
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
return type == this.tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,13 +167,12 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
|
||||
return type == this.tank.getTankType() ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
if(type == tank.getTankType()) tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1,4 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -1,4 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user