fixed it yeet

This commit is contained in:
Super_ 2019-12-13 19:58:49 -05:00
parent f0aec56186
commit 97caed9313

View File

@ -10,6 +10,7 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.util.Groups; import me.totalfreedom.totalfreedommod.util.Groups;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;
@ -18,6 +19,7 @@ import org.bukkit.block.ShulkerBox;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.entity.Player;
import org.bukkit.entity.Tameable; import org.bukkit.entity.Tameable;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -238,6 +240,16 @@ public class EventBlocker extends FreedomService
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onPlayerDeath(PlayerDeathEvent event) public void onPlayerDeath(PlayerDeathEvent event)
{ {
for (Player p : Bukkit.getOnlinePlayers())
{
for (Entity passengerEntity : p.getPassengers())
{
if (passengerEntity == event.getEntity())
{
p.removePassenger(passengerEntity);
}
}
}
event.setDeathMessage(event.getDeathMessage()); event.setDeathMessage(event.getDeathMessage());
} }
} }