generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a79e839
commit 21d6ea2
Showing
4 changed files
with
81 additions
and
1 deletion.
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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/com/portingdeadmods/nautec/compat/jade/MixerComponentProvider.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,49 @@ | ||
package com.portingdeadmods.nautec.compat.jade; | ||
|
||
import com.portingdeadmods.nautec.Nautec; | ||
import com.portingdeadmods.nautec.content.blockentities.AquaticCatalystBlockEntity; | ||
import com.portingdeadmods.nautec.content.blockentities.MixerBlockEntity; | ||
import com.portingdeadmods.nautec.content.blocks.MixerBlock; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.neoforged.neoforge.fluids.FluidStack; | ||
import snownee.jade.api.BlockAccessor; | ||
import snownee.jade.api.IBlockComponentProvider; | ||
import snownee.jade.api.ITooltip; | ||
import snownee.jade.api.config.IPluginConfig; | ||
|
||
public enum MixerComponentProvider implements IBlockComponentProvider { | ||
INSTANCE; | ||
|
||
|
||
@Override | ||
public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { | ||
if (blockAccessor.getBlockEntity() instanceof MixerBlockEntity blockEntity) { | ||
// Display the input fluid and its amount | ||
FluidStack inputFluid = blockEntity.getInputFluid(); | ||
iTooltip.add(Component.literal("Fluid Input: ") | ||
.append(Component.translatable(inputFluid.getFluid().getFluidType().getDescriptionId())) | ||
.append(" - " + blockEntity.getInputFluidAmount() + " mB")); | ||
|
||
// Display the output fluid and its amount | ||
FluidStack outputFluid = blockEntity.getOutputFluid(); | ||
iTooltip.add(Component.literal("Fluid Output: ") | ||
.append(Component.translatable(outputFluid.getFluid().getFluidType().getDescriptionId())) | ||
.append(" - " + blockEntity.getOutputFluidAmount() + " mB")); | ||
|
||
|
||
// Display the current duration and max duration of the mixing process | ||
int duration = blockEntity.getDuration(); | ||
int maxDuration = blockEntity.getMaxDuration(); | ||
iTooltip.add(Component.literal("Mixing Progress: " + duration + " / " + maxDuration + " ticks")); | ||
|
||
iTooltip.add(Component.literal("Energy: " + blockEntity.getPower() + " AP")); | ||
|
||
} | ||
} | ||
|
||
@Override | ||
public ResourceLocation getUid() { | ||
return ResourceLocation.fromNamespaceAndPath(Nautec.MODID, "mixer"); | ||
} | ||
} |
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