-
Notifications
You must be signed in to change notification settings - Fork 29
/
ItemFakeGolemShield.java
64 lines (54 loc) · 1.7 KB
/
ItemFakeGolemShield.java
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
package makeo.gadomancy.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import makeo.gadomancy.common.Gadomancy;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
*
* Created by makeo @ 25.06.2015 22:25
*/
public class ItemFakeGolemShield extends Item {
private final Item golemItem = new ItemFakeGolemPlacer();
private IIcon shieldIcon;
public ItemFakeGolemShield() {
setCreativeTab(null);
}
@SideOnly(Side.CLIENT)
public int getRenderPasses(int metadata) {
return golemItem.getRenderPasses(metadata) + 1;
}
@Override
public boolean getHasSubtypes() {
return golemItem.getHasSubtypes();
}
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
golemItem.getSubItems(item, tab, list);
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public void registerIcons(IIconRegister ir) {
shieldIcon = ir.registerIcon(Gadomancy.MODID + ":r_runicupg");
golemItem.registerIcons(ir);
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
if(pass == getRenderPasses(stack.getItemDamage()) - 1) {
return shieldIcon;
} else {
return golemItem.getIcon(stack, pass);
}
}
}