Skip to content

Commit f535fd4

Browse files
committed
Fix crash when placing some blocks in Prod due to AT level not being properly recognized
1 parent 161b040 commit f535fd4

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

src/main/java/mekanism/common/attachments/containers/chemical/ComponentBackedChemicalTank.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.jetbrains.annotations.NotNull;
2121
import org.jetbrains.annotations.Nullable;
2222

23-
@NothingNullByDefault//TODO - 1.20.5: BasicChemicalTank also implement IChemicalHandler. Do we want to be doing that here?
23+
@NothingNullByDefault
2424
public abstract class ComponentBackedChemicalTank<CHEMICAL extends Chemical<CHEMICAL>, STACK extends ChemicalStack<CHEMICAL>,
2525
ATTACHED extends IAttachedContainers<STACK, ATTACHED>> extends ComponentBackedContainer<STACK, ATTACHED> implements IChemicalTank<CHEMICAL, STACK> {
2626

@@ -54,9 +54,13 @@ protected boolean isEmpty(STACK value) {
5454
return value.isEmpty();
5555
}
5656

57+
/**
58+
* {@inheritDoc}
59+
*
60+
* @apiNote Try to minimize the number of calls to this method so that we don't have to look up the data component multiple times.
61+
*/
5762
@Override
5863
public STACK getStack() {
59-
//TODO - 1.20.5: Similar to getBasicInventorySlot do we want to reduce calls to this? Probably (We mostly do so, but we probably want to add a note here)
6064
return getContents(getAttached());
6165
}
6266

src/main/java/mekanism/common/attachments/containers/chemical/merged/MergedTankCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import net.neoforged.neoforge.common.util.INBTSerializable;
1616
import org.jetbrains.annotations.Nullable;
1717

18-
//TODO - 1.20.5: Re-evaluate/rethink this as using rawtypes to get around things like this is very cursed
18+
//TODO: Re-evaluate/rethink this as using rawtypes to get around things like this is very cursed
1919
@NothingNullByDefault
2020
@SuppressWarnings({"rawtypes", "unchecked"})
2121
public class MergedTankCreator implements IBasicContainerCreator {

src/main/java/mekanism/common/attachments/containers/energy/ComponentBackedEnergyContainer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ protected boolean isEmpty(FloatingLong value) {
4949
return ContainerType.ENERGY;
5050
}
5151

52+
/**
53+
* {@inheritDoc}
54+
*
55+
* @apiNote Try to minimize the number of calls to this method so that we don't have to look up the data component multiple times.
56+
*/
5257
@Override
5358
public FloatingLong getEnergy() {
54-
//TODO - 1.20.5: Similar to getBasicInventorySlot do we want to reduce calls to this? Probably (We mostly do so, but we probably want to add a note here)
5559
return getContents(getAttached());
5660
}
5761

src/main/java/mekanism/common/attachments/containers/fluid/ComponentBackedFluidTank.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ protected boolean isEmpty(FluidStack value) {
5353
return ContainerType.FLUID;
5454
}
5555

56+
/**
57+
* {@inheritDoc}
58+
*
59+
* @apiNote Try to minimize the number of calls to this method so that we don't have to look up the data component multiple times.
60+
*/
5661
@Override
5762
public FluidStack getFluid() {
58-
//TODO - 1.20.5: Similar to getBasicInventorySlot do we want to reduce calls to this? Probably (We mostly do so, but we probably want to add a note here)
5963
return getContents(getAttached());
6064
}
6165

src/main/java/mekanism/common/attachments/containers/heat/ComponentBackedHeatCapacitor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ protected HeatCapacitorData getContents(AttachedHeat attached) {
5555
return attached.get(containerIndex);
5656
}
5757

58+
/**
59+
* {@inheritDoc}
60+
*
61+
* @apiNote Try to minimize the number of calls to this method so that we don't have to look up the data component multiple times.
62+
*/
5863
protected HeatCapacitorData getData() {
59-
//TODO - 1.20.5: Similar to getBasicInventorySlot do we want to reduce calls to this? Probably (We mostly do so, but we probably want to add a note here)
6064
return getContents(getAttached());
6165
}
6266

src/main/java/mekanism/common/attachments/containers/item/ComponentBackedInventorySlot.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ protected boolean isEmpty(ItemStack value) {
5757
return ContainerType.ITEM;
5858
}
5959

60+
/**
61+
* {@inheritDoc}
62+
*
63+
* @apiNote Try to minimize the number of calls to this method so that we don't have to look up the data component multiple times.
64+
*/
6065
@Override
6166
public ItemStack getStack() {
62-
//TODO - 1.20.5: Similar to getBasicInventorySlot do we want to reduce calls to this? Probably (We mostly do so, but we probably want to add a note here)
6367
return getContents(getAttached());
6468
}
6569

src/main/resources/META-INF/accesstransformer.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected net.minecraft.world.item.ArmorItem ARMOR_MODIFIER_UUID_PER_TYPE
9393

9494
public net.minecraft.world.level.Explosion addOrAppendStack(Ljava/util/List;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/core/BlockPos;)V
9595
public net.minecraft.world.level.biome.Biome getTemperature(Lnet/minecraft/core/BlockPos;)F
96-
protected net.minecraft.world.level.block.entity.BlockEntity$ComponentHelper
96+
public net.minecraft.world.level.block.entity.BlockEntity$ComponentHelper
9797
public net.minecraft.world.level.block.entity.BlockEntity$DataComponentInput
9898
public net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase destroySpeed
9999
public net.minecraft.world.level.block.state.BlockBehaviour$Properties lightEmission

0 commit comments

Comments
 (0)