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
ef7fae1
commit d01fcac
Showing
7 changed files
with
52 additions
and
5 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
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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/novamachina/exnihilosequentia/common/waila/SieveComponentProvider.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,29 @@ | ||
package com.novamachina.exnihilosequentia.common.waila; | ||
|
||
import com.novamachina.exnihilosequentia.common.item.mesh.EnumMesh; | ||
import com.novamachina.exnihilosequentia.common.tileentity.sieve.SieveTile; | ||
import com.novamachina.exnihilosequentia.common.utility.StringUtils; | ||
import mcp.mobius.waila.api.IComponentProvider; | ||
import mcp.mobius.waila.api.IDataAccessor; | ||
import mcp.mobius.waila.api.IPluginConfig; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.util.text.ITextComponent; | ||
import net.minecraft.util.text.TranslationTextComponent; | ||
|
||
import java.util.List; | ||
|
||
public class SieveComponentProvider implements IComponentProvider { | ||
@Override | ||
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) { | ||
SieveTile sieveTile = (SieveTile) accessor.getTileEntity(); | ||
String block = I18n.format(sieveTile.getBlockStack().getTranslationKey()); | ||
|
||
if(!sieveTile.getBlockStack().isEmpty()) { | ||
tooltip.add(new TranslationTextComponent("waila.progress", StringUtils.formatPercent(sieveTile.getProgress()/ 1.0F))); | ||
tooltip.add(new TranslationTextComponent("waila.sieve.block", block)); | ||
} | ||
if(sieveTile.getMesh() != EnumMesh.NONE) { | ||
tooltip.add(new TranslationTextComponent("waila.sieve.mesh", sieveTile.getMesh().getName())); | ||
} | ||
} | ||
} |
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