diff --git a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/prefab/BlockEntityRelay.java b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/prefab/BlockEntityRelay.java index c127ad9..7f6d6d7 100644 --- a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/prefab/BlockEntityRelay.java +++ b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/prefab/BlockEntityRelay.java @@ -46,6 +46,8 @@ public int getCount() } }; + public abstract double getTransferRate(); + public BlockEntityRelay(BlockEntityType blockEntityType, BlockPos blockPos, BlockState blockState, double capacity) { @@ -76,7 +78,7 @@ public void discharge() BlockPos blockPos = getBlockPos().relative(value); if(level.getBlockEntity(blockPos) != null && level.getBlockEntity(blockPos) instanceof IEmcStorage iEmcStorage && iEmcStorage.canReceive()) { - double removed = iEmcStorage.receiveEmc(Math.min(getStoredEmc(), 500), false); + double removed = iEmcStorage.receiveEmc(Math.min(getStoredEmc(), getTransferRate()), false); extractEmc(removed, false); } } @@ -92,7 +94,7 @@ public void burnItem() { if(itemKleinStar.getKleinStarStored(stack) > 0) { - double energyRemoved = receiveEmc(Math.min(itemKleinStar.getKleinStarStored(stack), 2500), false); + double energyRemoved = receiveEmc(Math.min(itemKleinStar.getKleinStarStored(stack), getTransferRate()), false); itemKleinStar.extractKleinStarEmc(stack, energyRemoved, false); } return; @@ -118,7 +120,7 @@ public void charge() ItemStack stack = getContainer(Direction.UP).getItem(1); if(iEmcItem.canReceive(stack)) { - double energyRemoved = iEmcItem.receiveEmc(stack, Math.min(getStoredEmc(), 2500), false); + double energyRemoved = iEmcItem.receiveEmc(stack, Math.min(getStoredEmc(), getTransferRate()), false); extractEmc(energyRemoved, false); } } diff --git a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK1.java b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK1.java index cc0131b..4bdf6df 100644 --- a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK1.java +++ b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK1.java @@ -1,6 +1,7 @@ package net.creeperhost.equivalentexchange.blockentities.relays; import net.creeperhost.equivalentexchange.Constants; +import net.creeperhost.equivalentexchange.EquivalentExchange; import net.creeperhost.equivalentexchange.blockentities.prefab.BlockEntityRelay; import net.creeperhost.equivalentexchange.containers.relays.ContainerRelayMK1; import net.creeperhost.equivalentexchange.init.ModBlocks; @@ -43,4 +44,9 @@ public Container getContainer(@Nullable Direction side) { return simpleItemInventory == null ? this.simpleItemInventory = new BlockInventory(this, 8) : this.simpleItemInventory; } + + @Override + public double getTransferRate() { + return EquivalentExchange.CONFIG_DATA.BasicRelayTransferRate; + } } diff --git a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK2.java b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK2.java index 9e75f8e..4ed201a 100644 --- a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK2.java +++ b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK2.java @@ -1,6 +1,7 @@ package net.creeperhost.equivalentexchange.blockentities.relays; import net.creeperhost.equivalentexchange.Constants; +import net.creeperhost.equivalentexchange.EquivalentExchange; import net.creeperhost.equivalentexchange.blockentities.prefab.BlockEntityRelay; import net.creeperhost.equivalentexchange.containers.relays.ContainerRelayMK2; import net.creeperhost.equivalentexchange.init.ModBlocks; @@ -42,4 +43,9 @@ public AbstractContainerMenu createMenu(int i, @NotNull Inventory inventory, @No public Container getContainer(@Nullable Direction side) { return simpleItemInventory == null ? this.simpleItemInventory = new BlockInventory(this, 14) : this.simpleItemInventory; } + + @Override + public double getTransferRate() { + return EquivalentExchange.CONFIG_DATA.DarkMatterRelayTransferRate; + } } diff --git a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK3.java b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK3.java index b935d0b..8df66ba 100644 --- a/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK3.java +++ b/common/src/main/java/net/creeperhost/equivalentexchange/blockentities/relays/BlockEntityRelayMK3.java @@ -1,6 +1,7 @@ package net.creeperhost.equivalentexchange.blockentities.relays; import net.creeperhost.equivalentexchange.Constants; +import net.creeperhost.equivalentexchange.EquivalentExchange; import net.creeperhost.equivalentexchange.blockentities.prefab.BlockEntityRelay; import net.creeperhost.equivalentexchange.containers.relays.ContainerRelayMK3; import net.creeperhost.equivalentexchange.init.ModBlocks; @@ -42,4 +43,9 @@ public AbstractContainerMenu createMenu(int i, @NotNull Inventory inventory, @No public Container getContainer(@Nullable Direction side) { return simpleItemInventory == null ? this.simpleItemInventory = new BlockInventory(this, 22) : this.simpleItemInventory; } + + @Override + public double getTransferRate() { + return EquivalentExchange.CONFIG_DATA.RedMatterRelayTransferRate; + } } diff --git a/common/src/main/java/net/creeperhost/equivalentexchange/config/EE3ConfigData.java b/common/src/main/java/net/creeperhost/equivalentexchange/config/EE3ConfigData.java index 0288022..f62fa00 100644 --- a/common/src/main/java/net/creeperhost/equivalentexchange/config/EE3ConfigData.java +++ b/common/src/main/java/net/creeperhost/equivalentexchange/config/EE3ConfigData.java @@ -52,4 +52,13 @@ public class EE3ConfigData extends ConfigData @Comment("Evertide Pedestal cost in EMC") public double EvertidePedestalCost = 1000; + + @Comment("Basic Relay transfer rate") + public double BasicRelayTransferRate = 500; + + @Comment("Dark matter Relay transfer rate") + public double DarkMatterRelayTransferRate = 2500; + + @Comment("Red matter Relay transfer rate") + public double RedMatterRelayTransferRate = 5000; }