diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index 96894a15a..dc463a627 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -456,11 +456,9 @@ public class CreateJEI implements IModPlugin { return addRecipeListConsumer(recipes -> { List> excludedRecipes = getTypedRecipes(recipeType.get()); recipes.removeIf(recipe -> { - for (Recipe excludedRecipe : excludedRecipes) { - if (doInputsMatch(recipe, excludedRecipe)) { + for (Recipe excludedRecipe : excludedRecipes) + if (doInputsMatch(recipe, excludedRecipe) && doOutputsMatch(recipe, excludedRecipe)) return true; - } - } return false; }); }); @@ -570,4 +568,8 @@ public class CreateJEI implements IModPlugin { .test(matchingStacks[0]); } + public static boolean doOutputsMatch(Recipe recipe1, Recipe recipe2) { + return ItemStack.isSame(recipe1.getResultItem(), recipe2.getResultItem()); + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovingInteraction.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovingInteraction.java index 2b03e8e4e..94e325647 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovingInteraction.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovingInteraction.java @@ -116,7 +116,7 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav if (!(ctx.temporaryData instanceof ElevatorFloorSelection efs)) return false; if (efs.currentTargetY == contraption.clientYTarget) - return false; + return true; AllPackets.getChannel().sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY)); if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorControlsHandler.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorControlsHandler.java index c81edff52..01208138f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorControlsHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorControlsHandler.java @@ -22,6 +22,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; import net.minecraft.util.Mth; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; @@ -31,7 +32,19 @@ import net.minecraftforge.api.distmarker.OnlyIn; public class ElevatorControlsHandler { - private static ControlsSlot slot = new ContraptionControlsBlockEntity.ControlsSlot(); + private static ControlsSlot slot = new ElevatorControlsSlot(); + + private static class ElevatorControlsSlot extends ContraptionControlsBlockEntity.ControlsSlot { + + @Override + public boolean testHit(BlockState state, Vec3 localHit) { + Vec3 offset = getLocalOffset(state); + if (offset == null) + return false; + return localHit.distanceTo(offset) < scale * .85; + } + + } @OnlyIn(Dist.CLIENT) public static boolean onScroll(double delta) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java index abff6a032..b17932720 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java @@ -14,6 +14,7 @@ import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.core.Direction; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -27,6 +28,11 @@ public class ControlsMovementBehaviour implements MovementBehaviour { LerpedFloat equipAnimation = LerpedFloat.linear(); } + @Override + public ItemStack canBeDisabledVia(MovementContext context) { + return null; + } + @Override public void stopMoving(MovementContext context) { context.contraption.entity.stopControlling(context.localPos); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/InWorldProcessing.java b/src/main/java/com/simibubi/create/content/contraptions/processing/InWorldProcessing.java index c6dfbb00c..2e3cb3417 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/InWorldProcessing.java @@ -40,6 +40,7 @@ import net.minecraft.world.entity.animal.horse.SkeletonHorse; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.monster.EnderMan; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.AbstractCookingRecipe; import net.minecraft.world.item.crafting.BlastingRecipe; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; @@ -170,20 +171,22 @@ public class InWorldProcessing { .getRecipeFor(RecipeType.SMOKING, RECIPE_WRAPPER, world); if (type == Type.BLASTING) { - if (!smokingRecipe.isPresent()) { + RECIPE_WRAPPER.setItem(0, stack); + Optional smeltingRecipe = world.getRecipeManager() + .getRecipeFor(RecipeType.SMELTING, RECIPE_WRAPPER, world); + if (!smeltingRecipe.isPresent()) { RECIPE_WRAPPER.setItem(0, stack); - Optional smeltingRecipe = world.getRecipeManager() - .getRecipeFor(RecipeType.SMELTING, RECIPE_WRAPPER, world); - - if (smeltingRecipe.isPresent()) - return applyRecipeOn(stack, smeltingRecipe.get()); - - RECIPE_WRAPPER.setItem(0, stack); - Optional blastingRecipe = world.getRecipeManager() + smeltingRecipe = world.getRecipeManager() .getRecipeFor(RecipeType.BLASTING, RECIPE_WRAPPER, world); + } - if (blastingRecipe.isPresent()) - return applyRecipeOn(stack, blastingRecipe.get()); + if (smeltingRecipe.isPresent()) { + if (!smokingRecipe.isPresent() || !ItemStack.isSame(smokingRecipe.get() + .getResultItem(), + smeltingRecipe.get() + .getResultItem())) { + return applyRecipeOn(stack, smeltingRecipe.get()); + } } return Collections.emptyList(); diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java index d24f8b5eb..c322ff42b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/edgePoint/station/StationScreen.java @@ -271,10 +271,6 @@ public class StationScreen extends AbstractStationScreen { for (int i = carriages.size() - 1; i > 0; i--) { RenderSystem.setShaderColor(1, 1, 1, Math.min(1f, Math.min((position + offset - 10) / 30f, (background.width - 40 - position - offset) / 30f))); -// if (i == carriages.size() - 1 && train.doubleEnded) { -// offset += icon.render(TrainIconType.FLIPPED_ENGINE, ms, x + offset, y + 20) + 1; -// continue; -// } Carriage carriage = carriages.get(blockEntity.trainBackwards ? carriages.size() - i - 1 : i); offset += icon.render(carriage.bogeySpacing, ms, x + offset, y + 20) + 1; } @@ -287,8 +283,8 @@ public class StationScreen extends AbstractStationScreen { RenderSystem.setShaderColor(1, 1, 1, 1); - UIRenderHelper.drawStretched(ms, x + 21, y + 43, 150, 46, -100, AllGuiTextures.STATION_TEXTBOX_MIDDLE); AllGuiTextures.STATION_TEXTBOX_TOP.render(ms, x + 21, y + 42); + UIRenderHelper.drawStretched(ms, x + 21, y + 60, 150, 26, 0, AllGuiTextures.STATION_TEXTBOX_MIDDLE); AllGuiTextures.STATION_TEXTBOX_BOTTOM.render(ms, x + 21, y + 86); ms.pushPose(); diff --git a/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_active.json b/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_active.json index f92b01ffc..41b481ea8 100644 --- a/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_active.json +++ b/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_active.json @@ -1,17 +1,17 @@ { - "textures": { - "stonecutter_saw": "minecraft:block/stonecutter_saw", - "stonecutter_saw_reversed" : "create:block/saw_reversed" - }, - "elements": [ - { - "name": "Blade", - "from": [ 1, 8, 11 ], - "to": [ 15, 8.062, 18 ], - "faces": { - "up": { "texture": "#stonecutter_saw", "uv": [ 1, 9, 15, 16 ], "rotation": 180 }, - "down": { "texture": "#stonecutter_saw_reversed", "uv": [ 1, 9, 15, 16 ] } - } - } - ] + "credit": "Made with Blockbench", + "textures": { + "stonecutter_saw": "block/stonecutter_saw" + }, + "elements": [ + { + "name": "Blade", + "from": [1, 8, 11], + "to": [15, 8.062, 18], + "faces": { + "up": {"uv": [1, 9, 15, 16], "rotation": 180, "texture": "#stonecutter_saw"}, + "down": {"uv": [15, 9, 1, 16], "texture": "#stonecutter_saw"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_reversed.json b/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_reversed.json index 02382bef0..55de7a920 100644 --- a/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_reversed.json +++ b/src/main/resources/assets/create/models/block/mechanical_saw/blade_horizontal_reversed.json @@ -1,7 +1,17 @@ { - "parent": "create:block/mechanical_saw/blade_horizontal_active", - "textures": { - "stonecutter_saw": "create:block/saw_reversed", - "stonecutter_saw": "minecraft:block/stonecutter_saw" - } + "credit": "Made with Blockbench", + "textures": { + "stonecutter_saw": "block/stonecutter_saw" + }, + "elements": [ + { + "name": "Blade", + "from": [1, 8, 11], + "to": [15, 8.062, 18], + "faces": { + "up": {"uv": [15, 9, 1, 16], "rotation": 180, "texture": "#stonecutter_saw"}, + "down": {"uv": [1, 9, 15, 16], "texture": "#stonecutter_saw"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_active.json b/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_active.json index b1bc71a68..433fa5110 100644 --- a/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_active.json +++ b/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_active.json @@ -1,17 +1,17 @@ { - "textures": { - "stonecutter_saw": "minecraft:block/stonecutter_saw", - "stonecutter_saw_reversed" : "create:block/saw_reversed" - }, - "elements": [ - { - "name": "Saw", - "from": [ 0, 8, 11 ], - "to": [ 16, 8, 19 ], - "faces": { - "up": { "texture": "#stonecutter_saw", "uv": [ 0, 8, 16, 16 ], "rotation": 180 }, - "down": { "texture": "#stonecutter_saw_reversed", "uv": [ 0, 8, 16, 16 ] } - } - } - ] + "credit": "Made with Blockbench", + "textures": { + "stonecutter_saw": "block/stonecutter_saw" + }, + "elements": [ + { + "name": "Saw", + "from": [0, 8, 11], + "to": [16, 8, 19], + "faces": { + "up": {"uv": [0, 8, 16, 16], "rotation": 180, "texture": "#stonecutter_saw"}, + "down": {"uv": [16, 8, 0, 16], "texture": "#stonecutter_saw"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_reversed.json b/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_reversed.json index 56a353a4f..597c65c33 100644 --- a/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_reversed.json +++ b/src/main/resources/assets/create/models/block/mechanical_saw/blade_vertical_reversed.json @@ -1,7 +1,17 @@ { - "parent": "create:block/mechanical_saw/blade_vertical_active", - "textures": { - "stonecutter_saw": "create:block/saw_reversed", - "stonecutter_saw_reversed": "minecraft:block/stonecutter_saw" - } + "credit": "Made with Blockbench", + "textures": { + "stonecutter_saw": "block/stonecutter_saw" + }, + "elements": [ + { + "name": "Saw", + "from": [0, 8, 11], + "to": [16, 8, 19], + "faces": { + "up": {"uv": [16, 8, 0, 16], "rotation": 180, "texture": "#stonecutter_saw"}, + "down": {"uv": [0, 8, 16, 16], "texture": "#stonecutter_saw"} + } + } + ] } \ No newline at end of file