Fix -builddestroyonly Trace option
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
106a1a8fb0
Commit
69b31483f4
@ -35,6 +35,7 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockExplodeEvent;
|
import org.bukkit.event.block.BlockExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
@ -83,7 +84,7 @@ public class TNTListener implements Listener {
|
|||||||
explode(event.blockList(), event.getBlock().getLocation(), null, null);
|
explode(event.blockList(), event.getBlock().getLocation(), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void onExplode(EntityExplodeEvent event) {
|
public void onExplode(EntityExplodeEvent event) {
|
||||||
explode(event.blockList(), event.getLocation(), EventType.TNTExplodeInBuild, event);
|
explode(event.blockList(), event.getLocation(), EventType.TNTExplodeInBuild, event);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
@ -180,7 +181,7 @@ public class Recorder implements Listener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
if (!(entity instanceof TNTPrimed)) {
|
if (!(entity instanceof TNTPrimed)) {
|
||||||
@ -188,7 +189,9 @@ public class Recorder implements Listener {
|
|||||||
}
|
}
|
||||||
TraceRecorder traceRecorder = get((TNTPrimed) entity);
|
TraceRecorder traceRecorder = get((TNTPrimed) entity);
|
||||||
Region region = tntTraceRecorderMap.get((TNTPrimed) entity);
|
Region region = tntTraceRecorderMap.get((TNTPrimed) entity);
|
||||||
traceRecorder.explode((TNTPrimed) entity, !event.blockList().isEmpty() && region.inRegion(event.getLocation(), RegionType.BUILD, RegionExtensionType.EXTENSION));
|
boolean inBuildRegion = event.blockList().stream().anyMatch(block -> region.inRegion(block.getLocation(), RegionType.BUILD, RegionExtensionType.EXTENSION));
|
||||||
|
System.out.println(event.blockList() + " " + inBuildRegion);
|
||||||
|
traceRecorder.explode((TNTPrimed) entity, inBuildRegion);
|
||||||
tntTraceRecorderMap.remove(entity);
|
tntTraceRecorderMap.remove(entity);
|
||||||
tick();
|
tick();
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren