Skip to content

Commit

Permalink
Added disableRedstoneWireParticle
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Nov 20, 2021
1 parent eca8d30 commit e09b087
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ New tweaks:
- tweakmAutoFillContainer (Tweak toggles)
- netherPortalSoundChance (Generic)
- disableLightUpdates (Disable)
- disableRedstoneWireParticle (Disable)
- handRestockListType (List)
- handRestockWhiteList (List)
- handRestockBlackList (List)
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class TweakerMoreConfigs

@DisableConfig
public static final ConfigBooleanHotkeyed DISABLE_LIGHT_UPDATES = new ConfigBooleanHotkeyed("disableLightUpdates", false, "", "disableLightUpdates.comment", "Disable Light Updates");
@DisableConfig
public static final ConfigBooleanHotkeyed DISABLE_REDSTONE_WIRE_PARTICLE = new ConfigBooleanHotkeyed("disableRedstoneWireParticle", false, "", "disableRedstoneWireParticle.comment", "Disable particle of redstone wire");

private static String getItemId(Item item)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package me.fallenbreath.tweakermore.mixins.tweaks.disableRedstoneWireParticle;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.block.RedstoneWireBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(RedstoneWireBlock.class)
public abstract class RedstoneWireBlockMixin
{
// inject right before world.addParticle to avoid client RNG side effects
@Inject(
method = "randomDisplayTick",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/World;addParticle(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"
),
cancellable = true
)
private void disableRedstoneWireParticle(CallbackInfo ci)
{
if (TweakerMoreConfigs.DISABLE_REDSTONE_WIRE_PARTICLE.getBooleanValue())
{
ci.cancel();
}
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/tweakermore/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

"disableLightUpdates": "disableLightUpdates",
"disableLightUpdates.comment": "Yeets client-side light updates",
"disableRedstoneWireParticle": "disableRedstoneWireParticle",
"disableRedstoneWireParticle.comment": "Disable particle of redstone wire",

"tweakmAutoCleanContainer": "tweakmAutoCleanContainer",
"tweakmAutoCleanContainer.comment": "Automatically drops everything in the opened container\nand then close the container",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/tweakermore/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

"disableLightUpdates": "disableLightUpdates | 禁用光照更新",
"disableLightUpdates.comment": "禁用客户端光照更新",
"disableRedstoneWireParticle": "disableRedstoneWireParticle | 禁用红石粉粒子效果",
"disableRedstoneWireParticle.comment": "禁用红石粉发出的粒子效果",

"tweakmAutoCleanContainer": "tweakmAutoCleanContainer | 自动清空容器",
"tweakmAutoCleanContainer.comment": "打开后容器,自动将容器内的所有物品扔出\n然后关闭容器",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/tweakermore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"core.ListsConfigsMixin",
"tweaks.disableLightUpdates.ClientChunkManagerMixin",
"tweaks.disableLightUpdates.LightingProviderMixin",
"tweaks.disableRedstoneWireParticle.RedstoneWireBlockMixin",
"tweaks.handRestoreRestriction.InventoryUtilsMixin",
"tweaks.handRestoreRestriction.PlacementTweaksMixin",
"tweaks.netherPortalSoundChance.NetherPortalBlockMixin",
Expand Down

0 comments on commit e09b087

Please sign in to comment.