@Override
public void deserializeNBT(NBTTagCompound nbt)
{
this.growthRanges[0].deserializeNBT(nbt.getCompoundTag("tGrowthRangeMinimal"));
this.growthRanges[1].deserializeNBT(nbt.getCompoundTag("tGrowthRangeOptimal"));
this.growthRanges[2].deserializeNBT(nbt.getCompoundTag("tGrowthRangePerfect"));
this.humidityGrowthRange = Pair.of(nbt.getCompoundTag("hGrowthRange").getFloat("min"), nbt.getCompoundTag("hGrowthRange").getFloat("max"));
this.generation = nbt.getInteger("generation");
this.wild = nbt.getBoolean("wild");
this.type = EnumCrop.values()[nbt.getByte("type")];
this.plantedAt = new Calendar();
if (nbt.hasKey("plantedAt"))
{
this.plantedAt.deserializeNBT((NBTTagLong) nbt.getTag("plantedAt"));
}
this.health = nbt.getFloat("health");
this.growthRate = nbt.getFloat("growthRate");
this.waterConsumption = nbt.getFloat("waterConsumption");
this.growth = nbt.getFloat("growth");
this.nutrientConsumption.clear();
nbt.getTagList("nutrientConsumption", NBT.TAG_COMPOUND).forEach(tag -> this.nutrientConsumption.put(EnumPlantNutrient.values()[((NBTTagCompound)tag).getByte("nutrient")], ((NBTTagCompound)tag).getFloat("amount")));
}
CropStats.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:ExPetrum
作者:
评论列表
文章目录