mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Rename Orientation to ForgeDirection {Damn MCP naming a class Direction already}
This commit is contained in:
1 parent
035328496c
commit
fc430243d1
17 files changed
+56
-56
No files matched your search
+6
-6
@@ -1,6 +1,6 @@
|
||||
package net.minecraftforge.common;
|
||||
|
||||
public enum Orientation
|
||||
public enum ForgeDirection
|
||||
{
|
||||
/** -Y */
|
||||
DOWN(0, -1, 0),
|
||||
@@ -30,7 +30,7 @@ public enum Orientation
|
||||
public final int offsetZ;
|
||||
public final int flag;
|
||||
|
||||
private Orientation(int x, int y, int z)
|
||||
private ForgeDirection(int x, int y, int z)
|
||||
{
|
||||
offsetX = x;
|
||||
offsetY = y;
|
||||
@@ -38,18 +38,18 @@ public enum Orientation
|
||||
flag = 1 << ordinal();
|
||||
}
|
||||
|
||||
public static Orientation getOrientation(int id)
|
||||
public static ForgeDirection getOrientation(int id)
|
||||
{
|
||||
if (id < Orientation.values().length)
|
||||
if (id < ForgeDirection.values().length)
|
||||
{
|
||||
return Orientation.values()[id];
|
||||
return ForgeDirection.values()[id];
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
public static final int[] opposite = new int[] { 1, 0, 3, 2, 5, 4, 6};
|
||||
|
||||
public Orientation getOpposite()
|
||||
public ForgeDirection getOpposite()
|
||||
{
|
||||
return getOrientation(opposite[ordinal()]);
|
||||
}
|
||||
@@ -17,12 +17,12 @@ public interface ISidedInventory extends IInventory
|
||||
* Get the start of the side inventory.
|
||||
* @param side The global side to get the start of range.
|
||||
*/
|
||||
int getStartInventorySide(Orientation side);
|
||||
int getStartInventorySide(ForgeDirection side);
|
||||
|
||||
/**
|
||||
* Get the size of the side inventory.
|
||||
* @param side The global side.
|
||||
*/
|
||||
int getSizeInventorySide(Orientation side);
|
||||
int getSizeInventorySide(ForgeDirection side);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+
|
||||
public class Block
|
||||
{
|
||||
@@ -164,7 +164,7 @@
|
||||
+ * @param size The side to check
|
||||
+ * @return True if the block is solid on the specified side.
|
||||
+ */
|
||||
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, Orientation side)
|
||||
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
|
||||
+ {
|
||||
+ int meta = world.getBlockMetadata(x, y, z);
|
||||
+ if (this instanceof BlockStep)
|
||||
@@ -288,7 +288,7 @@
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire
|
||||
+ */
|
||||
+ public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, Orientation face)
|
||||
+ public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
+ {
|
||||
+ return blockFlammability[blockID];
|
||||
+ }
|
||||
@@ -305,7 +305,7 @@
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return True if the face can be on fire, false otherwise.
|
||||
+ */
|
||||
+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, Orientation face)
|
||||
+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
+ {
|
||||
+ return getFlammability(world, x, y, z, metadata, face) > 0;
|
||||
+ }
|
||||
@@ -322,7 +322,7 @@
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return A number that is used to determine the speed of fire growth around the block
|
||||
+ */
|
||||
+ public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, Orientation face)
|
||||
+ public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, ForgeDirection face)
|
||||
+ {
|
||||
+ return blockFireSpreadSpeed[blockID];
|
||||
+ }
|
||||
@@ -340,7 +340,7 @@
|
||||
+ * @param side The face that the fire is coming from
|
||||
+ * @return
|
||||
+ */
|
||||
+ public boolean isFireSource(World world, int x, int y, int z, int metadata, Orientation side)
|
||||
+ public boolean isFireSource(World world, int x, int y, int z, int metadata, ForgeDirection side)
|
||||
+ {
|
||||
+ if (blockID == Block.netherrack.blockID && side == UP)
|
||||
+ {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
import java.util.Random;
|
||||
+
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockButton extends Block
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)));
|
||||
+ Orientation dir = Orientation.getOrientation(par5);
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(par5);
|
||||
+ return (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH)) ||
|
||||
+ (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST)) ||
|
||||
@@ -43,7 +43,7 @@
|
||||
-
|
||||
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+
|
||||
+ Orientation dir = Orientation.getOrientation(par5);
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(par5);
|
||||
+
|
||||
+ if (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockChest extends BlockContainer
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.util.Random;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockDoor extends Block
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.util.Random;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockFire extends Block
|
||||
{
|
||||
@@ -78,7 +78,7 @@
|
||||
- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP);
|
||||
+ }
|
||||
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, Orientation face)
|
||||
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face)
|
||||
+ {
|
||||
+ int var8 = 0;
|
||||
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)];
|
||||
@@ -216,7 +216,7 @@
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, Orientation face)
|
||||
+ public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face)
|
||||
+ {
|
||||
+ Block block = Block.blocksList[world.getBlockId(x, y, z)];
|
||||
+ if (block != null)
|
||||
@@ -237,7 +237,7 @@
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return The chance of the block catching fire, or oldChance if it is higher
|
||||
+ */
|
||||
+ public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, Orientation face)
|
||||
+ public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face)
|
||||
+ {
|
||||
+ int newChance = 0;
|
||||
+ Block block = Block.blocksList[world.getBlockId(x, y, z)];
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.util.Random;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockLadder extends Block
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
@@ -1,4 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
+
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockLever extends Block
|
||||
{
|
||||
@@ -13,7 +13,7 @@
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- return par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4) ? true : (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)))));
|
||||
+ Orientation dir = Orientation.getOrientation(par5);
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(par5);
|
||||
+ return (dir == DOWN && par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN )) ||
|
||||
+ (dir == UP && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP )) ||
|
||||
+ (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) ||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
+
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockRail extends Block
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.util.Random;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockTorch extends Block
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -1,10 +1,14 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8)))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, Orientation.getOrientation((var6 & 3) + 2))))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, ForgeDirection.getOrientation((var6 & 3) + 2))))
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
- return isValidSupportBlock(par1World.getBlockId(par2, par3, par4));
|
||||
+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)) || par1World.isBlockSolidOnSide(par2, par3, par4, Orientation.UP);
|
||||
+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)) || par1World.isBlockSolidOnSide(par2, par3, par4, ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
+
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
|
||||
public class BlockTripWireSource extends Block
|
||||
{
|
||||
@@ -15,7 +15,7 @@
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)));
|
||||
+ Orientation dir = Orientation.getOrientation(par5);
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(par5);
|
||||
+ return (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH)) ||
|
||||
+ (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST )) ||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
-public class TileEntityBrewingStand extends TileEntity implements IInventory
|
||||
+import net.minecraftforge.common.ISidedInventory;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+
|
||||
+public class TileEntityBrewingStand extends TileEntity implements IInventory, ISidedInventory
|
||||
{
|
||||
@@ -27,14 +27,14 @@
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public int getStartInventorySide(Orientation side)
|
||||
+ public int getStartInventorySide(ForgeDirection side)
|
||||
+ {
|
||||
+ return (side == Orientation.UP ? 3 : 0);
|
||||
+ return (side == ForgeDirection.UP ? 3 : 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSizeInventorySide(Orientation side)
|
||||
+ public int getSizeInventorySide(ForgeDirection side)
|
||||
+ {
|
||||
+ return (side == Orientation.UP ? 1 : 3);
|
||||
+ return (side == ForgeDirection.UP ? 1 : 3);
|
||||
+ }
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraftforge.common.ISidedInventory;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import cpw.mods.fml.common.Side;
|
||||
@@ -75,15 +75,15 @@
|
||||
public void closeChest() {}
|
||||
+
|
||||
+ @Override
|
||||
+ public int getStartInventorySide(Orientation side)
|
||||
+ public int getStartInventorySide(ForgeDirection side)
|
||||
+ {
|
||||
+ if (side == Orientation.DOWN) return 1;
|
||||
+ if (side == Orientation.UP) return 0;
|
||||
+ if (side == ForgeDirection.DOWN) return 1;
|
||||
+ if (side == ForgeDirection.UP) return 0;
|
||||
+ return 2;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSizeInventorySide(Orientation side)
|
||||
+ public int getSizeInventorySide(ForgeDirection side)
|
||||
+ {
|
||||
+ return 1;
|
||||
+ }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import java.util.Set;
|
||||
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.common.Orientation;
|
||||
+import net.minecraftforge.common.ForgeDirection;
|
||||
+import net.minecraftforge.event.entity.EntityEvent;
|
||||
+import net.minecraftforge.event.world.WorldEvent;
|
||||
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
@@ -261,7 +261,7 @@
|
||||
{
|
||||
- Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
||||
- return var4 == null ? false : (var4.blockMaterial.isOpaque() && var4.renderAsNormalBlock() ? true : (var4 instanceof BlockStairs ? (this.getBlockMetadata(par1, par2, par3) & 4) == 4 : (var4 instanceof BlockHalfSlab ? (this.getBlockMetadata(par1, par2, par3) & 8) == 8 : false)));
|
||||
+ return isBlockSolidOnSide(par1, par2, par3, Orientation.UP);
|
||||
+ return isBlockSolidOnSide(par1, par2, par3, ForgeDirection.UP);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +353,7 @@
|
||||
+ * @param side The Side in question
|
||||
+ * @return True if the side is solid
|
||||
+ */
|
||||
+ public boolean isBlockSolidOnSide(int X, int Y, int Z, Orientation side)
|
||||
+ public boolean isBlockSolidOnSide(int X, int Y, int Z, ForgeDirection side)
|
||||
+ {
|
||||
+ return isBlockSolidOnSide(X, Y, Z, side, false);
|
||||
+ }
|
||||
@@ -369,7 +369,7 @@
|
||||
+ * @param _default The defult to return if the block doesn't exist.
|
||||
+ * @return True if the side is solid
|
||||
+ */
|
||||
+ public boolean isBlockSolidOnSide(int X, int Y, int Z, Orientation side, boolean _default)
|
||||
+ public boolean isBlockSolidOnSide(int X, int Y, int Z, ForgeDirection side, boolean _default)
|
||||
+ {
|
||||
+ if (X < -30000000 || Z < -30000000 || X >= 30000000 || Z >= 30000000)
|
||||
+ {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import static net.minecraftforge.common.Orientation.*;
|
||||
+import static net.minecraftforge.common.ForgeDirection.*;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
Reference in new issue
Block a user