-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/projectred-wires' into dev
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/main/java/mcp/mobius/waila/addons/projectred/HUDFMPWires.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,41 @@ | ||
package mcp.mobius.waila.addons.projectred; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import mcp.mobius.waila.api.ITaggedList; | ||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaFMPAccessor; | ||
import mcp.mobius.waila.api.IWailaFMPProvider; | ||
import mcp.mobius.waila.cbcore.LangUtil; | ||
import mcp.mobius.waila.utils.NBTUtil; | ||
|
||
public class HUDFMPWires implements IWailaFMPProvider { | ||
|
||
@Override | ||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, | ||
IWailaConfigHandler config) { | ||
return currenttip; | ||
} | ||
|
||
@Override | ||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, | ||
IWailaConfigHandler config) { | ||
if (!config.getConfig("pr.showsignal")) return currenttip; | ||
|
||
ITaggedList<String, String> tagList = (ITaggedList<String, String>) currenttip; | ||
int signal = ((NBTUtil.getNBTInteger(accessor.getNBTData(), "signal") & 0xff) + 16) / 17; | ||
if (tagList.getEntries("signal").isEmpty()) { | ||
tagList.add(String.format("%s : %s", LangUtil.translateG("hud.msg.power"), signal), "signal"); | ||
} | ||
|
||
return currenttip; | ||
} | ||
|
||
@Override | ||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, | ||
IWailaConfigHandler config) { | ||
return currenttip; | ||
} | ||
} |
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