From 86d89aab2016bb90c6631856251cbfbad1c48172 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 8 Sep 2021 21:13:17 -0300 Subject: [PATCH 1/3] added death messages control to cleanLogs (require showDeathMessages to be false as well). Fixes #1095 --- .../java/carpet/mixins/LivingEntityMixin.java | 27 +++++++++++++++++++ src/main/resources/carpet.mixins.json | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 src/main/java/carpet/mixins/LivingEntityMixin.java diff --git a/src/main/java/carpet/mixins/LivingEntityMixin.java b/src/main/java/carpet/mixins/LivingEntityMixin.java new file mode 100644 index 00000000..22e6c578 --- /dev/null +++ b/src/main/java/carpet/mixins/LivingEntityMixin.java @@ -0,0 +1,27 @@ +package carpet.mixins; + +import carpet.CarpetSettings; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.world.GameRules; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(LivingEntity.class) +public abstract class LivingEntityMixin extends Entity +{ + + public LivingEntityMixin(EntityType type, World world) + { + super(type, world); + } + + @Redirect(method = "onDeath", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;hasCustomName()Z")) + private boolean shouldLogDeaths(LivingEntity livingEntity) + { + return livingEntity.hasCustomName() && CarpetSettings.cleanLogs && world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES); + } +} diff --git a/src/main/resources/carpet.mixins.json b/src/main/resources/carpet.mixins.json index 40d083d7..b1cb8d4f 100644 --- a/src/main/resources/carpet.mixins.json +++ b/src/main/resources/carpet.mixins.json @@ -58,6 +58,8 @@ "ChunkTicketManager_spawnChunksMixin", "ServerWorld_spawnChunksMixin", + "LivingEntityMixin", + "MobEntityMixin", "EntityTrackerEntry_leashFixMixin", From 9652573c103fdeac769901cdbbf5fe4f9e796ff3 Mon Sep 17 00:00:00 2001 From: gnembon Date: Sat, 11 Sep 2021 00:37:54 -0300 Subject: [PATCH 2/3] removed time restrictions from /spawn test --- src/main/java/carpet/commands/SpawnCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/carpet/commands/SpawnCommand.java b/src/main/java/carpet/commands/SpawnCommand.java index 789d44d1..a97f5e6d 100644 --- a/src/main/java/carpet/commands/SpawnCommand.java +++ b/src/main/java/carpet/commands/SpawnCommand.java @@ -62,7 +62,7 @@ public class SpawnCommand executes( (c) -> recentSpawnsForType(c.getSource(), getString(c, "type"))))). then(literal("test"). executes( (c)-> runTest(c.getSource(), 72000, null)). - then(argument("ticks", integer(10,720000)). + then(argument("ticks", integer(10)). executes( (c)-> runTest( c.getSource(), getInteger(c, "ticks"), From c788b122a71d4d1a712372b6fa6ccc66f83994b3 Mon Sep 17 00:00:00 2001 From: gnembon Date: Fri, 17 Sep 2021 03:14:35 -0300 Subject: [PATCH 3/3] advance mappings --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5090c047..1e277432 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx1G # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html minecraft_version=1.17.1 - yarn_mappings=1.17.1+build.46 - loader_version=0.11.6 - fabric_version=0.39.1+1.17 + yarn_mappings=1.17.1+build.61 + loader_version=0.11.7 + fabric_version=0.40.1+1.17 # Mod Properties mod_version = 1.4.45