本文整理汇总了Java中net.minecraftforge.event.entity.player.PlayerWakeUpEvent类的典型用法代码示例。如果您正苦于以下问题:Java PlayerWakeUpEvent类的具体用法?Java PlayerWakeUpEvent怎么用?Java PlayerWakeUpEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerWakeUpEvent类属于net.minecraftforge.event.entity.player包,在下文中一共展示了PlayerWakeUpEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onWakeUp
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWakeUp(PlayerWakeUpEvent event)
{
boolean willSleep = event.setSpawn;
EntityPlayer player = event.entityPlayer;
if (!willSleep && playersToNotSetSpawn.get(player.getPersistentID()) != null)
{
playersToNotSetSpawn.remove(player.getUniqueID());
}
/*else if (!Settings.playerChecksBedRespawn[1])
{
LogHelper.info("Forcing bed spawn location");
ChunkCoordinates bedLocation = player.getBedLocation(player.dimension);
player.setSpawnChunk(bedLocation, true);
}*/
}
开发者ID:VikeStep,项目名称:sprinkles_for_vanilla,代码行数:17,代码来源:PlayerHandlers.java
示例2: playerWokeUp
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerWokeUp(PlayerWakeUpEvent event)
{
if (event.entity.worldObj.isRemote) return;
ChunkCoordinates bedLocation = event.entityPlayer.getBedLocation(event.entityPlayer.dimension);
if (bedLocation != null && event.entityPlayer.worldObj.getBlock(bedLocation.posX, bedLocation.posY, bedLocation.posZ) == ModBlocks.blockSleepingBag)
{
//If the player wakes up in one of those super confortable SleepingBags (tm) (Patent Pending)
BackpackProperty.get(event.entityPlayer).setForceCampFire(true);
LogHelper.info("Player just woke up in a sleeping bag, forcing respawn in the last lighted campfire, if there's any");
} else
{
//If it's a regular bed or whatever
BackpackProperty.get(event.entityPlayer).setForceCampFire(false);
}
}
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:17,代码来源:PlayerEventHandler.java
示例3: playerWakeUp
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
/** Adds behaviour when player wakes up from a bed. */
@SubscribeEvent
public void playerWakeUp(PlayerWakeUpEvent event) {
if (!event.shouldSetSpawn()) {
return;
}
EntityPlayer player = event.getEntityPlayer();
BlockPos pos = new BlockPos(player);
World world = event.getEntityPlayer().world;
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if (!(block instanceof BlockBed) || world.isRemote) {
return;
}
BlockPos posFoot = state.getValue(BlockBed.PART) == EPartBed.FOOT ?
pos : pos.offset(state.getValue(BlockBed.FACING).getOpposite());
BlockBed bed = (BlockBed) block;
bed.onWakeup(world, posFoot, (TEBed) world.getTileEntity(posFoot));
if (GeoConfig.gameplay.food) {
player.getCapability(GeoCaps.CAP_PLAYER, null)
.sleep(bed.getHealAmount());
}
}
开发者ID:JayAvery,项目名称:geomastery,代码行数:33,代码来源:PlayerEvents.java
示例4: PlayerWakeUpEvent
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
@SubscribeEvent
public void PlayerWakeUpEvent(PlayerWakeUpEvent e){
if(!e.getEntity().getEntityWorld().isRemote && ConfigurationFile.sleepingHealValue > 0.0f && !e.updateWorld()) {
e.getEntityPlayer().heal(ConfigurationFile.sleepingHealValue);
e.getEntityPlayer().addChatComponentMessage(new TextComponentTranslation("You feel refreshed..."));
}
}
开发者ID:baileyholl,项目名称:Event-Tweaks,代码行数:8,代码来源:SleepingEventHandler.java
示例5: onWakeUp
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWakeUp(PlayerWakeUpEvent evt) {
EntityPlayer p = evt.getEntityPlayer();
final IPlayerExtendedProperties sleep = p.getCapability(ModCyclic.CAPABILITYSTORAGE, null);
if (sleep != null && sleep.isSleeping()) {
sleep.setSleeping(false);
}
}
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:9,代码来源:ItemSleepingMat.java
示例6: onPlayerWakeup
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
public static void onPlayerWakeup(EntityPlayer player, boolean wakeImmediately, boolean updateWorldFlag, boolean setSpawn)
{
MinecraftForge.EVENT_BUS.post(new PlayerWakeUpEvent(player, wakeImmediately, updateWorldFlag, setSpawn));
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:ForgeEventFactory.java
示例7: onPlayerWakeup
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerWakeup(PlayerWakeUpEvent event) {
ProgressionAPI.registry.fireTrigger(event.getEntityPlayer(), getProvider().getUnlocalisedName());
}
开发者ID:joshiejack,项目名称:Progression,代码行数:5,代码来源:TriggerSleep.java
注:本文中的net.minecraftforge.event.entity.player.PlayerWakeUpEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论