diff --git a/SpigotCore_19/build.gradle b/SpigotCore_19/build.gradle new file mode 100644 index 0000000..c7b9f98 --- /dev/null +++ b/SpigotCore_19/build.gradle @@ -0,0 +1,54 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2021 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +plugins { + id 'base' + id 'java' +} + +group 'steamwar' +version '1.0' + +compileJava.options.encoding = 'UTF-8' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +sourceSets { + main { + java { + srcDirs = ['src/'] + } + resources { + srcDirs = ['src/'] + exclude '**/*.java', '**/*.kt' + } + } +} + +dependencies { + implementation project(":SpigotCore_Main") + implementation project(":SpigotCore_14") + + compileOnly files("${project.rootDir}/lib/WorldEdit-1.15.jar") + + compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT' + compileOnly 'com.mojang:brigadier:1.0.18' + compileOnly files("${project.rootDir}/lib/Spigot-1.19.jar") +} diff --git a/SpigotCore_19/settings.gradle b/SpigotCore_19/settings.gradle new file mode 100644 index 0000000..d0fdb7f --- /dev/null +++ b/SpigotCore_19/settings.gradle @@ -0,0 +1,20 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +rootProject.name = 'SpigotCore_19' \ No newline at end of file diff --git a/SpigotCore_19/src/de/steamwar/core/CraftbukkitWrapper19.java b/SpigotCore_19/src/de/steamwar/core/CraftbukkitWrapper19.java new file mode 100644 index 0000000..99e9479 --- /dev/null +++ b/SpigotCore_19/src/de/steamwar/core/CraftbukkitWrapper19.java @@ -0,0 +1,42 @@ +/* + This file is a part of the SteamWar software. + + Copyright (C) 2021 SteamWar.de-Serverteam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +package de.steamwar.core; + +import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.chunk.Chunk; +import org.bukkit.craftbukkit.v1_19_R1.CraftChunk; +import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer; +import org.bukkit.entity.Player; + +public class CraftbukkitWrapper19 implements CraftbukkitWrapper.ICraftbukkitWrapper { + + @Override + public void sendChunk(Player p, int chunkX, int chunkZ) { + Chunk chunk = ((CraftChunk)p.getWorld().getChunkAt(chunkX, chunkZ)).getHandle(); + ((CraftPlayer)p).getHandle().b.a(new ClientboundLevelChunkWithLightPacket(chunk, chunk.q.l_(), null, null, false)); + } + + @Override + @SuppressWarnings("deprecation") + public double[] getSpigotTPS() { + return MinecraftServer.getServer().recentTps; + } +} diff --git a/SpigotCore_Main/build.gradle b/SpigotCore_Main/build.gradle index bae5536..d421a14 100644 --- a/SpigotCore_Main/build.gradle +++ b/SpigotCore_Main/build.gradle @@ -43,7 +43,7 @@ sourceSets { } dependencies { - compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT' + compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT' compileOnly 'io.netty:netty-all:4.1.68.Final' compileOnly 'com.mojang:authlib:1.5.25' compileOnly 'mysql:mysql-connector-java:5.1.49' diff --git a/build.gradle b/build.gradle index 5610cf2..11b9180 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,8 @@ */ -import org.apache.tools.ant.taskdefs.condition.Os -import java.util.function.BiConsumer +import org.apache.tools.ant.taskdefs.condition.Os plugins { // Adding the base plugin fixes the following gradle warnings in IntelliJ: @@ -94,6 +93,7 @@ dependencies { implementation project(":SpigotCore_14") implementation project(":SpigotCore_15") implementation project(":SpigotCore_18") + implementation project(":SpigotCore_19") implementation project(":CommonCore") } diff --git a/settings.gradle b/settings.gradle index ffc0d4b..7706f16 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,6 +20,7 @@ rootProject.name = 'SpigotCore' include 'SpigotCore_Main' +include 'SpigotCore_19' include 'SpigotCore_18' include 'SpigotCore_15' include 'SpigotCore_14'