@Override public float getTemperatureAt(int x, int y, int z) { return this.wrapped.getTemperature(new BlockPos(x, y, z)); }
@Override public float getExactTemperature() { return getBiome().getTemperature(getPosition()); }
@Override public float getExactTemperature() { BlockPos coords = getReferenceCoord(); return world.getBiome(coords).getTemperature(coords); }
public static EnumTemperature getFromBiome(Biome biome, BlockPos pos) { if (BiomeHelper.isBiomeHellish(biome)) { return HELLISH; } float temperature = biome.getTemperature(pos); return getFromValue(temperature); } }
@Override public float getExactTemperature() { BlockPos coords = getCoordinates(); return world.getBiome(coords).getTemperature(coords); }
public IClimateState getBiomeState(World worldObj, BlockPos coordinates) { Biome biome = worldObj.getBiome(coordinates); return ClimateStateHelper.of(biome.getTemperature(coordinates), biome.getRainfall()); }
@Override public float getExactTemperature() { IClimateState climateState = getState(); float temperature; if (climateState.isPresent()) { temperature = climateState.getTemperature(); } else { Biome biome = getBiome(); temperature = biome.getTemperature(getCoordinates()); } return temperature; }
@Override public void fillWithRain(World worldIn, BlockPos pos) { if (worldIn.rand.nextInt(2) == 0) { float f = worldIn.getBiome(pos).getTemperature(pos); if (worldIn.getBiomeProvider().getTemperatureAtHeight(f, pos.getY()) >= 0.15F) { IBlockState iblockstate = worldIn.getBlockState(pos); if (((Integer)iblockstate.getValue(LEVEL)).intValue() < 3) { worldIn.setBlockState(pos, iblockstate.cycleProperty(LEVEL), 2); } } } }
float t = biome.getTemperature(pos); if (t > 1.5F || t < 0.1F) return false;
public static float getFloatTemperature(World world, Biome biome, BlockPos pos) { if (!SeasonsConfig.isDimensionWhitelisted(world.provider.getDimension())) { return biome.getTemperature(pos); } return getFloatTemperature(new SeasonTime(SeasonHelper.getSeasonState(world).getSeasonCycleTicks()).getSubSeason(), biome, pos); }
public static boolean tryGenHive(World world, Random rand, int x, int z, Hive hive) { final BlockPos hivePos = hive.getPosForHive(world, x, z); if (hivePos == null) { return false; } if (!hive.canReplace(world, hivePos)) { return false; } Biome biome = world.getBiome(hivePos); EnumTemperature temperature = EnumTemperature.getFromValue(biome.getTemperature(hivePos)); if (!hive.isGoodTemperature(temperature)) { return false; } if (!hive.isValidLocation(world, hivePos)) { return false; } return setHive(world, rand, hivePos, hive); }
@Override public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingData) { IEntityLivingData ret = super.onInitialSpawn(difficulty, livingData); if (!this.world.isRemote) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY); int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { setTextureType(1); } } setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); setEnchantmentBasedOnDifficulty(difficulty); if (world.rand.nextInt(2) == 0) { if (world.rand.nextInt(2) == 0) { setItemStackToSlot(EntityEquipmentSlot.OFFHAND, TIPPED_ARROW_CUSTOM); } else { setItemStackToSlot(EntityEquipmentSlot.OFFHAND, TIPPED_ARROW_CUSTOM_2); } } setCombatTask(); return ret; }
@Override public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { IEntityLivingData ret = super.onInitialSpawn(difficulty, livingdata); if (!this.world.isRemote) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY); int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { setTextureType(1); } } setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(GaiaItems.WEAPON_PROP_SWORD_WOOD)); setEnchantmentBasedOnDifficulty(difficulty); setCombatTask(); return ret; }
@Override public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { IEntityLivingData ret = super.onInitialSpawn(difficulty, livingdata); if (!this.world.isRemote) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY); int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { setTextureType(2); } else if (world.rand.nextInt(4) == 0) { setTextureType(1); } } // TEMP Method used instead of isChild setChild(true, 10); if (!isChild) { ItemStack weaponCustom = new ItemStack(GaiaItems.WEAPON_PROP_ENCHANTED, 1); weaponCustom.addEnchantment(Enchantments.KNOCKBACK, 2); setItemStackToSlot(EntityEquipmentSlot.MAINHAND, weaponCustom); } setCombatTask(); return ret; }
public static float getFloatTemperature(SubSeason subSeason, Biome biome, BlockPos pos) float biomeTemp = biome.getTemperature(pos);
@Override public void onLivingUpdate() { if (!this.world.isRemote) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY); int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 0)); addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 100, 0)); } } super.onLivingUpdate(); }
public static boolean canSnowAtInSeason(World world, BlockPos pos, boolean checkLight, @Nullable ISeasonState seasonState, boolean useUnmodifiedTemperature) float temperature = biome.getTemperature(pos);
int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 0)); addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 100, 0));
@Override public void onLivingUpdate() { if (!world.isRemote) { if (isWet()) { if (inWaterTimer <= 100) { ++inWaterTimer; } else { world.setEntityState(this, (byte) 8); heal(EntityAttributes.MAX_HEALTH_1 * 0.10F); addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 5 * 20, 0)); inWaterTimer = 0; } } } if (!this.world.isRemote) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY); int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 0)); addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 100, 0)); } } super.onLivingUpdate(); }
int k = MathHelper.floor(this.posZ); if (this.world.getBiome(new BlockPos(i, 0, k)).getTemperature(new BlockPos(i, j, k)) > 1.0F) { addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 0)); addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 100, 0));