Added new potion effects for bouncing as well as clinging to walls - the sigils will come later (Hai, Yulife~)
This commit is contained in:
parent
2e192ff29c
commit
5ad3c0eda1
5 changed files with 83 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue