How-To: KungFu Chicken [For 1.1.2_01 client only!]
+5
Kiada
alecn1519
Tei
Sage_pourpre
KungFuHamster
9 posters
Page 1 of 1
How-To: KungFu Chicken [For 1.1.2_01 client only!]
This post is deprecated. The class, method, and variable names have all changed with the recent Halloween "Boo" update. Please, use this as an example of the kinds of things you can do, but keep in mind that things have changed and you will not be able to follow this exactly.
See my page here for information on how I currently decompile and recompile, and what resources I use for research and development:
http://www.minecraftwiki.net/wiki/User:KungFuHamster
Goals:
- Basic: Adding a new chicken food item to Minecraft
- Bonus: Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
- Extra Credit: Baking that item to make it give more health
Adding a new food item to Minecraft
Prerequisites:
- Decompiled Minecraft source
- Compiler that works
(See this thread for getting started.)
Look at your decompiled di.class, the di.java code. Around line 185 after the line with di.aP, insert the following two lines:
This adds two new items. Let's dissect this structure: (new oj(x,y)).a(z)
oj: The basic food class
x: The Item ID. Arbitrary, but make sure you insert unique IDs, in order. These lines are after di.aP (ID 90, fishing rod) and before di.aQ (ID 2000, gold record) so I just picked two arbitrary numbers in between that range, 200 and 201. Check the Wiki for more detailed item information.
y: The second argument refers to how many half-hearts the item can heal. In this case, raw chicken isn't very good, but cooked chicken is yumalicious. I considered making raw chicken a "negative heal" (totally possible) to indicate that you should never eat raw chicken for fear of salmonella poisoning, but I decided to err on the side of fun.
z: The Zth icon in the items.png image. You'll have to create new graphics to use for your item, or you can reuse old ones if you are boring.
Compile di.java and place it in your minecraft.jar, per directions located elsewhere.
That's it for adding a basic item. You can't do anything with it yet, but it's there.
Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
Since I had decided I wanted chickens to be "pluckable" to obtain their feathers, making them drop meat when they died made sense to me.
Decompile your mz.class; this is the code that controls the chicken.
Find the code that says:
Change it to read:
This method, g(), returns the class of the item the chicken should drop when it dies. di.J.aS means "drop feathers (di.J) in the standard amount." I replaced feathers with our new raw chicken item, which has a more friendly name than the obfuscated names in the rest of the source.
Near the bottom of the chicken source, you'll see some variable declarations. Add the following:
This creates a new variable in the chicken class that lets you track how many feathers it has. aQ.nextInt(5) means generate a random integer from 0 to 4, and the +1 means it'll be 1 to 5. Our chicken will have anywhere from 1 to 5 feathers when it is spawned.
I looked in the cow source (am.java) because it had a right-click action, the template of which is: "public boolean a(dm dm1)"
Based on that method, I created a new method for plucking the chicken that checks how many feathers our chicken has, and decrements them if it has any, and kills the chicken when it is out of feathers so that our chicken is not an infinite source of feathers. Our new chicken-plucking routine looks like this:
And that's it! Recompile your mz.java and insert the resulting mz.class into your minecraft.jar and your chicken now has a random amount of feathers which can be harvested by right-clicking until it dies.
Baking that item to make it give more health
The last step in creating KungFu Chicken is to add the mapping for cooked chicken to your furnace.
Decompile ke.class and bring up the source.
Lines 197 to 210 in the source indicate the exchanges for baked/smelted items like glass, pork, iron ore, etc. After line 210, insert the following:
Recompile ke.java and insert the new ke.class into your minecraft.jar and you can now cook your chicken!
Here's the items.png file I used. It has the arrows from Risugami's Arrows mod too, just ignore that part...
The method and variable names will all change and this tutorial will be almost useless with the next update (presumed to be the Boo update, October 31, 2010.) Hopefully Notch will implement some API stuff soon so we don't have to change integral classes but can instead just tack on our own mods non-destructively.
(Eating works fine, I was just sloppy.)
This post is deprecated. The class, method, and variable names have all changed with the recent Halloween "Boo" update. Please, use this as an example of the kinds of things you can do, but keep in mind that things have changed and you will not be able to follow this exactly.[i]
See my page here for information on how I currently decompile and recompile, and what resources I use for research and development:
http://www.minecraftwiki.net/wiki/User:KungFuHamster
Goals:
- Basic: Adding a new chicken food item to Minecraft
- Bonus: Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
- Extra Credit: Baking that item to make it give more health
Adding a new food item to Minecraft
Prerequisites:
- Decompiled Minecraft source
- Compiler that works
(See this thread for getting started.)
Look at your decompiled di.class, the di.java code. Around line 185 after the line with di.aP, insert the following two lines:
- Code:
public static di itemChickenRaw = (new oj(200, 2)).a(217);
public static di itemChickenCooked = (new oj(201, 8)).a(218);
This adds two new items. Let's dissect this structure: (new oj(x,y)).a(z)
oj: The basic food class
x: The Item ID. Arbitrary, but make sure you insert unique IDs, in order. These lines are after di.aP (ID 90, fishing rod) and before di.aQ (ID 2000, gold record) so I just picked two arbitrary numbers in between that range, 200 and 201. Check the Wiki for more detailed item information.
y: The second argument refers to how many half-hearts the item can heal. In this case, raw chicken isn't very good, but cooked chicken is yumalicious. I considered making raw chicken a "negative heal" (totally possible) to indicate that you should never eat raw chicken for fear of salmonella poisoning, but I decided to err on the side of fun.
z: The Zth icon in the items.png image. You'll have to create new graphics to use for your item, or you can reuse old ones if you are boring.
Compile di.java and place it in your minecraft.jar, per directions located elsewhere.
That's it for adding a basic item. You can't do anything with it yet, but it's there.
Making it drop from a critter when it dies, and adding a new "pluck" ability to our chicken to repurpose the feathers
Since I had decided I wanted chickens to be "pluckable" to obtain their feathers, making them drop meat when they died made sense to me.
Decompile your mz.class; this is the code that controls the chicken.
Find the code that says:
- Code:
protected int g()
{
return di.J.aS;
}
Change it to read:
- Code:
protected int g()
{
return di.itemChickenRaw.aS;
// return di.J.aS; // feather
}
This method, g(), returns the class of the item the chicken should drop when it dies. di.J.aS means "drop feathers (di.J) in the standard amount." I replaced feathers with our new raw chicken item, which has a more friendly name than the obfuscated names in the rest of the source.
Near the bottom of the chicken source, you'll see some variable declarations. Add the following:
- Code:
public int feathers = aQ.nextInt(5) + 1;
This creates a new variable in the chicken class that lets you track how many feathers it has. aQ.nextInt(5) means generate a random integer from 0 to 4, and the +1 means it'll be 1 to 5. Our chicken will have anywhere from 1 to 5 feathers when it is spawned.
I looked in the cow source (am.java) because it had a right-click action, the template of which is: "public boolean a(dm dm1)"
Based on that method, I created a new method for plucking the chicken that checks how many feathers our chicken has, and decrements them if it has any, and kills the chicken when it is out of feathers so that our chicken is not an infinite source of feathers. Our new chicken-plucking routine looks like this:
- Code:
public boolean a(dm dm1) // right click
{
if (feathers > 1)
{
feathers--; // decrease feather pool
b(di.J.aS, 1); // drop a feather on the ground
return true;
} else
if (feathers == 1) //
{
feathers--; // not really necessary...
b(di.J.aS, 1); // drop one last feather
a(this, 20); // do 20 damage! dead chicken. :(
return true;
}
return false;
}
And that's it! Recompile your mz.java and insert the resulting mz.class into your minecraft.jar and your chicken now has a random amount of feathers which can be harvested by right-clicking until it dies.
Baking that item to make it give more health
The last step in creating KungFu Chicken is to add the mapping for cooked chicken to your furnace.
Decompile ke.class and bring up the source.
Lines 197 to 210 in the source indicate the exchanges for baked/smelted items like glass, pork, iron ore, etc. After line 210, insert the following:
- Code:
if (k == di.itemChickenRaw.aS)
return di.itemChickenCooked.aS;
Recompile ke.java and insert the new ke.class into your minecraft.jar and you can now cook your chicken!
Here's the items.png file I used. It has the arrows from Risugami's Arrows mod too, just ignore that part...
The method and variable names will all change and this tutorial will be almost useless with the next update (presumed to be the Boo update, October 31, 2010.) Hopefully Notch will implement some API stuff soon so we don't have to change integral classes but can instead just tack on our own mods non-destructively.
(Eating works fine, I was just sloppy.)
This post is deprecated. The class, method, and variable names have all changed with the recent Halloween "Boo" update. Please, use this as an example of the kinds of things you can do, but keep in mind that things have changed and you will not be able to follow this exactly.[i]
Last edited by KungFuHamster on Thu Nov 04, 2010 9:00 am; edited 5 times in total (Reason for editing : Deprecated)
KungFuHamster- Posts : 11
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Wow... Thank you !
Edit : Added link here to the Advanced modding thread on officials forums.
Edit : Added link here to the Advanced modding thread on officials forums.
Sage_pourpre- Posts : 6
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
I only have a surface level understanding of what's going on with a lot of this stuff, and I owe everything I did correctly to the Advanced Modding Thread @ minecraftforum.net, the #mcc channel on irc.Esper.Net, and the modding spreadsheet of course.
If anyone has any input as to why I can't eat the food, I'd love to fix that!
Thanks.
Edited to add credits.
If anyone has any input as to why I can't eat the food, I'd love to fix that!
Thanks.
Edited to add credits.
Last edited by KungFuHamster on Sat Oct 16, 2010 4:31 pm; edited 1 time in total
KungFuHamster- Posts : 11
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Well I guess it was sloppy dev practices that bit me. Eating the chicken is working now, with just the code listed in the original post.
KungFuHamster- Posts : 11
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Thanks for the awesome, in depth tutorial. I hope to create a few objects and release tutorials on here soon if I can figure them out.
alecn1519- Posts : 2
Join date : 2010-10-16
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
This is ridiculously helpful, thanks a bunch for getting this up!
Kiada- Posts : 2
Join date : 2010-10-18
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Can you explain where to find di.class?
If I decompile minecarft.jar in JD-GUI I get LZMA, META-INF, and net as folders. In the folders are .java files.
LZMA
- CRangeDecoder.java
- LzmaException.java
- LzmaInputStream.java
net
- GameUpdater.java
- Launcher.java
- LauncherFrame.java
- LoginForm.java
- MinecraftLauncher.java
- Util.java
I must have missed something.
If I decompile minecarft.jar in JD-GUI I get LZMA, META-INF, and net as folders. In the folders are .java files.
LZMA
- CRangeDecoder.java
- LzmaException.java
- LzmaInputStream.java
net
- GameUpdater.java
- Launcher.java
- LauncherFrame.java
- LoginForm.java
- MinecraftLauncher.java
- Util.java
I must have missed something.
BeerNuts- Posts : 1
Join date : 2010-10-21
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
This thread should answer a lot of your questions: http://www.minecraftforum.net/viewtopic.php?f=25&t=47098
Specifically, use the Mod Creator pack linked in the mod list; it will decompile the source for you and provide source fixes to common problems.
Specifically, use the Mod Creator pack linked in the mod list; it will decompile the source for you and provide source fixes to common problems.
KungFuHamster- Posts : 11
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
also, you are probably decompiling the launcher, no the game
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
I need some help on this.. I tried to follow the tutorial to the best of my abilities and It seems I've run into a black screen
So first what I did was, with the Mod creator pack I decompiled my minecraft.jar file.
And from the sources folder, I edited di.java and mz.java as KungFuHamster wrote.. So here is what my coding looks like in the .java files
For the DI.Java this is it
And here is the code for MZ.Java
I then recompiled using Mod creator pack ( I didn't bother with the cooking for now, ke.java ) and now I believe from this point on, I'm doing something wrong..
After I recompiled it I went into the temp folder within the Mod creator pack folder, and that's where the class files were.. I took the mz and di class files and put it in my minecraft.jar and when I launched the game it gave me a black screen..
What am I doing wrong? Please someone help me out?!?
So first what I did was, with the Mod creator pack I decompiled my minecraft.jar file.
And from the sources folder, I edited di.java and mz.java as KungFuHamster wrote.. So here is what my coding looks like in the .java files
For the DI.Java this is it
- Code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.io.PrintStream;
import java.util.Random;
public class di
{
protected di(int i)
{
field_290_aT = 64;
field_289_aU = 32;
field_287_aW = false;
field_291_aS = 256 + i;
if(field_233_c[256 + i] != null)
{
System.out.println((new StringBuilder()).append("CONFLICT @ ").append(i).toString());
}
field_233_c[256 + i] = this;
}
public di func_205_a(int i)
{
field_288_aV = i;
return this;
}
public int func_196_a(ev ev)
{
return field_288_aV;
}
public boolean func_192_a(ev ev, dm dm, cn cn, int i, int j, int k, int l)
{
return false;
}
public float func_204_a(ev ev, ly ly1)
{
return 1.0F;
}
public ev func_193_a(ev ev, cn cn, dm dm)
{
return ev;
}
public int func_200_b()
{
return field_290_aT;
}
public int func_197_c()
{
return field_289_aU;
}
public void func_202_a(ev ev, ge ge)
{
}
public void func_203_a(ev ev, int i, int j, int k, int l)
{
}
public int func_198_a(kh kh)
{
return 1;
}
public boolean func_195_a(ly ly1)
{
return false;
}
public void func_201_b(ev ev, ge ge)
{
}
public di func_199_d()
{
field_287_aW = true;
return this;
}
public boolean func_194_a()
{
return field_287_aW;
}
protected static Random field_234_b = new Random();
public static di field_233_c[] = new di[32000];
public static di field_232_d = (new ms(0, 2)).func_205_a(82);
public static di field_231_e = (new y(1, 2)).func_205_a(98);
public static di field_230_f = (new ks(2, 2)).func_205_a(114);
public static di field_229_g = (new nx(3)).func_205_a(5);
public static di field_228_h = (new oj(4, 4)).func_205_a(10);
public static di field_227_i = (new jg(5)).func_205_a(21);
public static di field_226_j = (new di(6)).func_205_a(37);
public static di field_225_k = (new di(7)).func_205_a(7);
public static di field_224_l = (new di(8)).func_205_a(55);
public static di field_223_m = (new di(9)).func_205_a(23);
public static di field_222_n = (new di(10)).func_205_a(39);
public static di field_221_o = (new iu(11, 2)).func_205_a(66);
public static di field_220_p = (new iu(12, 0)).func_205_a(64);
public static di field_219_q = (new ms(13, 0)).func_205_a(80);
public static di field_218_r = (new y(14, 0)).func_205_a(96);
public static di field_217_s = (new ks(15, 0)).func_205_a(112);
public static di field_216_t = (new iu(16, 1)).func_205_a(65);
public static di field_215_u = (new ms(17, 1)).func_205_a(81);
public static di field_214_v = (new y(18, 1)).func_205_a(97);
public static di field_213_w = (new ks(19, 1)).func_205_a(113);
public static di field_212_x = (new iu(20, 3)).func_205_a(67);
public static di field_211_y = (new ms(21, 3)).func_205_a(83);
public static di field_210_z = (new y(22, 3)).func_205_a(99);
public static di field_268_A = (new ks(23, 3)).func_205_a(115);
public static di field_266_B = (new di(24)).func_205_a(53).func_199_d();
public static di field_264_C = (new di(25)).func_205_a(71);
public static di field_263_D = (new ap(26, 10)).func_205_a(72);
public static di field_261_E = (new iu(27, 0)).func_205_a(68);
public static di field_259_F = (new ms(28, 0)).func_205_a(84);
public static di field_257_G = (new y(29, 0)).func_205_a(100);
public static di field_255_H = (new ks(30, 0)).func_205_a(116);
public static di field_253_I = (new di(31)).func_205_a(8);
public static di field_251_J = (new di(32)).func_205_a(24);
public static di field_250_K = (new di(33)).func_205_a(40);
public static di field_249_L = (new fu(34, 0)).func_205_a(128);
public static di field_248_M = (new fu(35, 1)).func_205_a(129);
public static di field_247_N = (new fu(36, 2)).func_205_a(130);
public static di field_246_O = (new fu(37, 3)).func_205_a(131);
public static di field_245_P = (new fu(38, 1)).func_205_a(132);
public static di field_244_Q;
public static di field_243_R = (new di(40)).func_205_a(25);
public static di field_242_S = (new oj(41, 5)).func_205_a(41);
public static di field_241_T = (new mr(42, 0, 0, 0)).func_205_a(0);
public static di field_240_U = (new mr(43, 0, 0, 1)).func_205_a(16);
public static di field_239_V = (new mr(44, 0, 0, 2)).func_205_a(32);
public static di field_238_W = (new mr(45, 0, 0, 3)).func_205_a(48);
public static di field_237_X = (new mr(46, 1, 1, 0)).func_205_a(1);
public static di field_236_Y = (new mr(47, 1, 1, 1)).func_205_a(17);
public static di field_235_Z = (new mr(48, 1, 1, 2)).func_205_a(33);
public static di field_286_aa = (new mr(49, 1, 1, 3)).func_205_a(49);
public static di field_285_ab = (new mr(50, 2, 2, 0)).func_205_a(2);
public static di field_284_ac = (new mr(51, 2, 2, 1)).func_205_a(18);
public static di field_283_ad = (new mr(52, 2, 2, 2)).func_205_a(34);
public static di field_282_ae = (new mr(53, 2, 2, 3)).func_205_a(50);
public static di field_281_af = (new mr(54, 3, 3, 0)).func_205_a(3);
public static di field_280_ag = (new mr(55, 3, 3, 1)).func_205_a(19);
public static di field_279_ah = (new mr(56, 3, 3, 2)).func_205_a(35);
public static di field_278_ai = (new mr(57, 3, 3, 3)).func_205_a(51);
public static di field_277_aj = (new mr(58, 1, 4, 0)).func_205_a(4);
public static di field_276_ak = (new mr(59, 1, 4, 1)).func_205_a(20);
public static di field_275_al = (new mr(60, 1, 4, 2)).func_205_a(36);
public static di field_274_am = (new mr(61, 1, 4, 3)).func_205_a(52);
public static di field_273_an = (new di(62)).func_205_a(6);
public static di field_272_ao = (new oj(63, 3)).func_205_a(87);
public static di field_271_ap = (new oj(64, 8)).func_205_a(88);
public static di field_270_aq = (new od(65)).func_205_a(26);
public static di field_269_ar = (new oj(66, 42)).func_205_a(11);
public static di field_267_as = (new md(67)).func_205_a(42);
public static di field_265_at;
public static di field_262_au = (new ac(69, 0)).func_205_a(74);
public static di field_260_av;
public static di field_258_aw;
public static di field_256_ax = (new jo(72, 0)).func_205_a(135);
public static di field_254_ay = (new jw(73)).func_205_a(104);
public static di field_252_az;
public static di field_309_aA = (new ef(75)).func_205_a(56);
public static di field_308_aB = (new bp(76)).func_205_a(14);
public static di field_307_aC = (new me(77)).func_205_a(136);
public static di field_306_aD = (new di(78)).func_205_a(103);
public static di field_305_aE = (new ac(79, -1)).func_205_a(77);
public static di field_304_aF = (new di(80)).func_205_a(22);
public static di field_303_aG = (new di(81)).func_205_a(57);
public static di field_302_aH;
public static di field_301_aI = (new di(83)).func_205_a(58);
public static di field_300_aJ = (new di(84)).func_205_a(59);
public static di field_299_aK = (new di(85)).func_205_a(30);
public static di field_298_aL = (new jo(86, 1)).func_205_a(151);
public static di field_297_aM = (new jo(87, 2)).func_205_a(167);
public static di field_296_aN = (new di(88)).func_205_a(12);
public static di field_295_aO = (new di(89)).func_205_a(54);
public static di field_294_aP = (new di(90)).func_205_a(69);
public static di itemChickenRaw = (new oj(200, 2)).a(217);
public static di itemChickenCooked = (new oj(201, 8)).a(218);
public static di field_293_aQ = (new lg(2000, "13")).func_205_a(240);
public static di field_292_aR = (new lg(2001, "cat")).func_205_a(241);
public static di field_132_itemCheese = (new oj(200, 10)).func_205_a(242);
public static di field_131_itemFriedEgg = (new oj(201, 12)).func_205_a(243);
public final int field_291_aS;
protected int field_290_aT;
protected int field_289_aU;
protected int field_288_aV;
protected boolean field_287_aW;
static
{
field_244_Q = (new jn(39, ly.field_447_aA.field_376_bc)).func_205_a(9);
field_265_at = (new ec(68, gb.field_1335_c)).func_205_a(43);
field_260_av = (new ac(70, ly.field_401_B.field_376_bc)).func_205_a(75);
field_258_aw = (new ac(71, ly.field_397_D.field_376_bc)).func_205_a(76);
field_252_az = (new ec(74, gb.field_1333_e)).func_205_a(44);
field_302_aH = (new gf(82, ly.field_423_aY)).func_205_a(27);
}
}
And here is the code for MZ.Java
- Code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.util.Random;
public class mz extends ag
{
public mz(cn cn1)
{
super(cn1);
field_753_a = false;
field_752_b = 0.0F;
field_758_c = 0.0F;
field_755_h = 1.0F;
field_728_u = "/mob/chicken.png";
func_371_a(0.3F, 0.4F);
field_717_E = 4;
field_754_i = field_630_aQ.nextInt(6000) + 6000;
}
public void func_425_j()
{
super.func_425_j();
field_756_e = field_752_b;
field_757_d = field_758_c;
field_758_c += (double)(field_600_av ? -1 : 4) * 0.29999999999999999D;
if(field_758_c < 0.0F)
{
field_758_c = 0.0F;
}
if(field_758_c > 1.0F)
{
field_758_c = 1.0F;
}
if(!field_600_av && field_755_h < 1.0F)
{
field_755_h = 1.0F;
}
field_755_h *= 0.90000000000000002D;
if(!field_600_av && field_607_ao < 0.0D)
{
field_607_ao *= 0.59999999999999998D;
}
field_752_b += field_755_h * 2.0F;
if(!field_615_ag.field_1026_y && --field_754_i <= 0)
{
field_615_ag.func_623_a(this, "mob.chickenplop", 1.0F, (field_630_aQ.nextFloat() - field_630_aQ.nextFloat()) * 0.2F + 1.0F);
func_367_b(di.field_296_aN.field_291_aS, 1);
field_754_i = field_630_aQ.nextInt(6000) + 6000;
}
}
protected void func_400_c(float f)
{
}
public void func_352_a(hm hm)
{
super.func_352_a(hm);
}
public void func_357_b(hm hm)
{
super.func_357_b(hm);
}
protected String func_423_c()
{
return "mob.chicken";
}
protected String func_414_d()
{
return "mob.chickenhurt";
}
protected String func_428_e()
{
return "mob.chickenhurt";
}
protected int func_422_g()
{
return di.itemChickenRaw.aS;
//return di.field_251_J.field_291_aS;
}
public boolean a(dm dm1) // right click
{
if (feathers > 1)
{
feathers--; // decrease feather pool
b(di.J.aS, 1); // drop a feather on the ground
return true;
} else
if (feathers == 1) //
{
feathers--; // not really necessary...
b(di.J.aS, 1); // drop one last feather
a(this, 20); // do 20 damage! dead chicken. :(
return true;
}
return false;
}
public boolean field_753_a;
public float field_752_b;
public float field_758_c;
public float field_757_d;
public float field_756_e;
public float field_755_h;
public int field_754_i;
public int feathers = aQ.nextInt(4) + 1;
}
I then recompiled using Mod creator pack ( I didn't bother with the cooking for now, ke.java ) and now I believe from this point on, I'm doing something wrong..
After I recompiled it I went into the temp folder within the Mod creator pack folder, and that's where the class files were.. I took the mz and di class files and put it in my minecraft.jar and when I launched the game it gave me a black screen..
What am I doing wrong? Please someone help me out?!?
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
wdrush wrote:After I recompiled it I went into the temp folder within the Mod creator pack folder, and that's where the class files were.. I took the mz and di class files and put it in my minecraft.jar and when I launched the game it gave me a black screen..
What am I doing wrong? Please someone help me out?!?
You used MCP 1.4 or 1.5 and the class files compiled with these versions are not compatible with the normal minecraft.jar. So it is currently not possible to put them into the minecraft.jar and that's the reason for the crash.
This will change in one of the next releases, but for the moment MCP 1.3 is the latest version that can be used to create compatible mods. Version 1.4 and 1.5 are the first step in creating a mod environment where mods will be compatible with future versions of minecraft, but that is still work in progress.
Searge- Posts : 15
Join date : 2010-10-17
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Oh I see. I was using version 1.5
Thank you so much for the help man, I'll use 1.3 and let you guys know what's up!
Thank you so much for the help man, I'll use 1.3 and let you guys know what's up!
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
Uhm, sorry to be a noob here, but I decompiled using version 1.3, and recompiled, and when I checked the minecraft folders, I only got a.class..
I don't know what's wrong..
-edit-
This is kind of weird. I ran the recompiler in administrative mode, and this is what I see on it..
-edit2-
I can't seem to get it right.. the minecraft_server after recompiling works, every class file seems to be there but the normal minecraft folder, the client one has nothing in it.. It's empty, like the compiler didn't even compile it at all.
What am I doing wrong?
I don't know what's wrong..
-edit-
This is kind of weird. I ran the recompiler in administrative mode, and this is what I see on it..
-edit2-
I can't seem to get it right.. the minecraft_server after recompiling works, every class file seems to be there but the normal minecraft folder, the client one has nothing in it.. It's empty, like the compiler didn't even compile it at all.
What am I doing wrong?
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
most probably javac is not on the path
http://www.java.com/en/download/help/path.xml
Your computer can find "javac"
you must change the enviromental variable PATH to include the folder of java/bin
another option is to change javac for "c:\whatever\java\bin\javac.exe" (using the correct path, not just whatever)
http://www.java.com/en/download/help/path.xml
Your computer can find "javac"
you must change the enviromental variable PATH to include the folder of java/bin
another option is to change javac for "c:\whatever\java\bin\javac.exe" (using the correct path, not just whatever)
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
My path should be fine.. This is it.. and I'm positive it works because when I type javac in cmd, it doesn't give me an error or anything, it prints out a whole bunch of commands. I've compiled a simple hello world script that I wrote in java, and it worked fine..
What I did was though, downloaded original .minecraft folder, and when I recompiled it, I saw every class file that should be there.. But, when I edited the mz.class file, and recompiled again, it wasn't there Everything else was,, just mz.class wasn't there... Which is disappointing.
What I did was though, downloaded original .minecraft folder, and when I recompiled it, I saw every class file that should be there.. But, when I edited the mz.class file, and recompiled again, it wasn't there Everything else was,, just mz.class wasn't there... Which is disappointing.
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
You should check if there are errors in your source. The compiler might not generate the class file if the source is not OK. Check the compile log file.wdrush wrote:My path should be fine.. This is it.. and I'm positive it works because when I type javac in cmd, it doesn't give me an error or anything, it prints out a whole bunch of commands. I've compiled a simple hello world script that I wrote in java, and it worked fine..
What I did was though, downloaded original .minecraft folder, and when I recompiled it, I saw every class file that should be there.. But, when I edited the mz.class file, and recompiled again, it wasn't there Everything else was,, just mz.class wasn't there... Which is disappointing.
Searge- Posts : 15
Join date : 2010-10-17
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
OMG YEES!! I GOT IT TO WORK!!
Could I make a video tutorial on this? I will give credits the kungfuhamster and link to this page for written introductions?
Could I make a video tutorial on this? I will give credits the kungfuhamster and link to this page for written introductions?
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
wdrush wrote:OMG YEES!! I GOT IT TO WORK!!
Could I make a video tutorial on this? I will give credits the kungfuhamster and link to this page for written introductions?
Please do!
KungFuHamster- Posts : 11
Join date : 2010-10-15
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
I'll have to do it tomorrow though when I'm not super tired..
wdrush- Posts : 7
Join date : 2010-10-24
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
KungfuHamster and Searge, I would like to thank you both for getting me started on Minecraft modding I spent my whole day adding new items and testing my abilities. So far I've added cooked/uncooked chicken into the game, along with pizza and hamburger. The pizza needs the eggs and cheese mod by willempiee in order for it to work.. Here is an in-game screenshot of the burger and pizza
The reason it took me long is because I had to teach myself how crafting works. To craft the pizza here is the formula:
-X
###
X = Cheese
# = Bread
- = Space (empty)
Here is the formula for Burger
#
B
#
B = cooked pork
# = bread
I'm planning on doing a video tutorial showing other how to do this stuff, but before that I want to be able to craft block type objects.. I'm really interested and eager to be able to mod furniture Like chairs and tables and stuff.
I was wondering if that would be possible or not..
Thanks again guys. You rock.
The reason it took me long is because I had to teach myself how crafting works. To craft the pizza here is the formula:
-X
###
X = Cheese
# = Bread
- = Space (empty)
Here is the formula for Burger
#
B
#
B = cooked pork
# = bread
I'm planning on doing a video tutorial showing other how to do this stuff, but before that I want to be able to craft block type objects.. I'm really interested and eager to be able to mod furniture Like chairs and tables and stuff.
I was wondering if that would be possible or not..
Thanks again guys. You rock.
wdrush- Posts : 7
Join date : 2010-10-24
Start.java not found
I can't get this to work. I've tried versions 1.6 and 1.3 and both give an error when I run test_game.bat after re-compiling:
C:\Users\Dell\Downloads\revengpack13\minecraft>test_game
Exception in thread "main" java.lang.NoClassDefFoundError: Start
Caused by: java.lang.ClassNotFoundException: Start
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Start. Program will exit.
Any ideas? Maybe the halloween update messes it up?
C:\Users\Dell\Downloads\revengpack13\minecraft>test_game
Exception in thread "main" java.lang.NoClassDefFoundError: Start
Caused by: java.lang.ClassNotFoundException: Start
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Start. Program will exit.
Any ideas? Maybe the halloween update messes it up?
shivers- Posts : 1
Join date : 2010-11-03
Re: How-To: KungFu Chicken [For 1.1.2_01 client only!]
From the bottom of my post at the beginning of the thread:
This post is deprecated. The class, method, and variable names have all changed with the recent Halloween "Boo" update. Please, use this as an example of the kinds of things you can do, but keep in mind that things have changed and you will not be able to follow this exactly.
I guess I'll put that at the top of the post and make the text large.
This post is deprecated. The class, method, and variable names have all changed with the recent Halloween "Boo" update. Please, use this as an example of the kinds of things you can do, but keep in mind that things have changed and you will not be able to follow this exactly.
I guess I'll put that at the top of the post and make the text large.
KungFuHamster- Posts : 11
Join date : 2010-10-15
Similar topics
» How-To: Change the time of day [Client 1.1.2 only!]
» Source code error correction after decompilation. (client)
» Source code error correction after decompilation. (client)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum