diff --git a/changelog.md b/changelog.md index 609ae35aa..1edbc12e7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ -- fixed crash when using Undead Battle Standard on server -- fixed bug with thunder not working properly during Undead Army -- fixed bug with Soul Jar damage bonus being calculated incorrectly \ No newline at end of file +- changed required Majrusz Library from 7.0.0+ to 7.0.1+ +- fixed game crash `java.lang.ClassNotFoundException` (reported by @NanoAi) +- fixed Soul Jar color issue caused by incompatibility with Sodium (reported by @LonelyFear) +- fixed bug with being unable to disable natural Undead Army spawns (reported by @NeuTraLZero) +- fixed bug with Undead Army not changing weather properly \ No newline at end of file diff --git a/common/libs/majrusz-library-common-1.20.1-7.0.0.jar b/common/libs/majrusz-library-common-1.20.1-7.0.1.jar similarity index 90% rename from common/libs/majrusz-library-common-1.20.1-7.0.0.jar rename to common/libs/majrusz-library-common-1.20.1-7.0.1.jar index c07da3f03..70ce9e776 100644 Binary files a/common/libs/majrusz-library-common-1.20.1-7.0.0.jar and b/common/libs/majrusz-library-common-1.20.1-7.0.1.jar differ diff --git a/common/src/main/java/com/majruszsdifficulty/items/SoulJar.java b/common/src/main/java/com/majruszsdifficulty/items/SoulJar.java index e728adc29..094b34293 100644 --- a/common/src/main/java/com/majruszsdifficulty/items/SoulJar.java +++ b/common/src/main/java/com/majruszsdifficulty/items/SoulJar.java @@ -247,9 +247,8 @@ private static int toMask( List< BonusType > bonuses ) { @OnlyIn( Dist.CLIENT ) public static class Client { static { - OnItemRenderColorGet.listen( Client::changeSoulColor ) - .addCondition( data->data.itemStack.getItem() instanceof SoulJar ) - .addCondition( data->data.layerIdx > 0 ); + OnItemRenderColorsGet.listen( Client::changeSoulColor ) + .addCondition( data->data.itemStack.getItem() instanceof SoulJar ); OnItemAttributeTooltip.listen( Client::addTooltip ) .addCondition( data->SoulJar.canHaveSouls( data.itemStack ) ); @@ -258,11 +257,11 @@ public static class Client { .addCondition( data->SoulJar.canHaveSouls( data.itemStack ) ); } - private static void changeSoulColor( OnItemRenderColorGet data ) { - data.color = BonusInfo.read( data.itemStack ) - .getBonus( data.layerIdx - 1 ) - .map( BonusType::getColor ) - .orElseGet( ()->0xeeeeee - data.layerIdx * 0x111111 ); + private static void changeSoulColor( OnItemRenderColorsGet data ) { + BonusInfo bonusInfo = BonusInfo.read( data.itemStack ); + for( int idx = 0; idx < 3; ++idx ) { + data.add( idx + 1, bonusInfo.getBonus( idx ).map( BonusType::getColor ).orElse( 0xeeeeee - idx * 0x111111 ) ); + } } private static void addTooltip( OnItemAttributeTooltip data ) { diff --git a/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyConfig.java b/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyConfig.java index f2ac29612..f5f34f413 100644 --- a/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyConfig.java +++ b/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyConfig.java @@ -113,7 +113,7 @@ public class UndeadArmyConfig { .define( "highlight_delay", Reader.number(), ()->HIGHLIGHT_DELAY, v->HIGHLIGHT_DELAY = Range.of( 30.0f, 3600.0f ).clamp( v ) ) .define( "extra_size_ratio_per_player", Reader.number(), ()->EXTRA_PLAYER_RATIO, v->EXTRA_PLAYER_RATIO = Range.of( 0.0f, 1.0f ).clamp( v ) ) .define( "area_radius", Reader.integer(), ()->AREA_RADIUS, v->AREA_RADIUS = Range.of( 35, 140 ).clamp( v ) ) - .define( "kill_requirement", Reader.integer(), ()->KILL_REQUIREMENT, v->KILL_REQUIREMENT = Range.of( 1, 1000 ).clamp( v ) ) + .define( "kill_requirement", Reader.integer(), ()->KILL_REQUIREMENT, v->KILL_REQUIREMENT = Range.of( 0, 1000 ).clamp( v ) ) .define( "kill_requirement_first", Reader.integer(), ()->KILL_REQUIREMENT_FIRST, v->KILL_REQUIREMENT_FIRST = Range.of( 1, 1000 ).clamp( v ) ) .define( "kill_requirement_warning", Reader.integer(), ()->KILL_REQUIREMENT_WARNING, v->KILL_REQUIREMENT_WARNING = Range.of( 1, 1000 ).clamp( v ) ) .define( "waves", Reader.list( Reader.custom( WaveDef::new ) ), ()->WAVE_DEFS, v->WAVE_DEFS = v ); diff --git a/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyHelper.java b/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyHelper.java index 1e8deadcf..fa541401f 100644 --- a/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyHelper.java +++ b/common/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmyHelper.java @@ -18,6 +18,7 @@ import net.minecraft.world.level.GameRules; import net.minecraft.world.level.Level; import net.minecraft.world.level.levelgen.Heightmap; +import net.minecraft.world.level.storage.ServerLevelData; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -90,6 +91,9 @@ private static void tick( OnServerTicked data ) { boolean hasAnyArmyFinished = UNDEAD_ARMIES.removeIf( UndeadArmy::hasFinished ); if( hasAnyArmyFinished && UNDEAD_ARMIES.isEmpty() ) { LevelHelper.setClearWeather( UndeadArmyHelper.getLevel(), TimeHelper.toTicks( 0.5 ) ); + if( UndeadArmyHelper.getLevel().getLevelData() instanceof ServerLevelData levelData ) { + levelData.setClearWeatherTime( TimeHelper.toTicks( 60.0 * 30.0 ) ); + } } } diff --git a/common/src/main/java/com/majruszsdifficulty/undeadarmy/listeners/WeatherController.java b/common/src/main/java/com/majruszsdifficulty/undeadarmy/listeners/WeatherController.java index e786d2b64..759d73f37 100644 --- a/common/src/main/java/com/majruszsdifficulty/undeadarmy/listeners/WeatherController.java +++ b/common/src/main/java/com/majruszsdifficulty/undeadarmy/listeners/WeatherController.java @@ -5,6 +5,7 @@ import com.majruszsdifficulty.undeadarmy.events.OnUndeadArmyStarted; import com.majruszsdifficulty.undeadarmy.events.OnUndeadArmyTicked; import net.minecraft.world.entity.PathfinderMob; +import net.minecraft.world.level.storage.ServerLevelData; public class WeatherController { static { @@ -15,6 +16,9 @@ public class WeatherController { private static void startRaining( OnUndeadArmyStarted data ) { LevelHelper.startRaining( data.getLevel(), TimeHelper.toTicks( 60.0 * 30.0 ), true ); + if( data.getLevel().getLevelData() instanceof ServerLevelData levelData ) { + levelData.setClearWeatherTime( 20 ); + } } private static void freezeWater( OnUndeadArmyTicked data ) { diff --git a/fabric/libs/majrusz-library-fabric-1.20.1-7.0.0.jar b/fabric/libs/majrusz-library-fabric-1.20.1-7.0.1.jar similarity index 86% rename from fabric/libs/majrusz-library-fabric-1.20.1-7.0.0.jar rename to fabric/libs/majrusz-library-fabric-1.20.1-7.0.1.jar index a9794f350..f218c05b0 100644 Binary files a/fabric/libs/majrusz-library-fabric-1.20.1-7.0.0.jar and b/fabric/libs/majrusz-library-fabric-1.20.1-7.0.1.jar differ diff --git a/forge/libs/majrusz-library-forge-1.20.1-7.0.0.jar b/forge/libs/majrusz-library-forge-1.20.1-7.0.1.jar similarity index 81% rename from forge/libs/majrusz-library-forge-1.20.1-7.0.0.jar rename to forge/libs/majrusz-library-forge-1.20.1-7.0.1.jar index 91648d7c1..f5302b8c0 100644 Binary files a/forge/libs/majrusz-library-forge-1.20.1-7.0.0.jar and b/forge/libs/majrusz-library-forge-1.20.1-7.0.1.jar differ diff --git a/gradle.properties b/gradle.properties index b9a28347c..6bf3b6b8d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version=1.20.1 # Mod mod_id=majruszsdifficulty mod_archives_name=majruszs-difficulty -mod_version=1.9.1 +mod_version=1.9.2 mod_display_name=Majrusz's Progressive Difficulty mod_description=Mod that progressively increases the game difficulty over time. mod_authors=Majrusz @@ -24,23 +24,23 @@ forge_version=1.20.1-47.1.0 forge_version_loader=[47,) forge_version_range=[47.1,) forge_minecraft_version_range=[1.20.1,) -forge_majruszlibrary_version_range=[7.0.0,8.0.0) +forge_majruszlibrary_version_range=[7.0.1,8.0.0) # NeoForge neoforge_version=1.20.1-47.1.76 neoforge_version_loader=[47,) neoforge_version_range=1.20.1-47.1.76 neoforge_minecraft_version_range=[1.20.1,) -neoforge_majruszlibrary_version_range=[7.0.0,8.0.0) +neoforge_majruszlibrary_version_range=[7.0.1,8.0.0) # Fabric fabric_loader_version=0.14.22 fabric_api_version=0.89.0+1.20.1 fabric_minecraft_version_range=>=1.20.1 -fabric_majruszlibrary_version_range=>=7.0.0 +fabric_majruszlibrary_version_range=>=7.0.1 # Majrusz Library -majruszlibrary_version=1.20.1-7.0.0 +majruszlibrary_version=1.20.1-7.0.1 # Publishing modrinth_project_id=GGDBwjOg diff --git a/neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.0.jar b/neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.1.jar similarity index 81% rename from neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.0.jar rename to neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.1.jar index c75da0bd4..6e1d093ab 100644 Binary files a/neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.0.jar and b/neoforge/libs/majrusz-library-neoforge-1.20.1-7.0.1.jar differ diff --git a/neoforge/src/main/java/com/majruszsdifficulty/loot/LootNeoForge.java b/neoforge/src/main/java/com/majruszsdifficulty/loot/LootNeoForge.java index 8fb8078a6..31cd98062 100644 --- a/neoforge/src/main/java/com/majruszsdifficulty/loot/LootNeoForge.java +++ b/neoforge/src/main/java/com/majruszsdifficulty/loot/LootNeoForge.java @@ -1,6 +1,6 @@ package com.majruszsdifficulty.loot; -import com.majruszsdifficulty.mixin.forge.IMixinLootTable; +import com.majruszsdifficulty.mixin.neoforge.IMixinLootTable; import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable; diff --git a/neoforge/src/main/java/com/majruszsdifficulty/mixin/forge/IMixinLootTable.java b/neoforge/src/main/java/com/majruszsdifficulty/mixin/neoforge/IMixinLootTable.java similarity index 88% rename from neoforge/src/main/java/com/majruszsdifficulty/mixin/forge/IMixinLootTable.java rename to neoforge/src/main/java/com/majruszsdifficulty/mixin/neoforge/IMixinLootTable.java index 26ff5d0d5..0d253dca4 100644 --- a/neoforge/src/main/java/com/majruszsdifficulty/mixin/forge/IMixinLootTable.java +++ b/neoforge/src/main/java/com/majruszsdifficulty/mixin/neoforge/IMixinLootTable.java @@ -1,4 +1,4 @@ -package com.majruszsdifficulty.mixin.forge; +package com.majruszsdifficulty.mixin.neoforge; import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable;