diff --git a/src/main/java/xyz/pixelatedw/finalbeta/WyHelper.java b/src/main/java/xyz/pixelatedw/finalbeta/WyHelper.java index cc4bcfd..36b91eb 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/WyHelper.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/WyHelper.java @@ -9,8 +9,8 @@ import java.util.HashMap; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.Player; import net.minecraft.item.ItemInstance; -import net.minecraft.item.ItemType; import net.minecraft.recipe.RecipeRegistry; +import net.minecraft.tile.Tile; import xyz.pixelatedw.finalbeta.mixin.RecipeRegistryAccessor; public class WyHelper { @@ -115,7 +115,8 @@ public class WyHelper { // player.dropItem(new ItemInstance(Tile.SLAB, 64)); // player.dropItem(new ItemInstance(ItemType.minecart, 1)); // player.dropItem(new ItemInstance(ItemType.minecartFurnace, 1)); - player.dropItem(new ItemInstance(ItemType.bucket, 1)); + player.dropItem(new ItemInstance(Tile.FENCE, 1)); + player.dropItem(new ItemInstance(Tile.STONE_SLAB, 1, 2)); // player.dropItem(new ItemInstance(Tile.GOLDEN_RAIL, 64)); // player.dropItem(new ItemInstance(Tile.COBBLESTONE, 64)); diff --git a/src/main/java/xyz/pixelatedw/finalbeta/mixin/FenceTileMixin.java b/src/main/java/xyz/pixelatedw/finalbeta/mixin/FenceTileMixin.java index 495904d..dfcdd39 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/mixin/FenceTileMixin.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/mixin/FenceTileMixin.java @@ -39,10 +39,20 @@ public class FenceTileMixin extends Tile { private Box createFenceBox(Level level, int x, int y, int z, boolean isOutline) { Tile tile = ((FenceTile)(Object)this); - boolean eastCheck = level.getMaterial(x + 1, y, z).isSolid(); - boolean westCheck = level.getMaterial(x - 1, y, z).isSolid(); - boolean southCheck = level.getMaterial(x, y, z + 1).isSolid(); - boolean northCheck = level.getMaterial(x, y, z - 1).isSolid(); + Tile xpTile = Tile.BY_ID[level.getTileId(x + 1, y, z)]; + Tile xnTile = Tile.BY_ID[level.getTileId(x - 1, y, z)]; + Tile zpTile = Tile.BY_ID[level.getTileId(x, y, z + 1)]; + Tile znTile = Tile.BY_ID[level.getTileId(x, y, z - 1)]; + + boolean xpCheck = xpTile != null && (xpTile.isFullCube() || xpTile.id == Tile.FENCE.id); + boolean xnCheck = xnTile != null && (xnTile.isFullCube() || xnTile.id == Tile.FENCE.id); + boolean zpCheck = zpTile != null && (zpTile.isFullCube() || zpTile.id == Tile.FENCE.id); + boolean znCheck = znTile != null && (znTile.isFullCube() || znTile.id == Tile.FENCE.id); + + boolean eastCheck = level.getMaterial(x + 1, y, z).isSolid() && xpCheck; + boolean westCheck = level.getMaterial(x - 1, y, z).isSolid() && xnCheck; + boolean southCheck = level.getMaterial(x, y, z + 1).isSolid() && zpCheck; + boolean northCheck = level.getMaterial(x, y, z - 1).isSolid() && znCheck; Box box = Box.create(westCheck ? 0 : 0.375f, 0.0f, northCheck ? 0.0f : 0.375f, eastCheck ? 1.0f : 0.625f, 1.0F, southCheck ? 1.0f : 0.625f); diff --git a/src/main/java/xyz/pixelatedw/finalbeta/mixin/TileRendererMixin.java b/src/main/java/xyz/pixelatedw/finalbeta/mixin/TileRendererMixin.java index fc3ee10..127c1d8 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/mixin/TileRendererMixin.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/mixin/TileRendererMixin.java @@ -49,10 +49,20 @@ public class TileRendererMixin { var9 = 1; } - int var10 = this.field_82.getMaterial(x - 1, y, z).isSolid() ? 1 : 0; - int var11 = this.field_82.getMaterial(x + 1, y, z).isSolid() ? 1 : 0; - int var12 = this.field_82.getMaterial(x, y, z - 1).isSolid() ? 1 : 0; - int var13 = this.field_82.getMaterial(x, y, z + 1).isSolid() ? 1 : 0; + Tile xpTile = Tile.BY_ID[this.field_82.getTileId(x + 1, y, z)]; + Tile xnTile = Tile.BY_ID[this.field_82.getTileId(x - 1, y, z)]; + Tile zpTile = Tile.BY_ID[this.field_82.getTileId(x, y, z + 1)]; + Tile znTile = Tile.BY_ID[this.field_82.getTileId(x, y, z - 1)]; + + boolean xpCheck = xpTile != null && (xpTile.isFullCube() || xpTile.id == Tile.FENCE.id); + boolean xnCheck = xnTile != null && (xnTile.isFullCube() || xnTile.id == Tile.FENCE.id); + boolean zpCheck = zpTile != null && (zpTile.isFullCube() || zpTile.id == Tile.FENCE.id); + boolean znCheck = znTile != null && (znTile.isFullCube() || znTile.id == Tile.FENCE.id); + + int var10 = this.field_82.getMaterial(x - 1, y, z).isSolid() && xnCheck ? 1 : 0; + int var11 = this.field_82.getMaterial(x + 1, y, z).isSolid() && xpCheck ? 1 : 0; + int var12 = this.field_82.getMaterial(x, y, z - 1).isSolid() && znCheck ? 1 : 0; + int var13 = this.field_82.getMaterial(x, y, z + 1).isSolid() && zpCheck ? 1 : 0; if (var8 == 0 && var9 == 0) { var8 = 1; }