Proper Reformating

This commit is contained in:
Kam committed 2025-03-13 17:14:45 -04:00
1 parent ce75880aba
commit 180d257024
1179 files changed
+59847 -61583

No files matched your search

@@ -20,20 +20,20 @@ import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.event.ItemEvent;
import org.lwjgl.opengl.GL11;
public abstract class ItemCustomizable extends Item implements ItemRenderInterface {
public abstract class ItemCustomizable extends Item implements ItemRenderInterface {
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister){
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = Items.iron_pickaxe.getIconFromDamage(0);
}
@Override
public int getColorFromItemStack(ItemStack itemStack, int par2){
public int getColorFromItemStack(ItemStack itemStack, int par2) {
return 0x8B4513;
}
@Override
public boolean onEntitySwing(EntityLivingBase entityLivingBase, ItemStack stack){
public boolean onEntitySwing(EntityLivingBase entityLivingBase, ItemStack stack) {
if (entityLivingBase.worldObj.isRemote) {
return false;
}
@@ -43,7 +43,7 @@ public abstract class ItemCustomizable extends Item implements ItemRenderInterfa
return EventHooks.onScriptItemAttack((IItemCustomizable) istack, eve);
}
public int getMaxItemUseDuration(ItemStack stack){
public int getMaxItemUseDuration(ItemStack stack) {
IItemCustomizable customizable = (IItemCustomizable) NpcAPI.Instance().getIItemStack(stack);
return customizable.getMaxItemUseDuration();
}
@@ -64,31 +64,27 @@ public abstract class ItemCustomizable extends Item implements ItemRenderInterfa
return istack instanceof IItemCustomizable ? istack.getMaxStackSize() : super.getItemStackLimit(stack);
}
public boolean isItemTool(ItemStack stack)
{
public boolean isItemTool(ItemStack stack) {
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
return istack instanceof IItemCustomizable ? ((IItemCustomizable) istack).isTool() : super.isItemTool(stack);
}
public float getDigSpeed(ItemStack stack, Block block, int metadata)
{
public float getDigSpeed(ItemStack stack, Block block, int metadata) {
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
return istack instanceof IItemCustomizable ? ((IItemCustomizable) istack).getDigSpeed() : super.getDigSpeed(stack, block, metadata);
}
public boolean isValidArmor(ItemStack stack, int armorType, Entity entity)
{
public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) {
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
if (istack instanceof IItemCustomizable) {
if(((IItemCustomizable) istack).getArmorType() == -1)
if (((IItemCustomizable) istack).getArmorType() == -1)
return true;
return armorType == ((IItemCustomizable) istack).getArmorType();
}
return super.isValidArmor(stack, armorType, entity);
}
public int getItemEnchantability(ItemStack stack)
{
public int getItemEnchantability(ItemStack stack) {
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
return istack instanceof IItemCustomizable ? ((IItemCustomizable) istack).getEnchantability() : super.getItemEnchantability(stack);
}
@@ -100,25 +96,23 @@ public abstract class ItemCustomizable extends Item implements ItemRenderInterfa
}
@Override
public boolean requiresMultipleRenderPasses(){
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public Item setUnlocalizedName(String name){
public Item setUnlocalizedName(String name) {
GameRegistry.registerItem(this, name);
return super.setUnlocalizedName(name);
}
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}
public EnumAction getItemUseAction(ItemStack stack)
{
public EnumAction getItemUseAction(ItemStack stack) {
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
if (istack instanceof IItemCustomizable) {
switch (((IItemCustomizable) istack).getItemUseAction()) {
@@ -138,7 +132,8 @@ public abstract class ItemCustomizable extends Item implements ItemRenderInterfa
}
@Override
public void renderSpecial() {}
public void renderSpecial() {
}
public void renderOffset(IItemCustomizable scriptCustomItem) {
GL11.glTranslatef(0.135F * scriptCustomItem.getScaleX(), 0.2F * scriptCustomItem.getScaleY(), 0.07F * scriptCustomItem.getScaleZ());