Create a new file named Sprite.java and paste this into it:
Code:
import java.awt.*;
import java.awt.image.PixelGrabber;
import sign.signlink;
public class Sprite extends Class30_Sub2_Sub1
{
public static String spriteDirectory = "./Sprites/";
public int width;
public int height;
public int colors[];
public int transparency[];
public Sprite(String s, int i)
{
try
{
Image image = Toolkit.getDefaultToolkit().getImage(spriteDirectory + s + " " + i + ".png");
MediaTracker mediatracker = new MediaTracker(client.component);
mediatracker.addImage(image, 0);
mediatracker.waitForAll();
width = image.getWidth(client.component) / 2;
height = image.getHeight(client.component);
colors = new int[width * height];
transparency = new int[width * height];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, width, height, colors, 0, width);
pixelgrabber.grabPixels();
PixelGrabber pixelgrabber2 = new PixelGrabber(image, width, 0, width * 2, height, transparency, 0, width);
pixelgrabber2.grabPixels();
for(int i2 = 0; i2 < transparency.length; i2++)
{
transparency[i2] = 0xffffff + (transparency[i2] + 1);
if(transparency[i2] == 0xff)
{
transparency[i2] = -1;
} else
{
transparency[i2] = (int)((((transparency[i2] >> 16) & 0xff) + ((transparency[i2] >> 8) & 0xff) + (transparency[i2] & 0xff)) / 3);
}
}
}
catch(Exception e)
{
System.out.println("Invalid Sprite: " + s + " " + i);
try
{
Image image = Toolkit.getDefaultToolkit().getImage(spriteDirectory + "X.png");
MediaTracker mediatracker = new MediaTracker(client.component);
mediatracker.addImage(image, 0);
mediatracker.waitForAll();
width = 30;
height = 30;
colors = new int[width * height];
transparency = new int[width * height];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, width, height, colors, 0, width);
pixelgrabber.grabPixels();
}
catch(Exception e2)
{
e2.printStackTrace();
}
}
}
public void draw(int x, int y)
{
int l = x + y * Class30_Sub2_Sub1.anInt1379;
int i1 = 0;
int j1 = height;
int k1 = width;
int l1 = Class30_Sub2_Sub1.anInt1379 - k1;
int i2 = 0;
if(y < Class30_Sub2_Sub1.anInt1381)
{
int j2 = Class30_Sub2_Sub1.anInt1381 - y;
j1 -= j2;
y = Class30_Sub2_Sub1.anInt1381;
i1 += j2 * k1;
l += j2 * Class30_Sub2_Sub1.anInt1379;
}
if(y + j1 > Class30_Sub2_Sub1.anInt1382)
{
j1 -= (y + j1) - Class30_Sub2_Sub1.anInt1382;
}
if(x < Class30_Sub2_Sub1.anInt1383)
{
int k2 = Class30_Sub2_Sub1.anInt1383 - x;
k1 -= k2;
x = Class30_Sub2_Sub1.anInt1383;
i1 += k2;
l += k2;
i2 += k2;
l1 += k2;
}
if(x + k1 > Class30_Sub2_Sub1.anInt1384)
{
int l2 = (x + k1) - Class30_Sub2_Sub1.anInt1384;
k1 -= l2;
i2 += l2;
l1 += l2;
}
if(k1 <= 0 || j1 <= 0)
{
return;
} else
{
draw2(i1, l, k1, j1, l1, i2);
return;
}
}
public void draw2(int j, int k, int l, int i1, int j1, int k1)
{
int color = 0;
boolean invert = false;
int opacity = 0;
int l1 = -(l >> 2);
l = -(l & 3);
for(int i2 = -i1; i2 < 0; i2++)
{
for(int j2 = l1; j2 < 0; j2++)
{
color = colors[j];
invert = transparency[j] == -1;
opacity = (int)(100 - (transparency[j++] / 2.55));
if(invert)
{
Class30_Sub2_Sub1.anIntArray1378[k] = 1 - Class30_Sub2_Sub1.anIntArray1378[k++];
} else
{
Class30_Sub2_Sub1.anIntArray1378[k] = mixColor(color, Class30_Sub2_Sub1.anIntArray1378[k++], opacity);
}
color = colors[j];
invert = transparency[j] == -1;
opacity = (int)(100 - (transparency[j++] / 2.55));
if(invert)
{
Class30_Sub2_Sub1.anIntArray1378[k] = 1 - Class30_Sub2_Sub1.anIntArray1378[k++];
} else
{
Class30_Sub2_Sub1.anIntArray1378[k] = mixColor(color, Class30_Sub2_Sub1.anIntArray1378[k++], opacity);
}
color = colors[j];
invert = transparency[j] == -1;
opacity = (int)(100 - (transparency[j++] / 2.55));
if(invert)
{
Class30_Sub2_Sub1.anIntArray1378[k] = 1 - Class30_Sub2_Sub1.anIntArray1378[k++];
} else
{
Class30_Sub2_Sub1.anIntArray1378[k] = mixColor(color, Class30_Sub2_Sub1.anIntArray1378[k++], opacity);
}
color = colors[j];
invert = transparency[j] == -1;
opacity = (int)(100 - (transparency[j++] / 2.55));
if(invert)
{
Class30_Sub2_Sub1.anIntArray1378[k] = 1 - Class30_Sub2_Sub1.anIntArray1378[k++];
} else
{
Class30_Sub2_Sub1.anIntArray1378[k] = mixColor(color, Class30_Sub2_Sub1.anIntArray1378[k++], opacity);
}
}
for(int k2 = l; k2 < 0; k2++)
{
color = colors[j];
invert = transparency[j] == -1;
opacity = (int)(100 - (transparency[j++] / 2.55));
if(invert)
{
Class30_Sub2_Sub1.anIntArray1378[k] = 1 - Class30_Sub2_Sub1.anIntArray1378[k++];
} else
{
Class30_Sub2_Sub1.anIntArray1378[k] = mixColor(color, Class30_Sub2_Sub1.anIntArray1378[k++], opacity);
}
}
k += j1;
j += k1;
}
}
public static int mixColor(int sourceColor, int destinationColor, int opacity)
{
return (((int)((((sourceColor >> 16) & 0xff) * (opacity / (double)100)) + (((destinationColor >> 16) & 0xff) * (1 - (opacity / (double)100))))) << 16) + (((int)((((sourceColor >> 8) & 0xff) * (opacity / (double)100)) + (((destinationColor >> 8) & 0xff) * (1 - (opacity / (double)100))))) << 8) + ((int)(((sourceColor & 0xff) * (opacity / (double)100)) + ((destinationColor & 0xff) * (1 - (opacity / (double)100)))));
}
}
And set spriteDirectory to where your sprite images are located.
Now to use it go into client.java and find the sprite you want to change to the new format, for example
Code:
aClass30_Sub2_Sub1_Sub1_1001 = new Class30_Sub2_Sub1_Sub1(class44_2, "mapedge", 0);
and replace it with this:
Code:
aClass30_Sub2_Sub1_Sub1_1001 = new Sprite("mapedge", 0);
then replace all the
Code:
aClass30_Sub2_Sub1_Sub1_1001.method348(x, junk, y);
with
Code:
aClass30_Sub2_Sub1_Sub1_1001.drawSprite(x, y);
and change
Code:
Class30_Sub2_Sub1_Sub1 aClass30_Sub2_Sub1_Sub1_1001
to
Code:
Sprite aClass30_Sub2_Sub1_Sub1_1001
The sprite must have the colors on the left side of the image, and the transparency on the right side of it as shown in the sprite below.

You can also use blue (0, 0, 255 or 0000ff) in the opacity for the color to be the inverted color of what is behind the sprite.