当前位置: 首页>>代码示例>>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;未经允许,请勿转载。