From 78b8b6f6079c4ae3ca8921be0ef34be4ca1b2732 Mon Sep 17 00:00:00 2001 From: Adrien1106 Date: Tue, 16 Apr 2024 00:24:16 +0200 Subject: [PATCH] cleanup + fixed wall collision when using chorus --- .../java/fr/adrien1106/reframed/ReFramed.java | 1 - .../reframed/block/ReframedWallBlock.java | 15 +++++++++++---- .../client/model/RetexturingBakedModel.java | 2 -- .../client/model/UnbakedRetexturedModel.java | 1 - 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/adrien1106/reframed/ReFramed.java b/src/main/java/fr/adrien1106/reframed/ReFramed.java index f0aff35..532f6e4 100644 --- a/src/main/java/fr/adrien1106/reframed/ReFramed.java +++ b/src/main/java/fr/adrien1106/reframed/ReFramed.java @@ -32,7 +32,6 @@ import static fr.adrien1106.reframed.util.blocks.BlockProperties.LIGHT; * TODO add minecraft models like wall fence etc -> for v1.6 * TODO better connected textures -> maybe v1.6 ? * TODO support continuity overlays -> not scheduled - * TODO fence remove collision if popped chorus -> asap */ public class ReFramed implements ModInitializer { public static final String MODID = "reframed"; diff --git a/src/main/java/fr/adrien1106/reframed/block/ReframedWallBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReframedWallBlock.java index 5b54a0a..581f7db 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReframedWallBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReframedWallBlock.java @@ -79,9 +79,12 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock { boolean side_full = other_state.isSideSolidFullSquare(world, moved, dir.getOpposite()); if (shouldConnectTo(other_state, side_full, dir.getOpposite())) { + Property wall_shape = getWallShape(dir); new_state = new_state.with( - getWallShape(dir), - fs || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_shape) + wall_shape, + fs + || (top_state.contains(wall_shape) && top_state.get(wall_shape) != WallShape.NONE) + || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_shape) ? WallShape.TALL : WallShape.LOW ); @@ -102,9 +105,12 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock { BlockState neighbor = world.getBlockState(offset); boolean side_full = neighbor.isSideSolidFullSquare(world, offset, dir.getOpposite()); if (shouldConnectTo(neighbor, side_full, dir.getOpposite())) { + Property wall_shape = getWallShape(dir); state = state.with( - getWallShape(dir), - fs || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_shape) + wall_shape, + fs + || (top_state.contains(wall_shape) && top_state.get(wall_shape) != WallShape.NONE) + || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_shape) ? WallShape.TALL : WallShape.LOW ); @@ -133,6 +139,7 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock { @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { + if (isGhost(view, pos)) return VoxelShapes.empty(); VoxelShape shape = state.get(UP) ? WALL_VOXELS[9]: VoxelShapes.empty(); for (Direction dir : Direction.Type.HORIZONTAL) { if (state.get(getWallShape(dir)) != WallShape.NONE) diff --git a/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java index 03cbe78..9400b1a 100644 --- a/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java @@ -2,10 +2,8 @@ package fr.adrien1106.reframed.client.model; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import fr.adrien1106.reframed.block.ReFramedBlock; import fr.adrien1106.reframed.block.ReFramedEntity; import fr.adrien1106.reframed.client.ReFramedClient; -import fr.adrien1106.reframed.client.util.RenderHelper; import fr.adrien1106.reframed.mixin.MinecraftAccessor; import fr.adrien1106.reframed.client.model.apperance.CamoAppearance; import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager; diff --git a/src/main/java/fr/adrien1106/reframed/client/model/UnbakedRetexturedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedRetexturedModel.java index 46e6ec5..f60ac40 100644 --- a/src/main/java/fr/adrien1106/reframed/client/model/UnbakedRetexturedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedRetexturedModel.java @@ -15,7 +15,6 @@ public abstract class UnbakedRetexturedModel implements UnbakedModel { protected int theme_index = 1; protected BlockState item_state; - protected final boolean ao = true; protected final int state_count; protected final Property[] properties;