Changed how batteries work, added energy cells

This commit is contained in:
HbmMods 2017-06-01 09:07:35 +02:00
parent 0f45390bf5
commit f67fe7a19d
25 changed files with 620 additions and 49 deletions

View File

@ -441,9 +441,23 @@ item.powder_actinium.name=Actiniumstaub
item.battery_generic.name=Batterie
item.battery_advanced.name=Fortgeschrittene Batterie
item.battery_lithium.name=Lithium-Ionen-Batterie
item.battery_schrabidium.name=Schrabidiumbatterie
item.battery_creative.name=Unendliche Batterie
item.battery_red_cell.name=Redstone-Energiezelle
item.battery_advanced_cell.name=Fortgeschrittene Energiezelle
item.battery_lithium_cell.name=Lithium-Ionen-Energiezelle
item.battery_schrabidium_cell.name=Schrabidium-Energiezelle
item.battery_red_cell_6.name=Sechsfache Redstone-Energiezelle
item.battery_advanced_cell_4.name=Vierfache fortgeschrittene Energiezelle
item.battery_lithium_cell_3.name=Dreifache Lithium-Ionen-Energiezelle
item.battery_schrabidium_cell_2.name=Doppelte Schrabidium-Energiezelle
item.battery_red_cell_24.name=24-fache Redstone-Energiezelle
item.battery_advanced_cell_12.name=Zwölffache fortgeschrittene Energiezelle
item.battery_lithium_cell_6.name=Sechsfache Lithium-Ionen-Energiezelle
item.battery_schrabidium_cell_4.name=Vierfache Schrabidium-Energiezelle
item.fusion_core.name=Fusionskern
item.energy_core.name=Selbstgebauter Energiekern

View File

@ -441,9 +441,23 @@ item.powder_actinium.name=Actinium Powder
item.battery_generic.name=Battery
item.battery_advanced.name=Advanced Battery
item.battery_lithium.name=Lithium-Ion Battery
item.battery_schrabidium.name=Schrabidium Battery
item.battery_creative.name=Infinite Battery
item.battery_red_cell.name=Redstone Power Cell
item.battery_advanced_cell.name=Advanced Power Cell
item.battery_lithium_cell.name=Lithium-Ion Power Cell
item.battery_schrabidium_cell.name=Schrabidium Power Cell
item.battery_red_cell_6.name=Sixfold Redstone Power Cell
item.battery_advanced_cell_4.name=Quadruple Advanced Power Cell
item.battery_lithium_cell_3.name=Tripple Lithium-Ion Power Cell
item.battery_schrabidium_cell_2.name=Double Schrabidium Power Cell
item.battery_red_cell_24.name=24-Fold Redstone Power Cell
item.battery_advanced_cell_12.name=Twelvefold Advanced Power Cell
item.battery_lithium_cell_6.name=Sixfold Lithium-Ion Power Cell
item.battery_schrabidium_cell_4.name=Quadruple Schrabidium Power Cell
item.fusion_core.name=Fusion Core
item.energy_core.name=Makeshift Energy Core

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

View File

@ -0,0 +1,203 @@
package com.hbm.entity.item;
import com.hbm.blocks.ModBlocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRailBase;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class EntityMinecartTest extends EntityMinecart
{
private int minecartTNTFuse = -1;
private static final String __OBFID = "CL_00001680";
public EntityMinecartTest(World p_i1727_1_)
{
super(p_i1727_1_);
}
public EntityMinecartTest(World p_i1728_1_, double p_i1728_2_, double p_i1728_4_, double p_i1728_6_)
{
super(p_i1728_1_, p_i1728_2_, p_i1728_4_, p_i1728_6_);
}
public int getMinecartType()
{
return 9;
}
public Block func_145817_o()
{
return ModBlocks.crate;
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
super.onUpdate();
if (this.minecartTNTFuse > 0)
{
--this.minecartTNTFuse;
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
}
else if (this.minecartTNTFuse == 0)
{
this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ);
}
if (this.isCollidedHorizontally)
{
double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ;
if (d0 >= 0.009999999776482582D)
{
this.explodeCart(d0);
}
}
}
public void killMinecart(DamageSource p_94095_1_)
{
super.killMinecart(p_94095_1_);
double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ;
if (!p_94095_1_.isExplosion())
{
this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F);
}
if (p_94095_1_.isFireDamage() || p_94095_1_.isExplosion() || d0 >= 0.009999999776482582D)
{
this.explodeCart(d0);
}
}
/**
* Makes the minecart explode.
*/
protected void explodeCart(double p_94103_1_)
{
if (!this.worldObj.isRemote)
{
double d1 = Math.sqrt(p_94103_1_);
if (d1 > 5.0D)
{
d1 = 5.0D;
}
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * d1), true);
this.setDead();
}
}
/**
* Called when the mob is falling. Calculates and applies fall damage.
*/
protected void fall(float p_70069_1_)
{
if (p_70069_1_ >= 3.0F)
{
float f1 = p_70069_1_ / 10.0F;
this.explodeCart((double)(f1 * f1));
}
super.fall(p_70069_1_);
}
/**
* Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power
*/
public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_)
{
if (p_96095_4_ && this.minecartTNTFuse < 0)
{
this.ignite();
}
}
@SideOnly(Side.CLIENT)
public void handleHealthUpdate(byte p_70103_1_)
{
if (p_70103_1_ == 10)
{
this.ignite();
}
else
{
super.handleHealthUpdate(p_70103_1_);
}
}
/**
* Ignites this TNT cart.
*/
public void ignite()
{
this.minecartTNTFuse = 80;
if (!this.worldObj.isRemote)
{
this.worldObj.setEntityState(this, (byte)10);
this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F);
}
}
@SideOnly(Side.CLIENT)
public int func_94104_d()
{
return this.minecartTNTFuse;
}
/**
* Returns true if the TNT minecart is ignited.
*/
public boolean isIgnited()
{
return this.minecartTNTFuse > -1;
}
public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_)
{
return this.isIgnited() && (BlockRailBase.func_150051_a(p_145772_6_) || BlockRailBase.func_150049_b_(p_145772_2_, p_145772_3_, p_145772_4_ + 1, p_145772_5_)) ? 0.0F : super.func_145772_a(p_145772_1_, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, p_145772_6_);
}
public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_)
{
return this.isIgnited() && (BlockRailBase.func_150051_a(p_145774_6_) || BlockRailBase.func_150049_b_(p_145774_2_, p_145774_3_, p_145774_4_ + 1, p_145774_5_)) ? false : super.func_145774_a(p_145774_1_, p_145774_2_, p_145774_3_, p_145774_4_, p_145774_5_, p_145774_6_, p_145774_7_);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
super.readEntityFromNBT(p_70037_1_);
if (p_70037_1_.hasKey("TNTFuse", 99))
{
this.minecartTNTFuse = p_70037_1_.getInteger("TNTFuse");
}
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
super.writeEntityToNBT(p_70014_1_);
p_70014_1_.setInteger("TNTFuse", this.minecartTNTFuse);
}
}

View File

@ -715,9 +715,23 @@ public class ModItems {
public static Item battery_generic;
public static Item battery_advanced;
public static Item battery_lithium;
public static Item battery_schrabidium;
public static Item battery_creative;
public static Item battery_red_cell;
public static Item battery_red_cell_6;
public static Item battery_red_cell_24;
public static Item battery_advanced_cell;
public static Item battery_advanced_cell_4;
public static Item battery_advanced_cell_12;
public static Item battery_lithium_cell;
public static Item battery_lithium_cell_3;
public static Item battery_lithium_cell_6;
public static Item battery_schrabidium_cell;
public static Item battery_schrabidium_cell_2;
public static Item battery_schrabidium_cell_4;
public static Item fusion_core;
public static Item energy_core;
public static Item fuse;
@ -1591,9 +1605,23 @@ public class ModItems {
battery_generic = new ItemBattery(50).setUnlocalizedName("battery_generic").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_generic");
battery_advanced = new ItemBattery(200).setUnlocalizedName("battery_advanced").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_advanced");
battery_lithium = new ItemBattery(2500).setUnlocalizedName("battery_lithium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_lithium");
battery_schrabidium = new ItemBattery(10000).setUnlocalizedName("battery_schrabidium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_schrabidium");
battery_creative = new Item().setUnlocalizedName("battery_creative").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_creative");
battery_red_cell = new ItemBattery(150).setUnlocalizedName("battery_red_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_red_cell");
battery_red_cell_6 = new ItemBattery(150 * 6).setUnlocalizedName("battery_red_cell_6").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_red_cell_6");
battery_red_cell_24 = new ItemBattery(150 * 24).setUnlocalizedName("battery_red_cell_24").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_red_cell_24");
battery_advanced_cell = new ItemBattery(600).setUnlocalizedName("battery_advanced_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_advanced_cell");
battery_advanced_cell_4 = new ItemBattery(600 * 4).setUnlocalizedName("battery_advanced_cell_4").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_advanced_cell_4");
battery_advanced_cell_12 = new ItemBattery(600 * 12).setUnlocalizedName("battery_advanced_cell_12").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_advanced_cell_12");
battery_lithium_cell = new ItemBattery(7500).setUnlocalizedName("battery_lithium_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_lithium_cell");
battery_lithium_cell_3 = new ItemBattery(7500 * 3).setUnlocalizedName("battery_lithium_cell_3").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_lithium_cell_3");
battery_lithium_cell_6 = new ItemBattery(7500 * 6).setUnlocalizedName("battery_lithium_cell_6").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_lithium_cell_6");
battery_schrabidium_cell = new ItemBattery(30000).setUnlocalizedName("battery_schrabidium_cell").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_schrabidium_cell");
battery_schrabidium_cell_2 = new ItemBattery(30000 * 2).setUnlocalizedName("battery_schrabidium_cell_2").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_schrabidium_cell_2");
battery_schrabidium_cell_4 = new ItemBattery(30000 * 4).setUnlocalizedName("battery_schrabidium_cell_4").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_schrabidium_cell_4");
fusion_core = new ItemBattery(5000).setUnlocalizedName("fusion_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fusion_core");
energy_core = new ItemBattery(5000).setUnlocalizedName("energy_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":energy_core");
fuse = new ItemCustomLore().setUnlocalizedName("fuse").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fuse");
@ -2225,8 +2253,21 @@ public class ModItems {
//Batteries
GameRegistry.registerItem(battery_generic, battery_generic.getUnlocalizedName());
GameRegistry.registerItem(battery_red_cell, battery_red_cell.getUnlocalizedName());
GameRegistry.registerItem(battery_red_cell_6, battery_red_cell_6.getUnlocalizedName());
GameRegistry.registerItem(battery_red_cell_24, battery_red_cell_24.getUnlocalizedName());
GameRegistry.registerItem(battery_advanced, battery_advanced.getUnlocalizedName());
GameRegistry.registerItem(battery_advanced_cell, battery_advanced_cell.getUnlocalizedName());
GameRegistry.registerItem(battery_advanced_cell_4, battery_advanced_cell_4.getUnlocalizedName());
GameRegistry.registerItem(battery_advanced_cell_12, battery_advanced_cell_12.getUnlocalizedName());
GameRegistry.registerItem(battery_lithium, battery_lithium.getUnlocalizedName());
GameRegistry.registerItem(battery_lithium_cell, battery_lithium_cell.getUnlocalizedName());
GameRegistry.registerItem(battery_lithium_cell_3, battery_lithium_cell_3.getUnlocalizedName());
GameRegistry.registerItem(battery_lithium_cell_6, battery_lithium_cell_6.getUnlocalizedName());
GameRegistry.registerItem(battery_schrabidium, battery_schrabidium.getUnlocalizedName());
GameRegistry.registerItem(battery_schrabidium_cell, battery_schrabidium_cell.getUnlocalizedName());
GameRegistry.registerItem(battery_schrabidium_cell_2, battery_schrabidium_cell_2.getUnlocalizedName());
GameRegistry.registerItem(battery_schrabidium_cell_4, battery_schrabidium_cell_4.getUnlocalizedName());
GameRegistry.registerItem(battery_creative, battery_creative.getUnlocalizedName());
GameRegistry.registerItem(fusion_core, fusion_core.getUnlocalizedName());
GameRegistry.registerItem(energy_core, energy_core.getUnlocalizedName());

View File

@ -8,23 +8,29 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ItemBattery extends Item {
private long maxCharge;
public ItemBattery(int dura) {
this.setMaxDamage(dura);
this.setNoRepair();
this.maxCharge = dura;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
long charge = maxCharge;
if(itemstack.hasTagCompound())
charge = this.getCharge(itemstack);
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced && itemstack.getItem() != ModItems.energy_core)
{
list.add("Energy stored: " + ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) + " HE");
list.add("Energy stored: " + (charge * 100) + " HE");
} else {
int charge = ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) / this.getMaxDamage();
list.add("Charge: " + charge + "%");
long charge1 = (charge * 100) / this.maxCharge;
list.add("Charge: " + charge1 + "%");
}
}
@ -44,4 +50,55 @@ public class ItemBattery extends Item {
return EnumRarity.common;
}
public void chargeBattery(ItemStack stack, int i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void setCharge(ItemStack stack, int i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", i);
}
}
}
public void dischargeBattery(ItemStack stack, int i) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", this.maxCharge - i);
}
}
}
public long getCharge(ItemStack stack) {
if(stack.getItem() instanceof ItemBattery) {
if(stack.hasTagCompound()) {
return stack.stackTagCompound.getLong("charge");
} else {
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setLong("charge", this.maxCharge);
return stack.stackTagCompound.getLong("charge");
}
}
return 0;
}
public long getMaxCharge() {
return maxCharge;
}
}

View File

@ -20,6 +20,7 @@ import com.hbm.interfaces.IOilAcceptor;
import com.hbm.interfaces.IOilSource;
import com.hbm.interfaces.ISource;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityCable;
import com.hbm.tileentity.TileEntityGasDuct;
@ -495,38 +496,114 @@ public class Library {
public static int chargeItemsFromTE(ItemStack[] slots, int index, int power, int maxPower) {
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && slots[index].getItemDamage() > 0)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell_6 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell_24 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
}
for(int i = 0; i < 5; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() > 0)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 5; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 5; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell_4 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 5; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell_12 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell_3 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell_6 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() > 0)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell_2 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell_4 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && slots[index].getItemDamage() > 0)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && slots[index].getItemDamage() > 0)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 50; i++)
@ -567,38 +644,114 @@ public class Library {
return maxPower;
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && slots[index].getItemDamage() < 50)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell_6 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_red_cell_24 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
}
for(int i = 0; i < 5; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() < 200)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() < 10000)
for(int i = 0; i < 5; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 25; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && slots[index].getItemDamage() < 5000)
for(int i = 0; i < 5; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell_4 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 5; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced_cell_12 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && slots[index].getItemDamage() < 5000)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell_3 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_lithium_cell_6 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell_2 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium_cell_4 && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 25; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && ((ItemBattery)slots[index].getItem()).getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
return power;

View File

@ -34,6 +34,7 @@ import com.hbm.entity.grenade.EntityGrenadeShrapnel;
import com.hbm.entity.grenade.EntityGrenadeStrong;
import com.hbm.entity.grenade.EntityGrenadeTau;
import com.hbm.entity.grenade.EntityGrenadeZOMG;
import com.hbm.entity.item.EntityMinecartTest;
import com.hbm.entity.missile.EntityMIRV;
import com.hbm.entity.missile.EntityMissileAntiBallistic;
import com.hbm.entity.missile.EntityMissileBunkerBuster;
@ -103,6 +104,7 @@ import com.hbm.render.entity.RenderFireball;
import com.hbm.render.entity.RenderFlare;
import com.hbm.render.entity.RenderHunterChopper;
import com.hbm.render.entity.RenderLN2;
import com.hbm.render.entity.RenderMinecartTest;
import com.hbm.render.entity.RenderMiniMIRV;
import com.hbm.render.entity.RenderMiniNuke;
import com.hbm.render.entity.RenderMirv;
@ -378,6 +380,8 @@ public class ClientProxy extends ServerProxy
RenderingRegistry.registerEntityRenderingHandler(EntityMinerBeam.class, new RenderBeam3());
RenderingRegistry.registerEntityRenderingHandler(EntityLN2.class, new RenderLN2(ModItems.energy_ball));
RenderingRegistry.registerEntityRenderingHandler(EntityMinecartTest.class, new RenderMinecartTest());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukePrototype.class, new RenderNukePrototype());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRedBarrel.class, new RenderRedBarrel());

View File

@ -481,13 +481,13 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_furnace), 1), new Object[] { "HMH", "MFM", "HMH", 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 'M', ModItems.motor, 'F', Item.getItemFromBlock(Blocks.furnace) });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_conductor), 1), new Object[] { "SWS", "FFF", "SWS", 'S', "ingotTitanium", 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'F', ModItems.fuse }));
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_core), 1), new Object[] { "HPH", "PCP", "HPH", 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 'C', ModItems.circuit_aluminium, 'P', Item.getItemFromBlock(Blocks.piston) });
GameRegistry.addRecipe(new ItemStack(ModItems.factory_core_titanium, 1, ModItems.factory_core_titanium.getMaxDamage()), new Object[] { "BRB", "RHR", "BRB", 'B', new ItemStack(ModItems.battery_generic, 1, ModItems.battery_generic.getMaxDamage()), 'R', Item.getItemFromBlock(Blocks.redstone_block), 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull) });
GameRegistry.addRecipe(new ItemStack(ModItems.factory_core_titanium, 1, ModItems.factory_core_titanium.getMaxDamage()), new Object[] { "BRB", "RHR", "BRB", 'B', ModItems.battery_generic, 'R', Item.getItemFromBlock(Blocks.redstone_block), 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull) });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', ModItems.plate_advanced_alloy, 'I', ModItems.ingot_advanced_alloy });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_furnace), 1), new Object[] { "HMH", "MFM", "HMH", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 'M', ModItems.motor, 'F', Item.getItemFromBlock(Blocks.furnace) });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_conductor), 1), new Object[] { "SWS", "FFF", "SWS", 'S', ModItems.ingot_advanced_alloy, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'F', ModItems.fuse });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_core), 1), new Object[] { "HPH", "PCP", "HPH", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 'C', ModItems.circuit_red_copper, 'P', Item.getItemFromBlock(Blocks.piston) });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.factory_core_advanced, 1, ModItems.factory_core_advanced.getMaxDamage()), new Object[] { "BLB", "SHS", "BLB", 'B', new ItemStack(ModItems.battery_advanced, 1, ModItems.battery_advanced.getMaxDamage()), 'S', "blockSulfur", 'L', "blockLead", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.factory_core_advanced, 1, ModItems.factory_core_advanced.getMaxDamage()), new Object[] { "BSB", "LHL", "BSB", 'B', new ItemStack(ModItems.battery_advanced, 1, ModItems.battery_advanced.getMaxDamage()), 'S', "blockSulfur", 'L', "blockLead", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.factory_core_advanced), new Object[] { "BLB", "SHS", "BLB", 'B', ModItems.battery_advanced, 'S', "blockSulfur", 'L', "blockLead", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.factory_core_advanced), new Object[] { "BSB", "LHL", "BSB", 'B', ModItems.battery_advanced, 'S', "blockSulfur", 'L', "blockLead", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.fuse, 1), new Object[] { " S ", "GAG", " S ", 'S', "plateSteel", 'G', Item.getItemFromBlock(Blocks.glass_pane), 'A', ModItems.wire_aluminium }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.redcoil_capacitor, 1), new Object[] { "PFP", "CBC", "CBC", 'P', "plateGold", 'B', Item.getItemFromBlock(Blocks.redstone_block), 'C', ModItems.coil_advanced_alloy, 'F', ModItems.fuse }));
@ -762,16 +762,31 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(ModItems.fleija_propellant, 1), new Object[] { "PPP", "TST", "PPP", 'P', ModItems.plate_schrabidium, 'S', ModItems.ingot_schrabidium, 'T', Item.getItemFromBlock(Blocks.tnt) });
GameRegistry.addRecipe(new ItemStack(ModItems.fleija_core, 1), new Object[] { "NUU", "BHW", "NUU", 'N', ModItems.nugget_neptunium, 'B', ModItems.nugget_beryllium, 'U', ModItems.nugget_u235, 'H', ModItems.coil_copper, 'W', ModItems.wire_red_copper });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_generic, 1, 50), new Object[] { " A ", "PRP", "PRP", 'A', ModItems.wire_aluminium, 'P', "plateAluminum", 'R', Items.redstone }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1, 200), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "sulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1, 200), new Object[] { " A ", "PLP", "PSP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "sulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1, 200), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "dustSulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1, 200), new Object[] { " A ", "PLP", "PSP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "dustSulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ItemStack(ModItems.battery_schrabidium, 1, 10000), new Object[] { " A ", "PNP", "PSP", 'A', ModItems.wire_schrabidium, 'P', ModItems.plate_schrabidium, 'S', ModItems.powder_schrabidium, 'N', ModItems.powder_neptunium });
GameRegistry.addRecipe(new ItemStack(ModItems.battery_schrabidium, 1, 10000), new Object[] { " A ", "PSP", "PNP", 'A', ModItems.wire_schrabidium, 'P', ModItems.plate_schrabidium, 'S', ModItems.powder_schrabidium, 'N', ModItems.powder_neptunium });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_generic, 1), new Object[] { " A ", "PRP", "PRP", 'A', ModItems.wire_aluminium, 'P', "plateAluminum", 'R', Items.redstone }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "sulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1), new Object[] { " A ", "PLP", "PSP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "sulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1), new Object[] { " A ", "PSP", "PLP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "dustSulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced, 1), new Object[] { " A ", "PLP", "PSP", 'A', ModItems.wire_red_copper, 'P', "plateCopper", 'S', "dustSulfur", 'L', "dustLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_lithium, 1), new Object[] { "A A", "PSP", "PLP", 'A', ModItems.wire_gold, 'P', "plateTitanium", 'S', "dustLithium", 'L', ModItems.powder_cobalt }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_lithium, 1), new Object[] { "A A", "PLP", "PSP", 'A', ModItems.wire_gold, 'P', "plateTitanium", 'S', "dustLithium", 'L', ModItems.powder_cobalt }));
GameRegistry.addRecipe(new ItemStack(ModItems.battery_schrabidium, 1), new Object[] { " A ", "PNP", "PSP", 'A', ModItems.wire_schrabidium, 'P', ModItems.plate_schrabidium, 'S', ModItems.powder_schrabidium, 'N', ModItems.powder_neptunium });
GameRegistry.addRecipe(new ItemStack(ModItems.battery_schrabidium, 1), new Object[] { " A ", "PSP", "PNP", 'A', ModItems.wire_schrabidium, 'P', ModItems.plate_schrabidium, 'S', ModItems.powder_schrabidium, 'N', ModItems.powder_neptunium });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.energy_core, 1), new Object[] { "PCW", "TRD", "PCW", 'P', ModItems.plate_advanced_alloy, 'C', ModItems.coil_advanced_alloy, 'W', ModItems.wire_advanced_alloy, 'R', ModItems.cell_tritium, 'D', ModItems.cell_deuterium, 'T', "ingotTungsten" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.energy_core, 1), new Object[] { "PCW", "TDR", "PCW", 'P', ModItems.plate_advanced_alloy, 'C', ModItems.coil_advanced_alloy, 'W', ModItems.wire_advanced_alloy, 'R', ModItems.cell_tritium, 'D', ModItems.cell_deuterium, 'T', "ingotTungsten" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_red_cell, 1), new Object[] { "WBW", "PBP", "WBW", 'W', ModItems.wire_aluminium, 'P', "plateAluminum", 'B', ModItems.battery_generic }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced_cell, 1), new Object[] { "WBW", "PBP", "WBW", 'W', ModItems.wire_red_copper, 'P', "plateCopper", 'B', ModItems.battery_advanced }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_lithium_cell, 1), new Object[] { "WBW", "PBP", "WBW", 'W', ModItems.wire_gold, 'P', "plateTitanium", 'B', ModItems.battery_lithium }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_schrabidium_cell, 1), new Object[] { "WBW", "PBP", "WBW", 'W', ModItems.wire_schrabidium, 'P', "plateSchrabidium", 'B', ModItems.battery_schrabidium }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_red_cell_6, 1), new Object[] { "BBB", "WPW", "BBB", 'W', ModItems.wire_aluminium, 'P', "plateAluminum", 'B', ModItems.battery_red_cell }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced_cell_4, 1), new Object[] { "BWB", "WPW", "BWB", 'W', ModItems.wire_red_copper, 'P', "plateCopper", 'B', ModItems.battery_advanced_cell }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_lithium_cell_3, 1), new Object[] { "WPW", "BBB", "WPW", 'W', ModItems.wire_gold, 'P', "plateTitanium", 'B', ModItems.battery_lithium_cell }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_schrabidium_cell_2, 1), new Object[] { "WPW", "BWB", "WPW", 'W', ModItems.wire_schrabidium, 'P', "plateSchrabidium", 'B', ModItems.battery_schrabidium_cell }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_red_cell_24, 1), new Object[] { "BWB", "WPW", "BWB", 'W', ModItems.wire_aluminium, 'P', "plateAluminum", 'B', ModItems.battery_red_cell_6 }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_advanced_cell_12, 1), new Object[] { "WPW", "BBB", "WPW", 'W', ModItems.wire_red_copper, 'P', "plateCopper", 'B', ModItems.battery_advanced_cell_4 }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_lithium_cell_6, 1), new Object[] { "WPW", "BWB", "WPW", 'W', ModItems.wire_gold, 'P', "plateTitanium", 'B', ModItems.battery_lithium_cell_3 }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.battery_schrabidium_cell_4, 1), new Object[] { "WPW", "BWB", "WPW", 'W', ModItems.wire_schrabidium, 'P', "plateSchrabidium", 'B', ModItems.battery_schrabidium_cell_2 }));
GameRegistry.addRecipe(new ItemStack(ModItems.schrabidium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.ingot_schrabidium });
GameRegistry.addRecipe(new ItemStack(ModItems.schrabidium_plate, 1), new Object[] { "E E", "EEE", "EEE", 'E', ModItems.ingot_schrabidium });
GameRegistry.addRecipe(new ItemStack(ModItems.schrabidium_legs, 1), new Object[] { "EEE", "E E", "E E", 'E', ModItems.ingot_schrabidium });

View File

@ -55,6 +55,7 @@ import com.hbm.entity.grenade.EntityGrenadeShrapnel;
import com.hbm.entity.grenade.EntityGrenadeStrong;
import com.hbm.entity.grenade.EntityGrenadeTau;
import com.hbm.entity.grenade.EntityGrenadeZOMG;
import com.hbm.entity.item.EntityMinecartTest;
import com.hbm.entity.logic.EntityNukeExplosion;
import com.hbm.entity.logic.EntityNukeExplosionAdvanced;
import com.hbm.entity.logic.EntityNukeExplosionPlus;
@ -474,6 +475,7 @@ public class MainRegistry
EntityRegistry.registerModEntity(EntityOilSpill.class, "entity_oil_spill", 73, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGasFX.class, "entity_spill_fx", 74, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGasFlameFX.class, "entity_gasflame_fx", 75, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityMinecartTest.class, "entity_minecart_test", 76, 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);

View File

@ -0,0 +1,66 @@
package com.hbm.render.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.entity.RenderMinecart;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartTNT;
import net.minecraft.init.Blocks;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.item.EntityMinecartTest;
public class RenderMinecartTest extends RenderMinecart
{
private static final String __OBFID = "CL_00001029";
protected void func_147910_a(EntityMinecartTest p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_)
{
int j = p_147910_1_.func_94104_d();
if (j > -1 && (float)j - p_147910_2_ + 1.0F < 10.0F)
{
float f1 = 1.0F - ((float)j - p_147910_2_ + 1.0F) / 10.0F;
if (f1 < 0.0F)
{
f1 = 0.0F;
}
if (f1 > 1.0F)
{
f1 = 1.0F;
}
f1 *= f1;
f1 *= f1;
float f2 = 1.0F + f1 * 0.3F;
GL11.glScalef(f2, f2, f2);
}
super.func_147910_a(p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_);
if (j > -1 && j / 5 % 2 == 0)
{
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, (1.0F - ((float)j - p_147910_2_ + 1.0F) / 100.0F) * 0.8F);
GL11.glPushMatrix();
this.field_94145_f.renderBlockAsItem(ModBlocks.crate, 0, 1.0F);
GL11.glPopMatrix();
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);
}
}
protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_)
{
this.func_147910_a((EntityMinecartTest)p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_);
}
}

View File

@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFactory;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
@ -20,7 +21,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
public int power = 0;
public int soundCycle = 0;
public final static int processTime = 100;
public final static int maxPower = ModItems.factory_core_advanced.getMaxDamage();
public final static int maxPower = (int)((ItemBattery)ModItems.factory_core_advanced).getMaxCharge();
private ItemStack slots[];
private String customName;
@ -230,7 +231,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
public void updateEntity() {
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_advanced)
{
this.power = ModItems.factory_core_advanced.getMaxDamage() - this.slots[22].getItemDamage();
this.power = (int) ((ItemBattery)ModItems.factory_core_advanced).getCharge(slots[22]);
} else {
this.power = 0;
}
@ -370,7 +371,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
if(this.power > 0 && (isProcessable(slots[9]) || isProcessable(slots[10]) || isProcessable(slots[23]) || isProcessable(slots[24])) && isStructureValid(worldObj))
{
this.progress += 1;
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
((ItemBattery)slots[22].getItem()).dischargeBattery(slots[22], 1);
if(soundCycle == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 0.75F);
soundCycle++;
@ -631,7 +632,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
public void setPower(int i) {
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_advanced)
{
slots[22].setItemDamage(maxPower - i);
((ItemBattery)slots[22].getItem()).setCharge(slots[22], i);
}
}
@Override

View File

@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFactory;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -21,7 +22,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
public int power = 0;
public int soundCycle = 0;
public final static int processTime = 200;
public final static int maxPower = ModItems.factory_core_titanium.getMaxDamage();
public final static int maxPower = (int)((ItemBattery)ModItems.factory_core_titanium).getMaxCharge();
private ItemStack slots[];
private String customName;
@ -231,7 +232,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
public void updateEntity() {
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_titanium)
{
this.power = ModItems.factory_core_titanium.getMaxDamage() - this.slots[22].getItemDamage();
this.power = (int) ((ItemBattery)ModItems.factory_core_titanium).getCharge(slots[22]);
} else {
this.power = 0;
}
@ -305,7 +306,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
if(this.power > 0 && (isProcessable(slots[9]) || isProcessable(slots[10])) && isStructureValid(worldObj))
{
this.progress += 1;
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
((ItemBattery)slots[22].getItem()).dischargeBattery(slots[22], 1);
if(soundCycle == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 0.75F);
soundCycle++;
@ -446,7 +447,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
public void setPower(int i) {
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_titanium)
{
slots[22].setItemDamage(maxPower - i);
((ItemBattery)slots[22].getItem()).setCharge(slots[22], i);
}
}
@Override