Jump to content

1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal


Recommended Posts

Posted

I am using a piece of decompiled code, does anyone know what this is supposed to be?

(1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal()])

Posted

This is 1.7.x IItemRenderer's ItemRenderType (enum).

Those are deprecated as of 1.8 (whole IItemRenderer).

In past versions this Enum was used to determine how to render item on screen (entity in world, 1st person, 3rd person, etc.)

1.7.10 is no longer supported by forge, you are on your own.

Posted

So what would i change it to? This is my whole class.

 

import net.minecraft.client.Minecraft;

import net.minecraft.client.entity.AbstractClientPlayer;

import net.minecraft.client.gui.inventory.GuiContainerCreative;

import net.minecraft.client.gui.inventory.GuiInventory;

import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.client.renderer.texture.TextureManager;

import net.minecraft.client.settings.GameSettings;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.client.IItemRenderer;

import net.minecraftforge.client.IItemRenderer.ItemRenderType;

import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;

import org.lwjgl.opengl.GL11;

 

public class RenderM9

  implements IItemRenderer

{

  private static final ResourceLocation texture = new ResourceLocation("MasterGuns", "modeltextures/M9.png");

  protected ModelM9 model;

  protected ModelLeftArm modellefta;

  protected ModelRightArm modelrighta;

 

  public RenderM9()

  {

    this.model = new M9();

    this.modelrighta = new ModelRightArm();

    this.modellefta = new ModelLeftArm();

  }

 

  public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type)

  {

    switch (type.ordinal())

    {

    case 1:

    case 2:

      return true;

    }

    return false;

  }

 

  public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper)

  {

    return false;

  }

 

  public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data)

  {

    AbstractClientPlayer player = Minecraft.func_71410_x().field_71439_g;

    switch (1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal()])

    {

    case 1:

    case 2:

      GL11.glPushMatrix();

     

      Minecraft.func_71410_x().field_71446_o.func_110577_a(texture);

      boolean isFirtsPerson = false;

      if ((data[1] != null) && ((data[1] instanceof EntityPlayer))) {

        if (((EntityPlayer)data[1] != Minecraft.func_71410_x().field_71451_h) || (Minecraft.func_71410_x().field_71474_y.field_74320_O != 0) || ((((Minecraft.func_71410_x().field_71462_r instanceof GuiInventory)) || ((Minecraft.func_71410_x().field_71462_r instanceof GuiContainerCreative))) && (RenderManager.field_78727_a.field_78735_i == 180.0F)))

        {

          float scale = 0.35F;

          GL11.glTranslatef(0.25F, 0.25F, 0.06F);

          GL11.glScalef(scale, scale, scale);

          GL11.glRotatef(100.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(150.0F, 1.0F, 0.0F, 0.0F);

          GL11.glRotatef(15.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(-7.0F, 1.0F, 0.0F, 0.0F);

        }

        else

        {

          isFirtsPerson = true;

         

          float scale = 0.7F;

          GL11.glTranslatef(-0.2F, 0.35F, -0.25F);

         

          GL11.glScalef(scale, scale, scale);

         

 

 

          GL11.glRotatef(100.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(150.0F, 1.0F, 0.0F, 0.0F);

         

          GL11.glRotatef(25.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(6.5F, 0.0F, 0.0F, 1.0F);

          GL11.glRotatef(-10.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(4.1F, 1.0F, 0.0F, 0.0F);

          GL11.glRotatef(-1.0F, 0.0F, 0.0F, 1.0F);

          GL11.glRotatef(-1.4F, 0.0F, 1.0F, 0.0F);

         

 

          GL11.glRotatef(-0.5F, 0.0F, 1.0F, 0.0F);

        }

      }

      this.model.func_78088_a((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

     

      GL11.glPopMatrix();

     

      GL11.glPushMatrix();

     

 

 

      Minecraft.func_71410_x().field_71446_o.func_110577_a(player.func_110306_p());

      if ((data[1] != null) && ((data[1] instanceof EntityPlayer))) {

        if (((EntityPlayer)data[1] != Minecraft.func_71410_x().field_71451_h) || (Minecraft.func_71410_x().field_71474_y.field_74320_O != 0) || ((((Minecraft.func_71410_x().field_71462_r instanceof GuiInventory)) || ((Minecraft.func_71410_x().field_71462_r instanceof GuiContainerCreative))) && (RenderManager.field_78727_a.field_78735_i == 180.0F)))

        {

          float scale = 0.0F;

          GL11.glScalef(scale, scale, scale);

        }

        else

        {

          float scale = 0.7F;

          GL11.glScalef(2.0F, scale, scale);

          isFirtsPerson = true;

          GL11.glTranslatef(0.15F, 0.4F, -2.1F);

          GL11.glRotatef(-120.0F, 0.0F, 1.0F, 0.0F);

          GL11.glRotatef(-70.0F, 1.0F, 0.0F, 0.0F);

          GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F);

        }

      }

      this.modellefta.func_78088_a((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

     

      GL11.glPopMatrix();

     

      GL11.glPushMatrix();

     

 

 

      Minecraft.func_71410_x().field_71446_o.func_110577_a(player.func_110306_p());

      if ((data[1] != null) && ((data[1] instanceof EntityPlayer))) {

        if (((EntityPlayer)data[1] != Minecraft.func_71410_x().field_71451_h) || (Minecraft.func_71410_x().field_71474_y.field_74320_O != 0) || ((((Minecraft.func_71410_x().field_71462_r instanceof GuiInventory)) || ((Minecraft.func_71410_x().field_71462_r instanceof GuiContainerCreative))) && (RenderManager.field_78727_a.field_78735_i == 180.0F)))

        {

          float scale = 0.0F;

          GL11.glScalef(scale, scale, scale);

        }

        else

        {

          float scale = 0.7F;

          GL11.glScalef(2.0F, scale, scale);

         

          isFirtsPerson = true;

          GL11.glTranslatef(-0.7F, -0.8F, -0.45F);

          GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);

        }

      }

      this.modelrighta.func_78088_a((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

     

      GL11.glPopMatrix();

    }

  }

}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.