🅱️attery

This commit is contained in:
Boblet 2024-08-19 16:38:29 +02:00
parent 2f727690b0
commit 680678b5b2
12 changed files with 40 additions and 34 deletions

View File

@ -1,16 +1,3 @@
## Changed
* To address certain balancing concerns, the RF to HE conversion rate is now 2:5. The HE to RF rate however is still 5:1
* Because of this, using chains of converters as batteries becomes exponentially lossy with size, therefore the input decay has been removed
* Input decay can still be configured if desired
* No input decay also means that converters are no longer infinite energy sinks
* Power converter recipes have been updated
* Soldering stations will no longer work if the recipe requires no input fluid while fluid is present
* While this does complicate using the soldering station manually, as switching from milgrade to standard ICs requires emptying the solderer with a siphon, it does make automating easier, since soldering stations will no longer treat incomplete milgrade circuits as ICs
* Cement is now edible
* Derricks have been remodeled, the port configuration has changed so existing derricks need to be replaced
* Derricks no longer spawn oil spills
* Metal deco blocks are now crafted in batches of 4, as well as recycled in batches of 4. Each block is therefore still worth 25% of an ingot, but recycling your own deco blocks is no longer lossy
## Fixed
* Fixed some machines not sending fluid gauge syncs properly
* Fixed refinery GUI crashing when invalid input is used
* Fixed pumpjack gauges not syncing properly
* Fixed some concrete variants not being revertable into uncolored concrete

View File

@ -18,6 +18,9 @@ public class ArmorModHandler {
public static final int cladding = 5;
public static final int kevlar = 6;
public static final int extra = 7;
public static final int battery = 8;
public static final int MOD_SLOTS = 9;
public static final UUID[] UUIDs = new UUID[] {
UUID.fromString("8d6e5c77-133e-4056-9c80-a9e42a1a0b65"),
@ -146,7 +149,7 @@ public class ArmorModHandler {
public static ItemStack[] pryMods(ItemStack armor) {
ItemStack[] slots = new ItemStack[8];
ItemStack[] slots = new ItemStack[MOD_SLOTS];
if(!hasMods(armor))
return slots;
@ -154,7 +157,7 @@ public class ArmorModHandler {
NBTTagCompound nbt = armor.getTagCompound();
NBTTagCompound mods = nbt.getCompoundTag(MOD_COMPOUND_KEY);
for(int i = 0; i < 8; i++) {
for(int i = 0; i < MOD_SLOTS; i++) {
NBTTagCompound cmp = mods.getCompoundTag(MOD_SLOT_KEY + i);

View File

@ -19,20 +19,21 @@ import net.minecraft.util.IIcon;
public class ContainerArmorTable extends Container {
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, 8);
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, ArmorModHandler.MOD_SLOTS);
public IInventory armor = new InventoryCraftResult();
public ContainerArmorTable(InventoryPlayer inventory) {
EntityPlayer player = inventory.player;
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.helmet_only, 26 + 22, 27)); // helmet only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62 + 22, 27)); // chestplate only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.legs_only, 98 + 22, 27)); // leggins only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.boots_only, 134 + 22, 45)); // boots only
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.servos, 134 + 22, 81)); //servos/frame
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.cladding, 98 + 22, 99)); //radiation cladding
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62 + 22, 99)); //kevlar/sapi/(ERA? :) )
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.extra, 26 + 22, 99)); //special parts
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.battery, 8 + 22, 63)); //special parts
this.addSlotToContainer(new Slot(armor, 0, 44 + 22, 63) {
@ -48,7 +49,7 @@ public class ContainerArmorTable extends Container {
if(stack != null) {
ItemStack[] mods = ArmorModHandler.pryMods(stack);
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
if(mods != null)
upgrades.setInventorySlotContents(i, mods[i]);
@ -65,7 +66,7 @@ public class ContainerArmorTable extends Container {
//if the armor piece is taken, absorb all armor pieces
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
ItemStack mod = upgrades.getStackInSlot(i);
@ -126,19 +127,19 @@ public class ContainerArmorTable extends Container {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 <= 8) {
if(par2 != 8 || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, 9, 13, false))
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
if(par2 <= ArmorModHandler.MOD_SLOTS) {
if(par2 != ArmorModHandler.MOD_SLOTS || !InventoryUtil.mergeItemStack(this.inventorySlots, var5, ArmorModHandler.MOD_SLOTS + 1, ArmorModHandler.MOD_SLOTS + 5, false))
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS + 5, this.inventorySlots.size(), true))
return null;
var4.onPickupFromSlot(p_82846_1_, var5);
} else {
if(var5.getItem() instanceof ItemArmor) {
if(!this.mergeItemStack(var5, 8, 9, false))
if(!this.mergeItemStack(var5, ArmorModHandler.MOD_SLOTS, ArmorModHandler.MOD_SLOTS + 1, false))
return null;
} else if(this.inventorySlots.get(8) != null && var5.getItem() instanceof ItemArmorMod) {
} else if(this.inventorySlots.get(ArmorModHandler.MOD_SLOTS) != null && var5.getItem() instanceof ItemArmorMod) {
ItemArmorMod mod = (ItemArmorMod)var5.getItem();
int slot = mod.type;

View File

@ -46,15 +46,16 @@ public class GUIArmorTable extends GuiInfoContainer {
"armorMod.type.cladding",
"armorMod.type.insert",
"armorMod.type.special",
"armorMod.type.battery",
"armorMod.insertHere"
};
for(int i = 0; i < 9; ++i) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS + 1; ++i) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
if(this.isMouseOverSlot(slot, x, y) && !slot.getHasStack()) {
this.drawCreativeTabHoveringText((i < 8 ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
this.drawCreativeTabHoveringText((i < ArmorModHandler.MOD_SLOTS ? EnumChatFormatting.LIGHT_PURPLE : EnumChatFormatting.YELLOW) + I18nUtil.resolveKey(unloc[i]), x, y);
}
}
}
@ -75,7 +76,7 @@ public class GUIArmorTable extends GuiInfoContainer {
this.drawTexturedModalRect(guiLeft + 22, guiTop, 0, 0, this.xSize - 22, this.ySize);
this.drawTexturedModalRect(guiLeft, guiTop + 31, 176, 96, 22, 100);
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
if(armor != null) {
@ -89,7 +90,7 @@ public class GUIArmorTable extends GuiInfoContainer {
this.drawTexturedModalRect(guiLeft + 41 + 22, guiTop + 60, 176, 52, 22, 22);
}
for(int i = 0; i < 8; i++) {
for(int i = 0; i < ArmorModHandler.MOD_SLOTS; i++) {
Slot slot = this.inventorySlots.getSlot(i);
drawIndicator(i, slot.xDisplayPosition - 1, slot.yDisplayPosition - 1);
}
@ -98,7 +99,7 @@ public class GUIArmorTable extends GuiInfoContainer {
private void drawIndicator(int index, int x, int y) {
ItemStack mod = this.inventorySlots.getSlot(index).getStack();
ItemStack armor = this.inventorySlots.getSlot(8).getStack();
ItemStack armor = this.inventorySlots.getSlot(ArmorModHandler.MOD_SLOTS).getStack();
if(mod == null)
return;

View File

@ -64,6 +64,7 @@ public class ItemArmorMod extends Item {
case ArmorModHandler.cladding: list.add(" " + I18nUtil.resolveKey("armorMod.type.cladding")); break;
case ArmorModHandler.kevlar: list.add(" " + I18nUtil.resolveKey("armorMod.type.insert")); break;
case ArmorModHandler.extra: list.add(" " + I18nUtil.resolveKey("armorMod.type.special")); break;
case ArmorModHandler.battery: list.add(" " + I18nUtil.resolveKey("armorMod.type.battery")); break;
}
}

View File

@ -0,0 +1,13 @@
package com.hbm.items.armor;
import com.hbm.handler.ArmorModHandler;
public class ItemModBattery extends ItemArmorMod {
public double mod;
public ItemModBattery(double mod) {
super(ArmorModHandler.battery, true, true, true, true);
this.mod = mod;
}
}

View File

@ -408,8 +408,8 @@ public class CraftingManager {
String dyeName = "dye" + dyes[15 - i];
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored, 8, i), new Object[] { "CCC", "CDC", "CCC", 'C', ModBlocks.concrete_smooth, 'D', dyeName });
}
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { ModBlocks.concrete_colored_ext });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored, 1, OreDictionary.WILDCARD_VALUE) });
addShapelessAuto(new ItemStack(ModBlocks.concrete_smooth, 1), new Object[] { new ItemStack(ModBlocks.concrete_colored_ext, 1, OreDictionary.WILDCARD_VALUE) });
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_GRAY });
addRecipeAuto(new ItemStack(ModBlocks.concrete_colored_ext, 6, EnumConcreteType.MACHINE_STRIPE.ordinal()), new Object[] { "CCC", "1 2", "CCC", 'C', ModBlocks.concrete_smooth, '1', KEY_BROWN, '2', KEY_BLACK });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B