Skip to content

Commit

Permalink
v4.1.4.1 b77
Browse files Browse the repository at this point in the history
* fix potential error related to `generic_jump_strength`
  • Loading branch information
stumper66 committed Nov 13, 2024
1 parent 74e8cbd commit 5c50d03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 4.1.4.1 b76
version = 4.1.4.1 b77
description = The Ultimate RPG Mob Levelling Solution
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,12 @@ class LevelManager : LevelInterface2 {
Addition.ATTRIBUTE_MAX_HEALTH -> attribute = Attribute.GENERIC_MAX_HEALTH
Addition.ATTRIBUTE_ATTACK_DAMAGE -> attribute = Attribute.GENERIC_ATTACK_DAMAGE
Addition.ATTRIBUTE_MOVEMENT_SPEED -> attribute = Attribute.GENERIC_MOVEMENT_SPEED
Addition.ATTRIBUTE_HORSE_JUMP_STRENGTH -> attribute = Attribute.GENERIC_JUMP_STRENGTH
Addition.ATTRIBUTE_HORSE_JUMP_STRENGTH -> {
attribute = if (LevelledMobs.instance.ver.useNewHorseJumpAttrib)
Attribute.GENERIC_JUMP_STRENGTH
else
Attribute.valueOf("HORSE_JUMP_STRENGTH")
}
Addition.ATTRIBUTE_ARMOR_BONUS -> attribute = Attribute.GENERIC_ARMOR
Addition.ATTRIBUTE_ARMOR_TOUGHNESS -> attribute = Attribute.GENERIC_ARMOR_TOUGHNESS
Addition.ATTRIBUTE_KNOCKBACK_RESISTANCE -> attribute = Attribute.GENERIC_KNOCKBACK_RESISTANCE
Expand Down Expand Up @@ -2022,7 +2027,7 @@ class LevelManager : LevelInterface2 {

if (lmEntity.livingEntity is Zombie)
attribs.add(Addition.ATTRIBUTE_ZOMBIE_SPAWN_REINFORCEMENTS)
else if (main.ver.useHorseJumpAttrib && lmEntity.livingEntity is Horse)
else if (main.ver.useNewHorseJumpAttrib && lmEntity.livingEntity is Horse)
attribs.add(Addition.ATTRIBUTE_HORSE_JUMP_STRENGTH)

main.levelManager.applyLevelledAttributes(lmEntity, attribs, nbtDatas)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ServerVersionInfo {
private var isOneTwentyFiveOrNewer = false
var useOldEnums = false
private set
var useHorseJumpAttrib = false
var useNewHorseJumpAttrib = false
private set

// preliminary fabric support. not entirely there yet
Expand All @@ -58,7 +58,7 @@ class ServerVersionInfo {
// 1.21.3 changed various enums to interfaces
useOldEnums = minorVersion < 21 || minorVersion == 21 && revision < 3

useHorseJumpAttrib = minorVersion >= 21 || (minorVersion == 20 && revision >= 6)
useNewHorseJumpAttrib = minorVersion >= 21 || (minorVersion == 20 && revision >= 6)
}

private fun parsePaperVersion(){
Expand Down

0 comments on commit 5c50d03

Please sign in to comment.