This repository was archived by the owner on Oct 1, 2025. It is now read-only.
forked from c7na/ItemUntranslator4GTNH
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataProvider.java
More file actions
69 lines (57 loc) · 2.24 KB
/
Copy pathDataProvider.java
File metadata and controls
69 lines (57 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.github.c7na.itemuntranslator.waila;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.github.c7na.itemuntranslator.ItemUntranslator;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
public class DataProvider implements IWailaDataProvider {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
if (!ItemUntranslator.SHOW_WAILA) return currenttip;
ItemStack stack = accessor.getStack();
if (stack == null) return currenttip;
if (ItemUntranslator.isBlacklisted(stack)) return currenttip;
String englishName = null;
try {
ItemUntranslator.getTooltipThread = Thread.currentThread();
englishName = stack.getDisplayName();
} finally {
ItemUntranslator.getTooltipThread = null;
}
if (englishName != null && !currenttip.isEmpty()) {
Object first = currenttip.get(0);
if (first == null || !englishName.equals(first.toString())) {
currenttip.add(englishName);
}
}
return currenttip;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
return currenttip;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
return currenttip;
}
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
int y, int z) {
return tag;
}
}