mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-06-15 16:44:32 +02:00
30 lines
825 B
Java
30 lines
825 B
Java
|
package de.ellpeck.naturesaura.api.aura.chunk;
|
||
|
|
||
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||
|
import net.minecraft.nbt.CompoundTag;
|
||
|
import net.minecraft.world.level.chunk.LevelChunk;
|
||
|
import net.neoforged.neoforge.common.util.INBTSerializable;
|
||
|
|
||
|
public class AuraChunkProvider implements INBTSerializable<CompoundTag> {
|
||
|
|
||
|
private IAuraChunk auraChunk;
|
||
|
|
||
|
public IAuraChunk get(LevelChunk chunk) {
|
||
|
if (this.auraChunk == null)
|
||
|
this.auraChunk = NaturesAuraAPI.instance().createAuraChunk();
|
||
|
this.auraChunk.ensureInitialized(chunk);
|
||
|
return this.auraChunk;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public CompoundTag serializeNBT() {
|
||
|
return this.get(null).serializeNBT();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void deserializeNBT(CompoundTag nbt) {
|
||
|
this.get(null).deserializeNBT(nbt);
|
||
|
}
|
||
|
|
||
|
}
|