本文整理匯總了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();
}
}
}
}
示例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();
}
}
示例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);
}
}
}
示例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());
}
示例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);
}
}
示例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();
}
}
示例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());
}
}
示例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();
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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();
}
}
示例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());
}
}
示例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();
}
}
}
示例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());
}
}