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..c69af6f6 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 = false; + @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/UTBarrierParticleMixin.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticleMixin.java new file mode 100644 index 00000000..6ef84222 --- /dev/null +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/blocks/barrier/mixin/UTBarrierParticleMixin.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 UTBarrierParticleMixin +{ + @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..b2200c76 --- /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": ["UTBarrierParticleMixin"] +} \ No newline at end of file