mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-03 22:34:42 +01:00
update gradle version and buildscripts
- also includes diverse leftover changes
This commit is contained in:
parent
812a6491de
commit
e9b5c01bc1
15 changed files with 226 additions and 22 deletions
13
build.gradle
13
build.gradle
|
@ -69,7 +69,8 @@ minecraft {
|
||||||
arg '-mixin.config=catnip.mixins.json'
|
arg '-mixin.config=catnip.mixins.json'
|
||||||
}
|
}
|
||||||
|
|
||||||
//jvmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") // uncomment with jbr
|
jvmArgs("-XX:-OmitStackTraceInFastThrow") // uncomment when you get exceptions with null messages etc
|
||||||
|
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") // uncomment with jbr
|
||||||
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
|
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
|
||||||
property 'forge.logging.console.level', 'info'
|
property 'forge.logging.console.level', 'info'
|
||||||
mods {
|
mods {
|
||||||
|
@ -283,8 +284,8 @@ mixin {
|
||||||
|
|
||||||
// Workaround for SpongePowered/MixinGradle#38
|
// Workaround for SpongePowered/MixinGradle#38
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
|
//tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
|
||||||
tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
|
//tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
@ -296,13 +297,13 @@ compileJava {
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
classifier = 'slim'
|
archiveClassifier = 'slim'
|
||||||
manifest {
|
manifest {
|
||||||
attributes([
|
attributes([
|
||||||
'Specification-Title': 'create',
|
'Specification-Title': 'create',
|
||||||
'Specification-Vendor': 'simibubi',
|
'Specification-Vendor': 'simibubi',
|
||||||
'Specification-Version': '1',
|
'Specification-Version': '1',
|
||||||
'Implementation-Title': project.jar.baseName,
|
'Implementation-Title': archiveBaseName,
|
||||||
'Implementation-Version': project.jar.archiveVersion,
|
'Implementation-Version': project.jar.archiveVersion,
|
||||||
'Implementation-Vendor': 'simibubi',
|
'Implementation-Vendor': 'simibubi',
|
||||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||||
|
@ -314,7 +315,7 @@ jar {
|
||||||
task jarJarRelease {
|
task jarJarRelease {
|
||||||
doLast {
|
doLast {
|
||||||
tasks.jarJar {
|
tasks.jarJar {
|
||||||
classifier = ''
|
archiveClassifier = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finalizedBy tasks.jarJar
|
finalizedBy tasks.jarJar
|
||||||
|
|
|
@ -11,7 +11,7 @@ minecraft_version = 1.18.2
|
||||||
forge_version = 40.1.60
|
forge_version = 40.1.60
|
||||||
|
|
||||||
# build dependency versions
|
# build dependency versions
|
||||||
forgegradle_version = 5.1.53
|
forgegradle_version = 6.+
|
||||||
mixingradle_version = 0.7-SNAPSHOT
|
mixingradle_version = 0.7-SNAPSHOT
|
||||||
mixin_version = 0.8.5
|
mixin_version = 0.8.5
|
||||||
librarian_version = 1.+
|
librarian_version = 1.+
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -14,6 +14,7 @@ public enum AllKeys {
|
||||||
TOOL_MENU("toolmenu", GLFW.GLFW_KEY_LEFT_ALT),
|
TOOL_MENU("toolmenu", GLFW.GLFW_KEY_LEFT_ALT),
|
||||||
ACTIVATE_TOOL("", GLFW.GLFW_KEY_LEFT_CONTROL),
|
ACTIVATE_TOOL("", GLFW.GLFW_KEY_LEFT_CONTROL),
|
||||||
TOOLBELT("toolbelt", GLFW.GLFW_KEY_LEFT_ALT),
|
TOOLBELT("toolbelt", GLFW.GLFW_KEY_LEFT_ALT),
|
||||||
|
ROTATE_MENU("rotate_menu", GLFW.GLFW_KEY_B),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class AnimatedItemDrain extends AnimatedKinetics {
|
||||||
ms.scale(scale, scale, scale);
|
ms.scale(scale, scale, scale);
|
||||||
float from = 2/16f;
|
float from = 2/16f;
|
||||||
float to = 1f - from;
|
float to = 1f - from;
|
||||||
FluidRenderer.renderFluidBox(fluid, from, from, from, to, 3/4f, to, buffer, ms, LightTexture.FULL_BRIGHT, false);
|
FluidRenderer.renderFluidBox(fluid.getFluid(), fluid.getAmount(), from, from, from, to, 3/4f, to, buffer, ms, LightTexture.FULL_BRIGHT, false);
|
||||||
buffer.endBatch();
|
buffer.endBatch();
|
||||||
|
|
||||||
matrixStack.popPose();
|
matrixStack.popPose();
|
||||||
|
|
|
@ -73,7 +73,8 @@ public class AnimatedSpout extends AnimatedKinetics {
|
||||||
matrixStack.scale(16, 16, 16);
|
matrixStack.scale(16, 16, 16);
|
||||||
float from = 3f / 16f;
|
float from = 3f / 16f;
|
||||||
float to = 17f / 16f;
|
float to = 17f / 16f;
|
||||||
FluidRenderer.renderFluidBox(fluids.get(0), from, from, from, to, to, to, buffer, matrixStack, LightTexture.FULL_BRIGHT, false);
|
FluidStack fluidStack = fluids.get(0);
|
||||||
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), from, from, from, to, to, to, buffer, matrixStack, LightTexture.FULL_BRIGHT, false);
|
||||||
matrixStack.popPose();
|
matrixStack.popPose();
|
||||||
|
|
||||||
float width = 1 / 128f * squeeze;
|
float width = 1 / 128f * squeeze;
|
||||||
|
@ -83,8 +84,7 @@ public class AnimatedSpout extends AnimatedKinetics {
|
||||||
matrixStack.translate(-0.5f, 0, -0.5f);
|
matrixStack.translate(-0.5f, 0, -0.5f);
|
||||||
from = -width / 2 + 0.5f;
|
from = -width / 2 + 0.5f;
|
||||||
to = width / 2 + 0.5f;
|
to = width / 2 + 0.5f;
|
||||||
FluidRenderer.renderFluidBox(fluids.get(0), from, 0, from, to, 2, to, buffer, matrixStack, LightTexture.FULL_BRIGHT,
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), from, 0, from, to, 2, to, buffer, matrixStack, LightTexture.FULL_BRIGHT, false);
|
||||||
false);
|
|
||||||
buffer.endBatch();
|
buffer.endBatch();
|
||||||
Lighting.setupFor3DItems();
|
Lighting.setupFor3DItems();
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class ItemDrainRenderer extends SmartTileEntityRenderer<ItemDrainTileEnti
|
||||||
float yOffset = (7 / 16f) * level;
|
float yOffset = (7 / 16f) * level;
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, yOffset, 0);
|
ms.translate(0, yOffset, 0);
|
||||||
FluidRenderer.renderFluidBox(fluidStack, min, yMin - yOffset, min, max, yMin, max, buffer, ms, light,
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), min, yMin - yOffset, min, max, yMin, max, buffer, ms, light,
|
||||||
false);
|
false);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ public class ItemDrainRenderer extends SmartTileEntityRenderer<ItemDrainTileEnti
|
||||||
if (processingTicks != -1) {
|
if (processingTicks != -1) {
|
||||||
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
||||||
AABB bb = new AABB(0.5, 1.0, 0.5, 0.5, 0.25, 0.5).inflate(radius / 32f);
|
AABB bb = new AABB(0.5, 1.0, 0.5, 0.5, 0.25, 0.5).inflate(radius / 32f);
|
||||||
FluidRenderer.renderFluidBox(fluidStack2, (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
FluidRenderer.renderFluidBox(fluidStack2.getFluid(), fluidStack2.getAmount(), (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
||||||
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true);
|
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class SpoutRenderer extends SafeTileEntityRenderer<SpoutTileEntity> {
|
||||||
float yOffset = (11 / 16f) * level;
|
float yOffset = (11 / 16f) * level;
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, yOffset, 0);
|
ms.translate(0, yOffset, 0);
|
||||||
FluidRenderer.renderFluidBox(fluidStack, min, min - yOffset, min, max, min, max, buffer, ms, light,
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), min, min - yOffset, min, max, min, max, buffer, ms, light,
|
||||||
false);
|
false);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ public class SpoutRenderer extends SafeTileEntityRenderer<SpoutTileEntity> {
|
||||||
if (processingTicks != -1) {
|
if (processingTicks != -1) {
|
||||||
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
||||||
AABB bb = new AABB(0.5, .5, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
|
AABB bb = new AABB(0.5, .5, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
|
||||||
FluidRenderer.renderFluidBox(fluidStack, (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
||||||
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true);
|
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class FluidTankRenderer extends SafeTileEntityRenderer<FluidTankTileEntit
|
||||||
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, clampedLevel - totalHeight, 0);
|
ms.translate(0, clampedLevel - totalHeight, 0);
|
||||||
FluidRenderer.renderFluidBox(fluidStack, xMin, yMin, zMin, xMax, yMax, zMax, buffer, ms, light, false);
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), xMin, yMin, zMin, xMax, yMax, zMax, buffer, ms, light, false);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,8 +172,7 @@ public class BasinRenderer extends SmartTileEntityRenderer<BasinTileEntity> {
|
||||||
|
|
||||||
float partial = Mth.clamp(units / totalUnits, 0, 1);
|
float partial = Mth.clamp(units / totalUnits, 0, 1);
|
||||||
xMax += partial * 12 / 16f;
|
xMax += partial * 12 / 16f;
|
||||||
FluidRenderer.renderFluidBox(renderedFluid, xMin, yMin, zMin, xMax, yMax, zMax, buffer, ms, light,
|
FluidRenderer.renderFluidBox(renderedFluid.getFluid(), renderedFluid.getAmount(), xMin, yMin, zMin, xMax, yMax, zMax, buffer, ms, light, false);
|
||||||
false);
|
|
||||||
|
|
||||||
xMin = xMax;
|
xMin = xMax;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.simibubi.create.content.contraptions.wrench;
|
||||||
|
|
||||||
|
import com.simibubi.create.AllItems;
|
||||||
|
import com.simibubi.create.AllKeys;
|
||||||
|
|
||||||
|
import net.createmod.catnip.gui.ScreenOpener;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.level.GameType;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
|
import net.minecraft.world.phys.HitResult;
|
||||||
|
|
||||||
|
public class RadialWrenchHandler {
|
||||||
|
|
||||||
|
public static void onKeyInput(int key, boolean pressed) {
|
||||||
|
Minecraft mc = Minecraft.getInstance();
|
||||||
|
if (mc.gameMode == null || mc.gameMode.getPlayerMode() == GameType.SPECTATOR)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (key != AllKeys.ROTATE_MENU.getBoundCode())
|
||||||
|
return;
|
||||||
|
|
||||||
|
LocalPlayer player = mc.player;
|
||||||
|
if (player == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Level level = player.level;
|
||||||
|
|
||||||
|
ItemStack heldItem = player.getMainHandItem();
|
||||||
|
if (heldItem.getItem() != AllItems.WRENCH.get())
|
||||||
|
return;
|
||||||
|
|
||||||
|
HitResult objectMouseOver = mc.hitResult;
|
||||||
|
if (!(objectMouseOver instanceof BlockHitResult blockHitResult))
|
||||||
|
return;
|
||||||
|
|
||||||
|
BlockState state = level.getBlockState(blockHitResult.getBlockPos());
|
||||||
|
|
||||||
|
if (!(state.getBlock() instanceof IWrenchable))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ScreenOpener.open(new RadialWrenchMenu(state));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,142 @@
|
||||||
|
package com.simibubi.create.content.contraptions.wrench;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.math.Quaternion;
|
||||||
|
import com.mojang.math.Vector3f;
|
||||||
|
import com.simibubi.create.AllKeys;
|
||||||
|
import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
|
||||||
|
import com.simibubi.create.content.contraptions.base.HorizontalAxisKineticBlock;
|
||||||
|
import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock;
|
||||||
|
import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock;
|
||||||
|
|
||||||
|
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||||
|
import net.createmod.catnip.gui.RadialMenu;
|
||||||
|
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||||
|
import net.createmod.catnip.utility.AnimationTickHolder;
|
||||||
|
import net.createmod.catnip.utility.theme.Color;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.block.state.properties.Property;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
|
public class RadialWrenchMenu extends AbstractSimiScreen {
|
||||||
|
|
||||||
|
private static final List<Property<?>> properties = List.of(
|
||||||
|
RotatedPillarKineticBlock.AXIS,
|
||||||
|
DirectionalKineticBlock.FACING,
|
||||||
|
HorizontalAxisKineticBlock.HORIZONTAL_AXIS,
|
||||||
|
HorizontalKineticBlock.HORIZONTAL_FACING
|
||||||
|
);
|
||||||
|
|
||||||
|
private final BlockState state;
|
||||||
|
private List<BlockState> allStates = List.of();
|
||||||
|
private RadialMenu radialMenu;
|
||||||
|
private int ticksOpen;
|
||||||
|
|
||||||
|
public RadialWrenchMenu(BlockState state) {
|
||||||
|
this.state = state;
|
||||||
|
|
||||||
|
if (!(state.getBlock() instanceof IWrenchable wrenchable))
|
||||||
|
return;
|
||||||
|
|
||||||
|
allStates = getRotatedStates(state);
|
||||||
|
/*allStates = Stream.concat(Arrays.stream(Iterate.directions)
|
||||||
|
.map(dir -> wrenchable.getRotatedBlockState(state, dir)),
|
||||||
|
Stream.of(state)
|
||||||
|
).distinct().toList();*/
|
||||||
|
|
||||||
|
radialMenu = new RadialMenu(allStates.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BlockState> getRotatedStates(BlockState state) {
|
||||||
|
List<BlockState> states = new ArrayList<>();
|
||||||
|
states.add(state);
|
||||||
|
|
||||||
|
for (Property<?> property : properties) {
|
||||||
|
if (state.hasProperty(property)) {
|
||||||
|
cycleAllPropertyValues(property, states);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return states;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void cycleAllPropertyValues(Property<?> property, List<BlockState> states) {
|
||||||
|
while (true) {
|
||||||
|
BlockState lastState = states.get(states.size() - 1);
|
||||||
|
BlockState cycledState = lastState.cycle(property);
|
||||||
|
|
||||||
|
if (states.contains(cycledState))
|
||||||
|
break;
|
||||||
|
|
||||||
|
states.add(cycledState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
ticksOpen++;
|
||||||
|
|
||||||
|
super.tick();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
|
int x = this.width / 2;
|
||||||
|
int y = this.height / 2;
|
||||||
|
|
||||||
|
LocalPlayer player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
|
Vec3 lookAngle = player.getLookAngle();
|
||||||
|
Quaternion quaternion = Quaternion.fromXYZDegrees(new Vector3f(player.getXRot(), player.getYRot(), 0));
|
||||||
|
|
||||||
|
ms.pushPose();
|
||||||
|
ms.translate(x, y, 0);
|
||||||
|
|
||||||
|
ms.pushPose();
|
||||||
|
|
||||||
|
radialMenu.draw(ms, allStates
|
||||||
|
.stream()
|
||||||
|
.map(state -> GuiGameElement.of(state)
|
||||||
|
.rotateBlock(player.getXRot(), player.getYRot() + 180, 0f)
|
||||||
|
.scale(24)
|
||||||
|
).toList()
|
||||||
|
);
|
||||||
|
|
||||||
|
ms.popPose();
|
||||||
|
|
||||||
|
if (allStates.size() <= 1) {
|
||||||
|
GuiGameElement.of(state)
|
||||||
|
.rotateBlock(player.getXRot(), player.getYRot(), 0f)
|
||||||
|
.scale(24)
|
||||||
|
.render(ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
ms.popPose();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(PoseStack p_238651_1_, int p_238651_2_) {
|
||||||
|
Color color = new Color(0x50_101010)
|
||||||
|
.scaleAlpha(Math.min(1, (ticksOpen + AnimationTickHolder.getPartialTicks()) / 20f));
|
||||||
|
|
||||||
|
fillGradient(p_238651_1_, 0, 0, this.width, this.height, color.getRGB(), color.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyReleased(int code, int scanCode, int modifiers) {
|
||||||
|
InputConstants.Key mouseKey = InputConstants.getKey(code, scanCode);
|
||||||
|
if (AllKeys.ROTATE_MENU.getKeybind().isActiveAndMatches(mouseKey)) {
|
||||||
|
onClose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.keyReleased(code, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
|
@MethodsReturnNonnullByDefault
|
||||||
|
@FieldsAreNonnullByDefault
|
||||||
|
package com.simibubi.create.content.contraptions.wrench;
|
||||||
|
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
|
import net.minecraft.FieldsAreNonnullByDefault;
|
||||||
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
|
@ -1,7 +1,10 @@
|
||||||
package com.simibubi.create.events;
|
package com.simibubi.create.events;
|
||||||
|
|
||||||
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.simibubi.create.CreateClient;
|
import com.simibubi.create.CreateClient;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.controls.TrainHUD;
|
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.controls.TrainHUD;
|
||||||
|
import com.simibubi.create.content.contraptions.wrench.RadialWrenchHandler;
|
||||||
import com.simibubi.create.content.curiosities.toolbox.ToolboxHandlerClient;
|
import com.simibubi.create.content.curiosities.toolbox.ToolboxHandlerClient;
|
||||||
import com.simibubi.create.content.logistics.item.LinkedControllerClientHandler;
|
import com.simibubi.create.content.logistics.item.LinkedControllerClientHandler;
|
||||||
import com.simibubi.create.content.logistics.trains.entity.TrainRelocator;
|
import com.simibubi.create.content.logistics.trains.entity.TrainRelocator;
|
||||||
|
@ -28,10 +31,11 @@ public class InputEvents {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int key = event.getKey();
|
int key = event.getKey();
|
||||||
boolean pressed = !(event.getAction() == 0);
|
boolean pressed = event.getAction() != GLFW.GLFW_RELEASE;
|
||||||
|
|
||||||
CreateClient.SCHEMATIC_HANDLER.onKeyInput(key, pressed);
|
CreateClient.SCHEMATIC_HANDLER.onKeyInput(key, pressed);
|
||||||
ToolboxHandlerClient.onKeyInput(key, pressed);
|
ToolboxHandlerClient.onKeyInput(key, pressed);
|
||||||
|
RadialWrenchHandler.onKeyInput(key, pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -98,8 +98,7 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
|
||||||
public AllSections getSection(IForgeRegistryEntry<?> entry) {
|
public AllSections getSection(IForgeRegistryEntry<?> entry) {
|
||||||
return sectionLookup.entrySet()
|
return sectionLookup.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(e -> e.getKey()
|
.filter(e -> e.getKey().get() == entry)
|
||||||
.get() == entry)
|
|
||||||
.map(Entry::getValue)
|
.map(Entry::getValue)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(AllSections.UNASSIGNED);
|
.orElse(AllSections.UNASSIGNED);
|
||||||
|
|
Loading…
Add table
Reference in a new issue