Skip to content

Commit

Permalink
Fix transparency bug with glass slabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 10, 2023
1 parent 523aa85 commit 72f0e79
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
11 changes: 6 additions & 5 deletions src/main/java/net/wurstclient/glass/GlassSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ private boolean isInvisibleToGlassSlab(BlockState state,
SlabType type = state.get(SlabBlock.TYPE);
SlabType typeFrom = stateFrom.get(SlabBlock.TYPE);

if(typeFrom == SlabType.DOUBLE)
return true;

switch(direction)
{
case UP:
if(typeFrom != SlabType.TOP && type != SlabType.BOTTOM)
return true;
break;

case DOWN:
if(type != typeFrom)
if(typeFrom != SlabType.BOTTOM && type != SlabType.TOP)
return true;
break;

case NORTH:
case EAST:
case SOUTH:
case WEST:
if(type == typeFrom)
if(type == typeFrom || typeFrom == SlabType.DOUBLE)
return true;
break;
}
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/wurstclient/glass/StainedGlassSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,23 @@ private boolean isInvisibleToGlassSlab(BlockState state,
SlabType type = state.get(SlabBlock.TYPE);
SlabType typeFrom = stateFrom.get(SlabBlock.TYPE);

if(typeFrom == SlabType.DOUBLE)
return true;

switch(direction)
{
case UP:
if(typeFrom != SlabType.TOP && type != SlabType.BOTTOM)
return true;
break;

case DOWN:
if(type != typeFrom)
if(typeFrom != SlabType.BOTTOM && type != SlabType.TOP)
return true;
break;

case NORTH:
case EAST:
case SOUTH:
case WEST:
if(type == typeFrom)
if(type == typeFrom || typeFrom == SlabType.DOUBLE)
return true;
break;
}
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/wurstclient/glass/TintedGlassSlabBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ private boolean isInvisibleToGlassSlab(BlockState state,
SlabType type = state.get(SlabBlock.TYPE);
SlabType typeFrom = stateFrom.get(SlabBlock.TYPE);

if(typeFrom == SlabType.DOUBLE)
return true;

switch(direction)
{
case UP:
if(typeFrom != SlabType.TOP && type != SlabType.BOTTOM)
return true;
break;

case DOWN:
if(type != typeFrom)
if(typeFrom != SlabType.BOTTOM && type != SlabType.TOP)
return true;
break;

case NORTH:
case EAST:
case SOUTH:
case WEST:
if(type == typeFrom)
if(type == typeFrom || typeFrom == SlabType.DOUBLE)
return true;
break;
}
Expand Down

0 comments on commit 72f0e79

Please sign in to comment.