diff --git a/gradle.properties b/gradle.properties index 45da38e..ea69731 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ org.gradle.jvmargs=-Xmx8G version_minecraft=1.18.1 version_forge_minecraft=1.18.1-39.0.5 version_jei=1.18.1:9.1.2.54 -version_engineersdecor=1.1.19-b2 +version_engineersdecor=1.1.19-b3 diff --git a/meta/update.json b/meta/update.json index e42459a..5ecfd33 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.18.1": { + "1.1.19-b3": "[F] Fixed rendering issue.", "1.1.19-b2": "[F] Fixed waterlogging.\n[F] Block entity parent saving corrected, ticker unified.\n[U] Forge/gradle update.", "1.1.19-b1": "[U] Initial 1.18.1 port.", "1.1.18": "[F] Block Placer placement context issue fix.\n[F] Fixed compatibility to Forge >=37.0.82.\n[M] Update lang ru_ru (PR#191, Smollet777).", @@ -49,6 +50,6 @@ }, "promos": { "1.18.1-recommended": "1.1.18", - "1.18.1-latest": "1.1.19-b2" + "1.18.1-latest": "1.1.19-b3" } } \ No newline at end of file diff --git a/readme.md b/readme.md index 31cf0e1..db43390 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.18.x. ## Version history + - v1.1.19-b3 [F] Fixed rendering issue. + - v1.1.19-b2 [F] Fixed waterlogging. [F] Block entity parent saving corrected, ticker unified. [U] Forge/gradle update. diff --git a/src/main/java/wile/engineersdecor/detail/ModRenderers.java b/src/main/java/wile/engineersdecor/detail/ModRenderers.java index d305c34..b8674f7 100644 --- a/src/main/java/wile/engineersdecor/detail/ModRenderers.java +++ b/src/main/java/wile/engineersdecor/detail/ModRenderers.java @@ -24,6 +24,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -71,7 +72,7 @@ public class ModRenderers @OnlyIn(Dist.CLIENT) public static class CraftingTableTer implements BlockEntityRenderer { - private static int tesr_error_counter = 4; + private static int tesr_error_counter = 16; private static final float scaler = 0.1f; private static final float gap = 0.19f; private static final float[] yrotations = {0, 90, 180, 270}; // [hdirection] S-W-N-E @@ -92,7 +93,9 @@ public class ModRenderers { if(tesr_error_counter <= 0) return; try { - final int di = Mth.clamp(te.getLevel().getBlockState(te.getBlockPos()).getValue(CraftingTableBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3); + final BlockState state = te.getLevel().getBlockState(te.getBlockPos()); + if(!(state.getBlock() instanceof EdCraftingTable.CraftingTableBlock)) return; + final int di = Mth.clamp(state.getValue(CraftingTableBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3); long posrnd = te.getBlockPos().asLong(); posrnd = (posrnd>>16)^(posrnd<<1); for(int i=0; i<9; ++i) { @@ -150,7 +153,9 @@ public class ModRenderers try { final ItemStack stack = te.getItemFrameStack(); if(stack.isEmpty()) return; - final int di = Mth.clamp(te.getLevel().getBlockState(te.getBlockPos()).getValue(EdLabeledCrate.LabeledCrateBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3); + final BlockState state = te.getLevel().getBlockState(te.getBlockPos()); + if(!(state.getBlock() instanceof EdLabeledCrate.LabeledCrateBlock)) return; + final int di = Mth.clamp(state.getValue(EdLabeledCrate.LabeledCrateBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3); double ox = tr[di][0], oy = tr[di][1], oz = tr[di][2]; float ry = (float)tr[di][3]; mxs.pushPose(); diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java index 7ef78d1..0ca749a 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java @@ -209,12 +209,7 @@ public class StandardBlocks { this(conf, properties, Arrays.stream(aabbs).map(Shapes::create).reduce(Shapes.empty(), (shape, aabb)->Shapes.joinUnoptimized(shape, aabb, BooleanOp.OR))); } public Cutout(long conf, BlockBehaviour.Properties properties, VoxelShape voxel_shape) - { - super(conf, properties); - vshape = voxel_shape; - BlockState state = getStateDefinition().any(); - registerDefaultState(state); - } + { super(conf, properties); vshape = voxel_shape; } @Override @SuppressWarnings("deprecation") @@ -304,7 +299,7 @@ public class StandardBlocks public Directed(long config, BlockBehaviour.Properties properties, final Function, Map> shape_supplier) { super(config, properties); - registerDefaultState(stateDefinition.any().setValue(FACING, Direction.UP)); + registerDefaultState(super.defaultBlockState().setValue(FACING, Direction.UP)); vshapes = shape_supplier.apply(getStateDefinition().getPossibleStates()); } @@ -459,7 +454,7 @@ public class StandardBlocks public Horizontal(long config, BlockBehaviour.Properties properties, final Function, Map> shape_supplier) { super(config|CFG_HORIZIONTAL, properties); - registerDefaultState(stateDefinition.any().setValue(HORIZONTAL_FACING, Direction.NORTH)); + registerDefaultState(super.defaultBlockState().setValue(HORIZONTAL_FACING, Direction.NORTH)); vshapes = shape_supplier.apply(getStateDefinition().getPossibleStates()); cshapes = shape_supplier.apply(getStateDefinition().getPossibleStates()); }