diff --git a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/WailaPluginHarvest.java b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/WailaPluginHarvest.java index 3d3254ff6..412815257 100644 --- a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/WailaPluginHarvest.java +++ b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/WailaPluginHarvest.java @@ -14,6 +14,7 @@ public class WailaPluginHarvest implements IWailaPlugin { public void register(IRegistrar registrar) { registrar.addFeatureConfig(Options.ENABLED, true); registrar.addConfig(Options.DISPLAY_MODE, HarvestDisplayMode.MODERN); + registrar.addConfig(Options.CREATIVE, false); registrar.addComponent(HarvestProvider.INSTANCE, TooltipPosition.BODY, Block.class); registrar.addEventListener(HarvestProvider.INSTANCE, 3000); } diff --git a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/config/Options.java b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/config/Options.java index ee75518f2..839eed411 100644 --- a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/config/Options.java +++ b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/config/Options.java @@ -7,6 +7,7 @@ public class Options { // @formatter:off public static final ResourceLocation ENABLED = rl("enabled"); public static final ResourceLocation DISPLAY_MODE = rl("display_mode"); + public static final ResourceLocation CREATIVE = rl("creative"); // @formatter:on public static ResourceLocation rl(String path) { diff --git a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/provider/HarvestProvider.java b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/provider/HarvestProvider.java index 699171d2c..81d2a6a00 100644 --- a/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/provider/HarvestProvider.java +++ b/src/pluginHarvest/java/mcp/mobius/waila/plugin/harvest/provider/HarvestProvider.java @@ -48,6 +48,7 @@ public enum HarvestProvider implements IBlockComponentProvider, IEventListener { @Override public void appendBody(ITooltip tooltip, IBlockAccessor accessor, IPluginConfig config) { if (!config.getBoolean(Options.ENABLED)) return; + if (accessor.getPlayer().isCreative() && !config.getBoolean(Options.CREATIVE)) return; updateId = accessor.getUpdateId(); state = accessor.getBlockState(); diff --git a/src/resources/resources/assets/waila/lang/en_us.json b/src/resources/resources/assets/waila/lang/en_us.json index f95b1f813..a2c937130 100644 --- a/src/resources/resources/assets/waila/lang/en_us.json +++ b/src/resources/resources/assets/waila/lang/en_us.json @@ -343,6 +343,7 @@ "config.waila.plugin_harvest.display_mode_modern" : "Modern", "config.waila.plugin_harvest.display_mode_classic" : "Classic", "config.waila.plugin_harvest.display_mode_classic_minimal" : "Classic Minimal", + "config.waila.plugin_harvest.creative" : "Show on Creative", "config.waila.plugin_wailax" : "Waila Extra", "config.waila.plugin_wailax.energy" : "Energy",