当前位置: 首页>>代码示例>>Java>>正文


Java World.getPlayerEntityByUUID方法代码示例

本文整理汇总了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;
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:27,代码来源:GrowthSteps.java

示例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);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:15,代码来源:RemoteShellActivateMessageHandler.java

示例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);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:15,代码来源:RemoteShellReturnMessageHandler.java

示例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);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:11,代码来源:ItemTaglock.java

示例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;
     }
 
开发者ID:TeamMelodium,项目名称:Melodium,代码行数:14,代码来源:MessageCompositionUpdate.java


注:本文中的net.minecraft.world.World.getPlayerEntityByUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。