Playtest IV

- Fixed lava fans voiding items that have smoking & smelting recipes with different outputs
- Fixed Mechanical Saws not rendering as animated when using rubidium (?)
- Right clicking elevator controls now always prevents block placement actions
- Increased size of the scroll bounding box on elevator controls
- Fixed a ui element of the Station Screen rendering behind the background
- Fixed train controls not rendering handles when loading in with activated contraption controls
This commit is contained in:
simibubi 2023-04-18 19:03:11 +02:00
parent 1432c46c47
commit 98a08d667e
10 changed files with 102 additions and 62 deletions

View file

@ -456,11 +456,9 @@ public class CreateJEI implements IModPlugin {
return addRecipeListConsumer(recipes -> { return addRecipeListConsumer(recipes -> {
List<Recipe<?>> excludedRecipes = getTypedRecipes(recipeType.get()); List<Recipe<?>> excludedRecipes = getTypedRecipes(recipeType.get());
recipes.removeIf(recipe -> { recipes.removeIf(recipe -> {
for (Recipe<?> excludedRecipe : excludedRecipes) { for (Recipe<?> excludedRecipe : excludedRecipes)
if (doInputsMatch(recipe, excludedRecipe)) { if (doInputsMatch(recipe, excludedRecipe) && doOutputsMatch(recipe, excludedRecipe))
return true; return true;
}
}
return false; return false;
}); });
}); });
@ -570,4 +568,8 @@ public class CreateJEI implements IModPlugin {
.test(matchingStacks[0]); .test(matchingStacks[0]);
} }
public static boolean doOutputsMatch(Recipe<?> recipe1, Recipe<?> recipe2) {
return ItemStack.isSame(recipe1.getResultItem(), recipe2.getResultItem());
}
} }

View file

@ -116,7 +116,7 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav
if (!(ctx.temporaryData instanceof ElevatorFloorSelection efs)) if (!(ctx.temporaryData instanceof ElevatorFloorSelection efs))
return false; return false;
if (efs.currentTargetY == contraption.clientYTarget) if (efs.currentTargetY == contraption.clientYTarget)
return false; return true;
AllPackets.getChannel().sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY)); AllPackets.getChannel().sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY));
if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte) if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte)

View file

@ -22,6 +22,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer; import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth; 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.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
@ -31,7 +32,19 @@ import net.minecraftforge.api.distmarker.OnlyIn;
public class ElevatorControlsHandler { 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) @OnlyIn(Dist.CLIENT)
public static boolean onScroll(double delta) { public static boolean onScroll(double delta) {

View file

@ -14,6 +14,7 @@ import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@ -27,6 +28,11 @@ public class ControlsMovementBehaviour implements MovementBehaviour {
LerpedFloat equipAnimation = LerpedFloat.linear(); LerpedFloat equipAnimation = LerpedFloat.linear();
} }
@Override
public ItemStack canBeDisabledVia(MovementContext context) {
return null;
}
@Override @Override
public void stopMoving(MovementContext context) { public void stopMoving(MovementContext context) {
context.contraption.entity.stopControlling(context.localPos); context.contraption.entity.stopControlling(context.localPos);

View file

@ -40,6 +40,7 @@ import net.minecraft.world.entity.animal.horse.SkeletonHorse;
import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.monster.EnderMan; import net.minecraft.world.entity.monster.EnderMan;
import net.minecraft.world.item.ItemStack; 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.BlastingRecipe;
import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.item.crafting.RecipeType;
@ -170,20 +171,22 @@ public class InWorldProcessing {
.getRecipeFor(RecipeType.SMOKING, RECIPE_WRAPPER, world); .getRecipeFor(RecipeType.SMOKING, RECIPE_WRAPPER, world);
if (type == Type.BLASTING) { if (type == Type.BLASTING) {
if (!smokingRecipe.isPresent()) {
RECIPE_WRAPPER.setItem(0, stack); RECIPE_WRAPPER.setItem(0, stack);
Optional<SmeltingRecipe> smeltingRecipe = world.getRecipeManager() Optional<? extends AbstractCookingRecipe> smeltingRecipe = world.getRecipeManager()
.getRecipeFor(RecipeType.SMELTING, RECIPE_WRAPPER, world); .getRecipeFor(RecipeType.SMELTING, RECIPE_WRAPPER, world);
if (!smeltingRecipe.isPresent()) {
if (smeltingRecipe.isPresent())
return applyRecipeOn(stack, smeltingRecipe.get());
RECIPE_WRAPPER.setItem(0, stack); RECIPE_WRAPPER.setItem(0, stack);
Optional<BlastingRecipe> blastingRecipe = world.getRecipeManager() smeltingRecipe = world.getRecipeManager()
.getRecipeFor(RecipeType.BLASTING, RECIPE_WRAPPER, world); .getRecipeFor(RecipeType.BLASTING, RECIPE_WRAPPER, world);
}
if (blastingRecipe.isPresent()) if (smeltingRecipe.isPresent()) {
return applyRecipeOn(stack, blastingRecipe.get()); if (!smokingRecipe.isPresent() || !ItemStack.isSame(smokingRecipe.get()
.getResultItem(),
smeltingRecipe.get()
.getResultItem())) {
return applyRecipeOn(stack, smeltingRecipe.get());
}
} }
return Collections.emptyList(); return Collections.emptyList();

View file

@ -271,10 +271,6 @@ public class StationScreen extends AbstractStationScreen {
for (int i = carriages.size() - 1; i > 0; i--) { for (int i = carriages.size() - 1; i > 0; i--) {
RenderSystem.setShaderColor(1, 1, 1, Math.min(1f, RenderSystem.setShaderColor(1, 1, 1, Math.min(1f,
Math.min((position + offset - 10) / 30f, (background.width - 40 - position - offset) / 30f))); 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); Carriage carriage = carriages.get(blockEntity.trainBackwards ? carriages.size() - i - 1 : i);
offset += icon.render(carriage.bogeySpacing, ms, x + offset, y + 20) + 1; 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); 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); 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); AllGuiTextures.STATION_TEXTBOX_BOTTOM.render(ms, x + 21, y + 86);
ms.pushPose(); ms.pushPose();

View file

@ -1,7 +1,7 @@
{ {
"credit": "Made with Blockbench",
"textures": { "textures": {
"stonecutter_saw": "minecraft:block/stonecutter_saw", "stonecutter_saw": "block/stonecutter_saw"
"stonecutter_saw_reversed" : "create:block/saw_reversed"
}, },
"elements": [ "elements": [
{ {
@ -9,8 +9,8 @@
"from": [1, 8, 11], "from": [1, 8, 11],
"to": [15, 8.062, 18], "to": [15, 8.062, 18],
"faces": { "faces": {
"up": { "texture": "#stonecutter_saw", "uv": [ 1, 9, 15, 16 ], "rotation": 180 }, "up": {"uv": [1, 9, 15, 16], "rotation": 180, "texture": "#stonecutter_saw"},
"down": { "texture": "#stonecutter_saw_reversed", "uv": [ 1, 9, 15, 16 ] } "down": {"uv": [15, 9, 1, 16], "texture": "#stonecutter_saw"}
} }
} }
] ]

View file

@ -1,7 +1,17 @@
{ {
"parent": "create:block/mechanical_saw/blade_horizontal_active", "credit": "Made with Blockbench",
"textures": { "textures": {
"stonecutter_saw": "create:block/saw_reversed", "stonecutter_saw": "block/stonecutter_saw"
"stonecutter_saw": "minecraft: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"}
} }
} }
]
}

View file

@ -1,7 +1,7 @@
{ {
"credit": "Made with Blockbench",
"textures": { "textures": {
"stonecutter_saw": "minecraft:block/stonecutter_saw", "stonecutter_saw": "block/stonecutter_saw"
"stonecutter_saw_reversed" : "create:block/saw_reversed"
}, },
"elements": [ "elements": [
{ {
@ -9,8 +9,8 @@
"from": [0, 8, 11], "from": [0, 8, 11],
"to": [16, 8, 19], "to": [16, 8, 19],
"faces": { "faces": {
"up": { "texture": "#stonecutter_saw", "uv": [ 0, 8, 16, 16 ], "rotation": 180 }, "up": {"uv": [0, 8, 16, 16], "rotation": 180, "texture": "#stonecutter_saw"},
"down": { "texture": "#stonecutter_saw_reversed", "uv": [ 0, 8, 16, 16 ] } "down": {"uv": [16, 8, 0, 16], "texture": "#stonecutter_saw"}
} }
} }
] ]

View file

@ -1,7 +1,17 @@
{ {
"parent": "create:block/mechanical_saw/blade_vertical_active", "credit": "Made with Blockbench",
"textures": { "textures": {
"stonecutter_saw": "create:block/saw_reversed", "stonecutter_saw": "block/stonecutter_saw"
"stonecutter_saw_reversed": "minecraft: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"}
} }
} }
]
}