mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Update FML:d075dafd075dafMerge branch 'master' into snapshot15 Fix up compilation and patching errors1bd6847Fix up packages.csv ordering for easier diffingdd832f2Update for MCP7.30c - fixes redstone rendering issuesaebf6ebAdd in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti8921cfeRemember to add the new patches!cd67596The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-servere1c6630Javadoc cleanup5ce4e31Fix breaking changea99c488Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates94282c5Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates7ad8529Update MCP to MCP7.26a and refresh MCP names15534edUpdate address of the FML repository to the new location in all the filesaa822e3Fix logical error in comment texta14ab91Update license text to make clear that FML is not a way to sidestep MCP licensing.0165742Fix mcp conf md5 signatures for the snapshot26a5b31FMLLogFormatter: dynamic log level name
137 lines
4.5 KiB
Diff
137 lines
4.5 KiB
Diff
--- ../src_base/minecraft/net/minecraft/block/BlockRailBase.java
|
|
+++ ../src_work/minecraft/net/minecraft/block/BlockRailBase.java
|
|
@@ -3,6 +3,7 @@
|
|
import java.util.Random;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
+import net.minecraft.entity.item.EntityMinecart;
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
import net.minecraft.util.MovingObjectPosition;
|
|
import net.minecraft.util.Vec3;
|
|
@@ -28,7 +29,7 @@
|
|
*/
|
|
public static final boolean isRailBlock(int par0)
|
|
{
|
|
- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID || par0 == Block.field_94337_cv.blockID;
|
|
+ return Block.blocksList[par0] instanceof BlockRailBase;
|
|
}
|
|
|
|
protected BlockRailBase(int par1, boolean par2)
|
|
@@ -105,7 +106,7 @@
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
- return 9;
|
|
+ return renderType;
|
|
}
|
|
|
|
/**
|
|
@@ -216,4 +217,107 @@
|
|
{
|
|
return 0;
|
|
}
|
|
+
|
|
+ /**
|
|
+ * Return true if the rail can make corners.
|
|
+ * Used by placement logic.
|
|
+ * @param world The world.
|
|
+ * @param x The rail X coordinate.
|
|
+ * @param y The rail Y coordinate.
|
|
+ * @param z The rail Z coordinate.
|
|
+ * @return True if the rail can make corners.
|
|
+ */
|
|
+ public boolean isFlexibleRail(World world, int y, int x, int z)
|
|
+ {
|
|
+ return !isPowered;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Returns true if the rail can make up and down slopes.
|
|
+ * Used by placement logic.
|
|
+ * @param world The world.
|
|
+ * @param x The rail X coordinate.
|
|
+ * @param y The rail Y coordinate.
|
|
+ * @param z The rail Z coordinate.
|
|
+ * @return True if the rail can make slopes.
|
|
+ */
|
|
+ public boolean canMakeSlopes(World world, int x, int y, int z)
|
|
+ {
|
|
+ return true;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Return the rail's metadata (without the power bit if the rail uses one).
|
|
+ * Can be used to make the cart think the rail something other than it is,
|
|
+ * for example when making diamond junctions or switches.
|
|
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
|
+ *
|
|
+ * Valid rail metadata is defined as follows:
|
|
+ * 0x0: flat track going North-South
|
|
+ * 0x1: flat track going West-East
|
|
+ * 0x2: track ascending to the East
|
|
+ * 0x3: track ascending to the West
|
|
+ * 0x4: track ascending to the North
|
|
+ * 0x5: track ascending to the South
|
|
+ * 0x6: WestNorth corner (connecting East and South)
|
|
+ * 0x7: EastNorth corner (connecting West and South)
|
|
+ * 0x8: EastSouth corner (connecting West and North)
|
|
+ * 0x9: WestSouth corner (connecting East and North)
|
|
+ *
|
|
+ * @param world The world.
|
|
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
|
+ * @param y The rail X coordinate.
|
|
+ * @param x The rail Y coordinate.
|
|
+ * @param z The rail Z coordinate.
|
|
+ * @return The metadata.
|
|
+ */
|
|
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
|
|
+ {
|
|
+ int meta = world.getBlockMetadata(x, y, z);
|
|
+ if(isPowered)
|
|
+ {
|
|
+ meta = meta & 7;
|
|
+ }
|
|
+ return meta;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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 x The rail X coordinate.
|
|
+ * @param y The rail Y coordinate.
|
|
+ * @param z The rail Z coordinate.
|
|
+ * @return The max speed of the current rail.
|
|
+ */
|
|
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
|
|
+ {
|
|
+ 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 y The rail X coordinate.
|
|
+ * @param x The rail Y coordinate.
|
|
+ * @param z The rail Z coordinate.
|
|
+ */
|
|
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
|
|
+ {
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Forge: Moved render type to a field and a setter.
|
|
+ * This allows for a mod to change the render type
|
|
+ * for vanilla rails, and any mod rails that extend
|
|
+ * this class.
|
|
+ */
|
|
+ private int renderType = 9;
|
|
+
|
|
+ public void setRenderType(int value)
|
|
+ {
|
|
+ renderType = value;
|
|
+ }
|
|
}
|