diff --git a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt index 51ac53d5c..9179031c3 100644 --- a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt +++ b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt @@ -77,7 +77,7 @@ -Ring of Aquadive: Fast underwater movement -Ring of Suction: Sucks up Items in the area -Ring of Water Absorption: Removes Water around - -Ring of Striptease (Or something like that): Attacker lose parts of their Armor + -Ring of Unarmoring: Attacker lose parts of their Armor -Food Cannon -Shoots Food Items diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java index e13662db8..679f7048b 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java @@ -1,5 +1,6 @@ package ellpeck.actuallyadditions.inventory; +import cofh.api.energy.IEnergyContainerItem; import ellpeck.actuallyadditions.inventory.slot.SlotImmovable; import ellpeck.actuallyadditions.items.ItemDrill; import ellpeck.actuallyadditions.items.ItemDrillUpgrade; @@ -26,7 +27,7 @@ public class ContainerDrill extends Container{ this.addSlotToContainer(new Slot(drillInventory, i, 44+i*18, 19){ @Override public boolean isItemValid(ItemStack stack){ - return stack.getItem() instanceof ItemDrillUpgrade; + return stack.getItem() instanceof ItemDrillUpgrade || stack.getItem() instanceof IEnergyContainerItem; } }); } @@ -86,7 +87,7 @@ public class ContainerDrill extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ //Shift from Inventory - if(newStack.getItem() instanceof ItemDrillUpgrade){ + if(newStack.getItem() instanceof ItemDrillUpgrade || newStack.getItem() instanceof IEnergyContainerItem){ if(!this.mergeItemStack(newStack, 0, 5, false)) return null; } // diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 899bd6748..4830e9642 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -90,6 +90,10 @@ public class InitItems{ public static Item itemDrillUpgradeBlockPlacing; public static Item itemBattery; + public static Item itemBatteryDouble; + public static Item itemBatteryTriple; + public static Item itemBatteryQuadruple; + public static Item itemBatteryQuintuple; public static Item itemTeleStaff; @@ -114,8 +118,12 @@ public class InitItems{ itemDrill = new ItemDrill(); ItemUtil.register(itemDrill); - itemBattery = new ItemBattery(); - ItemUtil.register(itemBattery); + itemBattery = new ItemBattery("itemBattery", 1000000, 5000); + itemBatteryDouble = new ItemBattery("itemBatteryDouble", 2000000, 10000); + itemBatteryTriple = new ItemBattery("itemBatteryTriple", 3000000, 15000); + itemBatteryQuadruple = new ItemBattery("itemBatteryQuadruple", 4000000, 20000); + itemBatteryQuintuple = new ItemBattery("itemBatteryQuintuple", 5000000, 25000); + ItemUtil.registerItems(new Item[]{itemBattery, itemBatteryDouble, itemBatteryTriple, itemBatteryQuadruple, itemBatteryQuintuple}); itemDrillUpgradeSpeed = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED, "itemDrillUpgradeSpeed"); itemDrillUpgradeSpeedII = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_II, "itemDrillUpgradeSpeedII"); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java index cc76e4cd9..e7f4f69ff 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java @@ -11,9 +11,12 @@ import net.minecraft.util.IIcon; public class ItemBattery extends ItemEnergy implements INameableItem{ - public ItemBattery(){ - super(1000000, 10000, 1); + private String name; + + public ItemBattery(String name, int capacity, int transfer){ + super(capacity, transfer, 1); this.setMaxStackSize(1); + this.name = name; } @Override @@ -34,6 +37,6 @@ public class ItemBattery extends ItemEnergy implements INameableItem{ @Override public String getName(){ - return "itemBattery"; + return name; } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index 6f623647d..95b5ed155 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -1,5 +1,6 @@ package ellpeck.actuallyadditions.items; +import cofh.api.energy.IEnergyContainerItem; import com.google.common.collect.Multimap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -15,6 +16,7 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -38,7 +40,7 @@ import java.util.Set; public class ItemDrill extends ItemEnergy implements INameableItem{ public ItemDrill(){ - super(500000, 5000, 3); + super(500000, 5000, 4); } public static float defaultEfficiency = ConfigFloatValues.DRILL_DAMAGE.getValue(); @@ -73,6 +75,26 @@ public class ItemDrill extends ItemEnergy implements INameableItem{ return false; } + public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ + NBTTagCompound compound = stack.getTagCompound(); + if(compound == null) return; + + ItemStack[] slots = this.getSlotsFromNBT(stack); + if(slots != null && slots.length > 0){ + for(ItemStack slotStack : slots){ + if(slotStack != null && slotStack.getItem() instanceof IEnergyContainerItem){ + if(this.getEnergyStored(stack) < this.getMaxEnergyStored(stack)){ + int energy = ((IEnergyContainerItem)slotStack.getItem()).getEnergyStored(slotStack); + if(energy > 0){ + int received = ((IEnergyContainerItem)stack.getItem()).receiveEnergy(stack, energy, false); + ((IEnergyContainerItem)slotStack.getItem()).extractEnergy(slotStack, received, false); + } + } + } + } + } + } + public float getEfficiencyFromUpgrade(ItemStack stack){ float efficiency = defaultEfficiency; if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED)){ diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index d9d74a6cb..bb84c199f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -23,6 +23,7 @@ item.actuallyadditions.itemDrill.name=Drill tooltip.actuallyadditions.itemDrill.desc.1=Mines all the Blocks! tooltip.actuallyadditions.itemDrill.desc.2=Powered by RF! Charge in an Energizer! Discharge in an Enervator! tooltip.actuallyadditions.itemDrill.desc.3=Drill Upgrades can be applied through Sneak-Right-Clicking! +tooltip.actuallyadditions.itemDrill.desc.4=Put in a filled Battery to make me recharge automatically! tile.actuallyadditions.blockMiscWoodCasing.name=Wood Casing tile.actuallyadditions.blockMiscStoneCasing.name=Stone Casing diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrange.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrange.png index 975d60c5d..29990eb36 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrange.png and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrange.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrangeOn.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrangeOn.png index 193e7d85e..77e382cfd 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrangeOn.png and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockColoredLampOrangeOn.png differ