DimDoors/StevenDimDoors/mod_pocketDim/PlayerRespawnTracker.java
SenseiKiwi b11354767d Overhauled configuration properties
Moved all configuration variables from mod_pocketDim to DDProperties
(formerly DimDoorsConfig). Changed property names to be clearer in
config file, modified some comments, and generally cleaned up the config
file. Fixed some missing properties and variables that were reading from
the wrong properties. Modified the order in which mod_pocketDim
instantiated some of its static fields so that they would load after
properties are read. Almost all classes load after properties are read.
Fixed indentation across various files and replaced references to
properties in mod_pocketDim with references to DDProperties.
2013-06-13 19:01:54 -04:00

80 lines
No EOL
1.5 KiB
Java

package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import cpw.mods.fml.common.IPlayerTracker;
public class PlayerRespawnTracker implements IPlayerTracker
{
public PlayerRespawnTracker()
{
if (properties == null)
properties = DDProperties.instance();
}
private static DDProperties properties = null;
@Override
public void onPlayerLogin(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerLogout(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerChangedDimension(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerRespawn(EntityPlayer player)
{
if(player.worldObj.provider.dimensionId==properties.LimboDimensionID)
{
if(!player.worldObj.isRemote && properties.LimboReturnsInventoryEnabled)
{
if(player.username!=null)
{
if(!mod_pocketDim.limboSpawnInventory.isEmpty()&&mod_pocketDim.limboSpawnInventory.containsKey(player.username))
{
for(EntityItem drop : mod_pocketDim.limboSpawnInventory.get(player.username))
{
if(drop.getEntityItem().getItem() instanceof ItemArmor)
{
}
player.inventory.addItemStackToInventory(drop.getEntityItem());
}
}
}
}
}
}
}