@SideOnly(Side.CLIENT) private double wobble(World worldIn, double p_185093_2_) { if (worldIn.getTotalWorldTime() != this.lastUpdateTick) { this.lastUpdateTick = worldIn.getTotalWorldTime(); double d0 = p_185093_2_ - this.rotation; d0 = MathHelper.positiveModulo(d0 + 0.5D, 1.0D) - 0.5D; this.rota += d0 * 0.1D; this.rota *= 0.8D; this.rotation = MathHelper.positiveModulo(this.rotation + this.rota, 1.0D); } return this.rotation; }
@SideOnly(Side.CLIENT) private double wobble(World worldIn, double angle) { if(worldIn.getTotalWorldTime() != lastUpdateTick) { lastUpdateTick = worldIn.getTotalWorldTime(); double d0 = angle - rotation; d0 = MathHelper.positiveModulo(d0 + 0.5D, 1.0D) - 0.5D; rota += d0 * 0.1D; rota *= 0.8D; rotation = MathHelper.positiveModulo(rotation + rota, 1.0D); } return rotation; }
@SideOnly(Side.CLIENT) private double wobble(World world, double time) { if(world.getTotalWorldTime() != lastUpdateTick) { lastUpdateTick = world.getTotalWorldTime(); double d0 = time - rotation; d0 = MathHelper.positiveModulo(d0 + 0.5D, 1.0D) - 0.5D; rota += d0 * 0.1D; rota *= 0.9D; rotation = MathHelper.positiveModulo(rotation + rota, 1.0D); } return rotation; }
@SideOnly(Side.CLIENT) private double wobble(World worldIn, double angle) { if(worldIn.getTotalWorldTime() != lastUpdateTick) { lastUpdateTick = worldIn.getTotalWorldTime(); double relAngle = angle - rotation; relAngle = MathHelper.positiveModulo(relAngle + 0.5, 1.0) - 0.5; rota += relAngle * 0.1; rota *= 0.8; rotation = MathHelper.positiveModulo(rotation + rota, 1.0); } return rotation; }
@SideOnly(Side.CLIENT) private double wobble(World worldIn, double p_185093_2_) { if (worldIn.getTotalWorldTime() != this.lastUpdateTick) { this.lastUpdateTick = worldIn.getTotalWorldTime(); double d0 = p_185093_2_ - this.rotation; d0 = MathHelper.positiveModulo(d0 + 0.5D, 1.0D) - 0.5D; this.rota += d0 * 0.1D; this.rota *= 0.8D; this.rotation = MathHelper.positiveModulo(this.rotation + this.rota, 1.0D); } return this.rotation; }
@SideOnly(Side.CLIENT) private double wobble(World worldIn, double p_185093_2_) { if (worldIn.getTotalWorldTime() != this.lastUpdateTick) { this.lastUpdateTick = worldIn.getTotalWorldTime(); double d0 = p_185093_2_ - this.rotation; d0 = MathHelper.positiveModulo(d0 + 0.5D, 1.0D) - 0.5D; this.rota += d0 * 0.1D; this.rota *= 0.8D; this.rotation = MathHelper.positiveModulo(this.rotation + this.rota, 1.0D); } return this.rotation; }
@SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entityIn) { if (entityIn == null && !stack.isOnItemFrame()) { return 0.0F; } else { boolean flag = entityIn != null; Entity entity = (Entity) (flag ? entityIn : stack.getItemFrame()); if (world == null) { world = entity.world; } double d0; if (hasTag(stack) && stack.getTagCompound().hasKey("dimID")) dimID = stack.getTagCompound().getInteger("dimID"); if (world.provider.getDimension() == dimID) { double d1 = flag ? (double) entity.rotationYaw : this.getFrameRotation((EntityItemFrame) entity); d1 = MathHelper.positiveModulo(d1 / 360.0D, 1.0D); double d2 = this.getSpawnToAngle(world, entity) / (Math.PI * 2D); d0 = 0.5D - (d1 - 0.25D - d2); } else { d0 = Math.random(); } if (flag) { d0 = this.wobble(world, d0); } return MathHelper.positiveModulo((float) d0, 1.0F); } }
@SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entityIn) { if (entityIn == null && !stack.isOnItemFrame()) { return 0.0F; } else { boolean flag = entityIn != null; Entity entity = (Entity) (flag ? entityIn : stack.getItemFrame()); if (world == null) { world = entity.world; } double d0; if (hasTag(stack) && stack.getTagCompound().hasKey("dimID")) dimID = stack.getTagCompound().getInteger("dimID"); if (world.provider.getDimension() == dimID) { double d1 = flag ? (double) entity.rotationYaw : this.getFrameRotation((EntityItemFrame) entity); d1 = MathHelper.positiveModulo(d1 / 360.0D, 1.0D); double d2 = this.getSpawnToAngle(world, entity) / (Math.PI * 2D); d0 = 0.5D - (d1 - 0.25D - d2); } else { d0 = Math.random(); } if (flag) { d0 = this.wobble(world, d0); } return MathHelper.positiveModulo((float) d0, 1.0F); } }
@SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entityIn) { if (entityIn == null && !stack.isOnItemFrame()) { return 0.0F; } else { boolean flag = entityIn != null; Entity entity = (Entity) (flag ? entityIn : stack.getItemFrame()); if (world == null) { world = entity.world; } double d0; if (hasTag(stack) && stack.getTagCompound().hasKey("dimID")) dimID = stack.getTagCompound().getInteger("dimID"); if (world.provider.getDimension() == dimID) { double d1 = flag ? (double) entity.rotationYaw : this.getFrameRotation((EntityItemFrame) entity); d1 = MathHelper.positiveModulo(d1 / 360.0D, 1.0D); double d2 = this.getSpawnToAngle(world, entity) / (Math.PI * 2D); d0 = 0.5D - (d1 - 0.25D - d2); } else { d0 = Math.random(); } if (flag) { d0 = this.wobble(world, d0); } return MathHelper.positiveModulo((float) d0, 1.0F); } }
@Override @SideOnly(Side.CLIENT) public float apply(ItemStack stack, World world, EntityLivingBase entityIn) { if(entityIn == null && !stack.isOnItemFrame()) return 0; else { boolean hasEntity = entityIn != null; Entity entity = (Entity)(hasEntity ? entityIn : stack.getItemFrame()); if(world == null) world = entity.world; double angle; BlockPos pos = getPos(stack); if(pos.getY() == world.provider.getDimension()) { double yaw = hasEntity ? entity.rotationYaw : getFrameRotation((EntityItemFrame) entity); yaw = MathHelper.positiveModulo(yaw / 360.0, 1.0); double relAngle = getDeathToAngle(entity, pos) / (Math.PI * 2); angle = 0.5 - (yaw - 0.25 - relAngle); } else angle = Math.random(); if (hasEntity) angle = wobble(world, angle); return MathHelper.positiveModulo((float) angle, 1.0F); } } @SideOnly(Side.CLIENT)
return MathHelper.positiveModulo((float)d0, 1.0F);
d1 = MathHelper.positiveModulo(d1 / 360.0D, 1.0D); double d2 = getAngleToPosition(entity, target) / (Math.PI * 2D); angle = 0.5D - (d1 - 0.25D - d2); angle = wobble(worldIn, angle); return MathHelper.positiveModulo((float) angle, 1.0F);