Prevent minecart mounts from being broken by others
This commit is contained in:
parent
2d5c676e1b
commit
2b3f6c9dbc
@ -10,6 +10,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
@ -173,9 +174,9 @@ public class MountCart extends Mount<Minecart>
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void cancelBreak(EntityDamageEvent event)
|
||||
public void cancelBreak(VehicleDamageEvent event)
|
||||
{
|
||||
if (GetActive().values().contains(event.getEntity()))
|
||||
if (GetActive().values().contains(event.getVehicle()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user