Find center fix
This commit is contained in:
parent
07b2143d40
commit
3283f9763b
1 changed files with 5 additions and 11 deletions
|
@ -16,6 +16,7 @@ import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.util.BlockRotation;
|
import net.minecraft.util.BlockRotation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.math.Direction.AxisDirection;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.Heightmap;
|
import net.minecraft.world.Heightmap;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -146,17 +147,10 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable
|
||||||
|
|
||||||
BlockState right, left;
|
BlockState right, left;
|
||||||
Direction rightDir, leftDir;
|
Direction rightDir, leftDir;
|
||||||
if (axis == Direction.Axis.X) {
|
rightDir = Direction.from(axis, AxisDirection.POSITIVE);
|
||||||
right = world.getBlockState(pos.east());
|
leftDir = rightDir.getOpposite();
|
||||||
left = world.getBlockState(pos.west());
|
right = world.getBlockState(pos.offset(rightDir));
|
||||||
rightDir = Direction.EAST;
|
left = world.getBlockState(pos.offset(leftDir));
|
||||||
leftDir = Direction.WEST;
|
|
||||||
} else {
|
|
||||||
right = world.getBlockState(pos.south());
|
|
||||||
left = world.getBlockState(pos.north());
|
|
||||||
rightDir = Direction.SOUTH;
|
|
||||||
leftDir = Direction.NORTH;
|
|
||||||
}
|
|
||||||
BlockState down = world.getBlockState(pos.down());
|
BlockState down = world.getBlockState(pos.down());
|
||||||
if (down.isOf(this)) {
|
if (down.isOf(this)) {
|
||||||
return findCenter(world, pos.move(Direction.DOWN), axis, ++step);
|
return findCenter(world, pos.move(Direction.DOWN), axis, ++step);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue