blob: c96212c8e61cca98101ed52f216c05b39583bf1c (
plain)
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
|
package gtnhlanth.common.item;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import gtnhlanth.Tags;
public class ItemPhotolithographicMask extends Item implements ICanFocus {
private final String name;
private final String descSpectrum;
public ItemPhotolithographicMask(String name, int maxDamage, String descSpectrum) {
super();
this.name = name;
this.descSpectrum = descSpectrum;
this.setUnlocalizedName("photomask." + name);
this.setMaxStackSize(1);
this.setMaxDamage(maxDamage);
this.setTextureName(Tags.MODID + ":photomask/" + name);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
if (!this.descSpectrum.isEmpty())
list.add("Suitable for the " + this.descSpectrum + " segment of the electromagnetic spectrum and lower");
if (this.getMaxDamage() > 0) // Not a precursor.
list.add("Max Uses: " + (this.getMaxDamage() + 1)); // maximum uses = max damage + 1 in general, as
// 0-durability masks still function
}
public String getDescSpectrum() {
return descSpectrum;
}
}
|