當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldEvent.Unload方法代碼示例

本文整理匯總了Java中net.minecraftforge.event.world.WorldEvent.Unload方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldEvent.Unload方法的具體用法?Java WorldEvent.Unload怎麽用?Java WorldEvent.Unload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.event.world.WorldEvent的用法示例。


在下文中一共展示了WorldEvent.Unload方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event)
{
    if(event.getWorld().isRemote)
    {
        Iterator<Map.Entry<EntityLivingBase, GooglyTracker>> ite = trackers.entrySet().iterator();
        while(ite.hasNext())
        {
            Map.Entry<EntityLivingBase, GooglyTracker> e = ite.next();
            GooglyTracker tracker = e.getValue();
            if(tracker.parent.getEntityWorld() == event.getWorld())
            {
                ite.remove();
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:GooglyEyes,代碼行數:18,代碼來源:EventHandler.java

示例2: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
    if (event.getWorld().isRemote) {
        return;
    }

    RedstoneEther.unloadServerWorld(event.getWorld());

    if (!ServerUtils.mc().isServerRunning()) {
        RedstoneEther.unloadServer();
        RedstoneEtherAddons.unloadServer();
    }
}
 
開發者ID:TheCBProject,項目名稱:WirelessRedstone,代碼行數:14,代碼來源:WREventHandler.java

示例3: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
	if (event.getWorld().isRemote) return;
	Integer worldid = event.getWorld().getWorldType().getId();
	synchronized(schedulers) {
		if (schedulers.containsKey(worldid)) {
			String worldName = event.getWorld().getWorldInfo().getWorldName();
			System.out.println("Clean unload for scheduler on world '"+worldName+"'.");
			//TODO: Save data to world
			schedulers.remove(worldid);
		}
	}
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:14,代碼來源:BigExplosionHandler.java

示例4: onDimensionUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDimensionUnload(WorldEvent.Unload event)
{
    ForgeChunkManager.unloadWorld(event.getWorld());
    if (event.getWorld() instanceof WorldServer)
        FakePlayerFactory.unloadWorld((WorldServer) event.getWorld());
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:8,代碼來源:ForgeInternalHandler.java

示例5: worldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void worldUnload(WorldEvent.Unload event)
{
	int dimensionID = event.getWorld().provider.getDimension();

	if (!event.getWorld().isRemote)
	{
		DimensionHandler.getInstance().unload(event.getWorld(), dimensionID);
	}
}
 
開發者ID:lumien231,項目名稱:Simple-Dimensions,代碼行數:11,代碼來源:SimpleDimensions.java

示例6: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(final WorldEvent.Unload event) {
	if(event.getWorld().provider.getDimension() == ModDimensions.CUBE_ID){
     PlayerCubeChunkLoaderManager.playerTickets.clear();
     PlayerCubeChunkLoaderManager.chunkLoaders.clear();
	}
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:8,代碼來源:PlayerCubeChunkLoaderManager.java

示例7: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onWorldUnload (WorldEvent.Unload event) {

    if (event.getWorld() instanceof WorldServer) {

        LOADED_MONOLITHS.remove(event.getWorld());
    }
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:9,代碼來源:FeatureMonolith.java

示例8: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(final WorldEvent.Unload event) {
    final EntityPlayerSP player = this.minecraft.player;
    if (player == null) {
        return;
    }

    if (player.world == event.getWorld()) {
        clearTraces();
    }
}
 
開發者ID:Lunatrius,項目名稱:Tracer,代碼行數:12,代碼來源:TraceHandler.java

示例9: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onWorldUnload (WorldEvent.Unload event) {

    if (event.getWorld() instanceof WorldServer) {

        LOADED_TETHERS.remove(event.getWorld());
    }
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:9,代碼來源:FeatureEnderTether.java

示例10: unloadWorld

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void unloadWorld(WorldEvent.Unload event) {
    DimensionalSettingsRegistry.instance.unloadWorld(event);
    if (event.getWorld() instanceof WorldServer) {
        servedWorlds.remove(event.getWorld().provider.getDimension());
    }
}
 
開發者ID:Zeno410,項目名稱:Geographicraft,代碼行數:8,代碼來源:ClimateControl.java

示例11: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
	if(event.getWorld().isRemote) {
		System.out.println("Unloading dimension " + event.getWorld().provider.getDimension());
		FancyFluidStorage.tankManager.removeAllForDimension(event.getWorld().provider.getDimension());
	}
}
 
開發者ID:Lordmau5,項目名稱:FFS,代碼行數:8,代碼來源:FancyFluidStorage.java

示例12: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
    BlockSystems.PROXY.getBlockSystemHandler(event.getWorld()).unloadWorld();
    if (event.getWorld().isRemote) {
        BlockSystemRenderHandler.removeAll();
    }
}
 
開發者ID:gegy1000,項目名稱:BlockSystems,代碼行數:8,代碼來源:ClientEventHandler.java

示例13: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onWorldUnload (WorldEvent.Unload event) {

    // Stop tracking a fake player in a world when that world is unloaded.
    if (event.getWorld() instanceof WorldServer) {

        FAKE_PLAYERS.remove(event.getWorld());
    }
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:10,代碼來源:FakePlayerHandler.java

示例14: onWorldUnLoad

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldUnLoad(WorldEvent.Unload event) {
    if (hasExtensions(event.getWorld()))//because force closing unloads a world twice
    {
        for (WorldExtension extension : worldMap.remove(event.getWorld().provider.getDimension())) {
            extension.unload();
        }
    }
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:10,代碼來源:WorldExtensionManager.java

示例15: onWorldUnload

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onWorldUnload(WorldEvent.Unload event) {
	if (!event.getWorld().isRemote) {
		removeWorldData(event.getWorld().provider.getDimension());
	}
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:7,代碼來源:StabilityHandler.java


注:本文中的net.minecraftforge.event.world.WorldEvent.Unload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。