Merge pull request 'bausystem/TLS' (#184) from bausystem/TLS into main

Reviewed-on: SteamWar/SteamWar#184
Reviewed-by: YoyoNow <yoyonow@noreply.localhost>
This commit is contained in:
2025-11-25 16:58:21 +01:00
6 changed files with 32 additions and 32 deletions
@@ -72,6 +72,14 @@ public class TestblockCommand extends SWCommand {
resetRegion(p, node, isExtension ? RegionExtensionType.EXTENSION : RegionExtensionType.NORMAL, isIgnoreAir, isOnlyColor, replaceTNT, replaceWater);
}
@Register(value="default")
public void setTestblockDefault(Player p) {
Region region = regionCheck(p);
if (region == null) return;
region.getRegionData().setTestblockSchematic(null);
resetRegion(p, null, RegionExtensionType.EXTENSION, false, false, false, false);
}
private void resetRegion(Player p, SchematicNode node, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors, boolean removeTNT, boolean removeWater) {
Region region = regionCheck(p);
if (region == null) return;
@@ -92,29 +100,10 @@ public class TestblockCommand extends SWCommand {
}
}
// Beta Tester enabled
switch (BauServer.getInstance().getOwnerID()) {
case 245:
case 403:
case 1898:
case 3320:
case 4603:
case 5262:
case 5399:
case 6032:
case 7862:
case 11077:
case 11888:
case 12258:
case 16009:
if (node == null) {
node = region.getRegionData().getTestblockSchematic();
} else {
region.getRegionData().setTestblockSchematic(node);
}
break;
default:
break;
if (node == null) {
node = region.getRegionData().getTestblockSchematic();
} else {
region.getRegionData().setTestblockSchematic(node);
}
PasteBuilder.ClipboardProvider clipboardProvider;
@@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.features.tntlistener;
package de.steamwar.bausystem.features.tls;
import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
@@ -43,4 +43,13 @@ public class TLSCommand extends SWCommand {
public void stop(@Validator Player player) {
listener.stopListening(player);
}
@Register(description = "TLS_TOGGLE_HELP")
public void toggle(@Validator Player player) {
if (listener.isActiveFor(player)) {
listener.stopListening(player);
} else {
listener.startListening(player);
}
}
}
@@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.features.tntlistener;
package de.steamwar.bausystem.features.tls;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
@@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.features.tntlistener;
package de.steamwar.bausystem.features.tls;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;