Skip to content

Commit

Permalink
Merged 1.9.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Majrusz authored Dec 4, 2023
2 parents e578767 + 640f6fb commit 07a4d00
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 19 deletions.
8 changes: 5 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
- 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
Binary file not shown.
15 changes: 7 additions & 8 deletions common/src/main/java/com/majruszsdifficulty/items/SoulJar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand All @@ -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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ) );
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 ) {
Expand Down
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 07a4d00

Please sign in to comment.