1.5.8 cache fix #13

Merged
Adrien1106 merged 3 commits from dev into master 2024-04-16 19:21:50 +02:00
4 changed files with 11 additions and 8 deletions
Showing only changes of commit 78b8b6f607 - Show all commits

View File

@ -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 add minecraft models like wall fence etc -> for v1.6
* TODO better connected textures -> maybe v1.6 ? * TODO better connected textures -> maybe v1.6 ?
* TODO support continuity overlays -> not scheduled * TODO support continuity overlays -> not scheduled
* TODO fence remove collision if popped chorus -> asap
*/ */
public class ReFramed implements ModInitializer { public class ReFramed implements ModInitializer {
public static final String MODID = "reframed"; public static final String MODID = "reframed";

View File

@ -79,9 +79,12 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock {
boolean side_full = other_state.isSideSolidFullSquare(world, moved, dir.getOpposite()); boolean side_full = other_state.isSideSolidFullSquare(world, moved, dir.getOpposite());
if (shouldConnectTo(other_state, side_full, dir.getOpposite())) { if (shouldConnectTo(other_state, side_full, dir.getOpposite())) {
Property<WallShape> wall_shape = getWallShape(dir);
new_state = new_state.with( new_state = new_state.with(
getWallShape(dir), wall_shape,
fs || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_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.TALL
: WallShape.LOW : WallShape.LOW
); );
@ -102,9 +105,12 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock {
BlockState neighbor = world.getBlockState(offset); BlockState neighbor = world.getBlockState(offset);
boolean side_full = neighbor.isSideSolidFullSquare(world, offset, dir.getOpposite()); boolean side_full = neighbor.isSideSolidFullSquare(world, offset, dir.getOpposite());
if (shouldConnectTo(neighbor, side_full, dir.getOpposite())) { if (shouldConnectTo(neighbor, side_full, dir.getOpposite())) {
Property<WallShape> wall_shape = getWallShape(dir);
state = state.with( state = state.with(
getWallShape(dir), wall_shape,
fs || shouldUseTall(WALL_VOXELS[dir.ordinal() + 3], top_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.TALL
: WallShape.LOW : WallShape.LOW
); );
@ -133,6 +139,7 @@ public class ReframedWallBlock extends WaterloggableReFramedBlock {
@Override @Override
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { 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(); VoxelShape shape = state.get(UP) ? WALL_VOXELS[9]: VoxelShapes.empty();
for (Direction dir : Direction.Type.HORIZONTAL) { for (Direction dir : Direction.Type.HORIZONTAL) {
if (state.get(getWallShape(dir)) != WallShape.NONE) if (state.get(getWallShape(dir)) != WallShape.NONE)

View File

@ -2,10 +2,8 @@ package fr.adrien1106.reframed.client.model;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import fr.adrien1106.reframed.block.ReFramedBlock;
import fr.adrien1106.reframed.block.ReFramedEntity; import fr.adrien1106.reframed.block.ReFramedEntity;
import fr.adrien1106.reframed.client.ReFramedClient; import fr.adrien1106.reframed.client.ReFramedClient;
import fr.adrien1106.reframed.client.util.RenderHelper;
import fr.adrien1106.reframed.mixin.MinecraftAccessor; import fr.adrien1106.reframed.mixin.MinecraftAccessor;
import fr.adrien1106.reframed.client.model.apperance.CamoAppearance; import fr.adrien1106.reframed.client.model.apperance.CamoAppearance;
import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager; import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager;

View File

@ -15,7 +15,6 @@ public abstract class UnbakedRetexturedModel implements UnbakedModel {
protected int theme_index = 1; protected int theme_index = 1;
protected BlockState item_state; protected BlockState item_state;
protected final boolean ao = true;
protected final int state_count; protected final int state_count;
protected final Property<?>[] properties; protected final Property<?>[] properties;