Merge branch 'mc1.18/dev' into mc1.18/global-railways

This commit is contained in:
simibubi 2022-05-31 03:15:34 +02:00
commit 0088f4f3f3
6 changed files with 23 additions and 9 deletions

View file

@ -5353,6 +5353,7 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/br
7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/items/storage_blocks/zinc.json 7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/items/storage_blocks/zinc.json
4853a67b18e1fbfc8f60b5ce6c386b05e40c9942 data/forge/tags/items/stripped_logs.json 4853a67b18e1fbfc8f60b5ce6c386b05e40c9942 data/forge/tags/items/stripped_logs.json
4efc25d146ac84be29a702b3f6490a367695242a data/forge/tags/items/stripped_wood.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 2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/azalea_root_replaceable.json
9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json 9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/dripstone_replaceable_blocks.json 2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/dripstone_replaceable_blocks.json

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:wrench"
]
}

View file

@ -266,6 +266,7 @@ public class AllItems {
public static final ItemEntry<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new) public static final ItemEntry<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new)
.properties(p -> p.stacksTo(1)) .properties(p -> p.stacksTo(1))
.model(AssetLookup.itemModelWithPartials()) .model(AssetLookup.itemModelWithPartials())
.tag(AllItemTags.WRENCH.tag)
.register(); .register();
public static final ItemEntry<MinecartContraptionItem> MINECART_CONTRAPTION = public static final ItemEntry<MinecartContraptionItem> MINECART_CONTRAPTION =

View file

@ -2,6 +2,8 @@ package com.simibubi.create;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping; import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.Screen;
@ -58,9 +60,15 @@ public enum AllKeys {
} }
public static boolean isKeyDown(int key) { public static boolean isKeyDown(int key) {
return GLFW.glfwGetKey(Minecraft.getInstance() return InputConstants.isKeyDown(Minecraft.getInstance()
.getWindow() .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() { public static boolean ctrlDown() {

View file

@ -211,7 +211,8 @@ public class AllTags {
STRIPPED_LOGS(FORGE), STRIPPED_LOGS(FORGE),
STRIPPED_WOOD(FORGE), STRIPPED_WOOD(FORGE),
BEACON_PAYMENT(FORGE), BEACON_PAYMENT(FORGE),
PLATES(FORGE) PLATES(FORGE),
WRENCH(FORGE, "tools/wrench")
; ;

View file

@ -126,9 +126,8 @@ public class ItemDescription {
double impact = BlockStressValues.getImpact(block); double impact = BlockStressValues.getImpact(block);
StressImpact impactId = impact >= config.highStressImpact.get() ? StressImpact.HIGH StressImpact impactId = impact >= config.highStressImpact.get() ? StressImpact.HIGH
: (impact >= config.mediumStressImpact.get() ? StressImpact.MEDIUM : StressImpact.LOW); : (impact >= config.mediumStressImpact.get() ? StressImpact.MEDIUM : StressImpact.LOW);
int index = impactId.ordinal();
MutableComponent level = MutableComponent level =
new TextComponent(makeProgressBar(3, index + 1)).withStyle(impactId.getAbsoluteColor()); new TextComponent(makeProgressBar(3, impactId.ordinal() + 1)).withStyle(impactId.getAbsoluteColor());
if (hasGoggles) if (hasGoggles)
level.append(impact + "x ") level.append(impact + "x ")
@ -145,9 +144,7 @@ public class ItemDescription {
double capacity = BlockStressValues.getCapacity(block); double capacity = BlockStressValues.getCapacity(block);
StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.HIGH StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.HIGH
: (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.LOW); : (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.LOW);
StressImpact opposite = StressImpact.values()[2 - impactId.ordinal()]; StressImpact opposite = StressImpact.values()[StressImpact.values().length - 2 - impactId.ordinal()];
int index = StressImpact.values().length - 2 - impactId.ordinal();
MutableComponent level = MutableComponent level =
new TextComponent(makeProgressBar(3, impactId.ordinal() + 1)).withStyle(opposite.getAbsoluteColor()); new TextComponent(makeProgressBar(3, impactId.ordinal() + 1)).withStyle(opposite.getAbsoluteColor());
@ -155,7 +152,7 @@ public class ItemDescription {
level.append(capacity + "x ") level.append(capacity + "x ")
.append(rpmUnit); .append(rpmUnit);
else 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()) // if (!isEngine && ((IRotate) block).showCapacityWithAnnotation())
// level += // level +=