fix stress display

This commit is contained in:
khj xiaogu 2021-11-22 19:54:27 +08:00
parent 62f2e04fc7
commit 3f924b6508
No known key found for this signature in database
GPG key ID: DEA172814EAFF426

View file

@ -9,6 +9,13 @@ public class SPStress implements IStressValueProvider {
@Override
public double getCapacity(Block arg0) {
if(!(arg0 instanceof FlywheelBlock))return 0;
String mat=arg0.getRegistryName().getPath().split("_")[0];
switch(mat) {
case "bronze":return SPConfig.COMMON.bronzeFlywheelCapacity.get();
case "cast":return SPConfig.COMMON.castIronFlywheelCapacity.get();
case "steel":return SPConfig.COMMON.steelFlywheelCapacity.get();
}
return 0;
}
@ -26,11 +33,13 @@ public class SPStress implements IStressValueProvider {
@Override
public boolean hasCapacity(Block arg0) {
if((arg0 instanceof FlywheelBlock))return true;
return false;
}
@Override
public boolean hasImpact(Block arg0) {
if(arg0 instanceof FlywheelBlock)return false;
return true;
}