本文整理汇总了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);
}
}
}
示例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);
}
});
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例6: onSwitchDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onSwitchDimension(PlayerEvent.PlayerChangedDimensionEvent ev) {
this.sendRequest(ev.player);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例11: onPlayerChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) {
instance(false).sendClientInfo(event.player);
}
示例12: onPlayerDimensionChange
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) {
this.data = DUMMY;
}
示例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);
}
示例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);
}