DimDoors/StevenDimDoors/mod_pocketDim/PlayerRespawnTracker.java

80 lines
1.5 KiB
Java
Raw Normal View History

package StevenDimDoors.mod_pocketDim;
2013-05-27 14:10:07 +02:00
import net.minecraft.entity.item.EntityItem;
2013-05-27 14:10:07 +02:00
import net.minecraft.entity.player.EntityPlayer;
2013-05-27 14:10:07 +02:00
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))
{
2013-05-27 14:10:07 +02:00
if(drop.getEntityItem().getItem() instanceof ItemArmor)
{
}
player.inventory.addItemStackToInventory(drop.getEntityItem());
}
}
}
}
}
}
}