2021-12-04 15:40:09 +01:00
|
|
|
package de.ellpeck.naturesaura.api.misc;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
|
|
|
import net.minecraft.nbt.CompoundTag;
|
|
|
|
import net.minecraft.world.level.Level;
|
2024-02-03 14:56:07 +01:00
|
|
|
import net.neoforged.neoforge.common.util.INBTSerializable;
|
|
|
|
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
|
|
|
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
2021-12-04 15:40:09 +01:00
|
|
|
|
|
|
|
public interface ILevelData extends ICapabilityProvider, INBTSerializable<CompoundTag> {
|
|
|
|
|
|
|
|
static ILevelData getLevelData(Level level) {
|
2021-12-23 13:27:52 +01:00
|
|
|
return level.getCapability(NaturesAuraAPI.CAP_LEVEL_DATA, null).orElse(null);
|
2021-12-04 15:40:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ILevelData getOverworldData(Level level) {
|
|
|
|
if (!level.isClientSide)
|
2022-06-27 15:24:04 +02:00
|
|
|
return ILevelData.getLevelData(level.getServer().getLevel(Level.OVERWORLD));
|
|
|
|
return ILevelData.getLevelData(level);
|
2021-12-04 15:40:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
IItemHandlerModifiable getEnderStorage(String name);
|
|
|
|
|
|
|
|
boolean isEnderStorageLocked(String name);
|
|
|
|
}
|