From 164586919bacbafdd87b35ed147f40bca063a2bc Mon Sep 17 00:00:00 2001 From: NotCoded <66999075+not-coded@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:06:46 +0100 Subject: [PATCH] his name is shithead, a single cell ornagnism. --- .../java/com/nexia/ffa/uhc/utilities/FfaAreas.java | 9 --------- .../nexia/minigames/games/skywars/SkywarsGame.java | 2 -- .../nexia/minigames/games/skywars/SkywarsMap.java | 12 +++++++++--- src/main/java/com/nexia/world/WorldUtil.java | 10 +++++----- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/nexia/ffa/uhc/utilities/FfaAreas.java b/src/main/java/com/nexia/ffa/uhc/utilities/FfaAreas.java index e861e773..3af4e95b 100644 --- a/src/main/java/com/nexia/ffa/uhc/utilities/FfaAreas.java +++ b/src/main/java/com/nexia/ffa/uhc/utilities/FfaAreas.java @@ -1,29 +1,20 @@ package com.nexia.ffa.uhc.utilities; -import com.combatreforged.factory.api.util.Identifier; import com.nexia.core.utilities.chat.ChatFormat; -import com.nexia.core.utilities.player.PlayerUtil; import com.nexia.core.utilities.pos.BlockVec3; import com.nexia.core.utilities.pos.EntityPos; -import com.nexia.core.utilities.pos.ProtectionBlock; -import com.nexia.core.utilities.pos.ProtectionMap; import com.nexia.core.utilities.time.ServerTime; import com.nexia.ffa.Main; import net.kyori.adventure.text.Component; -import net.minecraft.Util; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Blocks; import net.notcoded.codelib.util.world.structure.Rotation; import net.notcoded.codelib.util.world.structure.StructureMap; -import static com.nexia.minigames.games.bedwars.areas.BwAreas.protectionMap; - public class FfaAreas { public static ServerLevel ffaWorld = null; diff --git a/src/main/java/com/nexia/minigames/games/skywars/SkywarsGame.java b/src/main/java/com/nexia/minigames/games/skywars/SkywarsGame.java index 92255c3c..e6382c9c 100644 --- a/src/main/java/com/nexia/minigames/games/skywars/SkywarsGame.java +++ b/src/main/java/com/nexia/minigames/games/skywars/SkywarsGame.java @@ -241,8 +241,6 @@ public static void startGame() { ArrayList positions = new ArrayList<>(SkywarsGame.map.positions); - ServerTime.factoryServer.runCommand(String.format("execute in skywars:%s run worldborder set 30 60", SkywarsGame.id), 4, false); - for (AccuratePlayer player : SkywarsGame.alive) { EntityPos pos = positions.get(RandomUtil.randomInt(positions.size())); ServerPlayer serverPlayer = player.get(); diff --git a/src/main/java/com/nexia/minigames/games/skywars/SkywarsMap.java b/src/main/java/com/nexia/minigames/games/skywars/SkywarsMap.java index 6024aec7..a6f8c89e 100644 --- a/src/main/java/com/nexia/minigames/games/skywars/SkywarsMap.java +++ b/src/main/java/com/nexia/minigames/games/skywars/SkywarsMap.java @@ -1,6 +1,5 @@ package com.nexia.minigames.games.skywars; -import com.combatreforged.factory.api.util.Identifier; import com.nexia.core.Main; import com.nexia.core.utilities.pos.BlockVec3; import com.nexia.core.utilities.pos.EntityPos; @@ -68,8 +67,8 @@ public class SkywarsMap { ), new StructureMap(new ResourceLocation("skywars", "skyhenge"), Rotation.NO_ROTATION, true, new BlockPos(0, 80, 0), new BlockPos(-77, -7, -77), true)); public static SkywarsMap BELOW = new SkywarsMap("below", 8, new ArrayList<>(Arrays.asList( - new EntityPos(-29.5, 81.0, 69.5), - new EntityPos(29.5,81.0,69.5), + new EntityPos(-28.5, 81.0, 69.5), + new EntityPos(28.5,81.0,69.5), new EntityPos(69.5,81.0,28.5), new EntityPos(69.5,81.0,-28.5), new EntityPos(29.5,81.0,-68.5), @@ -78,6 +77,13 @@ public class SkywarsMap { new EntityPos(-68.5,81.0,29.5)) ), new StructureMap(new ResourceLocation("skywars", "below"), Rotation.NO_ROTATION, true, new BlockPos(0, 80, 0), new BlockPos(-76, -9, -76), true)); + public static SkywarsMap NULL = new SkywarsMap("null", 4, new ArrayList<>(Arrays.asList( + new EntityPos(-24.5, 77.0, 25.5), + new EntityPos(25.5, 77.0, -24.5), + new EntityPos(-24.5, 77.0, 25.5), + new EntityPos(-24.5, 77.0, -24.5)) + ), new StructureMap(new ResourceLocation("skywars", "null"), Rotation.NO_ROTATION, true, new BlockPos(0, 80, 0), new BlockPos(-33, -42, -33), true)); + public static SkywarsMap identifyMap(String name) { for(SkywarsMap map : SkywarsMap.skywarsMaps) { diff --git a/src/main/java/com/nexia/world/WorldUtil.java b/src/main/java/com/nexia/world/WorldUtil.java index 17e36ae3..6d8cd8e4 100644 --- a/src/main/java/com/nexia/world/WorldUtil.java +++ b/src/main/java/com/nexia/world/WorldUtil.java @@ -54,12 +54,12 @@ public static void deleteTempWorlds() { List duelsDelete = new ArrayList<>(); for (ServerLevel level : ServerTime.minecraftServer.getAllLevels()) { - String[] split = level.dimension().toString().replaceAll("]", "").split(":"); - if (split[1].toLowerCase().contains("duels")) { - duelsDelete.add(split[2]); + Identifier split = WorldUtil.getWorldName(WorldUtil.getWorldName(level)); + if (split.getNamespace().toLowerCase().contains("duels")) { + duelsDelete.add(split.getNamespace()); } - if (split[1].toLowerCase().contains("skywars")) { - skywarsDelete.add(split[2]); + if (split.getNamespace().toLowerCase().contains("skywars")) { + skywarsDelete.add(split.getNamespace()); } }