diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 6056b8170..203af54c6 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -5353,6 +5353,7 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/br 7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/items/storage_blocks/zinc.json 4853a67b18e1fbfc8f60b5ce6c386b05e40c9942 data/forge/tags/items/stripped_logs.json 4efc25d146ac84be29a702b3f6490a367695242a data/forge/tags/items/stripped_wood.json +e002dfedc5e8762de0f97ea1f3fa546e92e748ae data/forge/tags/items/tools/wrench.json 2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/azalea_root_replaceable.json 9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json 2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/dripstone_replaceable_blocks.json diff --git a/src/generated/resources/data/forge/tags/items/tools/wrench.json b/src/generated/resources/data/forge/tags/items/tools/wrench.json new file mode 100644 index 000000000..bfa16b91b --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/tools/wrench.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:wrench" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 8e6f5a9cb..9d57fb9da 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -266,6 +266,7 @@ public class AllItems { public static final ItemEntry WRENCH = REGISTRATE.item("wrench", WrenchItem::new) .properties(p -> p.stacksTo(1)) .model(AssetLookup.itemModelWithPartials()) + .tag(AllItemTags.WRENCH.tag) .register(); public static final ItemEntry MINECART_CONTRAPTION = diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java index 58ad25fdf..8da43a2c8 100644 --- a/src/main/java/com/simibubi/create/AllKeys.java +++ b/src/main/java/com/simibubi/create/AllKeys.java @@ -2,6 +2,8 @@ package com.simibubi.create; import org.lwjgl.glfw.GLFW; +import com.mojang.blaze3d.platform.InputConstants; + import net.minecraft.client.KeyMapping; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; @@ -58,9 +60,15 @@ public enum AllKeys { } public static boolean isKeyDown(int key) { - return GLFW.glfwGetKey(Minecraft.getInstance() + return InputConstants.isKeyDown(Minecraft.getInstance() .getWindow() - .getWindow(), key) != 0; + .getWindow(), key); + } + + public static boolean isMouseButtonDown(int button) { + return GLFW.glfwGetMouseButton(Minecraft.getInstance() + .getWindow() + .getWindow(), button) == 1; } public static boolean ctrlDown() { diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 4b9f63f20..ecb6868d5 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -211,7 +211,8 @@ public class AllTags { STRIPPED_LOGS(FORGE), STRIPPED_WOOD(FORGE), BEACON_PAYMENT(FORGE), - PLATES(FORGE) + PLATES(FORGE), + WRENCH(FORGE, "tools/wrench") ; diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index f70a4d121..e3a56e87f 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -126,9 +126,8 @@ public class ItemDescription { double impact = BlockStressValues.getImpact(block); StressImpact impactId = impact >= config.highStressImpact.get() ? StressImpact.HIGH : (impact >= config.mediumStressImpact.get() ? StressImpact.MEDIUM : StressImpact.LOW); - int index = impactId.ordinal(); MutableComponent level = - new TextComponent(makeProgressBar(3, index + 1)).withStyle(impactId.getAbsoluteColor()); + new TextComponent(makeProgressBar(3, impactId.ordinal() + 1)).withStyle(impactId.getAbsoluteColor()); if (hasGoggles) level.append(impact + "x ") @@ -145,9 +144,7 @@ public class ItemDescription { double capacity = BlockStressValues.getCapacity(block); StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.HIGH : (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.LOW); - StressImpact opposite = StressImpact.values()[2 - impactId.ordinal()]; - - int index = StressImpact.values().length - 2 - impactId.ordinal(); + StressImpact opposite = StressImpact.values()[StressImpact.values().length - 2 - impactId.ordinal()]; MutableComponent level = new TextComponent(makeProgressBar(3, impactId.ordinal() + 1)).withStyle(opposite.getAbsoluteColor()); @@ -155,7 +152,7 @@ public class ItemDescription { level.append(capacity + "x ") .append(rpmUnit); else - level.append(Lang.translate("tooltip.capacityProvided." + Lang.asId(impactId.name()))); + level.append(Lang.translate("tooltip.capacityProvided." + Lang.asId(opposite.name()))); // if (!isEngine && ((IRotate) block).showCapacityWithAnnotation()) // level +=