--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -33,7 +33,7 @@
     public static boolean func_176563_d(IBlockState p_176563_0_)
     {
         Block block = p_176563_0_.func_177230_c();
-        return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
+        return block instanceof BlockRailBase;
     }
 
     protected BlockRailBase(boolean p_i45389_1_)
@@ -174,7 +174,56 @@
     }
 
     public abstract IProperty func_176560_l();
+    /* ======================================== FORGE START =====================================*/
+    /**
+     * Return true if the rail can make corners.
+     * Used by placement logic.
+     * @param world The world.
+     * @param pod Block's position in world
+     * @return True if the rail can make corners.
+     */
+    public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
+    {
+        return !this.field_150053_a;
+    }
 
+    /**
+     * Returns true if the rail can make up and down slopes.
+     * Used by placement logic.
+     * @param world The world.
+     * @param pod Block's position in world
+     * @return True if the rail can make slopes.
+     */
+    public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
+    {
+        return true;
+    }
+
+    /**
+     * 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 pod 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 pod Block's position in world
+     */
+    public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+    {
+    }
+
+    /* ======================================== FORGE END =====================================*/
+
     public static enum EnumRailDirection implements IStringSerializable
     {
         NORTH_SOUTH(0, "north_south"),
@@ -251,6 +300,7 @@
         private final boolean field_150656_f;
         private final List field_150657_g = Lists.newArrayList();
         private static final String __OBFID = "CL_00000196";
+        private final boolean canMakeSlopes;
 
         public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
         {
@@ -259,7 +309,8 @@
             this.field_180366_e = p_i45739_4_;
             this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
             BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
-            this.field_150656_f = this.field_180365_d.field_150053_a;
+            this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
+            canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
             this.func_180360_a(enumraildirection);
         }
 
@@ -448,7 +499,7 @@
                 }
             }
 
-            if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+            if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
             {
                 if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
                 {
@@ -461,7 +512,7 @@
                 }
             }
 
-            if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+            if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
             {
                 if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
                 {
@@ -604,7 +655,7 @@
                 }
             }
 
-            if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+            if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
             {
                 if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
                 {
@@ -617,7 +668,7 @@
                 }
             }
 
-            if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+            if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
             {
                 if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
                 {
