/*
* KubaTech - Gregtech Addon
* Copyright (C) 2022 kuba6000
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see .
*
*/
package kubatech.loaders.item;
import java.util.List;
import kubatech.Tags;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
public class ItemProxy {
private final String unlocalizedName;
private final String texturepath;
private IIcon icon;
private int itemID;
public ItemProxy(String unlocalizedName, String texture) {
this.unlocalizedName = "kubaitem." + unlocalizedName;
texturepath = Tags.MODID + ":" + texture;
}
public void ItemInit(int index) {
itemID = index;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getDisplayName(ItemStack stack) {
return StatCollector.translateToLocal(this.unlocalizedName + ".name").trim();
}
public void registerIcon(IIconRegister iconRegister) {
icon = iconRegister.registerIcon(texturepath);
}
public IIcon getIcon() {
return icon;
}
public void addInformation(ItemStack stack, EntityPlayer entity, List tooltipList, boolean showDebugInfo) {}
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) {}
public EnumAction getItemUseAction(ItemStack stack) {
return EnumAction.none;
}
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer entity) {
return stack;
}
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer entity) {
return stack;
}
public int getMaxItemUseDuration() {
return 0;
}
}