From 905045a1ae32c7ba05d2110a3865e937e8cb8b8a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 12 Jun 2024 19:32:33 +0200 Subject: [PATCH] Update to 1.20 --- build.gradle | 8 ++------ src/de/steamwar/lobby/boatrace/BoatRace.java | 3 +-- src/de/steamwar/lobby/command/PortalCommand.java | 6 +++--- src/de/steamwar/lobby/map/CustomMap.java | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 8ccd593..88bf3c2 100644 --- a/build.gradle +++ b/build.gradle @@ -16,10 +16,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - - -import org.apache.tools.ant.taskdefs.condition.Os - plugins { id 'java' id 'application' @@ -59,9 +55,9 @@ repositories { } dependencies { - compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT' + compileOnly 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT' - compileOnly swdep("Spigot-1.19") + compileOnly swdep("Spigot-1.20") compileOnly swdep("WorldEdit-1.15") compileOnly swdep("SpigotCore") diff --git a/src/de/steamwar/lobby/boatrace/BoatRace.java b/src/de/steamwar/lobby/boatrace/BoatRace.java index 44a442e..18e8db6 100644 --- a/src/de/steamwar/lobby/boatrace/BoatRace.java +++ b/src/de/steamwar/lobby/boatrace/BoatRace.java @@ -23,7 +23,6 @@ import org.bukkit.event.vehicle.VehicleMoveEvent; import org.bukkit.scheduler.BukkitTask; import java.util.EventListener; -import java.util.Random; import static de.steamwar.lobby.util.Leaderboard.renderTime; @@ -134,7 +133,7 @@ public class BoatRace implements EventListener, Listener { public BoatRace(Player player) { this.player = player; boat = Bukkit.getWorlds().get(0).spawn(BoatRacePositions.START, Boat.class); - boat.setBoatType(Boat.Type.values()[new Random().nextInt(Boat.Type.values().length)]); + // boat.setBoatType(Boat.Type.values()[new Random().nextInt(Boat.Type.values().length)]); boat.addPassenger(player); bossBar = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SOLID); task = Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> { diff --git a/src/de/steamwar/lobby/command/PortalCommand.java b/src/de/steamwar/lobby/command/PortalCommand.java index b7773e5..d2264d2 100644 --- a/src/de/steamwar/lobby/command/PortalCommand.java +++ b/src/de/steamwar/lobby/command/PortalCommand.java @@ -16,7 +16,7 @@ import lombok.Data; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -33,7 +33,7 @@ public class PortalCommand extends SWCommand { return !steamwarUser.hasPerm(UserPerm.BUILD); } - @Register(help = true) + @Register public void genericHelp(Player player, String... args) { if (noPermissions(player)) return; LobbySystem.getMessage().sendPrefixless("COMMAND_HELP_HEAD", player, "portal"); @@ -104,7 +104,7 @@ public class PortalCommand extends SWCommand { private Location locationOfPlayer(Player player) { Location l = player.getLocation(); - l.setYaw(((CraftPlayer)player).getHandle().ck()); + l.setYaw(((CraftPlayer)player).getHandle().cm()); return l; } diff --git a/src/de/steamwar/lobby/map/CustomMap.java b/src/de/steamwar/lobby/map/CustomMap.java index 4be78d8..0e9885e 100644 --- a/src/de/steamwar/lobby/map/CustomMap.java +++ b/src/de/steamwar/lobby/map/CustomMap.java @@ -22,7 +22,7 @@ package de.steamwar.lobby.map; import net.minecraft.world.level.saveddata.maps.WorldMap; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_19_R2.map.CraftMapView; +import org.bukkit.craftbukkit.v1_20_R1.map.CraftMapView; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.MapMeta;