Skip to content

Commit

Permalink
Merge pull request #490 from WaitingIdly/barrier-visibility
Browse files Browse the repository at this point in the history
Improve Barrier Particle Display
  • Loading branch information
ACGaming authored Jun 16, 2024
2 parents 36704f7 + f03402a commit 123050f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
7 changes: 7 additions & 0 deletions src/main/resources/mixins.tweaks.blocks.barrier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.blocks.barrier.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTBarrierParticleMixin"]
}

0 comments on commit 123050f

Please sign in to comment.