Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void cast(EntityPlayer player) {
- AxisAlignedBB fanBox = getEffectAABB(player.worldObj, player);
- Vec3d lookVec = player.getLookVec();
- fanEntitiesAABB(player.worldObj, player, fanBox);
- }
- private static void fanEntitiesAABB(World world, EntityPlayer player, AxisAlignedBB fanBox) {
- Vec3d moveVec = player.getLookVec();
- List<Entity> inBox = world.getEntitiesWithinAABBExcludingEntity(player, fanBox);
- float force = 2.0F;
- for(Entity entity : inBox) {
- if(entity.canBePushed() || entity instanceof EntityItem) {
- entity.motionX = moveVec.xCoord * force;
- entity.motionY = moveVec.yCoord * force;
- entity.motionZ = moveVec.zCoord * force;
- }
- }
- }
- private static AxisAlignedBB getEffectAABB(World world, EntityPlayer player) {
- double range = 3.0D;
- double radius = 2.0D;
- Vec3d srcVec = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ);
- Vec3d lookVec = player.getLookVec();
- Vec3d destVec = srcVec.addVector(lookVec.xCoord * range, lookVec.yCoord * range, lookVec.zCoord * range);
- AxisAlignedBB crumbleBox = new AxisAlignedBB(destVec.xCoord - radius, destVec.yCoord - radius, destVec.zCoord - radius, destVec.xCoord + radius, destVec.yCoord + radius, destVec.zCoord + radius);
- return crumbleBox;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement