Merge pull request #3187 from wchen1990/mc1.18/dev

Add null check on ItemDescription's use of BlockStressValues.getProvider
This commit is contained in:
simibubi 2022-07-10 18:40:16 +02:00 committed by GitHub
commit 86cab0716f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,8 +129,10 @@ public class ItemDescription {
.addTo(list);
double capacity = BlockStressValues.getCapacity(block);
Couple<Integer> generatedRPM = BlockStressValues.getProvider(block)
.getGeneratedRPM(block);
BlockStressValues.IStressValueProvider stressProvider = BlockStressValues.getProvider(block);
Couple<Integer> generatedRPM = stressProvider != null ?
stressProvider.getGeneratedRPM(block)
: null;
StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.HIGH
: (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.LOW);