@Override public int getID( final EntityPlayer player ) { return this.getID( player.getGameProfile() ); }
public static String playerStr(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; }
public static String playerStr(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; }
@SubscribeEvent public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) { String username = event.player.getGameProfile().getName(); playersWithStepup.remove(username + ":false"); playersWithStepup.remove(username + ":true"); }
@SubscribeEvent public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) { String username = event.player.getGameProfile().getName(); playersWithFlight.remove(username + ":false"); playersWithFlight.remove(username + ":true"); }
private void encode( final ItemStack is, final EntityPlayer p ) { final GameProfile username = this.getProfile( is ); if( username != null && username.equals( p.getGameProfile() ) ) { this.setProfile( is, null ); } else { this.setProfile( is, p.getGameProfile() ); } }
@Override public boolean hasPermission( final EntityPlayer player, final SecurityPermissions perm ) { Preconditions.checkNotNull( player ); Preconditions.checkNotNull( perm ); final GameProfile profile = player.getGameProfile(); final int playerID = WorldData.instance().playerData().getPlayerID( profile ); return this.hasPermission( playerID, perm ); }
@Override public void renderSkull(float x, float y, float z, @Nonnull EnumFacing facing, float rotation, int skullType, @Nullable GameProfile profile, int destroyStage, float animateTicks) { Minecraft mc = Minecraft.getMinecraft(); Entity view = mc.getRenderViewEntity(); profile = null; if(view instanceof EntityPlayer) { skullType = 3; profile = ((EntityPlayer) mc.getRenderViewEntity()).getGameProfile(); } else if (view instanceof EntitySkeleton) skullType = 0; else if(view instanceof EntityWitherSkeleton) skullType = 1; else if(view instanceof EntityWither) skullType = 1; else if(view instanceof EntityZombie) skullType = 2; else if(view instanceof EntityCreeper) skullType = 4; else if(view instanceof EntityDragon) skullType = 5; super.renderSkull(x, y, z, facing, rotation, skullType, profile, destroyStage, animateTicks); } }
public void readFromNBT( final NBTTagCompound tag ) { this.data = tag; if( this.node != null && this.data != null ) { this.node.loadFromNBT( this.nbtName, this.data ); this.data = null; } else if( this.node != null && this.owner != null ) { final GameProfile profile = this.owner.getGameProfile(); final int playerID = WorldData.instance().playerData().getPlayerID( profile ); this.node.setPlayerID( playerID ); this.owner = null; } }
double z = event.getEntityLiving().posZ - 0.5; player.getGameProfile().getName(); float r = 1F; float g = 1F;
public void setOwner(@Nonnull EntityPlayer player) { if (!world.isRemote) { this.owner = UserIdent.create(player.getGameProfile()); } }
@Override public boolean authoriseUser(@Nonnull EntityPlayer username, @Nonnull ItemStack[] passwordIn) { if (checkPassword(passwordIn)) { authorisedUsers.add(UserIdent.create(username.getGameProfile())); return true; } return false; }
@Override public void setOwner(@Nonnull EntityPlayer player) { super.setOwner(player); this.travelOwner = UserIdent.create(player.getGameProfile()); }
@Override public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) { ITreeRoot treeRoot = TreeManager.treeRoot; ITree tree = treeRoot.getMember(germling); return tree != null && treeRoot.plantSapling(world, tree, player.getGameProfile(), pos); }
@Override public boolean canBlockBeAccessed(@Nonnull EntityPlayer playerName) { if (accessMode == AccessMode.PUBLIC) { return true; } // Covers protected and private access modes return isOwnerUser(UserIdent.create(playerName.getGameProfile())) || isAuthorisedUser(UserIdent.create(playerName.getGameProfile())) // TODO TeamMode button || FtblIntegration.isInSameTeam(UserIdent.create(playerName.getGameProfile()), getOwner()); }
@Override public boolean canSeeBlock(@Nonnull EntityPlayer playerName) { if (accessMode != AccessMode.PRIVATE) { return true; } UserIdent ident = UserIdent.create(playerName.getGameProfile()); return isOwnerUser(ident) || FtblIntegration.isInSameTeam(ident, getOwner()); }
@Override public boolean apply(@Nullable Channel input) { return input != null && (input.isPublic() || input.getUser().equals(EnderIO.proxy.getClientPlayer().getGameProfile()) || input.getUser() == UserIdent.NOBODY); }
@Override public void addChannel(Channel channel) { if (channel == null) { return; } if (!channel.isPublic() && !channel.getUser().equals(EnderIO.proxy.getClientPlayer().getGameProfile())) { return; } super.addChannel(channel); }
@SubscribeEvent public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { EntityPlayer player = event.player; IMailAddress address = PostManager.postRegistry.getMailAddress(player.getGameProfile()); POBox pobox = PostRegistry.getOrCreatePOBox(player.world, address); PacketPOBoxInfoResponse packet = new PacketPOBoxInfoResponse(pobox.getPOBoxInfo()); NetworkUtil.sendToPlayer(packet, player); } }
@Override public void onContainerClosed(EntityPlayer entityplayer) { if (!entityplayer.world.isRemote) { ILetter letter = inventory.getLetter(); if (!letter.isProcessed()) { IMailAddress sender = PostManager.postRegistry.getMailAddress(entityplayer.getGameProfile()); letter.setSender(sender); } } inventory.onLetterClosed(); super.onContainerClosed(entityplayer); }