Fixed Minecart Dupe Bug due to Intersection switching.
This commit is contained in:
parent
b649c9cd43
commit
06ab897e43
Binary file not shown.
@ -5771,6 +5771,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
if (ev.getVehicle().isValid()) {
|
if (ev.getVehicle().isValid()) {
|
||||||
ev.getVehicle().remove();
|
ev.getVehicle().remove();
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||||
|
if (ev.getAttacker().getVehicle()==null) {
|
||||||
switch (ev.getVehicle().getType()) {
|
switch (ev.getVehicle().getType()) {
|
||||||
case MINECART:{
|
case MINECART:{
|
||||||
ev.getVehicle().getLocation().getWorld().dropItemNaturally(ev.getVehicle().getLocation().add(0,1,0), new ItemStack(Material.MINECART));
|
ev.getVehicle().getLocation().getWorld().dropItemNaturally(ev.getVehicle().getLocation().add(0,1,0), new ItemStack(Material.MINECART));
|
||||||
@ -5788,6 +5791,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, 1);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5800,7 +5806,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//Drop a minecart at the position.
|
//Drop a minecart at the position.
|
||||||
if (ev.getVehicle().isValid()) {
|
if (ev.getVehicle().isValid()) {
|
||||||
ev.getVehicle().remove();
|
ev.getVehicle().remove();
|
||||||
|
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||||
|
if (ev.getExited().getVehicle()==null) {
|
||||||
ev.getVehicle().getWorld().dropItemNaturally(ev.getExited().getLocation().add(0,1,0), new ItemStack(Material.MINECART));
|
ev.getVehicle().getWorld().dropItemNaturally(ev.getExited().getLocation().add(0,1,0), new ItemStack(Material.MINECART));
|
||||||
|
}},1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user