本文整理汇总了Java中net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent类的典型用法代码示例。如果您正苦于以下问题:Java PlayerChangedDimensionEvent类的具体用法?Java PlayerChangedDimensionEvent怎么用?Java PlayerChangedDimensionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerChangedDimensionEvent类属于net.minecraftforge.fml.common.gameevent.PlayerEvent包,在下文中一共展示了PlayerChangedDimensionEvent类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: teleport
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void teleport(PlayerChangedDimensionEvent event) {
if (CommonProxy.d == 0) {
return;
}
if (event.player.world.isRemote) {
return;
}
if (event.toDim == 0) {
new SpawnTeleport(DimensionManager.getWorld(CommonProxy.d)).teleport(event.player, DimensionManager.getWorld(CommonProxy.d));
event.setCanceled(true);
}
}
示例2: onChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void onChangedDimension(PlayerChangedDimensionEvent event)
{
PlayerAether playerAether = PlayerAether.get(event.player);
if (playerAether != null)
{
playerAether.onChangedDimension(event.toDim, event.fromDim);
}
}
示例3: onPlayerChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onPlayerChangedDimension(PlayerChangedDimensionEvent event) {
IAttributeInstance maxHealthInstance = event.player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH);
AttributeModifier modifier = maxHealthInstance.getModifier(HealthHelper.LIFEBLOOD_HEALTH_MODIFIER_ID);
if (SyncedConfigHandler.getBooleanValue(GameplayOption.ENABLE_LOWERED_STARTING_HEALTH) && modifier != null) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), modifier);
event.player.getAttributeMap().applyAttributeModifiers(multimap);
}
}
示例4: onPlayerWarp
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerWarp(PlayerChangedDimensionEvent event) {
IPlayerExtendedProperties props = CapabilityRegistry.getPlayerProperties(event.player);
if (props.getMaxHealth() > 0 && event.player instanceof EntityPlayerMP) {
//force clientside hearts to visually update
ModCyclic.network.sendTo(new PacketSyncPlayerHealth(props.getMaxHealth()), (EntityPlayerMP) event.player);
}
}
示例5: onPlayerChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onPlayerChangedDimension(PlayerChangedDimensionEvent event)
{
if(event.player instanceof EntityPlayerMP)
{
ExcavationRenderTracker.INSTANCE.updatePlayerTracking((EntityPlayerMP) event.player);
}
}
示例6: playerDimensionChange
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerDimensionChange(PlayerChangedDimensionEvent event) {
RedstoneEther.server().resetPlayer(event.player);
RedstoneEtherAddons.server().onDimensionChange(event.player);
}
示例7: changeDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
/** Updates the brightness when the player changes dimension. */
@SubscribeEvent
public static void changeDimension(PlayerChangedDimensionEvent event) {
updateBrightness(event.toDim);
}
示例8: dimChangeEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void dimChangeEvent(PlayerChangedDimensionEvent event) {
NEIServerConfig.forPlayer(event.player.getCommandSenderName()).onWorldReload();
}
示例9: onPlayerChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerChangedDimension(PlayerChangedDimensionEvent event) {
SkinCore.updatePlayerSkin(event.player);
}
示例10: dimChangeEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void dimChangeEvent(PlayerChangedDimensionEvent event) {
NEIServerConfig.getSaveForPlayer(event.player.getName()).onWorldReload();
}
示例11: onEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onEvent(PlayerChangedDimensionEvent event) {
ProgressionAPI.registry.fireTrigger(event.player, getProvider().getUnlocalisedName(), event.fromDim, event.toDim);
}
示例12: onPlayerChangedDimension
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerChangedDimension(PlayerChangedDimensionEvent event){
event.player.getCapability(NecroDataCapabilityProvider.NECRO_DATA_CAP, null).triggerDimensionUnlock(event.toDim);
}
示例13: onPlayerChangedDimensionEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerChangedDimensionEvent(PlayerChangedDimensionEvent event)
{ sendBackpackStack(event.player, event.player); }