Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add note in Jade if block side which you're looking at is glued -> us…
…eful if rendering was disabled
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/de/melanx/utilitix/compat/jade/GlueProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.melanx.utilitix.compat.jade; | ||
|
||
import de.melanx.utilitix.UtilitiX; | ||
import de.melanx.utilitix.content.slime.SlimyCapability; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import snownee.jade.api.BlockAccessor; | ||
import snownee.jade.api.IBlockComponentProvider; | ||
import snownee.jade.api.ITooltip; | ||
import snownee.jade.api.config.IPluginConfig; | ||
|
||
public class GlueProvider implements IBlockComponentProvider { | ||
|
||
public static final ResourceLocation UID = UtilitiX.getInstance().resource("glue_information"); | ||
public static final GlueProvider INSTANCE = new GlueProvider(); | ||
private static final Component INFORMATION = Component.translatable("jade.utilitix.glue_information").withStyle(ChatFormatting.GREEN); | ||
|
||
@Override | ||
public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfig config) { | ||
if (!config.get(UtilJade.GLUE_INFORMATION)) { | ||
return; | ||
} | ||
|
||
accessor.getLevel().getChunkAt(accessor.getPosition()).getCapability(SlimyCapability.STICKY_CHUNK).ifPresent(stickyChunk -> { | ||
if (stickyChunk.get(accessor.getPosition().getX(), accessor.getPosition().getY(), accessor.getPosition().getZ(), accessor.getSide())) { | ||
tooltip.add(INFORMATION); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getUid() { | ||
return UID; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters