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


Java EntityPlayerMP.getGameProfile方法代码示例

本文整理汇总了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;
}
 
开发者ID:abused,项目名称:World-Border,代码行数:17,代码来源:WBCommand.java

示例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;
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:36,代码来源:EntityPlayerMPProxy.java

示例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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:PlayerList.java


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