Skip to content

Commit aab8bcf

Browse files
committed
Fix energy in machines getting clamped to un-upgraded amount when moving the machine (#8184)
1 parent 325119b commit aab8bcf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/mekanism/common/tile/base/TileEntityMekanism.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,12 @@ protected void applyImplicitComponents(@NotNull BlockEntity.DataComponentInput i
761761
for (ITileComponent component : components) {
762762
component.applyImplicitComponents(input);
763763
}
764+
if (supportsUpgrades()) {
765+
//Recalculate upgrades before setting types so that we don't clamp the stored energy
766+
for (Upgrade upgrade : getSupportedUpgrade()) {
767+
recalculateUpgrades(upgrade);
768+
}
769+
}
764770

765771
for (ContainerType<?, ?, ?> type : ContainerType.TYPES) {
766772
if (persists(type)) {
@@ -777,12 +783,6 @@ protected void applyImplicitComponents(@NotNull BlockEntity.DataComponentInput i
777783
if (supportsRedstone()) {
778784
setControlType(input.getOrDefault(MekanismDataComponents.REDSTONE_CONTROL, getControlType()));
779785
}
780-
if (supportsUpgrades()) {
781-
//Recalculate upgrades after applying components
782-
for (Upgrade upgrade : getSupportedUpgrade()) {
783-
recalculateUpgrades(upgrade);
784-
}
785-
}
786786
}
787787

788788
@Override

0 commit comments

Comments
 (0)