From 6f03b0820d392e66c4d23e5f4a716dc791e39532 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Wed, 20 Dec 2023 16:07:23 +0100 Subject: [PATCH 1/5] Updated version name --- changelog.md | 6 ------ gradle.properties | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 94becadcb..e69de29bb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +0,0 @@ -- changed required Majrusz Library version from 7.0.1+ to 7.0.2+ -- readded missing Bleeding advancements -- updated Chinese translation (thanks to @UDTakerBean) -- fixed bug with blood particles not being visible on server -- fixed bug with some expert mode and master mode mechanics working on earlier game stages -- fixed bug with Cursed Armor spawns not working properly \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8f86a8c8b..fc55f1366 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.3 +mod_version=1.9.4-unfinished mod_display_name=Majrusz's Progressive Difficulty mod_description=Mod that progressively increases the game difficulty over time. mod_authors=Majrusz From 4eedf2f85c074169cdc6ec740ecb7e9b200a23e8 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Wed, 20 Dec 2023 16:10:53 +0100 Subject: [PATCH 2/5] Fixed game crash when breaking chest with Cursed Armor inside (reported by @Jabkkm) --- changelog.md | 1 + .../java/com/majruszsdifficulty/entity/CursedArmor.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e69de29bb..e690f795e 100644 --- a/changelog.md +++ b/changelog.md @@ -0,0 +1 @@ +- fixed game crash when breaking chest with Cursed Armor inside (reported by @Jabkkm) \ No newline at end of file diff --git a/common/src/main/java/com/majruszsdifficulty/entity/CursedArmor.java b/common/src/main/java/com/majruszsdifficulty/entity/CursedArmor.java index 4677848a8..0639479bb 100644 --- a/common/src/main/java/com/majruszsdifficulty/entity/CursedArmor.java +++ b/common/src/main/java/com/majruszsdifficulty/entity/CursedArmor.java @@ -26,6 +26,7 @@ import com.majruszsdifficulty.MajruszsDifficulty; import com.majruszsdifficulty.bloodmoon.BloodMoonHelper; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.resources.ResourceLocation; @@ -254,7 +255,10 @@ private static void spawnCursedArmor( OnLootGenerated data ) { CursedArmor cursedArmor = EntityHelper.createSpawner( MajruszsDifficulty.CURSED_ARMOR_ENTITY, data.getLevel() ) .position( CursedArmor.getSpawnPosition( data ) ) .beforeEvent( entity->{ - float yRot = BlockHelper.getState( data.getLevel(), data.origin ).getValue( ChestBlock.FACING ).toYRot(); + float yRot = BlockHelper.getState( data.getLevel(), data.origin ) + .getOptionalValue( ChestBlock.FACING ) + .map( Direction::toYRot ) + .orElse( Random.nextInt( 0, 4 ) * 90.0f ); entity.setYRot( yRot ); entity.setYHeadRot( yRot ); entity.setYBodyRot( yRot ); From 8716529d155323a6993163632c190ad9be04eba1 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Wed, 20 Dec 2023 16:31:55 +0100 Subject: [PATCH 3/5] Fixed bug with game stages not reloading properly in the configuration file (reported by @Sully) --- changelog.md | 1 + .../java/com/majruszsdifficulty/gamestage/GameStage.java | 8 ++++++++ .../com/majruszsdifficulty/gamestage/GameStageConfig.java | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e690f795e..2e97bf5b8 100644 --- a/changelog.md +++ b/changelog.md @@ -1 +1,2 @@ +- fixed bug with game stages not reloading properly in the configuration file (reported by @Sully) - fixed game crash when breaking chest with Cursed Armor inside (reported by @Jabkkm) \ No newline at end of file diff --git a/common/src/main/java/com/majruszsdifficulty/gamestage/GameStage.java b/common/src/main/java/com/majruszsdifficulty/gamestage/GameStage.java index e67bb2ac5..a5a41d35d 100644 --- a/common/src/main/java/com/majruszsdifficulty/gamestage/GameStage.java +++ b/common/src/main/java/com/majruszsdifficulty/gamestage/GameStage.java @@ -77,6 +77,14 @@ public List< MutableComponent > getMessages() { .toList(); } + GameStage copy( GameStage gameStage ) { + this.format = gameStage.format; + this.trigger = gameStage.trigger; + this.messages = gameStage.messages; + + return this; + } + public static class Builder { private final GameStage gameStage; diff --git a/common/src/main/java/com/majruszsdifficulty/gamestage/GameStageConfig.java b/common/src/main/java/com/majruszsdifficulty/gamestage/GameStageConfig.java index 2708fee79..800a3f016 100644 --- a/common/src/main/java/com/majruszsdifficulty/gamestage/GameStageConfig.java +++ b/common/src/main/java/com/majruszsdifficulty/gamestage/GameStageConfig.java @@ -58,7 +58,7 @@ private static List< GameStage > keepOldReferencesValid( List< GameStage > newGa GameStage newGameStage = newGameStages.get( idx ); for( GameStage oldGameStage : oldGameStages ) { if( oldGameStage.is( newGameStage.getId() ) ) { - newGameStage = oldGameStage; // to keep references valid + newGameStage = oldGameStage.copy( newGameStage ); break; } } From d45dd485e7d63c49ac5a981c6cc1e7b41b9d22df Mon Sep 17 00:00:00 2001 From: Majrusz Date: Wed, 20 Dec 2023 16:39:19 +0100 Subject: [PATCH 4/5] Fixed game crash caused by compatibility issues with Loot Beams mod (reported by @davey) --- changelog.md | 1 + .../majruszsdifficulty/effects/bleeding/BleedingTooltip.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 2e97bf5b8..bfc3b45ac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +1,3 @@ - fixed bug with game stages not reloading properly in the configuration file (reported by @Sully) +- fixed game crash caused by compatibility issues with Loot Beams mod (reported by @davey) - fixed game crash when breaking chest with Cursed Armor inside (reported by @Jabkkm) \ No newline at end of file diff --git a/common/src/main/java/com/majruszsdifficulty/effects/bleeding/BleedingTooltip.java b/common/src/main/java/com/majruszsdifficulty/effects/bleeding/BleedingTooltip.java index 291d31a6f..0b86db5ac 100644 --- a/common/src/main/java/com/majruszsdifficulty/effects/bleeding/BleedingTooltip.java +++ b/common/src/main/java/com/majruszsdifficulty/effects/bleeding/BleedingTooltip.java @@ -14,7 +14,8 @@ public class BleedingTooltip { static { OnItemAttributeTooltip.listen( BleedingTooltip::addCustom ) - .addCondition( Bleeding::isEnabled ); + .addCondition( Bleeding::isEnabled ) + .addCondition( data->Side.getLocalPlayer() != null /* compatibility check */ ); } private static void addCustom( OnItemAttributeTooltip data ) { From 7bcaa494ea0ee4f7925b4762a7f66afa7594db72 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Wed, 20 Dec 2023 17:14:57 +0100 Subject: [PATCH 5/5] Removed unfinished tag --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index fc55f1366..de45b7924 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.4-unfinished +mod_version=1.9.4 mod_display_name=Majrusz's Progressive Difficulty mod_description=Mod that progressively increases the game difficulty over time. mod_authors=Majrusz