From 00d99031a6fcca267aacdf5cecf5236a3d731c63 Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Tue, 2 Dec 2014 15:00:45 -0500 Subject: [PATCH] partial cleanup to world utils --- src/mantle/world/DirectionUtils.java | 10 +++++----- src/mantle/world/WorldHelper.java | 21 +++++++-------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/mantle/world/DirectionUtils.java b/src/mantle/world/DirectionUtils.java index 7c2d20d..3d1fbd4 100644 --- a/src/mantle/world/DirectionUtils.java +++ b/src/mantle/world/DirectionUtils.java @@ -1,6 +1,6 @@ package mantle.world; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; /** * Helper functions for dealing with ForgeDirection @@ -16,14 +16,14 @@ public class DirectionUtils // No instantiation } - public static boolean isRightAngles (ForgeDirection a, ForgeDirection b) + public static boolean isRightAngles (EnumFacing a, EnumFacing b) { - return a != b && a != b.getOpposite() && a != ForgeDirection.UNKNOWN && b != ForgeDirection.UNKNOWN; + return a != b && a != b.getOpposite(); } - public static boolean isHorizontal (ForgeDirection a) + public static boolean isHorizontal (EnumFacing a) { - return a == ForgeDirection.EAST || a == ForgeDirection.NORTH || a == ForgeDirection.SOUTH || a == ForgeDirection.WEST; + return a == EnumFacing.EAST || a == EnumFacing.NORTH || a == EnumFacing.SOUTH || a == EnumFacing.WEST; } } diff --git a/src/mantle/world/WorldHelper.java b/src/mantle/world/WorldHelper.java index 0b63340..d006991 100644 --- a/src/mantle/world/WorldHelper.java +++ b/src/mantle/world/WorldHelper.java @@ -1,31 +1,24 @@ package mantle.world; -import mantle.common.ComparisonHelper; -import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class WorldHelper { - @Deprecated - public static boolean setBlockToAirBool (World w, int x, int y, int z) + public static boolean setBlockToAir (World w, BlockPos pos) { - return setBlockToAir(w, x, y, z); + return w.setBlockToAir(pos); } - public static boolean setBlockToAir (World w, int x, int y, int z) + public static boolean isAirBlock (IBlockAccess access, BlockPos pos) { - return w.setBlockToAir(x, y, z); + return access.getBlock(pos).isAir(access, pos); } - public static boolean isAirBlock (IBlockAccess access, int x, int y, int z) + public static boolean isAirBlock (World access, BlockPos pos) { - return access.getBlock(x,y,z).isAir(access, x,y,z); - } - - public static boolean isAirBlock (World access, int x, int y, int z) - { - return access.isAirBlock(x,y,z); + return access.isAirBlock(pos); } }