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


Java PlayerEvent.PlayerChangedDimensionEvent方法代碼示例

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


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

示例1: onPlayerChangedDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
//TODO NOTE THAT THIS DOES NOT TRIGGER FOR WHEN CLIENT LEAVES THE END. FIX IS ONLY IN 1.11
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event)
{
    ArrayList<GrabHandler> handlers = GrabHandler.getHandlers(event.player, Side.SERVER);
    for(int i = handlers.size() - 1; i >= 0; i--)
    {
        GrabHandler handler = handlers.get(i);
        if(handler.canSendAcrossDimensions())
        {
            GrabHandler.dimensionalEntities.add(handler.grabbed.getEntityId());
            handler.grabbed.getEntityData().setInteger("Grabbed-ID", handler.grabbed.getEntityId());
            handler.grabbed.changeDimension(event.player.dimension);
            handler.update();
        }
        else
        {
            handler.terminate();
            handlers.remove(i);
        }
    }
}
 
開發者ID:iChun,項目名稱:iChunUtil,代碼行數:23,代碼來源:EventHandlerServer.java

示例2: onPlayerChangedDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) {
	BrewStorageHandler.getBrewStorage(event.player).ifPresent(data -> {
		if (event.player instanceof EntityPlayerMP) {
			data.syncToNear(event.player);
		}
	});
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:9,代碼來源:BrewEvents.java

示例3: onPlayerDimensionChange

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) {
    if (event.player == null) {
        return;
    }
    retractDarts(event.player);
    if(checkGear(event.player)) {
        equipGear(event.player);
    }
}
 
開發者ID:InfinityRaider,項目名稱:3DManeuverGear,代碼行數:12,代碼來源:DartHandler.java

示例4: onPlayerChangedDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event)
{
    JustEnoughDimensions.logInfo("PlayerEvent.PlayerChangedDimensionEvent - DIM: {}", event.player.getEntityWorld().provider.getDimension());
    this.syncAndSetPlayerData(event.player);

    if (Configs.enableForcedGamemodes && event.player instanceof EntityPlayerMP)
    {
        GamemodeTracker.getInstance().playerChangedDimension((EntityPlayerMP) event.player, event.fromDim, event.toDim);
    }
}
 
開發者ID:maruohon,項目名稱:justenoughdimensions,代碼行數:12,代碼來源:JEDEventHandler.java

示例5: TravelEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void TravelEvent(PlayerEvent.PlayerChangedDimensionEvent event) {
	if (event.toDim == IDs.Nillax) {
		event.player.addStat(ModAchievements.travelToNillax, 1);
	}
	if (Constants.DEF_DARKLOAD == true) {
		if (event.toDim == IDs.Darkax) {
			event.player.addStat(ModAchievements.travelToDarkax, 1);
		}
	}
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:12,代碼來源:AchievementEvents.java

示例6: onSwitchDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onSwitchDimension(PlayerEvent.PlayerChangedDimensionEvent ev) {
    this.sendRequest(ev.player);
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:5,代碼來源:RandoresPlayerListener.java

示例7: onChangeDim

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onChangeDim(PlayerEvent.PlayerChangedDimensionEvent e)
{
    e.player.getCapability(CapabilityRegistry.ENTRY_STORE_CAP, null).sync((EntityPlayerMP) e.player);
    e.player.getCapability(CapabilityRegistry.AURA_CONTAINER_CAP, null).sync((EntityPlayerMP) e.player);
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:7,代碼來源:CapabilityEvents.java

示例8: onDimensionChange

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) {
    if (!event.player.world.isRemote && event.player instanceof EntityPlayerMP) //Mojang seems to wipe all caps on teleport
        FirstAid.NETWORKING.sendTo(new MessageResync(PlayerDataManager.getDamageModel(event.player)), (EntityPlayerMP) event.player);
}
 
開發者ID:ichttt,項目名稱:FirstAid,代碼行數:6,代碼來源:EventHandler.java

示例9: toLua

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@Override
public Proxy<PlayerEvent.PlayerChangedDimensionEvent> toLua(
    PlayerEvent.PlayerChangedDimensionEvent javaObj) {
  return new Proxy<>(getConverters(), getMetatable(), javaObj);
}
 
開發者ID:wizards-of-lua,項目名稱:wizards-of-lua,代碼行數:6,代碼來源:PlayerChangedDimensionEventClass.java

示例10: onPlayerChangedDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) {
    playerItemTankStates.put(event.player.getName(), new PlayerItemTankCache((EntityPlayerMP) event.player));
}
 
開發者ID:TheCBProject,項目名稱:EnderStorage,代碼行數:5,代碼來源:TankSynchroniser.java

示例11: onPlayerChangedDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) {
    instance(false).sendClientInfo(event.player);
}
 
開發者ID:TheCBProject,項目名稱:EnderStorage,代碼行數:5,代碼來源:EnderStorageManager.java

示例12: onPlayerDimensionChange

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) {
    this.data = DUMMY;
}
 
開發者ID:InfinityRaider,項目名稱:SettlerCraft,代碼行數:6,代碼來源:SettlementHandlerClient.java

示例13: onPlayerDimensionChange

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) {
    new MessageSyncSettlementsToClient(this.getSettlementsForWorld(event.player.getEntityWorld())).sendTo((EntityPlayerMP) event.player);
}
 
開發者ID:InfinityRaider,項目名稱:SettlerCraft,代碼行數:6,代碼來源:SettlementHandlerServer.java

示例14: changeDimension

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void changeDimension(PlayerEvent.PlayerChangedDimensionEvent event)
{
    if (!Helper.shouldCare(event.player)) return;
    GlobalBanList.process(event.toDim, event.player.inventory);
}
 
開發者ID:DoubleDoorDevelopment,項目名稱:ItemBlacklist,代碼行數:7,代碼來源:ServerEventHandlers.java


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