Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

.class file editing


  • Please log in to reply
4 replies to this topic

#1

tristanisms
  • Minecraft: tristanisms

Posted 24 April 2012 - 02:30 AM

I need to know how to edit .class files so I can get my mods working with each other. Here is the .class file I need to edit. (I just need to change the id)

import java.util.Random;
import net.minecraft.client.Minecraft;

public class BlockGrinder extends agy
{

    private Random grinderRand;
    private final boolean isActive;
    public yw entityplayer;
    private static boolean keepGrinderInventory = false;
    public static int Grinderside;
    public static int Grinderfrontoff;
    public static int Grinderfronton;
    public static int Grindertop;
    public static int Grinderbottom;

    protected BlockGrinder(int i, boolean flag)
    {
        super(i, acn.e);
        grinderRand = new Random();
        isActive = flag;
        Grinderside = ModLoader.addOverride("/terrain.png", "/Plant/grinderside.png");
        Grinderfronton = ModLoader.addOverride("/terrain.png", "/Plant/grinderfronton.png");
        Grinderfrontoff = ModLoader.addOverride("/terrain.png", "/Plant/grinderfrontoff.png");
        Grindertop = ModLoader.addOverride("/terrain.png", "/Plant/grindertop.png");
        Grinderbottom = ModLoader.addOverride("/terrain.png", "/Plant/grinderbottom.png");
    }

    public void a(xd world, int i, int j, int k)
    {
        super.a(world, i, j, k);
        setDefaultDirection(world, i, j, k);
    }

    private void setDefaultDirection(xd world, int i, int j, int k)
    {
        if(world.F)
        {
            return;
        }
        int l = world.a(i, j, k - 1);
        int i1 = world.a(i, j, k + 1);
        int j1 = world.a(i - 1, j, k);
        int k1 = world.a(i + 1, j, k);
        byte byte0 = 3;
        if(pb.n[l] && !pb.n[i1])
        {
            byte0 = 3;
        }
        if(pb.n[i1] && !pb.n[l])
        {
            byte0 = 2;
        }
        if(pb.n[j1] && !pb.n[k1])
        {
            byte0 = 5;
        }
        if(pb.n[k1] && !pb.n[j1])
        {
            byte0 = 4;
        }
        world.f(i, j, k, byte0);
    }

    public int d(ali iblockaccess, int i, int j, int k, int l)
    {
        if(l == 1)
        {
            return Grindertop;
        }
        if(l == 0)
        {
            return Grinderbottom;
        }
        int i1 = iblockaccess.e(i, j, k);
        if(l != i1)
        {
            return Grinderside;
        }
        if(isActive)
        {
            return Grinderfrontoff;
        } else
        {
            return Grinderfrontoff;
        }
    }

    public int a_(int i)
    {
        if(i == 1)
        {
            return Grindertop;
        }
        if(i == 0)
        {
            return Grindertop;
        }
        if(i == 3)
        {
            return Grinderfrontoff;
        } else
        {
            return Grinderside;
        }
    }

    public int a(Random random)
    {
        return 1;
    }

    public void a(xd world, int i, int j, int k, acq entityliving)
    {
        int l = gk.c((double)((entityliving.u * 4F) / 360F) + 0.5D) & 3;
        if(l == 0)
        {
            world.f(i, j, k, 2);
        }
        if(l == 1)
        {
            world.f(i, j, k, 5);
        }
        if(l == 2)
        {
            world.f(i, j, k, 3);
        }
        if(l == 3)
        {
            world.f(i, j, k, 4);
        }
    }

    public boolean b(xd world, int i, int j, int k, yw entityplayer)
    {
        if(world.F)
        {
            return true;
        } else
        {
            TileEntityGrinder tileentitygrinder = (TileEntityGrinder)world.b(i, j, k);
            ModLoader.openGUI(ModLoader.getMinecraftInstance().h, new GuiGrinder(ModLoader.getMinecraftInstance().h.ap, tileentitygrinder));
            return true;
        }
    }

    public static void updateGrinderBlockState(boolean flag, xd world, int i, int j, int k)
    {
        int l = world.e(i, j, k);
        kw tileentity = world.b(i, j, k);
        keepGrinderInventory = true;
        keepGrinderInventory = false;
        world.f(i, j, k, l);
        world.a(i, j, k, tileentity);
    }

    public kw u_()
    {
        return new TileEntityGrinder();
    }

    public void b_(xd world, int i, int j, int k)
    {
        if(!keepGrinderInventory)
        {
            TileEntityGrinder tileentitygrinder = (TileEntityGrinder)world.b(i, j, k);
label0:
            for(int l = 0; l < tileentitygrinder.a(); l++)
            {
                aan itemstack = tileentitygrinder.k_(l);
                if(itemstack == null)
                {
                    continue;
                }
                float f = grinderRand.nextFloat() * 0.8F + 0.1F;
                float f1 = grinderRand.nextFloat() * 0.8F + 0.1F;
                float f2 = grinderRand.nextFloat() * 0.8F + 0.1F;
                do
                {
                    if(itemstack.a <= 0)
                    {
                        continue label0;
                    }
                    int i1 = grinderRand.nextInt(21) + 10;
                    if(i1 > itemstack.a)
                    {
                        i1 = itemstack.a;
                    }
                    itemstack.a -= i1;
                    fq entityitem = new fq(world, (float)i + f, (float)j + f1, (float)k + f2, new aan(itemstack.c, i1, itemstack.i()));
                    float f3 = 0.05F;
                    entityitem.r = (float)grinderRand.nextGaussian() * f3;
                    entityitem.s = (float)grinderRand.nextGaussian() * f3 + 0.2F;
                    entityitem.t = (float)grinderRand.nextGaussian() * f3;
                    world.a(entityitem);
                } while(true);
            }

        }
        super.b_(world, i, j, k);
    }

}

Posted Image


Register or log in to remove.

#2

tristanisms
  • Minecraft: tristanisms

Posted 25 April 2012 - 01:42 AM

View PostFuzzy_Wuzzy, on 24 April 2012 - 10:43 PM, said:

public static int Grinderfronton;
public static int Grindertop;
public static int Grinderbottom;
private int blockID = 200;

protected BlockGrinder(int i, boolean flag)
{
super(blockID, acn.e);
grinderRand = new Random();
isActive = flag;
What do I do with this?

Posted Image


#3

LulzSec1271

Posted 25 April 2012 - 03:23 AM

View Posttristanisms, on 25 April 2012 - 01:42 AM, said:

What do I do with this?
You need a program called "Eclipse". It is a great Java editor and it is fairly easy to configure. Just look up how to configure Eclipse for Minecraft and customize it to suit your needs. Here is the download for Eclipse: http://www.eclipse.org/downloads/

I would download The Java EE IDE simply because it is geared for towards developers; however, Eclipse Classic works just as well in my opinion. Hope this helps.

#4

tristanisms
  • Minecraft: tristanisms

Posted 25 April 2012 - 11:47 AM

View PostLulzSec1271, on 25 April 2012 - 03:23 AM, said:

You need a program called "Eclipse". It is a great Java editor and it is fairly easy to configure. Just look up how to configure Eclipse for Minecraft and customize it to suit your needs. Here is the download for Eclipse: http://www.eclipse.org/downloads/

I would download The Java EE IDE simply because it is geared for towards developers; however, Eclipse Classic works just as well in my opinion. Hope this helps.
I didn't get anything helpful on online search engines (as usual). Would you mind telling how?

Posted Image


#5

BrickMan221

Posted 19 February 2013 - 02:30 AM

View Posttristanisms, on 25 April 2012 - 11:47 AM, said:

I didn't get anything helpful on online search engines (as usual). Would you mind telling how?

I found this if its helps:
http://www.minecraft...for-modding-mc/