本文整理汇总了Java中net.minecraft.entity.player.EntityPlayerMP.getGameProfile方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayerMP.getGameProfile方法的具体用法?Java EntityPlayerMP.getGameProfile怎么用?Java EntityPlayerMP.getGameProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayerMP
的用法示例。
在下文中一共展示了EntityPlayerMP.getGameProfile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPermission
import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
@Override
public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
if (sender instanceof DedicatedServer)
return true;
EntityPlayerMP player = (EntityPlayerMP) sender;
GameProfile profile = player.getGameProfile();
UserListOpsEntry opEntry = (UserListOpsEntry) WorldBorder.SERVER
.getPlayerList()
.getOppedPlayers()
.getEntry(profile);
// Level 2 (out of 4) have general access to game-changing commands
// TODO: Make this a configuration option
return opEntry != null && opEntry.getPermissionLevel() > 2;
}
示例2: EntityPlayerMPProxy
import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
public EntityPlayerMPProxy(EntityPlayerMP realPlayer, double posX, double posY, double posZ, float pitch, float yaw, int dimension)
{
super(realPlayer.mcServer, (WorldServer) realPlayer.world, realPlayer.getGameProfile(), realPlayer.interactionManager);
// yeah we don't really want to inject into the interactionManager..
realPlayer.interactionManager.player = realPlayer;
InjectionHandler.copyAllFieldsFrom(this, realPlayer, EntityPlayerMP.class);
this.posX = m_fakePosX = posX;
this.posY = m_fakePosY = posY;
this.posZ = m_fakePosZ = posZ;
this.rotationPitch = m_fakePitch = pitch;
this.rotationYaw = m_fakeYaw = yaw;
this.rotationYawHead = yaw;
this.dimension = m_fakeDimension = dimension;
m_realPosX = realPlayer.posX;
m_realPosY = realPlayer.posY;
m_realPosZ = realPlayer.posZ;
m_realPitch = realPlayer.rotationPitch;
m_realYaw = realPlayer.rotationYaw;
m_realYawHead = realPlayer.rotationYawHead;
m_realDimension = realPlayer.dimension;
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "posX", "field_70165_t"));
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "posY", "field_70163_u"));
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "posZ", "field_70161_v"));
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "rotationPitch", "field_70125_A"));
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "rotationYaw", "field_70177_z"));
m_nonsyncingFields.add(ReflectionHelper.findField(EntityLivingBase.class, "rotationYawHead", "field_70759_as"));
m_nonsyncingFields.add(ReflectionHelper.findField(Entity.class, "dimension", "field_71093_bK"));
m_realPlayer = realPlayer;
}
示例3: updatePermissionLevel
import net.minecraft.entity.player.EntityPlayerMP; //导入方法依赖的package包/类
public void updatePermissionLevel(EntityPlayerMP player)
{
GameProfile gameprofile = player.getGameProfile();
int i = this.canSendCommands(gameprofile) ? this.ops.getPermissionLevel(gameprofile) : 0;
i = this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() ? 4 : i;
i = this.commandsAllowedForAll ? 4 : i;
this.sendPlayerPermissionLevel(player, i);
}