REntity #148
@ -121,19 +121,4 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createLink(String source, String destination) {
|
|
||||||
try {
|
|
||||||
Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/server/Bau15/{0} {1}", new String[]{source, destination});
|
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/server/Bau15/" + source, destination);
|
|
||||||
processBuilder.directory(world.getWorldFolder());
|
|
||||||
processBuilder.inheritIO();
|
|
||||||
|
|
||||||
Process process = processBuilder.start();
|
|
||||||
process.waitFor();
|
|
||||||
} catch (IOException | InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
Bukkit.shutdown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -113,9 +113,11 @@ public class EntityShowMode implements ShowMode<TNTPosition> {
|
|||||||
tntEntityMap.clear();
|
tntEntityMap.clear();
|
||||||
explodeEntityMap.clear();
|
explodeEntityMap.clear();
|
||||||
updateEntityMap.clear();
|
updateEntityMap.clear();
|
||||||
|
if (entityServer != null) {
|
||||||
entityServer.close();
|
entityServer.close();
|
||||||
entityServer = null;
|
entityServer = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void generatePositions(TNTPosition position, boolean interpolateY, boolean interpolateXZ) {
|
private void generatePositions(TNTPosition position, boolean interpolateY, boolean interpolateXZ) {
|
||||||
generatePositions(position, interpolateY, interpolateXZ, (positionType, vector) -> {
|
generatePositions(position, interpolateY, interpolateXZ, (positionType, vector) -> {
|
||||||
|
@ -29,8 +29,8 @@ public class ShowModeParameter {
|
|||||||
private boolean sourceOnly = false;
|
private boolean sourceOnly = false;
|
||||||
private boolean explodeOnly = false;
|
private boolean explodeOnly = false;
|
||||||
private boolean ticks = false;
|
private boolean ticks = false;
|
||||||
private boolean buildDestroyOnly = false;
|
|
||||||
private boolean count = false;
|
private boolean count = false;
|
||||||
|
private boolean buildDestroyOnly = false;
|
||||||
|
|
||||||
public void enableWater() {
|
public void enableWater() {
|
||||||
this.water = true;
|
this.water = true;
|
||||||
@ -56,11 +56,11 @@ public class ShowModeParameter {
|
|||||||
this.ticks = true;
|
this.ticks = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableBuildDestroyOnly() {
|
|
||||||
this.buildDestroyOnly = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void enableCount() {
|
public void enableCount() {
|
||||||
this.count = true;
|
this.count = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void enableBuildDestroyOnly() {
|
||||||
|
this.buildDestroyOnly = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ public class TraceShowManager implements Listener {
|
|||||||
if (regionalShowModes == null) {
|
if (regionalShowModes == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ShowMode<TNTPosition> showMode = regionalShowModes.get(player);
|
ShowMode<TNTPosition> showMode = regionalShowModes.remove(player);
|
||||||
if (showMode == null) {
|
if (showMode == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -160,13 +160,10 @@ public class TraceShowManager implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLeave(PlayerQuitEvent event) {
|
public void onLeave(PlayerQuitEvent event) {
|
||||||
Region region = Region.getRegion(event.getPlayer().getLocation());
|
showModes.forEach((region, playerShowModeMap) -> {
|
||||||
if (!region.isGlobal()) {
|
ShowMode<TNTPosition> showMode = playerShowModeMap.remove(event.getPlayer());
|
||||||
Map<Player, ShowMode<TNTPosition>> regionalShowModes = showModes.get(region);
|
if (showMode != null) showMode.hide();
|
||||||
if (regionalShowModes != null) {
|
});
|
||||||
regionalShowModes.remove(event.getPlayer()).hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StoredRecords.cleanup(event.getPlayer());
|
StoredRecords.cleanup(event.getPlayer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,4 +71,18 @@ public class RayTraceUtils {
|
|||||||
return entityHitDistanceSquared < blockHitDistance * blockHitDistance ? entities : blocks;
|
return entityHitDistanceSquared < blockHitDistance * blockHitDistance ? entities : blocks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isOccluded(Vector a, Vector n, Vector b) {
|
||||||
|
// a = Head pos, n = View direction (normalized), b = entity center
|
||||||
|
// https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Vector_formulation
|
||||||
|
|
||||||
|
double abX = b.getX() - a.getX();
|
||||||
|
double abY = b.getY() - a.getY();
|
||||||
|
double abZ = b.getZ() - a.getZ();
|
||||||
|
double lambda = abX * n.getX() + abY * n.getY() + abZ * n.getZ();
|
||||||
|
double distX = abX - n.getX() * lambda;
|
||||||
|
double distY = abY - n.getY() * lambda;
|
||||||
|
double distZ = abZ - n.getZ() * lambda;
|
||||||
|
return Math.abs(distX) < 0.5 && Math.abs(distY) < 0.5 && Math.abs(distZ) < 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren