Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Barrier Particle Display #490

Merged
merged 3 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
}
Loading