I can't understand why that would be. I have all the code defined, the items registered, the textures set up, etc. Plus, it's even giving me errors for things that worked previously.
I still haven't gotten a fix to my problem yet. I'll include the code and the error below.
Code:
//Coded by dudeofx
package net.minecraft.src;
import java.util.Random;
public class mod_dnditems extends BaseMod{
public mod_dnditems()
{
//TODO List
addNames();
setTextures();
registerBlocks();
addRecipes();
addSmelting();
}
public void addNames()
{
ModLoader.AddName(sunrod, "Sun Rod");
ModLoader.AddName(cutemerald, "Emerald");
ModLoader.AddName(ruby, "Ruby");
ModLoader.AddName(garnet, "Garnet");
ModLoader.AddName(moonstone, "Moonstone");
ModLoader.AddName(jade, "Jade");
ModLoader.AddName(amber, "Amber");
ModLoader.AddName(pearl, "Pearl");
ModLoader.AddName(peridot, "Peridot");
ModLoader.AddName(turquoise, "Turquoise");
ModLoader.AddName(alexandrite, "Alexandrite");
ModLoader.AddName(aquamarine, "Aquamarine");
ModLoader.AddName(blackpearl, "Black Pearl");
ModLoader.AddName(fireopal, "Fire Opal");
ModLoader.AddName(jacinth, "Jacinth");
ModLoader.AddName(cutdiamond, "Rare Diamond");
ModLoader.AddName(sapphire, "Sapphire");
ModLoader.AddName(amethyst, "Amethyst");
ModLoader.AddName(ritualtable, "Ritual Table");
ModLoader.AddName(soulgem, "Soul Gem");
ModLoader.AddName(coingold, "Gold Coin");
ModLoader.AddName(coinsilver, "Silver Coin");
ModLoader.AddName(coincopper, "Copper Coin");
ModLoader.AddName(coinplatinum, "Platinum Coin");
ModLoader.AddName(coinastral, "Astral Diamond");
ModLoader.AddName(quarterstaff, "Quarterstaff");
ModLoader.AddName(javelin, "Javelin");
ModLoader.AddName(greatclub, "Greatclub");
ModLoader.AddName(dagger, "Dagger");
ModLoader.AddName(crossbow, "Crossbow");
ModLoader.AddName(morningstar, "Morning Star");
ModLoader.AddName(scythe, "Scythe");
ModLoader.AddName(club, "Club");
ModLoader.AddName(sling, "Sling");
ModLoader.AddName(mace, "Mace");
ModLoader.AddName(sickle, "Sickle");
ModLoader.AddName(spear, "Spear");
ModLoader.AddName(halberd, "Halberd");
ModLoader.AddName(longbow, "Longbow");
ModLoader.AddName(handaxe, "Handaxe");
ModLoader.AddName(shortsword, "Short Sword");
ModLoader.AddName(longsword, "Longsword");
ModLoader.AddName(maul, "Maul");
ModLoader.AddName(greataxe, "Greataxe");
ModLoader.AddName(warpick, "War Pick");
ModLoader.AddName(bastardsword, "******* Sword");
ModLoader.AddName(warhammer, "Warhammer");
ModLoader.AddName(flail, "Flail");
ModLoader.AddName(battleaxe, "Battleaxe");
ModLoader.AddName(throwinghammer, "Throwing Hammer");
ModLoader.AddName(scimitar, "Scimitar");
ModLoader.AddName(glaive, "Glaive");
}
public void setTextures()
{
coingold.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/coingold.png");
coinsilver.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/coinsilver.png");
coincopper.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/coincopper.png");
coinplatinum.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/coinplatinum.png");
coinastral.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/coinastral.png");
topaz.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/topaz.png");
amber.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/amber.png");
garnet.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/garnet.png");
moonstone.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/moonstone.png");
jade.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/jade.png");
pearl.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/pearl.png");
peridot.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/peridot.png");
turquoise.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/turquoise.png");
alexandrite.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/alexandrite.png");
aquamarine.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/aquamarine.png");
blackpearl.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/blackpearl.png");
fireopal.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/fireopal.png");
jacinth.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/jacinth.png");
cutdiamond.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/diamond.png");
cutemerald.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/emerald.png");
ruby.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/ruby.png");
sapphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/sapphire.png");
amethyst.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/amethyst.png");
soulgem.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/soulgem.png");
sunrod.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/sunrod.png");
quarterstaff.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/quarterstaff.png");
javelin.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/javelin.png");
greatclub.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/greatclub.png");
dagger.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/dagger.png");
crossbow.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/crossbow.png");
morningstar.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/morningstar.png");
scythe.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/scythe.png");
club.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/club.png");
sling.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/sling.png");
mace.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/mace.png");
sickle.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/sickle.png");
spear.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/spear.png");
halberd.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/halberd.png");
longbow.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/longbow.png");
handaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/handaxe.png");
shortsword.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/shortsword.png");
longsword.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/longsword.png");
maul.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/maul.png");
greataxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/greataxe.png");
warpick.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/warpick.png");
bastardsword.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/bastardsword.png");
warhammer.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/warhammer.png");
flail.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/flail.png");
battleaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/battleaxe.png");
throwinghammer.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/throwinghammer.png");
scimitar.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/scimitar.png");
glaive.iconIndex = ModLoader.addOverride("/gui/items.png", "/dudeofx/glaive.png");
}
public void registerBlocks()
{
}
public void addRecipes()
{
ModLoader.AddRecipe(new ItemStack(sunrod, 1), new Object[] {
" H ", " S ", " S ", Character.valueOf('H'), Block.glowStone, Character.valueOf('S'), Item.blazeRod
});
ModLoader.AddRecipe(new ItemStack(quarterstaff, 1)), new Object[] {
" G", " G ", "G ", Character.valueOf('G'), Item.stick
});
}
}
public void addSmelting()
{
}
public static Item amethyst;
public static Item amber;
public static Item garnet;
public static Item moonstone;
public static Item jade;
public static Item pearl;
public static Item peridot;
public static Item turquoise;
public static Item topaz;
public static Item alexandrite;
public static Item aquamarine;
public static Item blackpearl;
public static Item cutemerald;
public static Item sapphire;
public static Item fireopal;
public static Item jacinth;
public static Item cutdiamond;
public static Item ruby;
public static Item soulgem;
public static Item coingold;
public static Item coinsilver;
public static Item coincopper;
public static Item coinplatinum;
public static Item coinastral;
public static Item sunrod;
public static Item quarterstaff;
public static Item javelin;
public static Item greatclub;
public static Item dagger;
public static Item morningstar;
public static Item scythe;
public static Item crossbow;
public static Item club;
public static Item sling;
public static Item mace;
public static Item sickle;
public static Item spear;
public static Item halberd;
public static Item longbow;
public static Item handaxe;
public static Item shortsword;
public static Item longsword;
public static Item maul;
public static Item greataxe;
public static Item warpick;
public static Item bastardsword;
public static Item warhammer;
public static Item flail;
public static Item battleaxe;
public static Item throwinghammer;
public static Item scimitar;
public static Item glaive;
static
{
coingold = (new Item(400)).setItemName("coingold");
coinsilver = (new Item(401)).setItemName("coinsilver");
coincopper = (new Item(402)).setItemName("coincopper");
coinplatinum = (new Item(403)).setItemName("coinplatinum");
coinastral = (new Item(404)).setItemName("coinastral");
amber = (new Item(405)).setItemName("amber");
amethyst = (new Item(406)).setItemName("amethyst");
garnet = (new Item(407)).setItemName("garnet");
moonstone = (new Item(408)).setItemName("moonstone");
jade = (new Item(409)).setItemName("jade");
pearl = (new Item(410)).setItemName("pearl");
peridot = (new Item(411)).setItemName("peridot");
turquoise = (new Item(412)).setItemName("turquoise");
alexandrite = (new Item(413)).setItemName("alexandrite");
aquamarine = (new Item(414)).setItemName("aquamarine");
blackpearl = (new Item(415)).setItemName("blackpearl");
topaz = (new Item(416)).setItemName("topaz");
cutemerald = (new Item(417)).setItemName("cutemerald");
fireopal = (new Item(418)).setItemName("fireopal");
sapphire = (new Item(419)).setItemName("sapphire");
cutdiamond = (new Item(420)).setItemName("cutdiamond");
jacinth = (new Item(421)).setItemName("jacinth");
ruby = (new Item(422)).setItemName("ruby");
soulgem = (new Item(423)).setContainerItem(hollowsoulgem).setItemName("soulgem");
sunrod = (new ItemSunrod(425)).setItemName("sunrod");
quarterstaff = (new Item(426)).setItemName("quarterstaff");
javelin = (new Item(427)).setItemName("javelin");
greatclub = (new Item(428)).setItemName("greatclub");
dagger = (new Item(429)).setItemName("dagger");
crossbow = (new Item(430)).setItemName("crossbow");
morningstar = (new Item(431)).setItemName("morningstar");
scythe = (new Item(432)).setItemName("scythe");
club = (new Item(433)).setItemName("club");
sling = (new Item(434)).setItemName("sling");
mace = (new Item(435)).setItemName("mace");
sickle = (new Item(436)).setItemName("sickle");
spear = (new Item(437)).setItemName("spear");
halberd = (new Item(438)).setItemName("halberd");
longbow = (new Item(439)).setItemName("longbow");
handaxe = (new Item(440)).setItemName("handaxe");
shortsword = (new Item(441)).setItemName("shortsword");
longsword = (new Item(442)).setItemName("longsword");
maul = (new Item(443)).setItemName("maul");
warpick = (new Item(445)).setItemName("warpick");
bastardsword = (new Item(446)).setItemName("bastardsword");
warhammer = (new Item(447)).setItemName("warhammer");
flail = (new Item(448)).setItemName("flail");
battleaxe = (new Item(449)).setItemName("battleaxe");
throwinghammer = (new Item(450)).setItemName("throwinghammer");
scimitar = (new Item(451)).setItemName("scimitar");
glaive = (new Item(452)).setItemName("glaive");
}
public String getVersion()
{
return "Dungeons And Dragons";
}
public void load()
{
}
}
Error:
public static Item spear;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:190: class, interface, or enum
expected
public static Item halberd;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:191: class, interface, or enum
expected
public static Item longbow;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:192: class, interface, or enum
expected
public static Item handaxe;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:193: class, interface, or enum
expected
public static Item shortsword;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:194: class, interface, or enum
expected
public static Item longsword;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:195: class, interface, or enum
expected
public static Item maul;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:196: class, interface, or enum
expected
public static Item greataxe;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:197: class, interface, or enum
expected
public static Item warpick;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:198: class, interface, or enum
expected
public static Item bastardsword;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:199: class, interface, or enum
expected
public static Item warhammer;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:200: class, interface, or enum
expected
public static Item flail;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:201: class, interface, or enum
expected
public static Item battleaxe;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:202: class, interface, or enum
expected
public static Item throwinghammer;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:203: class, interface, or enum
expected
public static Item scimitar;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:204: class, interface, or enum
expected
public static Item glaive;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:207: class, interface, or enum
expected
{
^
src\minecraft\net\minecraft\src\mod_dnditems.java:209: class, interface, or enum
expected
coinsilver = (new Item(401)).setItemName("coinsi
lver");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:210: class, interface, or enum
expected
coincopper = (new Item(402)).setItemName("coinco
pper");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:211: class, interface, or enum
expected
coinplatinum = (new Item(403)).setItemName("coin
platinum");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:212: class, interface, or enum
expected
coinastral = (new Item(404)).setItemName("coinas
tral");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:213: class, interface, or enum
expected
amber = (new Item(405)).setItemName("amber");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:214: class, interface, or enum
expected
amethyst = (new Item(406)).setItemName("amethyst
");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:215: class, interface, or enum
expected
garnet = (new Item(407)).setItemName("garnet");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:216: class, interface, or enum
expected
moonstone = (new Item(408)).setItemName("moonsto
ne");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:217: class, interface, or enum
expected
jade = (new Item(409)).setItemName("jade");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:218: class, interface, or enum
expected
pearl = (new Item(410)).setItemName("pearl");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:219: class, interface, or enum
expected
peridot = (new Item(411)).setItemName("peridot")
;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:220: class, interface, or enum
expected
turquoise = (new Item(412)).setItemName("turquoi
se");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:221: class, interface, or enum
expected
alexandrite = (new Item(413)).setItemName("alexa
ndrite");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:222: class, interface, or enum
expected
aquamarine = (new Item(414)).setItemName("aquama
rine");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:223: class, interface, or enum
expected
blackpearl = (new Item(415)).setItemName("blackp
earl");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:224: class, interface, or enum
expected
topaz = (new Item(416)).setItemName("topaz");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:225: class, interface, or enum
expected
cutemerald = (new Item(417)).setItemName("cuteme
rald");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:226: class, interface, or enum
expected
fireopal = (new Item(418)).setItemName("fireopal
");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:227: class, interface, or enum
expected
sapphire = (new Item(419)).setItemName("sapphire
");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:228: class, interface, or enum
expected
cutdiamond = (new Item(420)).setItemName("cutdia
mond");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:229: class, interface, or enum
expected
jacinth = (new Item(421)).setItemName("jacinth")
;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:230: class, interface, or enum
expected
ruby = (new Item(422)).setItemName("ruby");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:231: class, interface, or enum
expected
soulgem = (new Item(423)).setContainerItem(hollo
wsoulgem).setItemName("soulgem");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:232: class, interface, or enum
expected
sunrod = (new ItemSunrod(425)).setItemName("sunr
od");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:233: class, interface, or enum
expected
quarterstaff = (new Item(426)).setItemName("quar
terstaff");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:234: class, interface, or enum
expected
javelin = (new Item(427)).setItemName("javelin")
;
^
src\minecraft\net\minecraft\src\mod_dnditems.java:235: class, interface, or enum
expected
greatclub = (new Item(428)).setItemName("greatcl
ub");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:236: class, interface, or enum
expected
dagger = (new Item(429)).setItemName("dagger");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:237: class, interface, or enum
expected
crossbow = (new Item(430)).setItemName("crossbow
");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:238: class, interface, or enum
expected
morningstar = (new Item(431)).setItemName("morni
ngstar");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:239: class, interface, or enum
expected
scythe = (new Item(432)).setItemName("scythe");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:240: class, interface, or enum
expected
club = (new Item(433)).setItemName("club");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:241: class, interface, or enum
expected
sling = (new Item(434)).setItemName("sling");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:242: class, interface, or enum
expected
mace = (new Item(435)).setItemName("mace");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:243: class, interface, or enum
expected
sickle = (new Item(436)).setItemName("sickle");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:244: class, interface, or enum
expected
spear = (new Item(437)).setItemName("spear");
^
src\minecraft\net\minecraft\src\mod_dnditems.java:245: class, interface, or enum
expected
halberd = (new Item(438)).setItemName("halberd")
;
^
100 errors
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 8.77 seconds
Press any key to continue . . .
I literally can't fit the whole error in it :P. A response would be nice whenever you get the time. And would it be possible to make a tutorial for multiplayer support?
I still haven't gotten a fix to my problem yet. I'll include the code and the error below.
I haven't messed with multiplayer support much, but I wanted to. I was planning on messing with it when MCP updated, which has now, so maybe a tutorial on it soon.
I'm not sure if this will work, but change everything so it's like this and get rid of the static { } completely.
public static Item coingold =(newItem(400)).setItemName("coingold");
Do you know how to fix lighting issues with custom block renders?
I have a block that has different shapes using meta data, and a render class for it.
Everything works correctly except the lighting in the cut away zones turns out very dark.
package net.minecraft.src;
public class RenderBlockCloud extends RenderBlocks
{
public static boolean renderV(Block block, int i, int j, int k, RenderBlocks renderblocks, int subBlock)
{
boolean flag = false;
switch (subBlock)
{
case 0: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 1: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 2: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 3: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 4: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 5: flag = StandardBlock(block, i, j, k, renderblocks); break;
}
if (!flag) flag = StandardBlock(block, i, j, k, renderblocks);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
return flag;
}
public static boolean renderLDS(Block block, int i, int j, int k, RenderBlocks renderblocks, int subBlock)
{
boolean flag = false;
switch (subBlock)
{
case 0: flag = StandardBlock(block, i, j, k, renderblocks); break;
case 1: flag = SlabBlock (block, i, j, k, renderblocks, 1); break;
case 2: flag = SlabBlock (block, i, j, k, renderblocks, 2); break;
case 3: flag = StairBlock (block, i, j, k, renderblocks, 1); break;
case 4: flag = StairBlock (block, i, j, k, renderblocks, 2); break;
case 5: flag = StairBlock (block, i, j, k, renderblocks, 3); break;
case 6: flag = StairBlock (block, i, j, k, renderblocks, 4); break;
case 7: flag = StairBlock (block, i, j, k, renderblocks, 5); break;
case 8: flag = StairBlock (block, i, j, k, renderblocks, 6); break;
case 9: flag = StairBlock (block, i, j, k, renderblocks, 7); break;
case 10: flag = StairBlock (block, i, j, k, renderblocks, 8); break;
}
if (!flag) flag = StandardBlock(block, i, j, k, renderblocks);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
return flag;
}
public static boolean StandardBlock(Block block, int i, int j, int k, RenderBlocks renderblocks)
{
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
return true;
}
public static boolean SlabBlock(Block block, int i, int j, int k, RenderBlocks renderblocks, int type)
{
boolean flag = false;
switch (type)
{
case 1: //Slab Top
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 2: //Slab Bottom
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
}
return flag;
}
public static boolean StairBlock(Block block, int i, int j, int k, RenderBlocks renderblocks, int type)
{
boolean flag = false;
switch(type)
{
case 1: //Stairs N
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 0.5F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 2: //Stairs E
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 3: //Stairs S
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 4: //Stairs W
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 5: //Upside Down Stairs N
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 6: //Upside Down Stairs E
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 7: //Upside Down Stairs S
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
case 8: //Upside Down Stairs W
block.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
renderblocks.renderStandardBlock(block, i, j, k);
flag = true;
break;
}
return flag;
}
}
Looks like you just need a semicolon at the end of the lines of code. Whenever the code has a number next to the line, that's the line you need a semicolon at the end of.
my error is that the block is invisible, what's wrong with my code that causes it to run but not crash? The console says this: at net.minecraft.src.ThreadDownloadImage.run(
Do you think you could make a tutorial on making new crops, armor without editing ANY base classes, trees w/sapling and how to get the tree to generate, and custom bonemeal that grows the custom sapling and crop? I hope thats not to much.
What you need to do first is make a new class, like GuiMuserae.java
This tutorial is just the Template for a basic GUI, the next one will be with buttons and text.
I've added comments to the code so each method can be explained
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class GuiMuserae extends GuiScreen
{
int x = (width - 176 ) / 2;
int y = (height - 166) / 2;
private static String backgroundImg;
public GuiMuserae()
{
super();
//Calls which image to display
backgroundImg = "/Folder/GuiImage.png";
}
//If false, won't pause the game when the GUI is open.
//If true, it will pause the game when open.
public boolean doesGuiPauseGame()
{
return false;
}
//When the GUI closes, x happens
public void onGuiClosed(){}
//This is where you put buttons
public void initGui()
{
controlList.clear();
}
//This is where buttons are told what to do when clicked
protected void actionPerformed(GuiButton guibutton)
{
}
//This is where it says what text and image to use
public void drawScreen(int i, int j, float f)
{
drawDefaultBackground();
try
{
int pic = mc.renderEngine.getTexture(backgroundImg);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(pic);
drawTexturedModalRect(x, y, 0, 0, 176, 166);
}
finally
{
}
super.drawScreen(i, j, f);
}
}
All of these would go into your GuiWhatever.java in the drawScreen method
This tutorial will teach you how to add centered and non-centered texts and strings
public void drawScreen(int i, int j, float f)
{
drawDefaultBackground();
try
{
int pic = mc.renderEngine.getTexture(backgroundImg);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(pic);
drawTexturedModalRect(x, y, 0, 0, 176, 166);
}
finally
{
}
//This adds the text to the game. It will add whatever is within the " "
//width / 2 is the width location, height / 2 is the height location, and 0xffffff is the text color.
//If you wanted it centered, change drawString to drawCenteredString
drawString(fontRenderer, "Whatever Text You Want Here", (width / 2, height / 2 , 0xffffff);
//The difference with this one is instead of " ", it's displaying a string. A string example is your score because the int changes.
drawString(fontRenderer, stringNameHere, (width / 2, height / 2, 0xffffff);
super.drawScreen(i, j, f);
}
All of these will go into your GuiWhatever.java in the initGui and actionPerformed methods
//This will be used later for making buttons disabled
private GuiButton buttonName;
public void initGui()
{
controlList.clear();
//the 1 is the button ID, width / 2 is width location, height / 2 is height location, 98 is button size (length)
//20 is button size (height)(don't change this), and Button Name is what is displayed on the button
controlList.add(buttonName = new GuiButton(1, width / 2, height / 2, 98, 20, "Button Name"));
}
protected void actionPerformed(GuiButton guibutton)
{
if(guibutton.id == 1)
{
//if true, you can click. If false, you can't
buttonName.enabled = false;
}
}
Code:
Error:
I literally can't fit the whole error in it :P. A response would be nice whenever you get the time. And would it be possible to make a tutorial for multiplayer support?
I haven't messed with multiplayer support much, but I wanted to. I was planning on messing with it when MCP updated, which has now, so maybe a tutorial on it soon.
I'm not sure if this will work, but change everything so it's like this and get rid of the static { } completely.
public static Item coingold = (new Item(400)).setItemName("coingold");
Code:
I have a block that has different shapes using meta data, and a render class for it.
Everything works correctly except the lighting in the cut away zones turns out very dark.
you need to change the second "Item" to the name of your items class file
I don't think that's how it works. The code has worked fine before, even without custom item files.
Maybe?
my code:
public
void setTextures()
{
dirt2.blockIndexInTexture = ModLoader.addOverride("/gui/items.png", "/Dirt/dirt.png")
}
my error is that the block is invisible, what's wrong with my code that causes it to run but not crash?
The console says this:
at net.minecraft.src.ThreadDownloadImage.run(
ThreadDownloadImage.java:35)
Tired of the same old maze maps? Me too! Click here for an endless maze, in which you try to survive and it's randomly generated so it's different every time!
it should be terrain.png
This, and how to make them repel as well.
Also, would it be possible to make a block heal you if you're within two blocks of it? I really need to figure this one out. :/
Be sure to check out my texture pack: Easy Ores!
What you need to do first is make a new class, like GuiMuserae.java
This tutorial is just the Template for a basic GUI, the next one will be with buttons and text.
I've added comments to the code so each method can be explained
All of these would go into your GuiWhatever.java in the drawScreen method
This tutorial will teach you how to add centered and non-centered texts and strings