SteamWar/BauSystem
Archiviert
13
0

Merge branch 'master' into ItemFrame

Dieser Commit ist enthalten in:
YoyoNow 2021-04-03 21:54:50 +02:00
Commit df54247fcc
3 geänderte Dateien mit 14 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -63,7 +63,9 @@ public class CommandTPSLimiter extends SWCommand {
public CommandTPSLimiter() {
super("tpslimit");
if (TPSUtils.isWarpAllowed()) {
tabCompletions.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"));
for (int i = 20; i <= 60; i += 5) {
tabCompletions.add(i + "");
}
}
}
@ -84,7 +86,7 @@ public class CommandTPSLimiter extends SWCommand {
@Register
public void valueCommand(Player p, double tpsLimitDouble) {
if (!permissionCheck(p)) return;
if (tpsLimitDouble < 0.5 || tpsLimitDouble > (TPSUtils.isWarpAllowed() ? 40 : 20)) {
if (tpsLimitDouble < 0.5 || tpsLimitDouble > (TPSUtils.isWarpAllowed() ? 60 : 20)) {
sendInvalidArgumentMessage(p);
return;
}
@ -117,7 +119,7 @@ public class CommandTPSLimiter extends SWCommand {
}
private void sendInvalidArgumentMessage(Player player) {
player.sendMessage(BauSystem.PREFIX + "§cNur Zahlen zwischen 0,5 und " + (TPSUtils.isWarpAllowed() ? 40 : 20) + ", und 'default' erlaubt.");
player.sendMessage(BauSystem.PREFIX + "§cNur Zahlen zwischen 0,5 und " + (TPSUtils.isWarpAllowed() ? 60 : 20) + ", und 'default' erlaubt.");
}
private void tpsLimiter() {
@ -166,7 +168,7 @@ public class CommandTPSLimiter extends SWCommand {
public static void setTPS(double d) {
if (d < 0.5) d = 0.5;
if (d > (TPSUtils.isWarpAllowed() ? 40 : 20)) d = (TPSUtils.isWarpAllowed() ? 40 : 20);
if (d > (TPSUtils.isWarpAllowed() ? 60 : 20)) d = (TPSUtils.isWarpAllowed() ? 60 : 20);
if (instance != null) {
currentTPSLimit = d;
instance.tpsLimiter();

Datei anzeigen

@ -23,6 +23,7 @@ package de.steamwar.bausystem.world;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -63,7 +64,12 @@ public class TNTSimulatorListener implements Listener {
startSimulation(event.getPlayer());
break;
case RIGHT_CLICK_BLOCK:
Vector location = event.getClickedBlock().getLocation().toVector().add(event.getBlockFace().getDirection()).add(HALF);
BlockFace blockFace = event.getBlockFace();
Vector direction = new Vector(blockFace.getModX(), blockFace.getModY(), blockFace.getModZ());
if (blockFace.getModX() != 0 || blockFace.getModY() != 0 || blockFace.getModZ() != 0) {
direction.normalize();
}
Vector location = event.getClickedBlock().getLocation().toVector().add(direction).add(HALF);
TNTSpawn tntSpawn = new TNTSpawn(location);
addTNT(event.getPlayer(), tntSpawn);
editTNT(event.getPlayer(), tntSpawn);

Datei anzeigen

@ -55,7 +55,7 @@ public class TPSUtils {
public static void setTPS(double tps) {
double d = 50 - (50 / (tps / 20.0));
nanoDOffset = Math.max(0, Math.min((long) (d * 1000000), 25000000));
nanoDOffset = Math.max(0, Math.min((long) (d * 1000000), 37500000));
}
public static boolean isWarpAllowed() {