2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
package StevenDimDoors.mod_pocketDim;
|
|
|
|
|
|
|
|
import net.minecraft.entity.EntityLiving;
|
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.potion.Potion;
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
|
|
|
import cpw.mods.fml.common.IPlayerTracker;
|
|
|
|
|
|
|
|
|
|
|
|
public class PlayerRespawnTracker implements IPlayerTracker
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@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==mod_pocketDim.limboDimID)
|
|
|
|
{
|
|
|
|
|
2013-04-14 03:15:06 +02:00
|
|
|
if(!player.worldObj.isRemote&&mod_pocketDim.returnInventory)
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
|
|
|
|
2013-04-14 03:15:06 +02:00
|
|
|
if(player.username!=null)
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
|
|
|
|
2013-04-14 03:15:06 +02:00
|
|
|
if(!mod_pocketDim.limboSpawnInventory.isEmpty()&&mod_pocketDim.limboSpawnInventory.containsKey(player.username))
|
|
|
|
{
|
|
|
|
for(EntityItem drop : mod_pocketDim.limboSpawnInventory.get(player.username))
|
|
|
|
{
|
|
|
|
|
|
|
|
player.inventory.addItemStackToInventory(drop.getEntityItem());
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
|
2013-04-14 03:15:06 +02:00
|
|
|
}
|
|
|
|
}
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|