本文整理匯總了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);
}