mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
More turbofan functionality, fluid NEI handler, mining drill fixes
This commit is contained in:
parent
924542911f
commit
f9330c0533
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3225
assets/hbm/models/turbofan_derp.obj
Normal file
3225
assets/hbm/models/turbofan_derp.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/hbm/textures/gui/gui_nei_fluid.png
Normal file
BIN
assets/hbm/textures/gui/gui_nei_fluid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 818 B |
BIN
assets/hbm/textures/items/ingot_cyrophyr.png
Normal file
BIN
assets/hbm/textures/items/ingot_cyrophyr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 327 B |
BIN
assets/hbm/textures/items/upgrade_mod_u.png
Normal file
BIN
assets/hbm/textures/items/upgrade_mod_u.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 362 B |
@ -5,14 +5,19 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -61,6 +66,40 @@ public class MachineTurbofan extends BlockContainer implements IMultiblock {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.turbofanDimensionEast, ModBlocks.dummy_block_turbofan);
|
||||
|
||||
//
|
||||
DummyBlockTurbofan.safeBreak = true;
|
||||
world.setBlock(x + 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te = world.getTileEntity(x + 1, y + 1, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y + 1, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y + 1, z - 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y + 1, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockTurbofan.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
@ -72,6 +111,40 @@ public class MachineTurbofan extends BlockContainer implements IMultiblock {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.turbofanDimensionSouth, ModBlocks.dummy_block_turbofan);
|
||||
|
||||
//
|
||||
DummyBlockTurbofan.safeBreak = true;
|
||||
world.setBlock(x + 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te = world.getTileEntity(x + 1, y + 1, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y + 1, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y + 1, z - 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y + 1, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockTurbofan.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
@ -83,6 +156,40 @@ public class MachineTurbofan extends BlockContainer implements IMultiblock {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.turbofanDimensionWest, ModBlocks.dummy_block_turbofan);
|
||||
|
||||
//
|
||||
DummyBlockTurbofan.safeBreak = true;
|
||||
world.setBlock(x + 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te = world.getTileEntity(x + 1, y + 1, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y + 1, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y + 1, z - 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y + 1, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockTurbofan.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
@ -94,10 +201,63 @@ public class MachineTurbofan extends BlockContainer implements IMultiblock {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.turbofanDimensionNorth, ModBlocks.dummy_block_turbofan);
|
||||
|
||||
//
|
||||
DummyBlockTurbofan.safeBreak = true;
|
||||
world.setBlock(x + 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te = world.getTileEntity(x + 1, y + 1, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y + 1, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y + 1, z - 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y + 1, z - 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y + 1, z + 1, ModBlocks.dummy_port_turbofan);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y + 1, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockTurbofan.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.linker) {
|
||||
return false;
|
||||
}else if (!player.isSneaking()) {
|
||||
TileEntityMachineTurbofan entity = (TileEntityMachineTurbofan) world.getTileEntity(x, y, z);
|
||||
if (entity != null) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_turbofan, world, x,
|
||||
y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
76
com/hbm/entity/particle/EntityTSmokeFX.java
Normal file
76
com/hbm/entity/particle/EntityTSmokeFX.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.hbm.entity.particle;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTSmokeFX extends EntityModFX
|
||||
{
|
||||
float smokeParticleScale;
|
||||
public int particleAge;
|
||||
public int maxAge;
|
||||
private static final String __OBFID = "CL_00000924";
|
||||
|
||||
public EntityTSmokeFX(World world) {
|
||||
super(world, 0, 0, 0);
|
||||
}
|
||||
|
||||
public EntityTSmokeFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_)
|
||||
{
|
||||
this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F);
|
||||
}
|
||||
|
||||
public EntityTSmokeFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_)
|
||||
{
|
||||
super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
this.motionZ *= 0.10000000149011612D;
|
||||
this.motionX += p_i1226_8_;
|
||||
this.motionY += p_i1226_10_;
|
||||
this.motionZ += p_i1226_12_;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D);
|
||||
this.particleScale *= 0.75F;
|
||||
this.particleScale *= p_i1226_14_;
|
||||
this.smokeParticleScale = this.particleScale;
|
||||
//this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
|
||||
//this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_);
|
||||
this.noClip = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if(maxAge < 100)
|
||||
{
|
||||
maxAge = rand.nextInt(21) + 65;
|
||||
}
|
||||
|
||||
this.particleAge++;
|
||||
|
||||
if (this.particleAge >= maxAge)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
this.motionX *= 0.7599999785423279D;
|
||||
this.motionY *= 0.7599999785423279D;
|
||||
this.motionZ *= 0.7599999785423279D;
|
||||
|
||||
if (this.onGround)
|
||||
{
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
}
|
||||
}
|
||||
@ -457,7 +457,7 @@ public class GUIHandler implements IGuiHandler {
|
||||
{
|
||||
if(entity instanceof TileEntityMachineTurbofan)
|
||||
{
|
||||
//return new ContainerMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
return new ContainerMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -861,7 +861,7 @@ public class GUIHandler implements IGuiHandler {
|
||||
{
|
||||
if(entity instanceof TileEntityMachineTurbofan)
|
||||
{
|
||||
//return new GUIMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
return new GUIMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,10 +63,10 @@ public class MultiblockHandler {
|
||||
public static final int[] pumpjackDimensionEast = new int[] { 0, 6, 4, 0, 1, 1 };
|
||||
public static final int[] pumpjackDimensionSouth = new int[] { 1, 1, 4, 0, 0, 6 };
|
||||
public static final int[] pumpjackDimensionWest = new int[] { 6, 0, 4, 0, 1, 1 };
|
||||
public static final int[] turbofanDimensionNorth = new int[] { 1, 1, 2, 0, 4, 3 };
|
||||
public static final int[] turbofanDimensionEast = new int[] { 3, 4, 2, 0, 1, 1 };
|
||||
public static final int[] turbofanDimensionSouth = new int[] { 1, 1, 2, 0, 3, 4 };
|
||||
public static final int[] turbofanDimensionWest = new int[] { 4, 3, 2, 0, 1, 1 };
|
||||
public static final int[] turbofanDimensionNorth = new int[] { 1, 1, 2, 0, 4, 4 };
|
||||
public static final int[] turbofanDimensionEast = new int[] { 4, 4, 2, 0, 1, 1 };
|
||||
public static final int[] turbofanDimensionSouth = new int[] { 1, 1, 2, 0, 4, 4 };
|
||||
public static final int[] turbofanDimensionWest = new int[] { 4, 4, 2, 0, 1, 1 };
|
||||
|
||||
//Approved!
|
||||
public static boolean checkSpace(World world, int x, int y, int z, int[] i) {
|
||||
|
||||
109
com/hbm/handler/nei/FluidRecipeHandler.java
Normal file
109
com/hbm/handler/nei/FluidRecipeHandler.java
Normal file
@ -0,0 +1,109 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.inventory.gui.GUIMachineShredder;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FluidRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
PositionedStack input;
|
||||
PositionedStack result;
|
||||
|
||||
public SmeltingSet(ItemStack input, ItemStack result) {
|
||||
input.stackSize = 1;
|
||||
this.input = new PositionedStack(input, 83 - 27 - 18 + 1, 5 + 18 + 1);
|
||||
this.result = new PositionedStack(result, 83 + 27 + 18 + 1, 5 + 18 + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] {input}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Fluid Containers";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return RefStrings.MODID + ":textures/gui/gui_nei_fluid.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if ((outputId.equals("fluidcons")) && getClass() == FluidRecipeHandler.class) {
|
||||
Map<Object, Object> recipes = MachineRecipes.instance().getFluidContainers();
|
||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
Map<Object, Object> recipes = MachineRecipes.instance().getFluidContainers();
|
||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
if (NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue(), result) || compareFluidStacks(result, (ItemStack)recipe.getKey()))
|
||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
if ((inputId.equals("fluidcons")) && getClass() == FluidRecipeHandler.class) {
|
||||
loadCraftingRecipes("fluidcons", new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
Map<Object, Object> recipes = MachineRecipes.instance().getFluidContainers();
|
||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
if (NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue(), ingredient) || compareFluidStacks(ingredient, (ItemStack)recipe.getKey()))
|
||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
|
||||
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
//return GUIMachineShredder.class;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(74 + 6, 23, 24, 18), "fluidcons"));
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
}
|
||||
}
|
||||
@ -3500,4 +3500,19 @@ public class MachineRecipes {
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public Map<Object, Object> getFluidContainers() {
|
||||
Map<Object, Object> map = new HashMap<Object, Object>();
|
||||
|
||||
for(FluidContainer con : FluidContainerRegistry.instance.allContainers) {
|
||||
if(con != null) {
|
||||
ItemStack fluid = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(con.type));
|
||||
fluid.stackTagCompound = new NBTTagCompound();
|
||||
fluid.stackTagCompound.setInteger("fill", con.content);
|
||||
map.put(fluid, con.fullContainer);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,114 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
public class ContainerMachineTurbofan {
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineTurbofan extends Container {
|
||||
|
||||
private TileEntityMachineTurbofan diFurnace;
|
||||
private int power;
|
||||
|
||||
public ContainerMachineTurbofan(InventoryPlayer invPlayer, TileEntityMachineTurbofan tedf) {
|
||||
power = 0;
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 17, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 17, 53));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 107, 17));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 2) {
|
||||
if (!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 0, 1, false))
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 2, 3, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.power != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
}
|
||||
}
|
||||
|
||||
this.power = this.diFurnace.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -48,6 +48,6 @@ public class GUIMachineMiningDrill extends GuiContainer {
|
||||
if(k == 2)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 0, 16, 16);
|
||||
if(k == 1)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 208, 52, 16, 16);
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 208, 0, 16, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,62 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
public class GUIMachineTurbofan {
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineDiesel;
|
||||
import com.hbm.inventory.container.ContainerMachineTurbofan;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineTurbofan extends GuiFluidContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_turbofan.png");
|
||||
private TileEntityMachineTurbofan diFurnace;
|
||||
|
||||
public GUIMachineTurbofan(InventoryPlayer invPlayer, TileEntityMachineTurbofan tedf) {
|
||||
super(new ContainerMachineTurbofan(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 69 - 52, 34, 52);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 152 - 9, guiTop + 69 - i, 176 + 16, 52 - i, 16, i);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(FluidTank.fluidTextures);
|
||||
|
||||
diFurnace.tank.renderTank(this, guiLeft + 53, guiTop + 69, diFurnace.tank.getTankType().textureX() * FluidTank.x, diFurnace.tank.getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
diFurnace.tank.renderTank(this, guiLeft + 53 + 16, guiTop + 69, diFurnace.tank.getTankType().textureX() * FluidTank.x, diFurnace.tank.getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
diFurnace.tank.renderTank(this, guiLeft + 53 + 32, guiTop + 69, diFurnace.tank.getTankType().textureX() * FluidTank.x, diFurnace.tank.getTankType().textureY() * FluidTank.y, 2, 52);
|
||||
}
|
||||
}
|
||||
|
||||
@ -727,6 +727,9 @@ public class ModItems {
|
||||
public static Item upgrade_fortune_1;
|
||||
public static Item upgrade_fortune_2;
|
||||
public static Item upgrade_fortune_3;
|
||||
public static Item upgrade_afterburn_1;
|
||||
public static Item upgrade_afterburn_2;
|
||||
public static Item upgrade_afterburn_3;
|
||||
|
||||
public static Item ingot_euphemium;
|
||||
public static Item nugget_euphemium;
|
||||
@ -1269,7 +1272,7 @@ public class ModItems {
|
||||
chopper_blades = new Item().setUnlocalizedName("chopper_blades").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":chopper_blades");
|
||||
combine_scrap = new Item().setUnlocalizedName("combine_scrap").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":combine_scrap");
|
||||
|
||||
shimmer_head = new Item().setUnlocalizedName("shimmer_head").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":shimmer_head");
|
||||
shimmer_head = new Item().setUnlocalizedName("shimmer_head").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":shimmer_head_original");
|
||||
shimmer_handle = new Item().setUnlocalizedName("shimmer_handle").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":shimmer_handle");
|
||||
|
||||
telepad = new Item().setUnlocalizedName("telepad").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":telepad");
|
||||
@ -1678,6 +1681,9 @@ public class ModItems {
|
||||
upgrade_fortune_1 = new ItemCustomLore().setUnlocalizedName("upgrade_fortune_1").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_fortune_1");
|
||||
upgrade_fortune_2 = new ItemCustomLore().setUnlocalizedName("upgrade_fortune_2").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_fortune_2");
|
||||
upgrade_fortune_3 = new ItemCustomLore().setUnlocalizedName("upgrade_fortune_3").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_fortune_3");
|
||||
upgrade_afterburn_1 = new ItemCustomLore().setUnlocalizedName("upgrade_afterburn_1").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_afterburn_1");
|
||||
upgrade_afterburn_2 = new ItemCustomLore().setUnlocalizedName("upgrade_afterburn_2").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_afterburn_2");
|
||||
upgrade_afterburn_3 = new ItemCustomLore().setUnlocalizedName("upgrade_afterburn_3").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":upgrade_afterburn_3");
|
||||
|
||||
wand = new ItemWand().setUnlocalizedName("wand_k").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setFull3D().setTextureName(RefStrings.MODID + ":wand");
|
||||
wand_s = new ItemWandS().setUnlocalizedName("wand_s").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setFull3D().setTextureName(RefStrings.MODID + ":wand_s");
|
||||
@ -1851,7 +1857,7 @@ public class ModItems {
|
||||
cape_vertice = new ArmorModel(MainRegistry.enumArmorMaterialEmerald, 9, 1).setUnlocalizedName("cape_vertice").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_unknown");
|
||||
|
||||
schrabidium_hammer = new WeaponSpecial(MainRegistry.enumToolMaterialHammer).setUnlocalizedName("schrabidium_hammer").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":schrabidium_hammer");
|
||||
shimmer_sledge = new WeaponSpecial(MainRegistry.enumToolMaterialSledge).setUnlocalizedName("shimmer_sledge").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":shimmer_sledge");
|
||||
shimmer_sledge = new WeaponSpecial(MainRegistry.enumToolMaterialSledge).setUnlocalizedName("shimmer_sledge").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":shimmer_sledge_original");
|
||||
bottle_opener = new WeaponSpecial(MainRegistry.enumToolMaterialBottleOpener).setUnlocalizedName("bottle_opener").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":bottle_opener");
|
||||
euphemium_stopper = new ItemSyringe().setUnlocalizedName("euphemium_stopper").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":euphemium_stopper");
|
||||
matchstick = new ItemMatch().setUnlocalizedName("matchstick").setCreativeTab(CreativeTabs.tabTools).setFull3D().setTextureName(RefStrings.MODID + ":matchstick");
|
||||
@ -2396,6 +2402,9 @@ public class ModItems {
|
||||
GameRegistry.registerItem(upgrade_fortune_1, upgrade_fortune_1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_fortune_2, upgrade_fortune_2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_fortune_3, upgrade_fortune_3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_afterburn_1, upgrade_afterburn_1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_afterburn_2, upgrade_afterburn_2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_afterburn_3, upgrade_afterburn_3.getUnlocalizedName());
|
||||
|
||||
//Machine Templates
|
||||
GameRegistry.registerItem(template_folder, template_folder.getUnlocalizedName());
|
||||
|
||||
@ -35,8 +35,7 @@ public class ItemCustomLore extends ItemRadioactive {
|
||||
if(this == ModItems.ingot_neptunium)
|
||||
{
|
||||
if(MainRegistry.polaroidID == 11) {
|
||||
list.add("Pretty weird...you know what I mean, right?");
|
||||
list.add("All of it. The lore, the polaroid, the...");
|
||||
list.add("Woo, scary!");
|
||||
} else
|
||||
list.add("That one's my favourite!");
|
||||
}
|
||||
@ -269,11 +268,6 @@ public class ItemCustomLore extends ItemRadioactive {
|
||||
|
||||
if(this == ModItems.igniter)
|
||||
{
|
||||
/*list.add("Don't get me wrong, but you use it");
|
||||
list.add("by directly right-clicking the");
|
||||
list.add("prototype. And yes, you also die. Why?");
|
||||
list.add("Because you stand two meters next to");
|
||||
list.add("the bomb, you fool.");*/
|
||||
list.add("(Used by right-clicking the Prototype)");
|
||||
list.add("It's a green metal handle with a");
|
||||
list.add("bright red button and a small lid.");
|
||||
@ -366,7 +360,7 @@ public class ItemCustomLore extends ItemRadioactive {
|
||||
list.add("form of life in the known universe'.\"");
|
||||
list.add("\"So?\"");
|
||||
list.add("\"'So?' C'mon man, they're ALIENS!\"");*/
|
||||
list.add("*insert Freeman's Mind reference here*");
|
||||
list.add("*insert Civil Protection reference here*");
|
||||
}
|
||||
|
||||
if(this == ModItems.gun_super_shotgun)
|
||||
@ -419,134 +413,143 @@ public class ItemCustomLore extends ItemRadioactive {
|
||||
|
||||
if(this == ModItems.upgrade_speed_1)
|
||||
{
|
||||
list.add("Mining drill speed upgrade");
|
||||
list.add("Effect: Delay -15 (from 50)");
|
||||
list.add("Drawback: Power consumption +300 (from 100)");
|
||||
list.add("Speed Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Delay -15 / Consumption +300");
|
||||
list.add("");
|
||||
list.add("Assembly machine speed upgrade");
|
||||
list.add("Effect: Delay -25 (from 100)");
|
||||
list.add("Drawback: Power consumption +300 (from 100)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Delay -25 / Consumption +300");
|
||||
list.add("");
|
||||
list.add("Chemical plant speed upgrade");
|
||||
list.add("Effect: Delay -25 (from 100)");
|
||||
list.add("Drawback: Power consumption +300 (from 100)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Delay -25 / Consumption +300");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_speed_2)
|
||||
{
|
||||
list.add("Mining drill speed upgrade");
|
||||
list.add("Effect: Delay -30 (from 50)");
|
||||
list.add("Drawback: Power consumption +600 (from 100)");
|
||||
list.add("Speed Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Delay -30 / Consumption +600");
|
||||
list.add("");
|
||||
list.add("Assembly machine speed upgrade");
|
||||
list.add("Effect: Delay -50 (from 100)");
|
||||
list.add("Drawback: Power consumption +600 (from 100)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Delay -50 / Consumption +600");
|
||||
list.add("");
|
||||
list.add("Chemical plant speed upgrade");
|
||||
list.add("Effect: Delay -50 (from 100)");
|
||||
list.add("Drawback: Power consumption +600 (from 100)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Delay -50 / Consumption +600");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_speed_3)
|
||||
{
|
||||
list.add("Mining drill speed upgrade");
|
||||
list.add("Effect: Delay -45 (from 50)");
|
||||
list.add("Drawback: Power consumption +900 (from 100)");
|
||||
list.add("Speed Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Delay -45 / Consumption +900");
|
||||
list.add("");
|
||||
list.add("Assembly machine speed upgrade");
|
||||
list.add("Effect: Delay -75 (from 100)");
|
||||
list.add("Drawback: Power consumption +900 (from 100)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Delay -75 / Consumption +900");
|
||||
list.add("");
|
||||
list.add("Chemical plant speed upgrade");
|
||||
list.add("Effect: Delay -75 (from 100)");
|
||||
list.add("Drawback: Power consumption +900 (from 100)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Delay -75 / Consumption +900");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_effect_1)
|
||||
{
|
||||
list.add("Mining drill effectiveness upgrade");
|
||||
list.add("Effect: Radius +1 (from 1)");
|
||||
list.add("Drawback: Power consumption +80 (from 100)");
|
||||
list.add("Effectiveness Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Radius +1 / Consumption +80");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_effect_2)
|
||||
{
|
||||
list.add("Mining drill effectiveness upgrade");
|
||||
list.add("Effect: Radius +2 (from 1)");
|
||||
list.add("Drawback: Power consumption +160 (from 100)");
|
||||
list.add("Effectiveness Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Radius +2 / Consumption +160");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_effect_3)
|
||||
{
|
||||
list.add("Mining drill effectiveness upgrade");
|
||||
list.add("Effect: Radius +3 (from 1)");
|
||||
list.add("Drawback: Power consumption +240 (from 100)");
|
||||
list.add("Effectiveness Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Radius +3 / Consumption +240");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_power_1)
|
||||
{
|
||||
list.add("Mining drill power saving upgrade");
|
||||
list.add("Effect: Power consumption -30 (from 100)");
|
||||
list.add("Drawback: Delay +5 (from 50)");
|
||||
list.add("Power Saving Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Consumption -30 / Delay +5");
|
||||
list.add("");
|
||||
list.add("Assembly machine power saving upgrade");
|
||||
list.add("Effect: Power consumption -30 (from 100)");
|
||||
list.add("Drawback: Delay +5 (from 50)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Consumption -30 / Delay +5");
|
||||
list.add("");
|
||||
list.add("Chemical plant power saving upgrade");
|
||||
list.add("Effect: Power consumption -30 (from 100)");
|
||||
list.add("Drawback: Delay +5 (from 50)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Consumption -30 / Delay +5");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_power_2)
|
||||
{
|
||||
list.add("Mining drill power saving upgrade");
|
||||
list.add("Effect: Power consumption -60 (from 100)");
|
||||
list.add("Drawback: Delay +10 (from 50)");
|
||||
list.add("Power Saving Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Consumption -60 / Delay +10");
|
||||
list.add("");
|
||||
list.add("Assembly machine power saving upgrade");
|
||||
list.add("Effect: Power consumption -60 (from 100)");
|
||||
list.add("Drawback: Delay +10 (from 50)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Consumption -60 / Delay +10");
|
||||
list.add("");
|
||||
list.add("Chemical plant power saving upgrade");
|
||||
list.add("Effect: Power consumption -60 (from 100)");
|
||||
list.add("Drawback: Delay +10 (from 50)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Consumption -60 / Delay +10");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_power_3)
|
||||
{
|
||||
list.add("Mining drill power saving upgrade");
|
||||
list.add("Effect: Power consumption -90 (from 100)");
|
||||
list.add("Drawback: Delay +15 (from 50)");
|
||||
list.add("Power Saving Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Consumption -90 / Delay +15");
|
||||
list.add("");
|
||||
list.add("Assembly machine power saving upgrade");
|
||||
list.add("Effect: Power consumption -90 (from 100)");
|
||||
list.add("Drawback: Delay +15 (from 50)");
|
||||
list.add("Assembly Machine:");
|
||||
list.add("Consumption -90 / Delay +15");
|
||||
list.add("");
|
||||
list.add("Chemical plant power saving upgrade");
|
||||
list.add("Effect: Power consumption -90 (from 100)");
|
||||
list.add("Drawback: Delay +15 (from 50)");
|
||||
list.add("Chemical Plant:");
|
||||
list.add("Consumption -90 / Delay +15");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_fortune_1)
|
||||
{
|
||||
list.add("Mining drill fortune upgrade");
|
||||
list.add("Effect: Fortune +1 (from 0");
|
||||
list.add("Drawback: Delay +15 (from 50)");
|
||||
list.add("Fortune Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Fortune +1 / Delay +15");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_fortune_2)
|
||||
{
|
||||
list.add("Mining drill fortune upgrade");
|
||||
list.add("Effect: Fortune +2 (from 0");
|
||||
list.add("Drawback: Delay +30 (from 50)");
|
||||
list.add("Fortune Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Fortune +2 / Delay +30");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_fortune_3)
|
||||
{
|
||||
list.add("Mining drill fortune upgrade");
|
||||
list.add("Effect: Fortune +3 (from 0");
|
||||
list.add("Drawback: Delay +45 (from 50)");
|
||||
list.add("Fortune Upgrade");
|
||||
list.add("Mining Drill:");
|
||||
list.add("Fortune +3 / Delay +45");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_afterburn_1)
|
||||
{
|
||||
list.add("Afterburner Upgrade");
|
||||
list.add("Turbofan:");
|
||||
list.add("XXXXXXX");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_afterburn_2)
|
||||
{
|
||||
list.add("Afterburner Upgrade");
|
||||
list.add("Turbofan:");
|
||||
list.add("XXXXXXX");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_afterburn_3)
|
||||
{
|
||||
list.add("Afterburner Upgrade");
|
||||
list.add("Turbofan:");
|
||||
list.add("XXXXXXX");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -974,6 +974,11 @@ public class Library {
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//Turbofan
|
||||
if(block == ModBlocks.dummy_port_turbofan)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
|
||||
if(tileentity == that)
|
||||
tileentity = null;
|
||||
|
||||
@ -29,6 +29,7 @@ public class ModDamageSource extends DamageSource {
|
||||
public static DamageSource rubble = (new DamageSource("rubble")).setProjectile();
|
||||
public static DamageSource shrapnel = (new DamageSource("shrapnel")).setProjectile();
|
||||
public static DamageSource blackhole = (new DamageSource("blackhole")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource turbofan = (new DamageSource("blender")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
|
||||
public ModDamageSource(String p_i1566_1_) {
|
||||
super(p_i1566_1_);
|
||||
|
||||
@ -67,6 +67,7 @@ import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.particle.EntityOilSpillFX;
|
||||
import com.hbm.entity.particle.EntitySSmokeFX;
|
||||
import com.hbm.entity.particle.EntitySmokeFX;
|
||||
import com.hbm.entity.particle.EntityTSmokeFX;
|
||||
import com.hbm.entity.projectile.EntityBaleflare;
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.entity.projectile.EntityChopperMine;
|
||||
@ -134,6 +135,7 @@ import com.hbm.render.entity.RenderShrapnel;
|
||||
import com.hbm.render.entity.RenderSmallNukeAlt;
|
||||
import com.hbm.render.entity.SSmokeRenderer;
|
||||
import com.hbm.render.entity.SpillRenderer;
|
||||
import com.hbm.render.entity.TSmokeRenderer;
|
||||
import com.hbm.render.item.ItemRenderBFLauncher;
|
||||
import com.hbm.render.item.ItemRenderBaleflare;
|
||||
import com.hbm.render.item.ItemRenderBigSword;
|
||||
@ -508,6 +510,7 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCombineBall.class, new RenderSnowball(ModItems.energy_ball));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDischarge.class, new ElectricityRenderer(ModItems.discharge));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEMPBlast.class, new RenderEMPBlast());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTSmokeFX.class, new TSmokeRenderer(ModItems.nuclear_waste));
|
||||
|
||||
RenderingRegistry.addNewArmourRendererPrefix("5");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("6");
|
||||
|
||||
@ -96,6 +96,7 @@ import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.particle.EntityOilSpillFX;
|
||||
import com.hbm.entity.particle.EntitySSmokeFX;
|
||||
import com.hbm.entity.particle.EntitySmokeFX;
|
||||
import com.hbm.entity.particle.EntityTSmokeFX;
|
||||
import com.hbm.entity.projectile.EntityBaleflare;
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.entity.projectile.EntityChopperMine;
|
||||
@ -572,6 +573,7 @@ public class MainRegistry
|
||||
EntityRegistry.registerModEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 78, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityBombletTheta.class, "entity_theta", 79, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityBombletSelena.class, "entity_selena", 80, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityTSmokeFX.class, "entity_t_smoke_fx", 81, this, 1000, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72);
|
||||
@ -711,12 +713,19 @@ public class MainRegistry
|
||||
OreDictionary.registerOre("dustNeodymium", ModItems.powder_neodymium);
|
||||
OreDictionary.registerOre("dustCaesium", ModItems.powder_caesium);
|
||||
OreDictionary.registerOre("dustStrontium", ModItems.powder_strontium);
|
||||
OreDictionary.registerOre("dustCobalt", ModItems.fragment_cobalt);
|
||||
OreDictionary.registerOre("dustCobalt", ModItems.powder_cobalt);
|
||||
OreDictionary.registerOre("dustBromine", ModItems.powder_bromine);
|
||||
OreDictionary.registerOre("dustNiobium", ModItems.fragment_niobium);
|
||||
OreDictionary.registerOre("dustNiobium", ModItems.powder_niobium);
|
||||
OreDictionary.registerOre("dustTennessine", ModItems.powder_tennessine);
|
||||
OreDictionary.registerOre("dustCerium", ModItems.powder_cerium);
|
||||
|
||||
OreDictionary.registerOre("nuggetNeodymium", ModItems.fragment_neodymium);
|
||||
OreDictionary.registerOre("nuggetCobalt", ModItems.fragment_cobalt);
|
||||
OreDictionary.registerOre("nuggetNiobium", ModItems.fragment_niobium);
|
||||
OreDictionary.registerOre("nuggetCerium", ModItems.fragment_cerium);
|
||||
OreDictionary.registerOre("nuggetLanthanium", ModItems.fragment_lanthanium);
|
||||
OreDictionary.registerOre("nuggetActinium", ModItems.fragment_actinium);
|
||||
|
||||
OreDictionary.registerOre("gemCoal", Items.coal);
|
||||
|
||||
OreDictionary.registerOre("oreUranium", ModBlocks.ore_uranium);
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.handler.nei.CMBFurnaceRecipeHandler;
|
||||
import com.hbm.handler.nei.CentrifugeRecipeHandler;
|
||||
import com.hbm.handler.nei.ChemplantRecipeHandler;
|
||||
import com.hbm.handler.nei.CyclotronRecipeHandler;
|
||||
import com.hbm.handler.nei.FluidRecipeHandler;
|
||||
import com.hbm.handler.nei.ModInfoHandler;
|
||||
import com.hbm.handler.nei.ReactorRecipeHandler;
|
||||
import com.hbm.handler.nei.RefineryRecipeHandler;
|
||||
@ -43,6 +44,8 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.registerUsageHandler(new ModInfoHandler());
|
||||
API.registerRecipeHandler(new ChemplantRecipeHandler());
|
||||
API.registerUsageHandler(new ChemplantRecipeHandler());
|
||||
API.registerRecipeHandler(new FluidRecipeHandler());
|
||||
API.registerUsageHandler(new FluidRecipeHandler());
|
||||
|
||||
//Some things are even beyond my control...or are they?
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_on)));
|
||||
|
||||
117
com/hbm/render/entity/TSmokeRenderer.java
Normal file
117
com/hbm/render/entity/TSmokeRenderer.java
Normal file
@ -0,0 +1,117 @@
|
||||
package com.hbm.render.entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.entity.particle.EntityTSmokeFX;
|
||||
import com.hbm.items.ModItems;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TSmokeRenderer extends Render {
|
||||
private Item field_94151_a;
|
||||
private int field_94150_f;
|
||||
private static final String __OBFID = "CL_00001008";
|
||||
|
||||
public TSmokeRenderer(Item p_i1259_1_, int p_i1259_2_) {
|
||||
this.field_94151_a = p_i1259_1_;
|
||||
this.field_94150_f = p_i1259_2_;
|
||||
}
|
||||
|
||||
public TSmokeRenderer(Item p_i1260_1_) {
|
||||
this(p_i1260_1_, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
|
||||
float p_76986_9_) {
|
||||
|
||||
if (p_76986_1_ instanceof EntityTSmokeFX) {
|
||||
EntityTSmokeFX fx = (EntityTSmokeFX) p_76986_1_;
|
||||
|
||||
if (fx.particleAge <= fx.maxAge && fx.particleAge >= fx.maxAge / 8 * 7) {
|
||||
field_94151_a = ModItems.d_smoke8;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) {
|
||||
field_94151_a = ModItems.d_smoke7;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) {
|
||||
field_94151_a = ModItems.d_smoke6;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) {
|
||||
field_94151_a = ModItems.d_smoke5;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) {
|
||||
field_94151_a = ModItems.d_smoke4;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) {
|
||||
field_94151_a = ModItems.d_smoke3;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) {
|
||||
field_94151_a = ModItems.d_smoke2;
|
||||
}
|
||||
|
||||
if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) {
|
||||
field_94151_a = ModItems.d_smoke1;
|
||||
}
|
||||
|
||||
IIcon iicon = field_94151_a.getIconFromDamage(0);
|
||||
|
||||
if (iicon != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
//
|
||||
//GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
//
|
||||
this.bindEntityTexture(p_76986_1_);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return TextureMap.locationItemsTexture;
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
|
||||
float f = p_77026_2_.getMinU();
|
||||
float f1 = p_77026_2_.getMaxU();
|
||||
float f2 = p_77026_2_.getMinV();
|
||||
float f3 = p_77026_2_.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
p_77026_1_.startDrawingQuads();
|
||||
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
|
||||
p_77026_1_.draw();
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,7 @@ public class RenderTurbofan extends TileEntitySpecialRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
i++;
|
||||
i -= 3;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
@ -1,7 +1,469 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.particle.EntityDSmokeFX;
|
||||
import com.hbm.entity.particle.EntityTSmokeFX;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
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;
|
||||
|
||||
public class TileEntityMachineTurbofan extends TileEntity {
|
||||
public class TileEntityMachineTurbofan extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public int power;
|
||||
public int soundCycle = 0;
|
||||
public static final int maxPower = 150000;
|
||||
public int age = 0;
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
public FluidTank tank;
|
||||
Random rand = new Random();
|
||||
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 0, 0 };
|
||||
private static final int[] slots_side = new int[] { 0 };
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineTurbofan() {
|
||||
slots = new ItemStack[3];
|
||||
tank = new FluidTank(FluidType.KEROSENE, 64000, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@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.machineTurbofan";
|
||||
}
|
||||
|
||||
@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) <= 64;
|
||||
}
|
||||
}
|
||||
|
||||
// You scrubs aren't needed for anything (right now)
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
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);
|
||||
|
||||
this.power = nbt.getInteger("powerTime");
|
||||
tank.readFromNBT(nbt, "fuel");
|
||||
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.setInteger("powerTime", power);
|
||||
tank.writeToNBT(nbt, "fuel");
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
age++;
|
||||
if (age >= 20) {
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if (age == 9 || age == 19)
|
||||
ffgeuaInit();
|
||||
|
||||
int nrg = 1250;
|
||||
int cnsp = 1;
|
||||
|
||||
if(slots[2] != null) {
|
||||
if(slots[2].getItem() == ModItems.upgrade_afterburn_1) {
|
||||
nrg *= 2;
|
||||
cnsp *= 2.5;
|
||||
}
|
||||
if(slots[2].getItem() == ModItems.upgrade_afterburn_2) {
|
||||
nrg *= 3;
|
||||
cnsp *= 5;
|
||||
}
|
||||
if(slots[2].getItem() == ModItems.upgrade_afterburn_3) {
|
||||
nrg *= 4;
|
||||
cnsp *= 7.5;
|
||||
}
|
||||
}
|
||||
|
||||
//Tank Management
|
||||
tank.loadTank(0, 1, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord);
|
||||
|
||||
if(tank.getFill() >= cnsp) {
|
||||
tank.setFill(tank.getFill() - cnsp);
|
||||
power += nrg;
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
|
||||
double posX = xCoord + 0.5;
|
||||
double posY = yCoord;
|
||||
double posZ = zCoord + 0.5;
|
||||
|
||||
if(meta == 2) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
EntityTSmokeFX smoke = new EntityTSmokeFX(worldObj);
|
||||
smoke.posX = xCoord + 0.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posY = yCoord + 1.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posZ = zCoord + 4.25;
|
||||
smoke.motionX = rand.nextGaussian() * 0.3;
|
||||
smoke.motionY = rand.nextGaussian() * 0.3;
|
||||
smoke.motionZ = 2.5 + (rand.nextFloat() * 3.5);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(smoke);
|
||||
}
|
||||
|
||||
//Exhaust push
|
||||
List<Entity> list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ + 4.5, posX + 1.5, posY + 3, posZ + 12));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionZ += 0.5;
|
||||
}
|
||||
|
||||
//Intake pull
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ - 12, posX + 1.5, posY + 3, posZ - 4.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionZ += 0.5;
|
||||
}
|
||||
|
||||
//Intake kill
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ - 5.5, posX + 1.5, posY + 3, posZ - 4.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.attackEntityFrom(ModDamageSource.turbofan, 1000);
|
||||
}
|
||||
}
|
||||
if(meta == 3) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
EntityTSmokeFX smoke = new EntityTSmokeFX(worldObj);
|
||||
smoke.posX = xCoord + 0.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posY = yCoord + 1.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posZ = zCoord - 4.25;
|
||||
smoke.motionX = rand.nextGaussian() * 0.3;
|
||||
smoke.motionY = rand.nextGaussian() * 0.3;
|
||||
smoke.motionZ = -2.5 - (rand.nextFloat() * 3.5);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(smoke);
|
||||
}
|
||||
|
||||
//Exhaust push
|
||||
List<Entity> list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ - 12, posX + 1.5, posY + 3, posZ - 4.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionZ -= 0.5;
|
||||
}
|
||||
|
||||
//Intake pull
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ + 4.5, posX + 1.5, posY + 3, posZ + 12));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionZ -= 0.5;
|
||||
}
|
||||
|
||||
//Intake kill
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 1.5, posY, posZ + 4.5, posX + 1.5, posY + 3, posZ + 5.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.attackEntityFrom(ModDamageSource.turbofan, 1000);
|
||||
}
|
||||
}
|
||||
if(meta == 4) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
EntityTSmokeFX smoke = new EntityTSmokeFX(worldObj);
|
||||
smoke.posX = xCoord + 4.25;
|
||||
smoke.posY = yCoord + 1.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posZ = zCoord + 0.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.motionX = 2.5 + (rand.nextFloat() * 3.5);
|
||||
smoke.motionY = rand.nextGaussian() * 0.3;
|
||||
smoke.motionZ = rand.nextGaussian() * 0.3;
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(smoke);
|
||||
}
|
||||
|
||||
//Exhaust push
|
||||
List<Entity> list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX + 4.5, posY, posZ - 1.5, posX + 12, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionX += 0.5;
|
||||
}
|
||||
|
||||
//Intake pull
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 12, posY, posZ - 1.5, posX - 4.5, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionX += 0.5;
|
||||
}
|
||||
|
||||
//Intake kill
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 5.5, posY, posZ - 1.5, posX - 4.5, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.attackEntityFrom(ModDamageSource.turbofan, 1000);
|
||||
}
|
||||
}
|
||||
if(meta == 5) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
EntityTSmokeFX smoke = new EntityTSmokeFX(worldObj);
|
||||
smoke.posX = xCoord - 4.25;
|
||||
smoke.posY = yCoord + 1.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.posZ = zCoord + 0.5 + (rand.nextGaussian() * 0.5);
|
||||
smoke.motionX = -2.5 - (rand.nextFloat() * 3.5);
|
||||
smoke.motionY = rand.nextGaussian() * 0.3;
|
||||
smoke.motionZ = rand.nextGaussian() * 0.3;
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(smoke);
|
||||
}
|
||||
|
||||
//Exhaust push
|
||||
List<Entity> list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX - 12, posY, posZ - 1.5, posX - 4.5, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionX -= 0.5;
|
||||
}
|
||||
|
||||
//Intake pull
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX + 4.5, posY, posZ - 1.5, posX + 12, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.motionX -= 0.5;
|
||||
}
|
||||
|
||||
//Intake kill
|
||||
list = (List<Entity>)worldObj.getEntitiesWithinAABBExcludingEntity(null,
|
||||
AxisAlignedBB.getBoundingBox(posX + 4.5, posY, posZ - 1.5, posX + 5.5, posY + 3, posZ + 1.5));
|
||||
|
||||
for(Entity e : list) {
|
||||
e.attackEntityFrom(ModDamageSource.turbofan, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ffgeua(int x, int y, int z, boolean newTact) {
|
||||
|
||||
Library.ffgeua(x, y, z, newTact, this, worldObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ffgeuaInit() {
|
||||
ffgeua(this.xCoord + 2, this.yCoord + 1, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord + 2, this.yCoord + 1, this.zCoord + 1, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord + 1, this.zCoord + 2, getTact());
|
||||
ffgeua(this.xCoord - 1, this.yCoord + 1, this.zCoord + 2, getTact());
|
||||
ffgeua(this.xCoord - 2, this.yCoord + 1, this.zCoord + 1, getTact());
|
||||
ffgeua(this.xCoord - 2, this.yCoord + 1, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord - 1, this.yCoord + 1, this.zCoord - 2, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord + 1, this.zCoord - 2, getTact());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if (age >= 0 && age < 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSPower(int i) {
|
||||
this.power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IConsumer> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearList() {
|
||||
this.list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxAFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user