Skip to content

Commit

Permalink
Allow Editable Signs to be disabled via config. Partially resolves is…
Browse files Browse the repository at this point in the history
…sue Haven-King#67.

The first bullet point is not really addressed because the Mixin will still be applied.
  • Loading branch information
gniftygnome committed Sep 3, 2021
1 parent 70cde5e commit bfb74ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/dev/hephaestus/tweaks/TweaksConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public class TweaksConfig implements ConfigData {
@ConfigEntry.Gui.Tooltip
public boolean automaticDoors = true;

@ConfigEntry.Category("misc")
@ConfigEntry.Gui.Tooltip
public boolean editableSigns = true;

public static class AutoPlanting {
@ConfigEntry.Gui.Tooltip(count = 4)
public boolean enabled = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.hephaestus.tweaks.mixin.block;

import dev.hephaestus.tweaks.Tweaks;
import net.minecraft.block.AbstractSignBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.SignBlock;
Expand All @@ -21,7 +22,7 @@ protected EditableSigns(Settings settings, SignType type) {

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (!world.isClient && player != null) {
if (Tweaks.CONFIG.editableSigns && !world.isClient && player != null) {
player.openEditSignScreen((SignBlockEntity)world.getBlockEntity(pos));
return ActionResult.SUCCESS;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/assets/tinytweaks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
"text.autoconfig.tinytweaks.option.armorStandSwap.@Tooltip": "Right click an armor stand while sneaking to swap armor with it",
"text.autoconfig.tinytweaks.option.automaticDoors": "Automatic Doors",
"text.autoconfig.tinytweaks.option.automaticDoors.@Tooltip": "Wooden doors open and close automatically as you walk through them",
"text.autoconfig.tinytweaks.option.editableSigns": "Editable Signs",
"text.autoconfig.tinytweaks.option.editableSigns.@Tooltip": "Right-click (use) to edit signs",
"text.autoconfig.tinytweaks.option.easyHarvestCrops.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.easyHarvestSugarcane.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.easyHarvestDropAsItems.boolean.true": "§aOn",
Expand Down Expand Up @@ -153,6 +155,7 @@
"text.autoconfig.tinytweaks.option.blueSoulFireEffects.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.soulFireDoesMoreDamage.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.automaticDoors.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.editableSigns.boolean.true": "§aOn",
"text.autoconfig.tinytweaks.option.easyHarvestCrops.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.easyHarvestSugarcane.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.easyHarvestDropAsItems.boolean.false": "§cOff",
Expand Down Expand Up @@ -185,5 +188,6 @@
"text.autoconfig.tinytweaks.option.blueSoulFireEffects.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.soulFireDoesMoreDamage.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.automaticDoors.boolean.false": "§cOff",
"text.autoconfig.tinytweaks.option.editableSigns.boolean.false": "§cOff",
"block.cauldron.makeInfinite": "This cauldron has been blessed with the heart of the sea"
}

0 comments on commit bfb74ba

Please sign in to comment.