Search in sources :

Example 6 with PlayerExtendedProperties

use of mcjty.rftools.playerprops.PlayerExtendedProperties in project RFTools by McJty.

the class DialingDeviceTileEntity method changeFavorite.

// Server side only.
private void changeFavorite(String playerName, Coordinate receiver, int dimension, boolean favorite) {
    List list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
    for (Object p : list) {
        EntityPlayerMP entityplayermp = (EntityPlayerMP) p;
        if (playerName.equals(entityplayermp.getDisplayName())) {
            PlayerExtendedProperties properties = PlayerExtendedProperties.getProperties(entityplayermp);
            properties.getFavoriteDestinationsProperties().setDestinationFavorite(new GlobalCoordinate(receiver, dimension), favorite);
            return;
        }
    }
}
Also used : PlayerExtendedProperties(mcjty.rftools.playerprops.PlayerExtendedProperties) ArrayList(java.util.ArrayList) List(java.util.List) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) GlobalCoordinate(mcjty.lib.varia.GlobalCoordinate)

Aggregations

PlayerExtendedProperties (mcjty.rftools.playerprops.PlayerExtendedProperties)6 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)3 GlobalCoordinate (mcjty.lib.varia.GlobalCoordinate)3 PlayerPreferencesProperties (mcjty.lib.preferences.PlayerPreferencesProperties)2 Coordinate (mcjty.lib.varia.Coordinate)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 IExtendedEntityProperties (net.minecraftforge.common.IExtendedEntityProperties)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DimensionInformation (mcjty.rftools.dimension.DimensionInformation)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 TileEntity (net.minecraft.tileentity.TileEntity)1 World (net.minecraft.world.World)1