Im sure with Stairs/Slabs that there is a class like StairBlock or something that the block extends to avoid all that horrible boundingbox and orientation code
Yes, you can extend BlockStairs or BlockStep, but I show it the way I do so that people do not become dependant on pre-made classes. They learn nothing by extending a class, but doing it the way I do in my tutorial, they can see and and work with the actual code that does the work.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Simply remove it then change the getVersion String to this:
public String getVersion();
{
return "1.2.5";
}
Remove the empty " " set in the recipe:
ModLoader.addRecipe(new ItemStack(seaweed, 4), new Object [] {"#", Character.valueOf('#'), Block.leaves});
Once you've done all that, remove the ; at the end of the class and it should all work fine.
The first part was automatically put in there, i first created this with textedit then i got eclipse and that was there, i think it is what my picture is with all the color mixtures.
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/mod_seaweed.java:3: class mod_Food is public, should be declared in a file named mod_Food.java
public class mod_Food extends BaseMod
^
src/minecraft/net/minecraft/src/mod_seaweed.java:3: cannot find symbol
symbol: class BaseMod
public class mod_Food extends BaseMod
^
src/minecraft/net/minecraft/src/mod_seaweed.java:9: cannot find symbol
symbol : variable Namehere
location: class net.minecraft.src.mod_Food
Namehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/seaweed.png");
^
src/minecraft/net/minecraft/src/mod_seaweed.java:9: cannot find symbol
symbol : variable ModLoader
location: class net.minecraft.src.mod_Food
Namehere.iconIndex = ModLoader.addOverride("/gui/items.png", "/mod/seaweed.png");
^
src/minecraft/net/minecraft/src/mod_seaweed.java:10: cannot find symbol
symbol : variable ModLoader
location: class net.minecraft.src.mod_Food
ModLoader.addName(seaweed, "SeaWeed");
^
src/minecraft/net/minecraft/src/mod_seaweed.java:11: cannot find symbol
symbol : variable ModLoader
location: class net.minecraft.src.mod_Food
ModLoader.addRecipe(new ItemStack(seaweed, 4), new Object [] {"#", Character.valueOf('#'), Block.leaves});
^
src/minecraft/net/minecraft/src/mod_seaweed.java:14: missing method body, or declare abstract
public String getVersion();
^
src/minecraft/net/minecraft/src/mod_seaweed.java:16: return outside method
return "1.2.5";
^
I got a problem and a quick question. So I made my beaver model and all the classes and it spawns in the world, but they do not move and are not animated.
mod_Buildercraft
package net.minecraft.src;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Buildercraft extends BaseMod {
public void load() {
I got a problem and a quick question. So I made my beaver model and all the classes and it spawns in the world, but they do not move and are not animated.
mod_Buildercraft
package net.minecraft.src;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Buildercraft extends BaseMod {
public void load() {
And my question is, how can I make two blocks drop when a certain block is mined, like when you kill a cow.
Animation isn't automatic, you have to add it. The simplest way to do it is to add the setRotationAngles method from ModelBiped to your model class. Remember to change the names of which objects are actually being animated otherwise you'll get errors.
Possibly try to keep changing the 1 to a higher number, and just keep going through them. If my thinking is correct, then the 1 should be the id of the first slab, then 2 should be the upside down version. Then 3 should be the next slab and 4 the upside down version of it. Again, this is just my thoughts on the matter and may not be correct. Trial and error is always a way to go about things when you're not entirely sure.
I've been working on trying to code glass panes, and it's harder than I first thought. Any ideas?
I don't like telling people to do this, but, when you have your new block and its class, make it extend BlockPane. If that doesn't work then I will make a quick tutorial.
hey, can you please help me? how can I make one OreBlock to generate only in 1 Biome?
I've been going to add it in for a while, and need to make a new tutorial, so I'll add it into the OP now. It will probably take about half an hour from when I post this.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You know, I actually have a tutorial on this, yet you still use my thread to advertise your problem.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I fixed it the reason why is becuase i had 2 "public void load()" code parts in the class and it was messing it up. but if i make 2 achievements only one of the achievements show up.
if i make 2 achievements only one of the achievements show up.
Can you post your code please. It is most likely a naming problem.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
so i used your biomegen tutorial and then i wanted to use my block as the top layer but i keep getting this error can you help
mod_Crop
package net.minecraft.src;
public class mod_Crop extends BaseMod
{
public static final BiomeGenBase woop = (new BiomeGenExample(25)).setColor(0xfa9418).setBiomeName("woop");
public static final Block newdirt = new BlockCrop1(160, 0).setBlockName("newdirt").setHardness(0.25F).setResistance(4F).setLightValue(1F);
public void load()
{
newdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/rawr.png");
ModLoader.registerBlock(newdirt);
ModLoader.addName(newdirt, "Mud");
ModLoader.addRecipe(new ItemStack(newdirt, 1), new Object [] {"###", Character.valueOf('#'), Block.dirt});
ModLoader.addBiome(woop);
}
public String getVersion()
{
return "1.2.5";
}
}
Mods loaded: 1
ModLoader 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 9f578458 --------
Generated 06/05/12 15:31
Minecraft: Minecraft 1.2.5
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_32, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 8600 GS/PCIe/SSE2 version 3.3.0, NVIDIA Corporation
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:287)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1279)
at net.minecraft.src.ModLoader.init(ModLoader.java:849)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at net.minecraft.src.BiomeGenExample.<init>(BiomeGenExample.java:12)
at net.minecraft.src.mod_Crop.<clinit>(mod_Crop.java:4)
... 15 more
--- END ERROR REPORT d8ff8eff ----------
The block's public static final line must be before the biome's.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Can you post your code please. It is most likely a naming problem.
I fixed with with help from _303 but i have another problem i dotn know how i can make it so when i craft a certain mod item because itemID doesnt work
hey thanks but i have another error when i was looking for my new biome the game crashed i presume something to do with my biome?
the error
Mods loaded: 2
ModLoader 1.2.5
mod_Crop 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 8936f4c2 --------
Generated 06/05/12 18:22
Minecraft: Minecraft 1.2.5
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_32, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 8600 GS/PCIe/SSE2 version 3.3.0, NVIDIA Corporation
java.lang.ArrayIndexOutOfBoundsException: -96
at net.minecraft.src.ExtendedBlockStorage.setExtBlockID(ExtendedBlockStorage.java:83)
at net.minecraft.src.Chunk.<init>(Chunk.java:113)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:290)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:93)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:119)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:654)
at net.minecraft.src.World.getBlockId(World.java:547)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2258)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2145)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2092)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1978)
at net.minecraft.src.GuiSelectWorld.selectWorld(GuiSelectWorld.java:204)
at net.minecraft.src.GuiWorldSlot.elementClicked(GuiWorldSlot.java:38)
at net.minecraft.src.GuiSlot.drawScreen(GuiSlot.java:234)
at net.minecraft.src.GuiSelectWorld.drawScreen(GuiSelectWorld.java:231)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1008)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:662)
--- END ERROR REPORT 37d11948 ----------
The ArrayIndexOutOfBoundsException: -96 error means that the number -96 cannot be used for a biome. Try using the number he used in the tutorial.
Yes, you can extend BlockStairs or BlockStep, but I show it the way I do so that people do not become dependant on pre-made classes. They learn nothing by extending a class, but doing it the way I do in my tutorial, they can see and and work with the actual code that does the work.
together they are powerful beyond imagination."
The first part was automatically put in there, i first created this with textedit then i got eclipse and that was there, i think it is what my picture is with all the color mixtures.
You use the
and then you change the 1 on the end and it will give you a different type of block
mod_Buildercraft
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Buildercraft extends BaseMod {
public void load() {
//TEXTURES
BurnstoneOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/burnstoneore.png");
BurnstoneIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/burnstoneingot.png");
BurnstonePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/burnstonepickaxe.png");
BurnstoneSpade.iconIndex = ModLoader.addOverride("/gui/items.png", "/burnstonespade.png");
BurnstoneAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/burnstoneaxe.png");
BurnstoneSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/burnstonesword.png");
FlameSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/flamesword.png");
//REGISTERED BLOCKS
ModLoader.registerBlock(BurnstoneOre);
//ADD NAME
ModLoader.addName(BurnstoneIngot, "Burnstone Ingot");
ModLoader.addName(BurnstonePickaxe, "Burnstone Pickaxe");
ModLoader.addName(BurnstoneSpade, "Burnstone Shovel");
ModLoader.addName(BurnstoneOre, "Burnstone Ore");
ModLoader.addName(BurnstoneAxe, "Burnstone Axe");
ModLoader.addName(BurnstoneHoe, "Burnstone Hoe");
ModLoader.addName(BurnstoneSword, "Burnstone Sword");
ModLoader.addName(FlameSword, "Flame Sword");
//ADD RECIPES
ModLoader.addRecipe(new ItemStack(BurnstonePickaxe, 1), new Object [] {"###", " % ", " % ",
Character.valueOf('#'), BurnstoneIngot, Character.valueOf('%'), Item.stick});
ModLoader.addRecipe(new ItemStack(BurnstoneSpade, 1), new Object [] {" # ", " % ", " % ",
Character.valueOf('#'), BurnstoneIngot, Character.valueOf('%'), Item.stick});
ModLoader.addRecipe(new ItemStack(BurnstoneAxe, 1), new Object [] {"## ", "#% ", " % ",
Character.valueOf('#'), BurnstoneIngot, Character.valueOf('%'), Item.stick});
ModLoader.addRecipe(new ItemStack(BurnstoneHoe, 1), new Object [] {"## ", " % ", " % ",
Character.valueOf('#'), BurnstoneIngot, Character.valueOf('%'), Item.stick});
ModLoader.addRecipe(new ItemStack(BurnstoneSword, 1), new Object [] {" # ", " # ", " % ",
Character.valueOf('#'), BurnstoneIngot, Character.valueOf('%'), Item.stick});
ModLoader.addShapelessRecipe(new ItemStack(FlameSword, 1), new Object [] {BurnstoneSword, Item.blazeRod});
//ADD SMELTING
ModLoader.addSmelting(BurnstoneOre.blockID, new ItemStack(BurnstoneIngot, 1));
//REGISTER ENTITY
ModLoader.registerEntityID(CustomEntityBeaver.class, "Beaver",
ModLoader.getUniqueEntityId());
//ADD SPAWN
ModLoader.addSpawn(CustomEntityBeaver.class, 12, 14, 18, EnumCreatureType.creature);
}
//ITEMS
public static final Item BurnstoneIngot = new CustomItemBurnstoneIngot(201).setItemName("burnstone ingot");
//BLOCKS
public static final Block BurnstoneOre = new CustomBlockBurnstoneOre(200, 0).setBlockName("burnstone ore").setHardness(3F).setResistance(4F);
//TOOLS
public static final Item BurnstonePickaxe = new CustomItemPickaxe(202, CustomEnumToolMaterial.BURNSTONE).setItemName("burnstone pickaxe");
public static final Item BurnstoneSpade = new CustomItemSpade(203, CustomEnumToolMaterial.BURNSTONE).setItemName("burnstone spade");
public static final Item BurnstoneAxe = new CustomItemAxe(204, CustomEnumToolMaterial.BURNSTONE).setItemName("burnstone axe");
public static final Item BurnstoneHoe = new CustomItemHoe(205, CustomEnumToolMaterial.BURNSTONE).setItemName("burnstone hoe");
public static final Item BurnstoneSword = new CustomItemSword(206, CustomEnumToolMaterial.BURNSTONE).setItemName("burnstone sword");
public static final Item FlameSword = new CustomItemSword(207, CustomEnumToolMaterial.BURNSTONE).setItemName("flame sword");
//ADD RENDERER
public void addRenderer(Map m){
m.put(CustomEntityBeaver.class, new CustomRenderBeaver(new CustomModelBeaver(), 0.5F));
}
//CREATIVE GUI
public boolean onTickInGame(float f, Minecraft minecraft){
if(minecraft.currentScreen == null){
creativeInventory = null;
}
return true;
}
public boolean onTickInGui(float f, Minecraft minecraft, GuiScreen guiscreen){
if((guiscreen instanceof GuiContainerCreative) && !(creativeInventory instanceof
GuiContainerCreative) && !minecraft.theWorld.isRemote){
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
int i = 0;
list.add(new ItemStack(BurnstoneOre, 1, i));
}
creativeInventory = guiscreen;
return true;
}
private static GuiScreen creativeInventory;
//STRUCTURES
//MC VERSION
public String getVersion() {
return "1.2.5";
}
}
public class CustomRenderBeaver extends RenderLiving
{
protected CustomModelBeaver modelBeaverMain;
protected float field_40296_d;
public CustomRenderBeaver(CustomModelBeaver par1CustomModelBeaver, float par2){
this(par1CustomModelBeaver, par2, 1.0F);
modelBeaverMain = par1CustomModelBeaver;
}
public CustomRenderBeaver(CustomModelBeaver par1CustomModelBeaver, float par2, float par3){
super(par1CustomModelBeaver, par2);
modelBeaverMain = par1CustomModelBeaver;
field_40296_d = par3;
}
}
public class CustomEntityBeaver extends EntityMob {
public CustomEntityBeaver(World w)
{
super(w);
texture = "/Beaver.png";
moveSpeed = 1F;
isImmuneToFire = false;
attackStrength = 4;
getNavigator().func_48664_a(true);
tasks.addTask(0, new EntityAISwimming(this));
}
public int getMaxHealth(){
return 20;
}
protected String getLivingSound(){
return "mob.cow";
}
protected int getDropItemID(){
return mod_Buildercraft.FlameSword.shiftedIndex;
}
protected boolean canDeSpawn(){
return false;
}
public CustomEntityBeaver spawnBabyAnimal(EntityAnimal par1EntityAnimal)
{
return new CustomEntityBeaver(worldObj);
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(mod_Buildercraft.BurnstoneSword, 1);
}
private static final ItemStack defaultHeldItem;
}
public class CustomModelBeaver extends ModelBase
{
//fields
ModelRenderer head;
ModelRenderer body;
ModelRenderer rightarm;
ModelRenderer tail;
ModelRenderer leftarm;
ModelRenderer rightleg;
ModelRenderer nose;
ModelRenderer leftleg;
public CustomModelBeaver()
{
textureWidth = 64;
textureHeight = 32;
head = new ModelRenderer(this, 0, 0);
head.addBox(-4F, -8F, -5F, 8, 8, 8);
head.setRotationPoint(0F, 10F, -1F);
head.setTextureSize(64, 32);
head.mirror = true;
setRotation(head, 0F, 0F, 0F);
body = new ModelRenderer(this, 16, 16);
body.addBox(-4F, 0F, -2F, 8, 9, 4);
body.setRotationPoint(0F, 10F, 0F);
body.setTextureSize(64, 32);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
rightarm = new ModelRenderer(this, 40, 16);
rightarm.addBox(-3F, -2F, -2F, 4, 10, 4);
rightarm.setRotationPoint(-5F, 10F, 0F);
rightarm.setTextureSize(64, 32);
rightarm.mirror = true;
setRotation(rightarm, 0F, 0F, 0F);
tail = new ModelRenderer(this, 36, 0);
tail.addBox(0F, 0F, 0F, 6, 7, 1);
tail.setRotationPoint(-3F, 13F, 2F);
tail.setTextureSize(64, 32);
tail.mirror = true;
setRotation(tail, 0F, 0F, 0F);
leftarm = new ModelRenderer(this, 40, 16);
leftarm.addBox(-1F, -2F, -2F, 4, 10, 4);
leftarm.setRotationPoint(5F, 10F, 0F);
leftarm.setTextureSize(64, 32);
leftarm.mirror = true;
setRotation(leftarm, 0F, 0F, 0F);
rightleg = new ModelRenderer(this, 0, 16);
rightleg.addBox(-2F, 0F, -2F, 4, 5, 4);
rightleg.setRotationPoint(-2F, 19F, 0F);
rightleg.setTextureSize(64, 32);
rightleg.mirror = true;
setRotation(rightleg, 0F, 0F, 0F);
nose = new ModelRenderer(this, 0, 26);
nose.addBox(0F, 0F, 0F, 2, 2, 1);
nose.setRotationPoint(-1F, 5F, -7F);
nose.setTextureSize(64, 32);
nose.mirror = true;
setRotation(nose, 0F, 0F, 0F);
leftleg = new ModelRenderer(this, 0, 16);
leftleg.addBox(-2F, 0F, -2F, 4, 5, 4);
leftleg.setRotationPoint(2F, 19F, 0F);
leftleg.setTextureSize(64, 32);
leftleg.mirror = true;
setRotation(leftleg, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
head.render(f5);
body.render(f5);
rightarm.render(f5);
tail.render(f5);
leftarm.render(f5);
rightleg.render(f5);
nose.render(f5);
leftleg.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5);
}
}
And my question is, how can I make two blocks drop when a certain block is mined, like when you kill a cow.
how do i do it with half slabs?
achievement.BlastMining
achievement.BlastMining
Desc
this is the code for the achievement:
Animation isn't automatic, you have to add it. The simplest way to do it is to add the setRotationAngles method from ModelBiped to your model class. Remember to change the names of which objects are actually being animated otherwise you'll get errors.
Possibly try to keep changing the 1 to a higher number, and just keep going through them. If my thinking is correct, then the 1 should be the id of the first slab, then 2 should be the upside down version. Then 3 should be the next slab and 4 the upside down version of it. Again, this is just my thoughts on the matter and may not be correct. Trial and error is always a way to go about things when you're not entirely sure.
I don't like telling people to do this, but, when you have your new block and its class, make it extend BlockPane. If that doesn't work then I will make a quick tutorial.
?????
That's strange, I'll test it now and see if I can reproduce what you're getting, and if I can, a fix for it.
I've been going to add it in for a while, and need to make a new tutorial, so I'll add it into the OP now. It will probably take about half an hour from when I post this.
together they are powerful beyond imagination."
Link to my problem. I hope someone can help me
You know, I actually have a tutorial on this, yet you still use my thread to advertise your problem.
together they are powerful beyond imagination."
thanks also if i make 2 achievements only one of the achievements show up.btw that code is in the mod_Explosive_Warfare class
Can you post your code please. It is most likely a naming problem.
together they are powerful beyond imagination."
The block's public static final line must be before the biome's.
together they are powerful beyond imagination."
I fixed with with help from _303 but i have another problem i dotn know how i can make it so when i craft a certain mod item because itemID doesnt work
if(itemstack.itemID == mod_Explosive_Warfare.m_Chemcan.itemID)
Art by me: MrPancakeWolfie@DeviantArt