46 lines
1.2 KiB
Java
46 lines
1.2 KiB
Java
package common.block.natural;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import common.attributes.Attribute;
|
|
import common.attributes.UsageSlot;
|
|
import common.block.SoundType;
|
|
import common.entity.npc.EntityNPC;
|
|
import common.init.MetalType;
|
|
import common.item.Item;
|
|
import common.item.ItemStack;
|
|
|
|
public class BlockMetalOre extends BlockOre {
|
|
private final MetalType metal;
|
|
|
|
public BlockMetalOre(MetalType metal) {
|
|
this.metal = metal;
|
|
this.setSound(SoundType.STONE);
|
|
this.setLight(metal.radioactivity > 0.0F ? 0.25F : 0.0F);
|
|
this.setRadiation(metal.radioactivity * 0.5f);
|
|
}
|
|
|
|
public MetalType getMetal() {
|
|
return this.metal;
|
|
}
|
|
|
|
public boolean isMagnetic() {
|
|
return this.metal.isMagnetic();
|
|
}
|
|
|
|
public void getTooltips(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
|
{
|
|
tooltip.add(this.metal.formatSymbol());
|
|
if(this.metal.radioactivity > 0.0f) {
|
|
tooltip.add(this.metal.formatRadioactivity());
|
|
}
|
|
tooltip.add(this.metal.formatRarity());
|
|
}
|
|
|
|
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot)
|
|
{
|
|
if((slot == null || slot == UsageSlot.INVENTORY) && this.metal.radioactivity > 0.0f)
|
|
map.put(Attribute.RADIATION, this.metal.radioactivity * 4.0f * 2.0f);
|
|
}
|
|
}
|