mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-26 06:42:57 +00:00
partial cleanup to world utils
This commit is contained in:
1 parent
f824777c44
commit
00d99031a6
2 files changed
+12
-19
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user