From c487cfa23280ba09974f3be63619b71fa3f39a80 Mon Sep 17 00:00:00 2001 From: ef3d0c3e Date: Sun, 11 Aug 2024 13:50:17 +0200 Subject: [PATCH] Map resources --- core/pom.xml | 12 ++ .../java/org/ef3d0c3e/sheepwars/Util.java | 13 ++ .../sheepwars/commands/CmdSheepWars.java | 22 +++- .../org/ef3d0c3e/sheepwars/game/Game.java | 23 +++- .../java/org/ef3d0c3e/sheepwars/kits/Kit.java | 30 +++++ .../org/ef3d0c3e/sheepwars/kits/KitData.java | 7 + .../sheepwars/level/game/GameLevel.java | 44 +++++++ .../sheepwars/level/lobby/LobbyEvents.java | 7 +- .../java/org/ef3d0c3e/sheepwars/maps/Map.java | 124 ++++++++++++++++++ .../ef3d0c3e/sheepwars/maps/MapManager.java | 94 +++++++++++++ .../org/ef3d0c3e/sheepwars/maps/VoteItem.java | 4 + .../org/ef3d0c3e/sheepwars/maps/VoteMenu.java | 4 + .../org/ef3d0c3e/sheepwars/maps/VoteNPC.java | 4 + .../org/ef3d0c3e/sheepwars/npc/PlayerNPC.java | 15 +++ .../ef3d0c3e/sheepwars/player/CPlayer.java | 14 ++ .../sheepwars/player/CosmeticManager.java | 27 +++- .../org/ef3d0c3e/sheepwars/teams/Team.java | 14 +- .../ef3d0c3e/sheepwars/teams/TeamItem.java | 60 +++++++++ .../org/ef3d0c3e/sheepwars/teams/TeamNPC.java | 12 +- .../main/resources/exports/maps/blimp.schem | Bin 0 -> 8773 bytes .../src/main/resources/exports/maps/blimp.yml | 24 ++++ .../main/resources/exports/maps/flying.schem | Bin 0 -> 12211 bytes .../main/resources/exports/maps/flying.yml | 28 ++++ .../main/resources/exports/maps/oilrig.schem | Bin 0 -> 20453 bytes .../main/resources/exports/maps/oilrig.yml | 26 ++++ 25 files changed, 592 insertions(+), 16 deletions(-) create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/kits/Kit.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/kits/KitData.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/level/game/GameLevel.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/maps/Map.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/maps/MapManager.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/maps/VoteItem.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/maps/VoteMenu.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/maps/VoteNPC.java create mode 100644 core/src/main/java/org/ef3d0c3e/sheepwars/teams/TeamItem.java create mode 100644 core/src/main/resources/exports/maps/blimp.schem create mode 100644 core/src/main/resources/exports/maps/blimp.yml create mode 100644 core/src/main/resources/exports/maps/flying.schem create mode 100644 core/src/main/resources/exports/maps/flying.yml create mode 100644 core/src/main/resources/exports/maps/oilrig.schem create mode 100644 core/src/main/resources/exports/maps/oilrig.yml diff --git a/core/pom.xml b/core/pom.xml index b2d281c..4d65338 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -83,5 +83,17 @@ 33.1.0-jre compile + + org.bukkit + bukkit + 1.21.1-R0.1-SNAPSHOT + compile + + + org.bukkit + bukkit + 1.21.1-R0.1-SNAPSHOT + compile + diff --git a/core/src/main/java/org/ef3d0c3e/sheepwars/Util.java b/core/src/main/java/org/ef3d0c3e/sheepwars/Util.java index 687aad2..f5bca62 100644 --- a/core/src/main/java/org/ef3d0c3e/sheepwars/Util.java +++ b/core/src/main/java/org/ef3d0c3e/sheepwars/Util.java @@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.profile.PlayerProfile; import org.bukkit.profile.PlayerTextures; +import org.bukkit.util.Vector; import javax.annotation.Nullable; import java.net.MalformedURLException; @@ -71,4 +72,16 @@ public class Util { return skull; } + + /** + * Parses string to vector + * @param text Text in the form ".5 7.5 -10" + * @return Vector + */ + public static Vector parseVector(final String text) + { + String[] split = text.split(" ", 3); + + return new Vector(Double.valueOf(split[0]), Double.valueOf(split[1]), Double.valueOf(split[2])); + } } diff --git a/core/src/main/java/org/ef3d0c3e/sheepwars/commands/CmdSheepWars.java b/core/src/main/java/org/ef3d0c3e/sheepwars/commands/CmdSheepWars.java index 5c53755..e82c58e 100644 --- a/core/src/main/java/org/ef3d0c3e/sheepwars/commands/CmdSheepWars.java +++ b/core/src/main/java/org/ef3d0c3e/sheepwars/commands/CmdSheepWars.java @@ -1,10 +1,16 @@ package org.ef3d0c3e.sheepwars.commands; import com.google.common.collect.Lists; +import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; +import org.ef3d0c3e.sheepwars.SheepWars; +import org.ef3d0c3e.sheepwars.maps.Map; +import org.ef3d0c3e.sheepwars.maps.MapManager; import org.jetbrains.annotations.NotNull; +import org.ef3d0c3e.sheepwars.game.Game; import javax.annotation.Nullable; import java.util.Arrays; @@ -33,6 +39,20 @@ public class CmdSheepWars extends Command { sender.sendMessage(" - §astart §fStarts the game"); sender.sendMessage(" - §adebug §7