Files
CustomNPC-Plus/src/main/java/noppes/npcs/items/ItemNpcInterface.java
T

58 lines
1.6 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs.items;
2023-01-12 21:33:06 -05:00
import cpw.mods.fml.common.registry.GameRegistry;
2018-09-13 12:03:28 -04:00
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import noppes.npcs.CustomItems;
import noppes.npcs.CustomNpcs;
import org.lwjgl.opengl.GL11;
2025-03-13 17:14:45 -04:00
public class ItemNpcInterface extends Item implements ItemRenderInterface {
public ItemNpcInterface(int par1) {
this();
}
public ItemNpcInterface() {
setCreativeTab(CustomItems.tab);
CustomNpcs.proxy.registerItem(this);
}
public void renderSpecial() {
GL11.glScalef(0.66f, 0.66f, 0.66f);
2018-09-13 12:03:28 -04:00
GL11.glTranslatef(0, 0.3f, 0);
2025-03-13 17:14:45 -04:00
}
;
2018-09-13 12:03:28 -04:00
@Override
2025-03-13 17:14:45 -04:00
public int getItemEnchantability() {
2018-09-13 12:03:28 -04:00
//return this.toolMaterial.getEnchantability();
2025-03-13 17:14:45 -04:00
return super.getItemEnchantability();
2018-09-13 12:03:28 -04:00
}
@Override
2025-03-13 17:14:45 -04:00
public Item setUnlocalizedName(String name) {
super.setUnlocalizedName(name);
GameRegistry.registerItem(this, name);
return this;
2018-09-13 12:03:28 -04:00
}
@Override
2025-03-13 17:14:45 -04:00
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, EntityLivingBase par3EntityLiving) {
if (par2EntityLiving.getHealth() <= 0)
return false;
2018-09-13 12:03:28 -04:00
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
2025-03-13 17:14:45 -04:00
public boolean hasItem(EntityPlayer player, Item item) {
return player.inventory.hasItem(item);
}
public boolean consumeItem(EntityPlayer player, Item item) {
return player.inventory.consumeInventoryItem(item);
}
2018-09-13 12:03:28 -04:00
}