mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
548 lines
24 KiB
Diff
548 lines
24 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
|
@@ -34,7 +34,7 @@
|
|
public static boolean isRailBlock(IBlockState state)
|
|
{
|
|
Block block = state.getBlock();
|
|
- return block == Blocks.RAIL || block == Blocks.GOLDEN_RAIL || block == Blocks.DETECTOR_RAIL || block == Blocks.ACTIVATOR_RAIL;
|
|
+ return block instanceof BlockRailBase;
|
|
}
|
|
|
|
protected BlockRailBase(boolean isPowered)
|
|
@@ -57,7 +57,7 @@
|
|
|
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
|
{
|
|
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = state.getBlock() == this ? (BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty()) : null;
|
|
+ EnumRailDirection blockrailbase$enumraildirection = state.getBlock() == this ? getRailDirection(source, pos, state, null) : null;
|
|
return blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending() ? ASCENDING_AABB : FLAT_AABB;
|
|
}
|
|
|
|
@@ -73,7 +73,7 @@
|
|
|
|
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
{
|
|
- return worldIn.getBlockState(pos.down()).isTopSolid();
|
|
+ return worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos.down(), EnumFacing.UP);
|
|
}
|
|
|
|
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
|
|
@@ -93,32 +93,33 @@
|
|
{
|
|
if (!worldIn.isRemote)
|
|
{
|
|
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty());
|
|
+ final IBlockState currentState = worldIn.getBlockState(pos);
|
|
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = getRailDirection(worldIn, pos, currentState.getBlock() == this ? currentState : state, null);
|
|
boolean flag = false;
|
|
|
|
- if (!worldIn.getBlockState(pos.down()).isTopSolid())
|
|
+ if (!worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos.down(), EnumFacing.UP))
|
|
{
|
|
flag = true;
|
|
}
|
|
|
|
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !worldIn.getBlockState(pos.east()).isTopSolid())
|
|
+ if (blockrailbase$enumraildirection == EnumRailDirection.ASCENDING_EAST && !worldIn.getBlockState(pos.east()).isSideSolid(worldIn, pos.east(), EnumFacing.UP))
|
|
{
|
|
flag = true;
|
|
}
|
|
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !worldIn.getBlockState(pos.west()).isTopSolid())
|
|
+ else if (blockrailbase$enumraildirection == EnumRailDirection.ASCENDING_WEST && !worldIn.getBlockState(pos.west()).isSideSolid(worldIn, pos.west(), EnumFacing.UP))
|
|
{
|
|
flag = true;
|
|
}
|
|
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !worldIn.getBlockState(pos.north()).isTopSolid())
|
|
+ else if (blockrailbase$enumraildirection == EnumRailDirection.ASCENDING_NORTH && !worldIn.getBlockState(pos.north()).isSideSolid(worldIn, pos.north(), EnumFacing.UP))
|
|
{
|
|
flag = true;
|
|
}
|
|
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !worldIn.getBlockState(pos.south()).isTopSolid())
|
|
+ else if (blockrailbase$enumraildirection == EnumRailDirection.ASCENDING_SOUTH && !worldIn.getBlockState(pos.south()).isSideSolid(worldIn, pos.south(), EnumFacing.UP))
|
|
{
|
|
flag = true;
|
|
}
|
|
|
|
- if (flag && !worldIn.isAirBlock(pos))
|
|
+ if (flag && !currentState.getBlock().isAir(currentState, worldIn, pos))
|
|
{
|
|
this.dropBlockAsItem(worldIn, pos, state, 0);
|
|
worldIn.setBlockToAir(pos);
|
|
@@ -136,7 +137,7 @@
|
|
|
|
protected IBlockState updateDir(World worldIn, BlockPos pos, IBlockState state, boolean initialPlacement)
|
|
{
|
|
- return worldIn.isRemote ? state : (new BlockRailBase.Rail(worldIn, pos, state)).place(worldIn.isBlockPowered(pos), initialPlacement).getBlockState();
|
|
+ return worldIn.isRemote ? state : (new Rail(worldIn, pos, state)).place(worldIn.isBlockPowered(pos), initialPlacement).getBlockState();
|
|
}
|
|
|
|
public EnumPushReaction getMobilityFlag(IBlockState state)
|
|
@@ -154,7 +155,7 @@
|
|
{
|
|
super.breakBlock(worldIn, pos, state);
|
|
|
|
- if (((BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty())).isAscending())
|
|
+ if (getRailDirection(worldIn, pos, state, null).isAscending())
|
|
{
|
|
worldIn.notifyNeighborsOfStateChange(pos.up(), this, false);
|
|
}
|
|
@@ -166,8 +167,101 @@
|
|
}
|
|
}
|
|
|
|
- public abstract IProperty<BlockRailBase.EnumRailDirection> getShapeProperty();
|
|
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
|
|
+ public abstract IProperty<EnumRailDirection> getShapeProperty();
|
|
|
|
+ /* ======================================== FORGE START =====================================*/
|
|
+ /**
|
|
+ * Return true if the rail can make corners.
|
|
+ * Used by placement logic.
|
|
+ * @param world The world.
|
|
+ * @param pos Block's position in world
|
|
+ * @return True if the rail can make corners.
|
|
+ */
|
|
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
|
+ {
|
|
+ return !this.isPowered;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Returns true if the rail can make up and down slopes.
|
|
+ * Used by placement logic.
|
|
+ * @param world The world.
|
|
+ * @param pos Block's position in world
|
|
+ * @return True if the rail can make slopes.
|
|
+ */
|
|
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
|
+ {
|
|
+ return true;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Return the rail's direction.
|
|
+ * Can be used to make the cart think the rail is a different shape,
|
|
+ * for example when making diamond junctions or switches.
|
|
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
|
+ *
|
|
+ * @param world The world.
|
|
+ * @param pos Block's position in world
|
|
+ * @param state The BlockState
|
|
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
|
+ * @return The direction.
|
|
+ */
|
|
+ public EnumRailDirection getRailDirection(IBlockAccess world, BlockPos pos, IBlockState state, @javax.annotation.Nullable net.minecraft.entity.item.EntityMinecart cart)
|
|
+ {
|
|
+ return state.getValue(getShapeProperty());
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Returns the max speed of the rail at the specified position.
|
|
+ * @param world The world.
|
|
+ * @param cart The cart on the rail, may be null.
|
|
+ * @param pos Block's position in world
|
|
+ * @return The max speed of the current rail.
|
|
+ */
|
|
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
|
+ {
|
|
+ return 0.4f;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * This function is called by any minecart that passes over this rail.
|
|
+ * It is called once per update tick that the minecart is on the rail.
|
|
+ * @param world The world.
|
|
+ * @param cart The cart on the rail.
|
|
+ * @param pos Block's position in world
|
|
+ */
|
|
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
|
+ {
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit).
|
|
+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the
|
|
+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations.
|
|
+ * The method should return true if the rotation was successful though.
|
|
+ *
|
|
+ * @param world The world
|
|
+ * @param pos Block position in world
|
|
+ * @param axis The axis to rotate around
|
|
+ * @return True if the rotation was successful, False if the rotation failed, or is not possible
|
|
+ */
|
|
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
|
+ {
|
|
+ IBlockState state = world.getBlockState(pos);
|
|
+ for (IProperty prop : state.getProperties().keySet())
|
|
+ {
|
|
+ if (prop.getName().equals("shape"))
|
|
+ {
|
|
+ world.setBlockState(pos, state.cycleProperty(prop));
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+ return false;
|
|
+ }
|
|
+
|
|
+ /* ======================================== FORGE END =====================================*/
|
|
+
|
|
public static enum EnumRailDirection implements IStringSerializable
|
|
{
|
|
NORTH_SOUTH(0, "north_south"),
|
|
@@ -181,7 +275,7 @@
|
|
NORTH_WEST(8, "north_west"),
|
|
NORTH_EAST(9, "north_east");
|
|
|
|
- private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[values().length];
|
|
+ private static final EnumRailDirection[] META_LOOKUP = new EnumRailDirection[values().length];
|
|
private final int meta;
|
|
private final String name;
|
|
|
|
@@ -206,7 +300,7 @@
|
|
return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST;
|
|
}
|
|
|
|
- public static BlockRailBase.EnumRailDirection byMetadata(int meta)
|
|
+ public static EnumRailDirection byMetadata(int meta)
|
|
{
|
|
if (meta < 0 || meta >= META_LOOKUP.length)
|
|
{
|
|
@@ -223,7 +317,7 @@
|
|
|
|
static
|
|
{
|
|
- for (BlockRailBase.EnumRailDirection blockrailbase$enumraildirection : values())
|
|
+ for (EnumRailDirection blockrailbase$enumraildirection : values())
|
|
{
|
|
META_LOOKUP[blockrailbase$enumraildirection.getMetadata()] = blockrailbase$enumraildirection;
|
|
}
|
|
@@ -238,6 +332,7 @@
|
|
private IBlockState state;
|
|
private final boolean isPowered;
|
|
private final List<BlockPos> connectedRails = Lists.<BlockPos>newArrayList();
|
|
+ private final boolean canMakeSlopes;
|
|
|
|
public Rail(World worldIn, BlockPos pos, IBlockState state)
|
|
{
|
|
@@ -245,8 +340,9 @@
|
|
this.pos = pos;
|
|
this.state = state;
|
|
this.block = (BlockRailBase)state.getBlock();
|
|
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(this.block.getShapeProperty());
|
|
- this.isPowered = this.block.isPowered;
|
|
+ EnumRailDirection blockrailbase$enumraildirection = block.getRailDirection(worldIn, pos, state, null);
|
|
+ this.isPowered = !this.block.isFlexibleRail(worldIn, pos);
|
|
+ this.canMakeSlopes = this.block.canMakeSlopes(worldIn, pos);
|
|
this.updateConnectedRails(blockrailbase$enumraildirection);
|
|
}
|
|
|
|
@@ -255,7 +351,7 @@
|
|
return this.connectedRails;
|
|
}
|
|
|
|
- private void updateConnectedRails(BlockRailBase.EnumRailDirection railDirection)
|
|
+ private void updateConnectedRails(EnumRailDirection railDirection)
|
|
{
|
|
this.connectedRails.clear();
|
|
|
|
@@ -307,7 +403,7 @@
|
|
{
|
|
for (int i = 0; i < this.connectedRails.size(); ++i)
|
|
{
|
|
- BlockRailBase.Rail blockrailbase$rail = this.findRailAt(this.connectedRails.get(i));
|
|
+ Rail blockrailbase$rail = this.findRailAt(this.connectedRails.get(i));
|
|
|
|
if (blockrailbase$rail != null && blockrailbase$rail.isConnectedToRail(this))
|
|
{
|
|
@@ -352,7 +448,7 @@
|
|
}
|
|
}
|
|
|
|
- private boolean isConnectedToRail(BlockRailBase.Rail rail)
|
|
+ private boolean isConnectedToRail(Rail rail)
|
|
{
|
|
return this.isConnectedTo(rail.pos);
|
|
}
|
|
@@ -387,12 +483,12 @@
|
|
return i;
|
|
}
|
|
|
|
- private boolean canConnectTo(BlockRailBase.Rail rail)
|
|
+ private boolean canConnectTo(Rail rail)
|
|
{
|
|
return this.isConnectedToRail(rail) || this.connectedRails.size() != 2;
|
|
}
|
|
|
|
- private void connectTo(BlockRailBase.Rail rail)
|
|
+ private void connectTo(Rail rail)
|
|
{
|
|
this.connectedRails.add(rail.pos);
|
|
BlockPos blockpos = this.pos.north();
|
|
@@ -403,70 +499,70 @@
|
|
boolean flag1 = this.isConnectedTo(blockpos1);
|
|
boolean flag2 = this.isConnectedTo(blockpos2);
|
|
boolean flag3 = this.isConnectedTo(blockpos3);
|
|
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null;
|
|
+ EnumRailDirection blockrailbase$enumraildirection = null;
|
|
|
|
if (flag || flag1)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_SOUTH;
|
|
}
|
|
|
|
if (flag2 || flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.EAST_WEST;
|
|
}
|
|
|
|
if (!this.isPowered)
|
|
{
|
|
if (flag1 && flag3 && !flag && !flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_EAST;
|
|
}
|
|
|
|
if (flag1 && flag2 && !flag && !flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_WEST;
|
|
}
|
|
|
|
if (flag && flag2 && !flag1 && !flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_WEST;
|
|
}
|
|
|
|
if (flag && flag3 && !flag1 && !flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_EAST;
|
|
}
|
|
}
|
|
|
|
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
|
+ if (blockrailbase$enumraildirection == EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
|
{
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_NORTH;
|
|
}
|
|
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos1.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_SOUTH;
|
|
}
|
|
}
|
|
|
|
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
|
+ if (blockrailbase$enumraildirection == EnumRailDirection.EAST_WEST && canMakeSlopes)
|
|
{
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_EAST;
|
|
}
|
|
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos2.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_WEST;
|
|
}
|
|
}
|
|
|
|
if (blockrailbase$enumraildirection == null)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_SOUTH;
|
|
}
|
|
|
|
this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection);
|
|
@@ -475,7 +571,7 @@
|
|
|
|
private boolean hasNeighborRail(BlockPos posIn)
|
|
{
|
|
- BlockRailBase.Rail blockrailbase$rail = this.findRailAt(posIn);
|
|
+ Rail blockrailbase$rail = this.findRailAt(posIn);
|
|
|
|
if (blockrailbase$rail == null)
|
|
{
|
|
@@ -488,7 +584,7 @@
|
|
}
|
|
}
|
|
|
|
- public BlockRailBase.Rail place(boolean powered, boolean initialPlacement)
|
|
+ public Rail place(boolean powered, boolean initialPlacement)
|
|
{
|
|
BlockPos blockpos = this.pos.north();
|
|
BlockPos blockpos1 = this.pos.south();
|
|
@@ -498,38 +594,38 @@
|
|
boolean flag1 = this.hasNeighborRail(blockpos1);
|
|
boolean flag2 = this.hasNeighborRail(blockpos2);
|
|
boolean flag3 = this.hasNeighborRail(blockpos3);
|
|
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null;
|
|
+ EnumRailDirection blockrailbase$enumraildirection = null;
|
|
|
|
if ((flag || flag1) && !flag2 && !flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_SOUTH;
|
|
}
|
|
|
|
if ((flag2 || flag3) && !flag && !flag1)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.EAST_WEST;
|
|
}
|
|
|
|
if (!this.isPowered)
|
|
{
|
|
if (flag1 && flag3 && !flag && !flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_EAST;
|
|
}
|
|
|
|
if (flag1 && flag2 && !flag && !flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_WEST;
|
|
}
|
|
|
|
if (flag && flag2 && !flag1 && !flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_WEST;
|
|
}
|
|
|
|
if (flag && flag3 && !flag1 && !flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_EAST;
|
|
}
|
|
}
|
|
|
|
@@ -537,12 +633,12 @@
|
|
{
|
|
if (flag || flag1)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_SOUTH;
|
|
}
|
|
|
|
if (flag2 || flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.EAST_WEST;
|
|
}
|
|
|
|
if (!this.isPowered)
|
|
@@ -551,78 +647,78 @@
|
|
{
|
|
if (flag1 && flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_EAST;
|
|
}
|
|
|
|
if (flag2 && flag1)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_WEST;
|
|
}
|
|
|
|
if (flag3 && flag)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_EAST;
|
|
}
|
|
|
|
if (flag && flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_WEST;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (flag && flag2)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_WEST;
|
|
}
|
|
|
|
if (flag3 && flag)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_EAST;
|
|
}
|
|
|
|
if (flag2 && flag1)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_WEST;
|
|
}
|
|
|
|
if (flag1 && flag3)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.SOUTH_EAST;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
|
+ if (blockrailbase$enumraildirection == EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
|
{
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_NORTH;
|
|
}
|
|
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos1.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_SOUTH;
|
|
}
|
|
}
|
|
|
|
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
|
+ if (blockrailbase$enumraildirection == EnumRailDirection.EAST_WEST && canMakeSlopes)
|
|
{
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_EAST;
|
|
}
|
|
|
|
if (BlockRailBase.isRailBlock(this.world, blockpos2.up()))
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.ASCENDING_WEST;
|
|
}
|
|
}
|
|
|
|
if (blockrailbase$enumraildirection == null)
|
|
{
|
|
- blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
|
|
+ blockrailbase$enumraildirection = EnumRailDirection.NORTH_SOUTH;
|
|
}
|
|
|
|
this.updateConnectedRails(blockrailbase$enumraildirection);
|
|
@@ -634,7 +730,7 @@
|
|
|
|
for (int i = 0; i < this.connectedRails.size(); ++i)
|
|
{
|
|
- BlockRailBase.Rail blockrailbase$rail = this.findRailAt(this.connectedRails.get(i));
|
|
+ Rail blockrailbase$rail = this.findRailAt(this.connectedRails.get(i));
|
|
|
|
if (blockrailbase$rail != null)
|
|
{
|