mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
1.21.5 nms (#55)
This commit is contained in:
parent
cf022cf36c
commit
7238b37b9e
6 changed files with 87 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.alexcrea"
|
group = "xyz.alexcrea"
|
||||||
version = "1.9.1"
|
version = "1.10.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// EcoEnchants
|
// EcoEnchants
|
||||||
|
|
@ -67,6 +67,7 @@ dependencies {
|
||||||
implementation(project(":nms:v1_21R1", configuration = "reobf"))
|
implementation(project(":nms:v1_21R1", configuration = "reobf"))
|
||||||
implementation(project(":nms:v1_21R2", configuration = "reobf"))
|
implementation(project(":nms:v1_21R2", configuration = "reobf"))
|
||||||
implementation(project(":nms:v1_21R3", configuration = "reobf"))
|
implementation(project(":nms:v1_21R3", configuration = "reobf"))
|
||||||
|
implementation(project(":nms:v1_21R4"))//, configuration = "reobf")) // TODO add again when paperweigh 1.21.5 update
|
||||||
|
|
||||||
// include kotlin for the offline jar
|
// include kotlin for the offline jar
|
||||||
implementation(kotlin("stdlib"))
|
implementation(kotlin("stdlib"))
|
||||||
|
|
|
||||||
1
nms/v1_21R4/.gitignore
vendored
Normal file
1
nms/v1_21R4/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
.lastDeploymentsId
|
||||||
47
nms/v1_21R4/build.gradle.kts
Normal file
47
nms/v1_21R4/build.gradle.kts
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
|
group = rootProject.group
|
||||||
|
version = rootProject.version
|
||||||
|
|
||||||
|
//TODO uncomment when paperDevBundle 1.21.4 release
|
||||||
|
/*plugins {
|
||||||
|
id("io.papermc.paperweight.userdev")
|
||||||
|
}*/
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(project(":nms:nms-common"))
|
||||||
|
|
||||||
|
// Used for nms
|
||||||
|
compileOnly("org.spigotmc:spigot-api:1.20.5-R0.1-SNAPSHOT") //TODO remove when paperDevBundle 1.21.5 release
|
||||||
|
compileOnly("org.spigotmc:spigot:1.21.5-R0.1-SNAPSHOT") //TODO remove when paperDevBundle 1.21.5 release
|
||||||
|
//paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT") //TODO uncomment when paperDevBundle 1.21.5 release
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
|
|
||||||
|
mavenLocal()//TODO remove when paperDevBundle 1.21.5 release
|
||||||
|
}
|
||||||
|
|
||||||
|
// minecraft 1.21 java version is 21.
|
||||||
|
|
||||||
|
// Configure used version of kotlin and java
|
||||||
|
java {
|
||||||
|
disableAutoTargetJvm()
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set target version
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
sourceCompatibility = "21"
|
||||||
|
targetCompatibility = "21"
|
||||||
|
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
compilerOptions {
|
||||||
|
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
|
||||||
|
jvmTarget.set(JvmTarget.JVM_21)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package xyz.alexcrea.cuanvil.dependency.packet.versions
|
||||||
|
|
||||||
|
import net.minecraft.network.protocol.game.PacketPlayOutAbilities
|
||||||
|
import net.minecraft.world.entity.player.PlayerAbilities
|
||||||
|
import org.bukkit.craftbukkit.v1_21_R4.entity.CraftPlayer
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import xyz.alexcrea.cuanvil.dependency.packet.PacketManager
|
||||||
|
import xyz.alexcrea.cuanvil.dependency.packet.PacketManagerBase
|
||||||
|
|
||||||
|
class V1_21R4_PacketManager : PacketManagerBase(), PacketManager {
|
||||||
|
override val canSetInstantBuild: Boolean
|
||||||
|
get() = true
|
||||||
|
|
||||||
|
override fun setInstantBuild(player: Player, instantBuild: Boolean) {
|
||||||
|
val nmsPlayer = (player as CraftPlayer).handle
|
||||||
|
val playerAbilities: PlayerAbilities = nmsPlayer.gk()
|
||||||
|
val sendedAbilities: PlayerAbilities
|
||||||
|
|
||||||
|
if (playerAbilities.d == instantBuild) {
|
||||||
|
sendedAbilities = playerAbilities
|
||||||
|
} else {
|
||||||
|
sendedAbilities = PlayerAbilities()
|
||||||
|
sendedAbilities.a = playerAbilities.a
|
||||||
|
sendedAbilities.b = playerAbilities.b
|
||||||
|
sendedAbilities.c = playerAbilities.c
|
||||||
|
sendedAbilities.d = instantBuild
|
||||||
|
sendedAbilities.e = playerAbilities.e
|
||||||
|
sendedAbilities.m = playerAbilities.m
|
||||||
|
sendedAbilities.n = playerAbilities.n
|
||||||
|
}
|
||||||
|
val packet = PacketPlayOutAbilities(sendedAbilities)
|
||||||
|
nmsPlayer.f.sendPacket(packet)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -29,6 +29,8 @@ include("nms:v1_21R2")
|
||||||
findProject(":nms:v1_21R2")?.name = "v1_21R2"
|
findProject(":nms:v1_21R2")?.name = "v1_21R2"
|
||||||
include("nms:v1_21R3")
|
include("nms:v1_21R3")
|
||||||
findProject(":nms:v1_21R3")?.name = "v1_21R3"
|
findProject(":nms:v1_21R3")?.name = "v1_21R3"
|
||||||
|
include("nms:v1_21R4")
|
||||||
|
findProject(":nms:v1_21R4")?.name = "v1_21R4"
|
||||||
|
|
||||||
include(":impl:LegacyEcoEnchant")
|
include(":impl:LegacyEcoEnchant")
|
||||||
findProject(":impl:LegacyEcoEnchant")?.name = "LegacyEcoEnchant"
|
findProject(":impl:LegacyEcoEnchant")?.name = "LegacyEcoEnchant"
|
||||||
|
|
@ -57,6 +57,7 @@ object PacketManagerSelector {
|
||||||
0, 1 -> V1_21R1_PacketManager()
|
0, 1 -> V1_21R1_PacketManager()
|
||||||
2, 3 -> V1_21R2_PacketManager()
|
2, 3 -> V1_21R2_PacketManager()
|
||||||
4 -> V1_21R3_PacketManager()
|
4 -> V1_21R3_PacketManager()
|
||||||
|
5 -> V1_21R4_PacketManager()
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue