use of net.minecraft.world.storage.MapStorage in project Magma by magmafoundation.
the class CraftServer method getMap.
@Override
@Deprecated
public CraftMapView getMap(short id) {
MapStorage collection = console.worlds[0].mapStorage;
MapData worldmap = (MapData) collection.getOrLoadData(MapData.class, "map_" + id);
if (worldmap == null) {
return null;
}
return worldmap.mapView;
}
use of net.minecraft.world.storage.MapStorage in project Multiblocked by CleanroomMC.
the class MultiblockWorldSavedData method getOrCreate.
public static MultiblockWorldSavedData getOrCreate(World world) {
if (world == null || world instanceof DummyWorld) {
return DUMMY;
}
MapStorage perWorldStorage = world.getPerWorldStorage();
String name = getName(world);
worldRef = new WeakReference<>(world);
MultiblockWorldSavedData mbwsd = (MultiblockWorldSavedData) perWorldStorage.getOrLoadData(MultiblockWorldSavedData.class, name);
worldRef = null;
if (mbwsd == null) {
perWorldStorage.setData(name, mbwsd = new MultiblockWorldSavedData(name));
}
return mbwsd;
}
use of net.minecraft.world.storage.MapStorage in project Crossroads by Crossroads-Development.
the class PlayerDimensionMapSavedData method get.
public static PlayerDimensionMapSavedData get(World world, @Nullable PlayerProfileCache playerCache) {
cache = playerCache;
MapStorage storage = world.getMapStorage();
PlayerDimensionMapSavedData data = (PlayerDimensionMapSavedData) storage.getOrLoadData(PlayerDimensionMapSavedData.class, PLAYER_DIM_ID);
if (data == null) {
data = new PlayerDimensionMapSavedData();
storage.setData(PLAYER_DIM_ID, data);
}
cache = null;
return data;
}
use of net.minecraft.world.storage.MapStorage in project CumServerPro by MCUmbrella.
the class CraftServer method getMap.
@Override
@Deprecated
public CraftMapView getMap(short id) {
MapStorage collection = console.worlds[0].mapStorage;
MapData worldmap = (MapData) collection.getOrLoadData(MapData.class, "map_" + id);
if (worldmap == null) {
return null;
}
return worldmap.mapView;
}
use of net.minecraft.world.storage.MapStorage in project Flux-Networks by SonarSonic.
the class FluxEvents method onWorldSave.
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
if (event.getWorld().isRemote) {
return;
}
if (event.getWorld().provider.getDimension() == FluxNetworks.saveDimension) {
MapStorage storage = event.getWorld().getPerWorldStorage();
NetworkData data = (NetworkData) storage.getOrLoadData(NetworkData.class, NetworkData.tag);
if (data == null && !FluxNetworks.getServerCache().getAllNetworks().isEmpty()) {
storage.setData(NetworkData.tag, new NetworkData(NetworkData.tag));
}
}
}
Aggregations