Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api/src/main/java/kr/toxicity/model/api/nms/NMSVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public enum NMSVersion {
* Minecraft 26.2.x
* @since 3.2.0
*/
V26_R2(88)
V26_R2(88),
/**
* Minecraft 26.3.x
* @since 3.5.0
*/
V26_R3(97)
;
/**
* The resource pack format version (pack.mcmeta).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
* @param patch minor update
*/
public record MinecraftVersion(int major, int minor, int patch) implements Comparable<MinecraftVersion> {
/**
* 26.3
*/
public static final MinecraftVersion V26_3 = of(26, 3, 0);
/**
* 26.2
*/
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val Project.libs
get() = rootProject.extensions.getByName("libs") as LibrariesForLibs

val LATEST_VERSION = listOf(
"26.2"
"26.3"
)

val SUPPORTED_VERSIONS = buildList {
Expand All @@ -23,7 +23,8 @@ val SUPPORTED_VERSIONS = buildList {
"1.21.11",
"26.1",
"26.1.1",
"26.1.2"
"26.1.2",
"26.2"
))
addAll(LATEST_VERSION)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.bstats.bukkit.Metrics
import org.bukkit.Bukkit
import org.semver4j.Semver

private typealias Latest = kr.toxicity.model.bukkit.nms.v26_R2.NMSImpl
private typealias Latest = kr.toxicity.model.bukkit.nms.v26_R3.NMSImpl

internal class BetterModelProperties(
private val plugin: AbstractBetterModelPlugin
Expand All @@ -42,7 +42,8 @@ internal class BetterModelProperties(

val version = parse(Bukkit.getBukkitVersion().substringBefore('-'))
val nms = when (version) {
V26_2 -> Latest()
V26_3 -> Latest()
V26_2 -> kr.toxicity.model.bukkit.nms.v26_R2.NMSImpl()
V26_1, V26_1_1, V26_1_2 -> kr.toxicity.model.bukkit.nms.v26_R1.NMSImpl()
V1_21_11 -> kr.toxicity.model.bukkit.nms.v1_21_R7.NMSImpl()
V1_21_9, V1_21_10 -> kr.toxicity.model.bukkit.nms.v1_21_R6.NMSImpl()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

project_version=3.5.0
minecraft_version=26.2
minecraft_version=26.3
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ shadow = "9.6.1"
minotaur = "2.10.0"
hangarPublish = "0.1.4"

fabric-api = "0.160.0+26.2"
fabric-api = "0.160.6+26.3"
fabric-language-kotlin = "1.14.1+kotlin.2.4.20"

cloud-bukkit = "2.0.1"
cloud-mod = "2.0.0"
cloud-mod = "2.1.0"
cloud-core = "2.1.0"

configurate = "4.2.0"

neoform = "26.2-2"
neoform = "26.3-1"

[libraries]
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
Expand All @@ -28,14 +28,14 @@ adventure-api = "net.kyori:adventure-api:5.2.0"
adventure-examination = "net.kyori:examination-api:1.3.0"
adventure-option = "net.kyori:option:1.1.0"
adventure-platform-bukkit = "io.github.toxicity188:adventure-platform-bukkit:5.2.0"
adventure-platform-fabric = "net.kyori:adventure-platform-fabric:7.1.1"
adventure-platform-fabric = "net.kyori:adventure-platform-fabric:7.2.0"

asm-tree = "org.ow2.asm:asm-tree:9.10.1"

fabric-loader = "net.fabricmc:fabric-loader:0.19.5"
fabric-language-kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric-language-kotlin" }

polymer-resource-pack = "eu.pb4:polymer-resource-pack:0.17.5+26.2"
polymer-resource-pack = "eu.pb4:polymer-resource-pack:0.18.0+26.3-rc-1"

configurate-core = { module = "org.spongepowered:configurate-core", version.ref = "configurate" }
configurate-yaml = { module = "org.spongepowered:configurate-yaml", version.ref = "configurate" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -375,17 +373,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -383,17 +381,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -384,17 +382,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -384,17 +382,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -384,17 +382,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -383,17 +381,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ internal class HitBoxImpl(
}

override fun getActiveEffects(): Collection<MobEffectInstance> {
return ifLivingEntity { getActiveEffects() } ?: emptyList()
return ifLivingEntity { activeEffects } ?: emptyList()
}

override fun getControllingPassenger(): LivingEntity? {
Expand Down Expand Up @@ -367,17 +367,15 @@ internal class HitBoxImpl(
}

override fun addEffect(effectInstance: MobEffectInstance, entity: Entity?): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity) } == true
}

override fun addEffect(
effectInstance: MobEffectInstance,
entity: Entity?,
cause: EntityPotionEffectEvent.Cause
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause) } == true
}

override fun addEffect(
Expand All @@ -386,17 +384,15 @@ internal class HitBoxImpl(
cause: EntityPotionEffectEvent.Cause,
fireEvent: Boolean
): Boolean {
if (entity === delegate) return false
return ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
return entity !== delegate && ifLivingEntity { addEffect(effectInstance, entity, cause, fireEvent) } == true
}

override fun hurtServer(world: ServerLevel, source: DamageSource, amount: Float): Boolean {
if (source.entity === delegate || delegate.isInvulnerable) return false
if (source.entity === controllingPassenger && !mountController.canBeDamagedByRider()) return false
val ds = ModelDamageSourceImpl(source)
val event = HitBoxDamagedEvent(craftEntity, ds, amount)
if (!listener.handle(event)) return false
return ifLivingEntity { hurtServer(world, source, event.damage) } == true
return listener.handle(event) && ifLivingEntity { hurtServer(world, source, event.damage) } == true
}

override fun deflection(projectile: Projectile): ProjectileDeflection {
Expand Down
Loading