2019-02-17 22:51:05 +01:00
|
|
|
package de.ellpeck.naturesaura.api.misc;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2019-03-20 20:51:24 +01:00
|
|
|
import net.minecraft.server.MinecraftServer;
|
2019-02-17 22:51:05 +01:00
|
|
|
import net.minecraft.world.DimensionType;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
|
|
|
import net.minecraftforge.common.util.INBTSerializable;
|
2019-03-20 20:51:24 +01:00
|
|
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
2019-02-17 22:51:05 +01:00
|
|
|
import net.minecraftforge.items.IItemHandlerModifiable;
|
|
|
|
|
|
|
|
public interface IWorldData extends ICapabilityProvider, INBTSerializable<NBTTagCompound> {
|
|
|
|
|
|
|
|
static IWorldData getWorldData(World world) {
|
|
|
|
if (world.hasCapability(NaturesAuraAPI.capWorldData, null))
|
|
|
|
return world.getCapability(NaturesAuraAPI.capWorldData, null);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
static IWorldData getOverworldData(World world) {
|
2019-03-20 20:51:24 +01:00
|
|
|
if (!world.isRemote) {
|
|
|
|
return getWorldData(world.getMinecraftServer().getWorld(DimensionType.OVERWORLD.getId()));
|
|
|
|
}
|
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
|
|
|
}
|