generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
c358ad8
commit 43671a5
Showing
4 changed files
with
80 additions
and
2 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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/portingdeadmods/modjam/compat/jade/AquaticCatalystComponentProvider.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,35 @@ | ||
package com.portingdeadmods.modjam.compat.jade; | ||
|
||
import com.portingdeadmods.modjam.content.blockentities.AquaticCatalystBlockEntity; | ||
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 enum AquaticCatalystComponentProvider implements IBlockComponentProvider { | ||
INSTANCE; | ||
|
||
@Override | ||
public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { | ||
if (blockAccessor.getBlockEntity() instanceof AquaticCatalystBlockEntity blockEntity) { | ||
if (blockEntity.isActive()) { | ||
iTooltip.add(Component.literal("Status: Active")); | ||
blockEntity.getCurrentRecipe().ifPresent(recipe -> { | ||
iTooltip.add(Component.literal("Processing: ").append(Component.literal(blockEntity.getItemHandler().getStackInSlot(0).getCount() +"x ").append(Component.translatable(blockEntity.getProcessingItem().getDescriptionId())))); | ||
iTooltip.add(Component.literal("Remaining Duration: " + blockEntity.getRemainingDuration() + " ticks")); | ||
iTooltip.add(Component.literal("Transferring: " + blockEntity.getPower() + "AP/T")); | ||
}); | ||
} else { | ||
iTooltip.add(Component.literal("Status: Inactive")); | ||
} | ||
} | ||
} | ||
|
||
|
||
@Override | ||
public ResourceLocation getUid() { | ||
return ResourceLocation.fromNamespaceAndPath("modjam", "aquatic_catalyst"); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/portingdeadmods/modjam/compat/jade/JadePlugin.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,22 @@ | ||
package com.portingdeadmods.modjam.compat.jade; | ||
|
||
import com.portingdeadmods.modjam.content.blockentities.AquaticCatalystBlockEntity; | ||
import com.portingdeadmods.modjam.content.blocks.AquaticCatalystBlock; | ||
import snownee.jade.api.IWailaClientRegistration; | ||
import snownee.jade.api.IWailaCommonRegistration; | ||
import snownee.jade.api.IWailaPlugin; | ||
import snownee.jade.api.WailaPlugin; | ||
|
||
@WailaPlugin | ||
public class JadePlugin implements IWailaPlugin { | ||
|
||
@Override | ||
public void register(IWailaCommonRegistration registration) { | ||
//TODO register data providers | ||
} | ||
|
||
@Override | ||
public void registerClient(IWailaClientRegistration registration) { | ||
registration.registerBlockComponent(AquaticCatalystComponentProvider.INSTANCE, AquaticCatalystBlock.class); | ||
} | ||
} |
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