diff --git a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseCell.java b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseCell.java index 24f47d1..e3a80dd 100644 --- a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseCell.java +++ b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseCell.java @@ -18,26 +18,28 @@ public abstract class DenseCell> extends BaseCell { protected final int capacity; protected final double idleDrain; protected final int bytesPerType; + protected final int type; - public DenseCell(Materials.MaterialType whichCell, int bytes) { - this(whichCell, bytes, 1, 16); + public DenseCell(Materials.MaterialType whichCell, int bytes, int type) { + this(whichCell, bytes, 1, 16, type); } - public DenseCell(Materials.MaterialType whichCell, int bytes, int bytesPerType) { - this(whichCell, bytes, bytesPerType, 16); + public DenseCell(Materials.MaterialType whichCell, int bytes, int bytesPerType, int type) { + this(whichCell, bytes, bytesPerType, 16, type); } - public DenseCell(Materials.MaterialType whichCell, int bytes, double idleDrain) { - this(whichCell, bytes, 1, idleDrain); + public DenseCell(Materials.MaterialType whichCell, int bytes, double idleDrain, int type) { + this(whichCell, bytes, 1, idleDrain, type); } - public DenseCell(Materials.MaterialType whichCell, int bytes, int bytesPerType, double idleDrain) { + public DenseCell(Materials.MaterialType whichCell, int bytes, int bytesPerType, double idleDrain, int type) { super(whichCell, bytes, bytesPerType, idleDrain); this.setMaxStackSize(1); this.component = whichCell; this.capacity = bytes; this.idleDrain = idleDrain; this.bytesPerType = bytesPerType; + this.type = type; } public IItemHandler getUpgradesInventory(ItemStack is) { @@ -55,7 +57,7 @@ public String getUnlocalizedGroupName(Set others, ItemStack is) { @Override public int getTotalTypes(@NotNull ItemStack cellItem) { - return CrazyAEConfig.cellItemsTypesAmt; + return this.type; } @Override diff --git a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseFluidCell.java b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseFluidCell.java index 1641346..38669fb 100644 --- a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseFluidCell.java +++ b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseFluidCell.java @@ -10,16 +10,16 @@ public class DenseFluidCell extends DenseCell { - public DenseFluidCell(Materials.MaterialType whichCell, int bytes) { - super(whichCell, bytes); + public DenseFluidCell(Materials.MaterialType whichCell, int bytes, int type) { + super(whichCell, bytes, type); } - public DenseFluidCell(Materials.MaterialType whichCell, int bytes, int bytesPerType) { - super(whichCell, bytes, bytesPerType, 16); + public DenseFluidCell(Materials.MaterialType whichCell, int bytes, int bytesPerType, int type) { + super(whichCell, bytes, bytesPerType, 16, type); } - public DenseFluidCell(Materials.MaterialType whichCell, int bytes, double idleDrain) { - super(whichCell, bytes, 1, idleDrain); + public DenseFluidCell(Materials.MaterialType whichCell, int bytes, double idleDrain, int type) { + super(whichCell, bytes, 1, idleDrain, type); } @NotNull @@ -30,6 +30,6 @@ public IFluidStorageChannel getChannel() { @Override public int getTotalTypes(@NotNull ItemStack cellItem) { - return CrazyAEConfig.cellFluidTypesAmt; + return this.type; } } diff --git a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseItemCell.java b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseItemCell.java index 1b7c1c4..ea8d27f 100644 --- a/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseItemCell.java +++ b/src/main/java/dev/beecube31/crazyae2/common/items/cells/storage/DenseItemCell.java @@ -8,16 +8,16 @@ public class DenseItemCell extends DenseCell { - public DenseItemCell(Materials.MaterialType whichCell, int bytes) { - super(whichCell, bytes); + public DenseItemCell(Materials.MaterialType whichCell, int bytes, int type) { + super(whichCell, bytes, type); } - public DenseItemCell(Materials.MaterialType whichCell, int bytes, int bytesPerType) { - super(whichCell, bytes, bytesPerType, 16); + public DenseItemCell(Materials.MaterialType whichCell, int bytes, int bytesPerType, int type) { + super(whichCell, bytes, bytesPerType, 16, type); } - public DenseItemCell(Materials.MaterialType whichCell, int bytes, double idleDrain) { - super(whichCell, bytes, 1, idleDrain); + public DenseItemCell(Materials.MaterialType whichCell, int bytes, double idleDrain, int type) { + super(whichCell, bytes, 1, idleDrain, type); } @NotNull diff --git a/src/main/java/dev/beecube31/crazyae2/common/registration/definitions/Items.java b/src/main/java/dev/beecube31/crazyae2/common/registration/definitions/Items.java index 62b1d36..ef777ca 100644 --- a/src/main/java/dev/beecube31/crazyae2/common/registration/definitions/Items.java +++ b/src/main/java/dev/beecube31/crazyae2/common/registration/definitions/Items.java @@ -24,6 +24,7 @@ import dev.beecube31.crazyae2.common.registration.registry.interfaces.Definitions; import dev.beecube31.crazyae2.core.CrazyAE; import dev.beecube31.crazyae2.core.CrazyAESidedHandler; +import dev.beecube31.crazyae2.core.config.CrazyAEConfig; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.item.ItemStack; @@ -192,35 +193,35 @@ public Items(Registry registry) { - this.storageCell256k = this.registerById(registry.item("storage_cell_256k", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_256K, 256 * 1024, 4D)) + this.storageCell256k = this.registerById(registry.item("storage_cell_256k", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_256K, 256 * 1024, 4D, CrazyAEConfig.storageCell256kTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.storageCell1mb = this.registerById(registry.item("storage_cell_1mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_1MB, 1024 * 1024, 6D)) + this.storageCell1mb = this.registerById(registry.item("storage_cell_1mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_1MB, 1024 * 1024, 6D, CrazyAEConfig.storageCell1mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.storageCell4mb = this.registerById(registry.item("storage_cell_4mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_4MB, 4096 * 1024, 8D)) + this.storageCell4mb = this.registerById(registry.item("storage_cell_4mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_4MB, 4096 * 1024, 8D, CrazyAEConfig.storageCell4mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.storageCell16mb = this.registerById(registry.item("storage_cell_16mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_16MB, 16384 * 1024, 12D)) + this.storageCell16mb = this.registerById(registry.item("storage_cell_16mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_16MB, 16384 * 1024, 12D, CrazyAEConfig.storageCell16mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.storageCell64mb = this.registerById(registry.item("storage_cell_64mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_64MB, 65536 * 1024, 24D)) + this.storageCell64mb = this.registerById(registry.item("storage_cell_64mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_64MB, 65536 * 1024, 24D, CrazyAEConfig.storageCell64mbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.storageCell256mb = this.registerById(registry.item("storage_cell_256mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_256MB, 262144 * 1024, 40D)) + this.storageCell256mb = this.registerById(registry.item("storage_cell_256mb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_256MB, 262144 * 1024, 40D, CrazyAEConfig.storageCell256mbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.storageCell1gb = this.registerById(registry.item("storage_cell_1gb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_1GB, 1048576 * 1024, 52D)) + this.storageCell1gb = this.registerById(registry.item("storage_cell_1gb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_1GB, 1048576 * 1024, 52D, CrazyAEConfig.storageCell1gbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.storageCell2gb = this.registerById(registry.item("storage_cell_2gb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_2GB, Integer.MAX_VALUE, 64D)) + this.storageCell2gb = this.registerById(registry.item("storage_cell_2gb", () -> new DenseItemCell(Materials.MaterialType.CELL_PART_2GB, Integer.MAX_VALUE, 64D, CrazyAEConfig.storageCell2gbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); @@ -406,35 +407,35 @@ public Items(Registry registry) { - this.fluidCell256k = this.registerById(registry.item("fluid_storage_cell_256k", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_256K, 256 * 1024, 4D)) + this.fluidCell256k = this.registerById(registry.item("fluid_storage_cell_256k", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_256K, 256 * 1024, 4D, CrazyAEConfig.fluidCell256kTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.fluidCell1mb = this.registerById(registry.item("fluid_storage_cell_1mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_1MB, 1024 * 1024, 6D)) + this.fluidCell1mb = this.registerById(registry.item("fluid_storage_cell_1mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_1MB, 1024 * 1024, 6D, CrazyAEConfig.fluidCell1mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.fluidCell4mb = this.registerById(registry.item("fluid_storage_cell_4mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_4MB, 4096 * 1024, 8D)) + this.fluidCell4mb = this.registerById(registry.item("fluid_storage_cell_4mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_4MB, 4096 * 1024, 8D, CrazyAEConfig.fluidCell4mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.fluidCell16mb = this.registerById(registry.item("fluid_storage_cell_16mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_16MB, 16384 * 1024, 12D)) + this.fluidCell16mb = this.registerById(registry.item("fluid_storage_cell_16mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_16MB, 16384 * 1024, 12D, CrazyAEConfig.fluidCell16mbTypeAmt)) .features(Features.DENSE_CELLS) .build()); - this.fluidCell64mb = this.registerById(registry.item("fluid_storage_cell_64mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_64MB, 65536 * 1024, 24D)) + this.fluidCell64mb = this.registerById(registry.item("fluid_storage_cell_64mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_64MB, 65536 * 1024, 24D, CrazyAEConfig.fluidCell64mbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.fluidCell256mb = this.registerById(registry.item("fluid_storage_cell_256mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_256MB, 262144 * 1024, 40D)) + this.fluidCell256mb = this.registerById(registry.item("fluid_storage_cell_256mb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_256MB, 262144 * 1024, 40D, CrazyAEConfig.fluidCell256mbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.fluidCell1gb = this.registerById(registry.item("fluid_storage_cell_1gb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_1GB, 1048576 * 1024, 52D)) + this.fluidCell1gb = this.registerById(registry.item("fluid_storage_cell_1gb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_1GB, 1048576 * 1024, 52D, CrazyAEConfig.fluidCell1gbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); - this.fluidCell2gb = this.registerById(registry.item("fluid_storage_cell_2gb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_2GB, Integer.MAX_VALUE, 64D)) + this.fluidCell2gb = this.registerById(registry.item("fluid_storage_cell_2gb", () -> new DenseFluidCell(Materials.MaterialType.CELL_FLUID_PART_2GB, Integer.MAX_VALUE, 64D, CrazyAEConfig.fluidCell2gbTypeAmt)) .features(Features.MEGA_DENSE_CELLS) .build()); diff --git a/src/main/java/dev/beecube31/crazyae2/core/config/CrazyAEConfig.java b/src/main/java/dev/beecube31/crazyae2/core/config/CrazyAEConfig.java index e750adf..261985a 100644 --- a/src/main/java/dev/beecube31/crazyae2/core/config/CrazyAEConfig.java +++ b/src/main/java/dev/beecube31/crazyae2/core/config/CrazyAEConfig.java @@ -1,6 +1,8 @@ package dev.beecube31.crazyae2.core.config; import dev.beecube31.crazyae2.Tags; +import dev.beecube31.crazyae2.common.features.Features; +import dev.beecube31.crazyae2.common.registration.definitions.Materials; import net.minecraftforge.common.config.Config; import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.common.config.Configuration; @@ -34,15 +36,87 @@ public final class CrazyAEConfig extends Configuration { @Config.RangeInt(min = 1) public static int QCMBoostAmt = 8; - @Config.Comment("Amount of types for Items Cells") - @Config.Name("cellItemsTypesAmt") + @Config.Comment("Amount of types for 256k Items Cells") + @Config.Name("storageCell256kTypeAmt") @Config.RangeInt(min = 1) - public static int cellItemsTypesAmt = 63; + public static int storageCell256kTypeAmt = 63; - @Config.Comment("Amount of types for Fluid Cells") - @Config.Name("cellFluidTypesAmt") + @Config.Comment("Amount of types for 1m Items Cells") + @Config.Name("storageCell1mbTypeAmt") @Config.RangeInt(min = 1) - public static int cellFluidTypesAmt = 15; + public static int storageCell1mbTypeAmt = 63; + + @Config.Comment("Amount of types for 4m Items Cells") + @Config.Name("storageCell4mbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell4mbTypeAmt = 63; + + @Config.Comment("Amount of types for 16m Items Cells") + @Config.Name("storageCell16mbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell16mbTypeAmt = 63; + + @Config.Comment("Amount of types for 64m Items Cells") + @Config.Name("storageCell64mbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell64mbTypeAmt = 63; + + @Config.Comment("Amount of types for 256m Items Cells") + @Config.Name("storageCell256mbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell256mbTypeAmt = 63; + + @Config.Comment("Amount of types for 1g Items Cells") + @Config.Name("storageCell1gbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell1gbTypeAmt = 63; + + @Config.Comment("Amount of types for 2g Items Cells") + @Config.Name("storageCell2gbTypeAmt") + @Config.RangeInt(min = 1) + public static int storageCell2gbTypeAmt = 63; + + + + @Config.Comment("Amount of types for 256k Fluid Cells") + @Config.Name("fluidCell256kTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell256kTypeAmt = 15; + + @Config.Comment("Amount of types for 1m Fluid Cells") + @Config.Name("fluidCell1mbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell1mbTypeAmt = 15; + + @Config.Comment("Amount of types for 4m Fluid Cells") + @Config.Name("fluidCell4mbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell4mbTypeAmt = 15; + + @Config.Comment("Amount of types for 16m Fluid Cells") + @Config.Name("fluidCell16mbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell16mbTypeAmt = 15; + + @Config.Comment("Amount of types for 64m Fluid Cells") + @Config.Name("fluidCell64mbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell64mbTypeAmt = 15; + + @Config.Comment("Amount of types for 256m Fluid Cells") + @Config.Name("fluidCell256mbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell256mbTypeAmt = 15; + + @Config.Comment("Amount of types for 1g Fluid Cells") + @Config.Name("fluidCell1gbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell1gbTypeAmt = 15; + + @Config.Comment("Amount of types for 2g Fluid Cells") + @Config.Name("fluidCell2gbTypeAmt") + @Config.RangeInt(min = 1) + public static int fluidCell2gbTypeAmt = 15; //SolarPanels