Skip to content

Commit

Permalink
Merge remote-tracking branch 'DrParadox7/GTPR' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed May 10, 2024
2 parents 3ab36bd + 1cfe3ce commit f4d4d19
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/main/java/twilightforest/block/BlockTFNagastone.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public void onNeighborBlockChange(World world, int x, int y, int z, Block neighb
te.facing = Facing.NORTH;
break;
case 9:
case 14:
te.blockMetadata = 1;
te.direction = Direction.UP;
te.facing = Facing.SOUTH;
Expand All @@ -248,11 +249,6 @@ public void onNeighborBlockChange(World world, int x, int y, int z, Block neighb
te.direction = Direction.SIDE;
te.facing = Facing.EAST;
break;
case 14:
te.blockMetadata = 1;
te.direction = Direction.UP;
te.facing = Facing.SOUTH;
break;
}
world.setTileEntity(x, y, z, te);
}
Expand Down Expand Up @@ -286,6 +282,7 @@ public void Check4Neighbours(World world, int x, int y, int z) {

public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
TileEntityTFNagastone currentBlock = (TileEntityTFNagastone) world.getTileEntity(x, y, z);
Facing facingCurrentBlock = currentBlock.facing != null ? currentBlock.facing : Facing.EAST;
if (world.getBlockMetadata(x, y, z) == 1) if (isNagaStoneInDirection(world, x, y, z, direction)) {
TileEntityTFNagastone neighbourBlock = null;
switch (direction) {
Expand Down Expand Up @@ -319,7 +316,7 @@ public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
case 0:
if (neighbourBlock.direction != Direction.DOWN) return false;
else {
if (currentBlock.direction == Direction.SIDE) switch (currentBlock.facing) {
if (currentBlock.direction == Direction.SIDE) switch (facingCurrentBlock) {
case EAST:
case WEST:
return neighbourBlock.facing == Facing.EAST || neighbourBlock.facing == Facing.WEST;
Expand All @@ -329,14 +326,14 @@ public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
|| neighbourBlock.facing == Facing.SOUTH;
}
else {
return neighbourBlock.facing == currentBlock.facing;
return neighbourBlock.facing == facingCurrentBlock;
}
}
break;
case 1:
if (neighbourBlock.direction != Direction.UP) return false;
else {
if (currentBlock.direction == Direction.SIDE) switch (currentBlock.facing) {
if (currentBlock.direction == Direction.SIDE) switch (facingCurrentBlock) {
case EAST:
case WEST:
return neighbourBlock.facing == Facing.EAST || neighbourBlock.facing == Facing.WEST;
Expand All @@ -346,7 +343,7 @@ public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
|| neighbourBlock.facing == Facing.SOUTH;
}
else {
return neighbourBlock.facing == currentBlock.facing;
return neighbourBlock.facing == facingCurrentBlock;
}
}
break;
Expand All @@ -366,9 +363,9 @@ public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
if ((currentBlock.direction == Direction.SIDE && neighbourBlock.direction == Direction.SIDE)
|| (currentBlock.direction != Direction.SIDE
&& neighbourBlock.direction != Direction.SIDE
&& neighbourBlock.facing != currentBlock.facing)) {
&& neighbourBlock.facing != facingCurrentBlock)) {
return false;
} else switch (currentBlock.facing) {
} else switch (facingCurrentBlock) {
case EAST:
case WEST:
return neighbourBlock.facing == Facing.EAST || neighbourBlock.facing == Facing.WEST;
Expand All @@ -380,7 +377,7 @@ public boolean CanConnectTo(World world, int x, int y, int z, int direction) {
case 2:
case 3:
if (currentBlock.direction == Direction.SIDE) {
switch (currentBlock.facing) {
switch (facingCurrentBlock) {
case EAST:
case WEST:
if (neighbourBlock.direction == Direction.SIDE) return true;
Expand All @@ -395,7 +392,7 @@ else return (neighbourBlock.facing == Facing.EAST
} else {
if (neighbourBlock.direction != Direction.SIDE) return false;
else {
switch (currentBlock.facing) {
switch (facingCurrentBlock) {
case EAST:
case WEST:
return neighbourBlock.facing == Facing.EAST
Expand All @@ -410,7 +407,7 @@ else return (neighbourBlock.facing == Facing.EAST
case 4:
case 5:
if (currentBlock.direction == Direction.SIDE) {
switch (currentBlock.facing) {
switch (facingCurrentBlock) {
case EAST:
case WEST:
if (neighbourBlock.direction != Direction.SIDE) return false;
Expand All @@ -425,7 +422,7 @@ else return (neighbourBlock.facing == Facing.NORTH
} else {
if (neighbourBlock.direction != Direction.SIDE) return false;
else {
switch (currentBlock.facing) {
switch (facingCurrentBlock) {
case EAST:
case WEST:
return false;
Expand Down

0 comments on commit f4d4d19

Please sign in to comment.