本文整理汇总了Java中net.minecraft.world.World.getPlayerEntityByUUID方法的典型用法代码示例。如果您正苦于以下问题:Java World.getPlayerEntityByUUID方法的具体用法?Java World.getPlayerEntityByUUID怎么用?Java World.getPlayerEntityByUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.getPlayerEntityByUUID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canAdvance
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public boolean canAdvance(World world, BlockPos pos, IBlockState state) {
TileEntity tile = world.getTileEntity(pos);
if (tile != null && tile instanceof TileFeroxia) {
TileFeroxia te = (TileFeroxia)tile;
EntityPlayer player = UCUtils.getPlayerFromUUID(te.getOwner().toString());
if (!world.isRemote && player != null && world.getPlayerEntityByUUID(te.getOwner()) != null) {
NBTTagCompound tag = player.getEntityData();
if (!tag.hasKey("hasSacrificed"))
{
player.addChatMessage(new TextComponentString(TextFormatting.RED + "The savage plant whispers: \"The time is right to perform a self sacrifice.\""));
tag.setBoolean("hasSacrificed", false);
return false;
}
if (tag.hasKey("hasSacrificed") && tag.getBoolean("hasSacrificed"))
{
tag.removeTag("hasSacrificed");
world.setBlockState(pos, ((Feroxia)state.getBlock()).withAge(7), 2);
GrowthSteps.generateSteps(player);
return false;
}
}
}
return false;
}
示例2: handleInGame
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void handleInGame(RemoteShellActivateMessage message, World world) {
TileEntity entity = world.getTileEntity(message.getEntityPos());
if (!(entity instanceof RemoteShellEntity)) {
System.err.println("No bundle builder entity at "+message.getEntityPos().toString());
return;
}
RemoteShellEntity remoteShell = (RemoteShellEntity)entity;
EntityPlayer player = world.getPlayerEntityByUUID(UUID.fromString(message.playerId));
remoteShell.activate(message.activatedMachine, player);
}
示例3: handleInGame
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void handleInGame(RemoteShellReturnMessage message, World world) {
TileEntity entity = world.getTileEntity(message.getEntityPos());
if (entity == null || !(entity instanceof RemoteShellEntity)) {
System.err.println("No remoteShell entity at "+message.getEntityPos().toString());
return;
}
RemoteShellEntity remoteShell = (RemoteShellEntity)entity;
EntityPlayer player = world.getPlayerEntityByUUID(UUID.fromString(message.playerId));
remoteShell.returnToShell(player);
}
示例4: getVictim
import net.minecraft.world.World; //导入方法依赖的package包/类
public Optional<EntityLivingBase> getVictim(ItemStack stack, World world) {
UUID uuid = NBTHelper.getUniqueID(stack, TAGLOCK_ENTITY);
for (Entity entity : world.loadedEntityList) {
if (entity instanceof EntityLivingBase && entity.getUniqueID().equals(uuid)) {
return Optional.of((EntityLivingBase) entity);
}
}
EntityPlayer victim = world.getPlayerEntityByUUID(uuid);
return Optional.ofNullable(victim);
}
示例5: onMessage
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public IMessage onMessage(final MessageCompositionUpdate message, final MessageContext ctx) {
World world = ctx.getServerHandler().playerEntity.world;
EntityPlayer p = world.getPlayerEntityByUUID(message.id);
if (p != null){
ItemStack s = p.getHeldItem(message.mainHand ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND).copy();
if (s.getItem() == RegistryManager.composition_paper){
s.setTagCompound(message.tag);
p.setHeldItem(message.mainHand ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND, s);
}
}
return null;
}