Added new potion effects for bouncing as well as clinging to walls - the sigils will come later (Hai, Yulife~)

This commit is contained in:
WayofTime 2016-10-13 19:58:39 -04:00
parent 2e192ff29c
commit 5ad3c0eda1
5 changed files with 83 additions and 5 deletions

View file

@ -93,6 +93,29 @@ public class Utils
return null;
}
public static boolean isPlayerBesideSolidBlockFace(EntityPlayer player)
{
World world = player.worldObj;
double minimumDistanceFromAxis = 0.7;
BlockPos centralPos = player.getPosition();
for (EnumFacing facing : EnumFacing.HORIZONTALS)
{
BlockPos offsetPos = centralPos.offset(facing);
double distance = Math.min(offsetPos.getX() + 0.5 - player.posX, offsetPos.getZ() + 0.5 - player.posZ);
if (distance > minimumDistanceFromAxis)
{
continue;
}
IBlockState state = world.getBlockState(offsetPos);
if (state.isSideSolid(world, offsetPos, facing.getOpposite()))
{
return true;
}
}
return false;
}
public static boolean canPlayerSeeDemonWill(EntityPlayer player)
{
ItemStack[] mainInventory = player.inventory.mainInventory;