mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 03:43:41 +01:00
Fix valve handles not having a tooltip
This commit is contained in:
parent
f9a40e2f06
commit
282a9a6f3a
1 changed files with 5 additions and 2 deletions
|
@ -22,10 +22,12 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate.SpeedLevel;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate.StressImpact;
|
||||
import com.simibubi.create.content.contraptions.components.crank.ValveHandleBlock;
|
||||
import com.simibubi.create.content.contraptions.components.fan.EncasedFanBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.engine.EngineBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.engine.FurnaceEngineBlock;
|
||||
|
@ -92,6 +94,7 @@ public class ItemDescription {
|
|||
List<ITextComponent> list = new ArrayList<>();
|
||||
|
||||
boolean isEngine = block instanceof EngineBlock;
|
||||
boolean isHandle = block instanceof ValveHandleBlock;
|
||||
CKinetics config = AllConfigs.SERVER.kinetics;
|
||||
SpeedLevel minimumRequiredSpeedLevel =
|
||||
isEngine ? SpeedLevel.NONE : ((IRotate) block).getMinimumRequiredSpeedLevel();
|
||||
|
@ -101,7 +104,7 @@ public class ItemDescription {
|
|||
Map<ResourceLocation, ConfigValue<Double>> capacities = config.stressValues.getCapacities();
|
||||
boolean hasStressImpact = impacts.containsKey(id) && impacts.get(id)
|
||||
.get() > 0 && StressImpact.isEnabled();
|
||||
boolean hasStressCapacity = capacities.containsKey(id) && StressImpact.isEnabled();
|
||||
boolean hasStressCapacity = (isHandle || capacities.containsKey(id)) && StressImpact.isEnabled();
|
||||
boolean hasGlasses =
|
||||
AllItems.GOGGLES.get() == Minecraft.getInstance().player.getItemStackFromSlot(EquipmentSlotType.HEAD)
|
||||
.getItem();
|
||||
|
@ -151,7 +154,7 @@ public class ItemDescription {
|
|||
if (hasStressCapacity) {
|
||||
List<ITextComponent> stressCapacityLevels =
|
||||
Lang.translatedOptions("tooltip.capacityProvided", "low", "medium", "high");
|
||||
double capacity = capacities.get(id)
|
||||
double capacity = capacities.get(isHandle ? AllBlocks.HAND_CRANK.getId() : id)
|
||||
.get();
|
||||
StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.LOW
|
||||
: (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.HIGH);
|
||||
|
|
Loading…
Reference in a new issue