From e71f7f6c6ab8965e31cc62a723c149358f4ae794 Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Wed, 12 Jun 2024 18:04:43 -0700 Subject: [PATCH 1/3] Improve Barrier Particle Display --- README.md | 1 + .../config/UTConfigTweaks.java | 5 ++++ .../universaltweaks/core/UTLoadingPlugin.java | 1 + .../barrier/mixin/UTBarrierParticle.java | 29 +++++++++++++++++++ .../mixins.tweaks.blocks.barrier.json | 7 +++++ 5 files changed, 43 insertions(+) create mode 100644 src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java create mode 100644 src/main/resources/mixins.tweaks.blocks.barrier.json diff --git a/README.md b/README.md index fdcdddab..50a68696 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ All changes are toggleable via config files. * **Hide Personal Effect Particles:** Disables potion effect particles emitting from yourself * **Horizontal Collision Damage:** Applies horizontal collision damage to the player akin to elytra collision * **Husk & Stray Spawning:** Lets husks and strays spawn underground like regular zombies and skeletons +* **Improve Barrier Particle Display:** Causes Barrier Particles to always be displayed to players in Creative mode * **Improve Language Switching Speed:** Improves the speed of switching languages in the Language GUI * **Improved Entity Tracker Warning:** Provides more information to addPacket removed entity warnings * **Incurable Potions:** Excludes potion effects from being curable with curative items like buckets of milk diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java index 5be472a0..9751b234 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java @@ -158,6 +158,11 @@ public static class BlocksCategory @Config.Comment("Determines how long falling blocks remain in ticks until they are dropped under normal circumstances") public int utFallingBlockLifespan = 600; + @Config.RequiresMcRestart + @Config.Name("Improve Barrier Particle Display") + @Config.Comment("Causes Barrier Particles to always be displayed to players in Creative mode") + public boolean utBarrierParticleDisplay = true; + @Config.RequiresMcRestart @Config.Name("Prevent Observer Activating on Placement") @Config.Comment("Controls if the observer activates itself on the first tick when it is placed") diff --git a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java index c9ba086d..a7ca1e86 100644 --- a/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java +++ b/src/main/java/mod/acgaming/universaltweaks/core/UTLoadingPlugin.java @@ -72,6 +72,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader put("mixins.bugfixes.world.chunksaving.json", () -> UTConfigBugfixes.WORLD.utChunkSavingToggle && !spongeForgeLoaded); put("mixins.bugfixes.world.tileentities.json", () -> UTConfigBugfixes.WORLD.utTileEntityMap != UTConfigBugfixes.WorldCategory.EnumMaps.HASHMAP); put("mixins.bugfixes.world.witchhuts.json", () -> UTConfigBugfixes.WORLD.utWitchStructuresToggle); + put("mixins.tweaks.blocks.barrier.json", () -> UTConfigTweaks.BLOCKS.utBarrierParticleDisplay); put("mixins.tweaks.blocks.bedobstruction.json", () -> UTConfigTweaks.BLOCKS.utBedObstructionToggle); put("mixins.tweaks.blocks.breakablebedrock.json", () -> UTConfigTweaks.BLOCKS.BREAKABLE_BEDROCK.utBreakableBedrockToggle); put("mixins.tweaks.blocks.endcrystal.json", () -> UTConfigTweaks.BLOCKS.utEndCrystalAnywherePlacing); diff --git a/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java new file mode 100644 index 00000000..78dbc17a --- /dev/null +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java @@ -0,0 +1,29 @@ +package mod.acgaming.universaltweaks.tweaks.blocks.barrier.mixin; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.world.GameType; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +import mod.acgaming.universaltweaks.config.UTConfigTweaks; + +// Courtesy of WaitingIdly +@Mixin(WorldClient.class) +public class UTBarrierParticle +{ + @Shadow + @Final + private Minecraft mc; + + @ModifyVariable(method = "doVoidFogParticles", at = @At(value = "STORE", ordinal = 0)) + private boolean utAlwaysDisplayBarrier(boolean original) + { + if (!UTConfigTweaks.BLOCKS.utBarrierParticleDisplay) return original; + return this.mc.playerController.getCurrentGameType() == GameType.CREATIVE; + } +} \ No newline at end of file diff --git a/src/main/resources/mixins.tweaks.blocks.barrier.json b/src/main/resources/mixins.tweaks.blocks.barrier.json new file mode 100644 index 00000000..0817b6cd --- /dev/null +++ b/src/main/resources/mixins.tweaks.blocks.barrier.json @@ -0,0 +1,7 @@ +{ + "package": "mod.acgaming.universaltweaks.tweaks.blocks.barrier.mixin", + "refmap": "universaltweaks.refmap.json", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "client": ["UTBarrierParticle"] +} \ No newline at end of file From adc9e31d7f8f06b2fb7704828047ab3f6017d2e5 Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:21:39 -0700 Subject: [PATCH 2/3] default to false --- .../mod/acgaming/universaltweaks/config/UTConfigTweaks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java index 9751b234..c69af6f6 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java @@ -161,7 +161,7 @@ public static class BlocksCategory @Config.RequiresMcRestart @Config.Name("Improve Barrier Particle Display") @Config.Comment("Causes Barrier Particles to always be displayed to players in Creative mode") - public boolean utBarrierParticleDisplay = true; + public boolean utBarrierParticleDisplay = false; @Config.RequiresMcRestart @Config.Name("Prevent Observer Activating on Placement") From f03402ac67f3114409303e48d7fb985d3b713915 Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:22:56 -0700 Subject: [PATCH 3/3] rename file --- .../{UTBarrierParticle.java => UTBarrierParticleMixin.java} | 2 +- src/main/resources/mixins.tweaks.blocks.barrier.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/{UTBarrierParticle.java => UTBarrierParticleMixin.java} (96%) diff --git a/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticleMixin.java similarity index 96% rename from src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java rename to src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticleMixin.java index 78dbc17a..6ef84222 100644 --- a/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticle.java +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticleMixin.java @@ -14,7 +14,7 @@ // Courtesy of WaitingIdly @Mixin(WorldClient.class) -public class UTBarrierParticle +public class UTBarrierParticleMixin { @Shadow @Final diff --git a/src/main/resources/mixins.tweaks.blocks.barrier.json b/src/main/resources/mixins.tweaks.blocks.barrier.json index 0817b6cd..b2200c76 100644 --- a/src/main/resources/mixins.tweaks.blocks.barrier.json +++ b/src/main/resources/mixins.tweaks.blocks.barrier.json @@ -3,5 +3,5 @@ "refmap": "universaltweaks.refmap.json", "minVersion": "0.8", "compatibilityLevel": "JAVA_8", - "client": ["UTBarrierParticle"] + "client": ["UTBarrierParticleMixin"] } \ No newline at end of file