2019-02-17 22:51:05 +01:00
|
|
|
package de.ellpeck.naturesaura.api.misc;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
2019-10-20 22:30:49 +02:00
|
|
|
import net.minecraft.nbt.CompoundNBT;
|
2019-02-17 22:51:05 +01:00
|
|
|
import net.minecraft.world.World;
|
2020-01-21 21:04:44 +01:00
|
|
|
import net.minecraft.world.dimension.DimensionType;
|
2019-02-17 22:51:05 +01:00
|
|
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
|
|
|
import net.minecraftforge.common.util.INBTSerializable;
|
|
|
|
import net.minecraftforge.items.IItemHandlerModifiable;
|
|
|
|
|
2019-10-20 22:30:49 +02:00
|
|
|
public interface IWorldData extends ICapabilityProvider, INBTSerializable<CompoundNBT> {
|
2019-02-17 22:51:05 +01:00
|
|
|
|
|
|
|
static IWorldData getWorldData(World world) {
|
2020-01-21 21:04:44 +01:00
|
|
|
return world.getCapability(NaturesAuraAPI.capWorldData, null).orElse(null);
|
2019-02-17 22:51:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static IWorldData getOverworldData(World world) {
|
2019-03-21 12:41:33 +01:00
|
|
|
if (!world.isRemote)
|
2020-01-21 21:04:44 +01:00
|
|
|
return getWorldData(world.getServer().getWorld(DimensionType.OVERWORLD));
|
2019-02-17 22:51:05 +01:00
|
|
|
return getWorldData(world);
|
|
|
|
}
|
|
|
|
|
|
|
|
IItemHandlerModifiable getEnderStorage(String name);
|
2019-02-18 19:30:35 +01:00
|
|
|
|
|
|
|
boolean isEnderStorageLocked(String name);
|
2019-02-17 22:51:05 +01:00
|
|
|
}
|