mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 12:59:44 +00:00
Cleanup Log, loading from nbt, remove Version check
This commit is contained in:
1 parent
14c42afd29
commit
7b0259a343
89 files changed
+450
-930
No files matched your search
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.farming.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -17,23 +18,25 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import forestry.api.core.BiomeHelper;
|
||||
import forestry.api.core.INBTTagable;
|
||||
import forestry.api.core.INbtReadable;
|
||||
import forestry.api.core.INbtWritable;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IStreamable;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
import forestry.farming.gui.IFarmLedgerDelegate;
|
||||
|
||||
public class FarmHydrationManager implements IFarmLedgerDelegate, INBTTagable, IStreamable {
|
||||
public class FarmHydrationManager implements IFarmLedgerDelegate, INbtWritable, INbtReadable, IStreamable {
|
||||
private static final int DELAY_HYDRATION = 100;
|
||||
private static final float RAINFALL_MODIFIER_MAX = 15f;
|
||||
private static final float RAINFALL_MODIFIER_MIN = 0.5f;
|
||||
|
||||
@Nonnull
|
||||
private final IClimatised climatised;
|
||||
private int hydrationDelay = 0;
|
||||
private int ticksSinceRainfall = 0;
|
||||
|
||||
public FarmHydrationManager(IClimatised climatised) {
|
||||
public FarmHydrationManager(@Nonnull IClimatised climatised) {
|
||||
this.climatised = climatised;
|
||||
}
|
||||
|
||||
@@ -86,12 +89,6 @@ public class FarmHydrationManager implements IFarmLedgerDelegate, INBTTagable, I
|
||||
return Math.round(((double) ticksSinceRainfall / 24000) * 10) / 10.;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
hydrationDelay = nbttagcompound.getInteger("HydrationDelay");
|
||||
ticksSinceRainfall = nbttagcompound.getInteger("TicksSinceRainfall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setInteger("HydrationDelay", hydrationDelay);
|
||||
@@ -109,4 +106,10 @@ public class FarmHydrationManager implements IFarmLedgerDelegate, INBTTagable, I
|
||||
hydrationDelay = data.readVarInt();
|
||||
ticksSinceRainfall = data.readVarInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
hydrationDelay = nbt.getInteger("HydrationDelay");
|
||||
ticksSinceRainfall = nbt.getInteger("TicksSinceRainfall");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user