本文整理匯總了Java中net.minecraft.world.storage.MapStorage類的典型用法代碼示例。如果您正苦於以下問題:Java MapStorage類的具體用法?Java MapStorage怎麽用?Java MapStorage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MapStorage類屬於net.minecraft.world.storage包,在下文中一共展示了MapStorage類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onWorldTick
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event) {
if(event.world.isRemote){ return; } // Not called on client
long time = event.world.getWorldTime();
if (time > Util.ticksInDay) {
MapStorage storage = event.world.getPerWorldStorage();
TimeData td = (TimeData) storage.getOrLoadData(TimeData.class, "firmatime");
if(td==null){
td = new TimeData("");
storage.setData("firmatime", td);
}
td.addDay();
event.world.setWorldTime(time - Util.ticksInDay);
td.setDirty(true);
System.out.println("Day inceremented on Server " + td.toString());
}
}
示例2: WorldServer
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
{
super(saveHandlerIn, info, net.minecraftforge.common.DimensionManager.createProviderFor(dimensionId), profilerIn, false);
this.mcServer = server;
this.theEntityTracker = new EntityTracker(this);
this.thePlayerManager = new PlayerChunkMap(this);
// Guarantee the dimension ID was not reset by the provider
int providerDim = this.provider.getDimension();
this.provider.registerWorld(this);
this.provider.setDimension(providerDim);
this.chunkProvider = this.createChunkProvider();
perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, saveHandlerIn));
this.worldTeleporter = new Teleporter(this);
this.calculateInitialSkylight();
this.calculateInitialWeather();
this.getWorldBorder().setSize(server.getMaxWorldSize());
net.minecraftforge.common.DimensionManager.setWorld(dimensionId, this, mcServer);
}
示例3: World
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
{
this.eventListeners = Lists.newArrayList(new IWorldEventListener[] {this.pathListener});
this.theCalendar = Calendar.getInstance();
this.worldScoreboard = new Scoreboard();
this.spawnHostileMobs = true;
this.spawnPeacefulMobs = true;
this.lightUpdateBlockList = new int[32768];
this.saveHandler = saveHandlerIn;
this.theProfiler = profilerIn;
this.worldInfo = info;
this.provider = providerIn;
this.isRemote = client;
this.worldBorder = providerIn.createWorldBorder();
perWorldStorage = new MapStorage((ISaveHandler)null);
}
示例4: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static SavedData get(World world)
{
if(instance == null)
{
MapStorage storage = world.getMapStorage();
if(storage == null)
{
FMLLog.log(Level.ERROR, "Map storage is null for world");
return null;
}
instance = (SavedData)storage.getOrLoadData(SavedData.class, DATA_NAME);
if(instance == null)
{
instance = new SavedData();
storage.setData(DATA_NAME, instance);
instance.markDirty();
}
}
return instance;
}
示例5: World
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public World(ISaveHandler p_i45368_1_, String p_i45368_2_, WorldProvider p_i45368_3_, WorldSettings p_i45368_4_, Profiler p_i45368_5_)
{
this.ambientTickCountdown = this.rand.nextInt(12000);
this.spawnHostileMobs = true;
this.spawnPeacefulMobs = true;
this.collidingBoundingBoxes = new ArrayList();
this.lightUpdateBlockList = new int[32768];
this.saveHandler = p_i45368_1_;
this.theProfiler = p_i45368_5_;
this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_);
this.provider = p_i45368_3_;
perWorldStorage = new MapStorage((ISaveHandler)null);
// Cauldron start
this.world = null;
this.timings = null;
this.spigotConfig = null;
this.activeChunkSet_CB = null;
this.chunkTickRadius = 0;
// Cauldron end
}
示例6: World
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public World(ISaveHandler p_i1953_1_, String p_i1953_2_, WorldProvider p_i1953_3_, WorldSettings p_i1953_4_, Profiler p_i1953_5_, ILogAgent p_i1953_6_) {
this.field_72990_M = this.field_73012_v.nextInt(12000);
this.field_72994_J = new int['\u8000'];
this.field_73019_z = p_i1953_1_;
this.field_72984_F = p_i1953_5_;
this.field_72986_A = new WorldInfo(p_i1953_4_, p_i1953_2_);
this.field_73011_w = p_i1953_3_;
this.field_72988_C = new MapStorage(p_i1953_1_);
this.field_98181_L = p_i1953_6_;
VillageCollection var7 = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages");
if(var7 == null) {
this.field_72982_D = new VillageCollection(this);
this.field_72988_C.func_75745_a("villages", this.field_72982_D);
} else {
this.field_72982_D = var7;
this.field_72982_D.func_82566_a(this);
}
p_i1953_3_.func_76558_a(this);
this.field_73020_y = this.func_72970_h();
this.func_72966_v();
this.func_72947_a();
}
示例7: getPerWorldStorage
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
protected static MapStorage getPerWorldStorage(World worldObj) {
if (Versions.isForgeInstalled()) {
//return worldObj.getPerWorldStorage();
if (_getPerWorldStorage == null) {
_getPerWorldStorage = Reflect.lookupMethod(ForgeWorldAccess.class, World.class, MapStorage.class, "getPerWorldStorage");
}
if (_getPerWorldStorage.valid()) {
try {
return _getPerWorldStorage.getLambda(worldObj).getPerWorldStorage();
} catch (Throwable e) {
_getPerWorldStorage.invalidate();
}
}
}
return worldObj.getMapStorage();
}
示例8: getSimply
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static RandoresWorldData getSimply(World world) {
MapStorage storage = world.getMapStorage();
RandoresWorldData data = (RandoresWorldData) storage.getOrLoadData(RandoresWorldData.class, NAME);
if (data == null) {
data = new RandoresWorldData();
data.setSeed(genSeed(world));
storage.setData(NAME, data);
}
return data;
}
示例9: getMapStorage
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@Override
public MapStorage getMapStorage() {
if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
return m_proxyWorld.getMapStorage();
} else if (m_realWorld != null) {
return m_realWorld.getMapStorage();
} else {
return super.getMapStorage();
}
}
示例10: getPerWorldStorage
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@Override
public MapStorage getPerWorldStorage() {
if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
return m_proxyWorld.getPerWorldStorage();
} else if (m_realWorld != null) {
return m_realWorld.getPerWorldStorage();
} else {
return super.getPerWorldStorage();
}
}
示例11: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
@SuppressWarnings("ConstantConditions")
public static WorldMonolithData get(World world) {
MapStorage storage = world.getMapStorage();
WorldMonolithData data = (WorldMonolithData) storage.getOrLoadData(WorldMonolithData.class, NAME);
if(data == null) {
data = new WorldMonolithData(NAME);
storage.setData(NAME, data);
}
return data;
}
示例12: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static WorldQuantumData get(World world) {
MapStorage storage = world.getMapStorage();
//noinspection ConstantConditions
WorldQuantumData data = (WorldQuantumData) storage.getOrLoadData(WorldQuantumData.class, NAME);
if(data == null) {
data = new WorldQuantumData(NAME);
storage.setData(NAME, data);
}
return data;
}
示例13: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static TileList get(World world)
{
MapStorage storage = world.getMapStorage();
TileList instance = (TileList)storage.getOrLoadData(TileList.class, DATA_NAME);
TileList.world = world;
if (instance == null)
{
System.out.println("It was null");
instance = new TileList();
storage.setData(DATA_NAME, instance);
}
return instance;
}
示例14: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static WorldTurn get(World world)
{
MapStorage storage = world.getMapStorage();
System.out.println(storage);
WorldTurn instance = (WorldTurn)storage.getOrLoadData(WorldTurn.class, DATA_NAME);
if (instance == null)
{
System.out.println("It was null");
instance = new WorldTurn();
storage.setData(DATA_NAME, instance);
}
return instance;
}
示例15: get
import net.minecraft.world.storage.MapStorage; //導入依賴的package包/類
public static EmpireList get(World world)
{
EmpireList.world = world;
MapStorage storage = world.getMapStorage();
EmpireList instance = (EmpireList)storage.getOrLoadData(EmpireList.class, DATA_NAME);
if (instance == null)
{
System.out.println("It was null");
instance = new EmpireList();
storage.setData(DATA_NAME, instance);
}
return instance;
}