Everything posted by AppliedOnce
-
Custom structures for one specific biome (vanilla biome)
Thanks, that seemed to work. But is there a way to make it spawn in like a hillside as well? I tried this: protected int[] GetValidSpawnBlocks() { return new int[] { Block.dirt.blockID }; } public boolean LocationIsValidSpawn(World world, int x, int y, int z) { int checkID = world.getBlockId(x, y, z + 2); int checkID2 = world.getBlockId(x, y + 5, z + 1); if (checkID != Block.grass.blockID || (checkID2 != Block.dirt.blockID && checkID2 != Block.stone.blockID)) { return false; } else { return true; } } public WorldGenDungeon() { } public boolean generate(World world, Random rand, int i, int j, int k) { // check that each corner is one of the valid spawn blocks if (!LocationIsValidSpawn(world, i, j, k + 2) || !LocationIsValidSpawn(world, i, j + 5, k + 1)) { return false; } And then the generation underneath that. This is in a custom class called WorldGenDungeon.
-
Custom structures for one specific biome (vanilla biome)
Hi, I was just wondering if there was a way to make custom structures spawn in a specific vanilla biome.
-
Help needed! Error ...
Hey I just wondered if anyone could help me with this error that I've got here:
-
Help with custom crafting recipes
I would have done it like this: ItemStack moonstone = new ItemStack(tes_BaseMod.moonstone); ItemStack clay = new ItemStack(Block.blockClay); ItemStack paper = new ItemStack(Item.paper); GameRegistry.addSmelting(new ItemStack(Block.bedrock, 1), clay, 1.0F); GameRegistry.addRecipe(new ItemStack(tes_BaseMod.moonstone, 1), " X ", " X ", "XPX", 'X', clay, 'P', paper); The last parameter in the furnace recipe is a float so you need F at the end. This gives the same ammount of exp that diamonds give you when mined. This won't give you any errors at all.
-
Making a recipe that takes any item and outputs the item times 2
Is there a way to create a recipe that takes 2 items, one is sort of a multiplier and one is the item getting multiplied. So for example 1 dust that together with any item makes 2 items? Thanks in advance.
-
What do you put in the fuelhandler to ...
What do you put in the fuelhandler to make only one metadata of an item to become a fuel?
-
Is there a way to make metadata blocks drop metadata items?
I found a way, I just used a if statement inside damage dropped and make them return a different metadata. I had them make an item all the time, but it came out with the metadata of the block, instead of the metadata of the item I wanted. So I just took if (metadata == "<the block I wanted to change ex. 2>") { return metadata + 1) }
-
Is there a way to make metadata blocks drop metadata items?
Like the title says, is there a way to make metadata blocks drop metadata items? Oh and also make some of the blocks drop their own. It has to be both.
-
Is there a way to make metadata blocks drop metadata items?
Like the title says, is there a way to make metadata blocks drop metadata items? Oh and also make some of the blocks drop their own. It has to be both.
-
Bug in MCP with forge? (build 426)
Thanks man, that helped alot.
-
Bug in MCP with forge? (build 426)
Hi, I were going to update my forge version to the 426 build, but when I open the eclipse folder inside mcp with eclipse, I only get 2 folders up in my eclipse. Client and Server? Why is that, and is it a bug?
-
Which base file should I look at for making a new dimension?
As the title say, which minecraft.src file should I look at when I'm trying to make a new dimension? I know it's about 5 files.
-
Problem with custom leaves...
That didn't work
-
Problem with custom leaves...
Hi, I got a problem with my custom leaves that when you look at them with a block below it, you can see right through the block underneath it. Also I can't get the "fast", "fanzy" option for the texture to work. Please help me. Here is my LeafBlock Code: package XetosMod.common; import java.util.ArrayList; import java.util.Random; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import net.minecraft.src.Block; import net.minecraft.src.BlockLeavesBase; import net.minecraft.src.ColorizerFoliage; import net.minecraft.src.CreativeTabs; import net.minecraft.src.EntityPlayer; import net.minecraft.src.IBlockAccess; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.Material; import net.minecraft.src.World; import net.minecraftforge.common.IShearable; public class XetosLeaves extends BlockLeavesBase implements IShearable { private int baseIndexInPNG; int[] adjacentTreeBlocks; protected XetosLeaves(int par1, int par2) { super(par1, par2, Material.leaves, false); this.baseIndexInPNG = par2; this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.tabDecorations); this.setStepSound(soundGrassFootstep); } @SideOnly(Side.CLIENT) public int getBlockColor() { double var1 = 0.5D; double var3 = 1.0D; return ColorizerFoliage.getFoliageColor(var1, var3); } @SideOnly(Side.CLIENT) /** * Returns the color this block should be rendered. Used by leaves. */ public int getRenderColor(int par1) { return ColorizerFoliage.getFoliageColorBasic(); } public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if ((var5 & 3) == 1) { return ColorizerFoliage.getFoliageColorPine(); } else if ((var5 & 3) == 2) { return ColorizerFoliage.getFoliageColorBirch(); } else { int var6 = 0; int var7 = 0; int var8 = 0; for (int var9 = -1; var9 <= 1; ++var9) { for (int var10 = -1; var10 <= 1; ++var10) { int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor(); var6 += (var11 & 16711680) >> 16; var7 += (var11 & 65280) >> 8; var8 += var11 & 255; } } return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; } } public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { byte var7 = 1; int var8 = var7 + 1; if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { for (int var9 = -var7; var9 <= var7; ++var9) { for (int var10 = -var7; var10 <= var7; ++var10) { for (int var11 = -var7; var11 <= var7; ++var11) { int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); if (Block.blocksList[var12] != null) { Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); } } } } } } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { int var6 = par1World.getBlockMetadata(par2, par3, par4); if ((var6 & != 0 && (var6 & 4) == 0) { byte var7 = 4; int var8 = var7 + 1; byte var9 = 32; int var10 = var9 * var9; int var11 = var9 / 2; if (this.adjacentTreeBlocks == null) { this.adjacentTreeBlocks = new int[var9 * var9 * var9]; } int var12; if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { int var13; int var14; int var15; for (var12 = -var7; var12 <= var7; ++var12) { for (var13 = -var7; var13 <= var7; ++var13) { for (var14 = -var7; var14 <= var7; ++var14) { var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14); Block block = Block.blocksList[var15]; if (block != null && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; } else { this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; } } } } for (var12 = 1; var12 <= 4; ++var12) { for (var13 = -var7; var13 <= var7; ++var13) { for (var14 = -var7; var14 <= var7; ++var14) { for (var15 = -var7; var15 <= var7; ++var15) { if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) { if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; } if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; } if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) { this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12; } if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) { this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12; } if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) { this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12; } if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) { this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12; } } } } } } } var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11]; if (var12 >= 0) { par1World.setBlockMetadata(par2, par3, par4, var6 & -9); } else { this.removeLeaves(par1World, par2, par3, par4); } } } } @SideOnly(Side.CLIENT) /** * A randomly called display update to be able to add particles or other items for display */ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { double var6 = (double)((float)par2 + par5Random.nextFloat()); double var8 = (double)par3 - 0.05D; double var10 = (double)((float)par4 + par5Random.nextFloat()); par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); } } private void removeLeaves(World par1World, int par2, int par3, int par4) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockWithNotify(par2, par3, par4, 0); } public int quantityDropped(Random par1Random) { return par1Random.nextInt(20) == 0 ? 1 : 0; } public int idDropped(int par1, Random par2Random, int par3) { return XetosMod.serpentSapling.blockID; } public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { if (!par1World.isRemote) { byte var8 = 20; if ((par5 & 3) == 3) { var8 = 40; } if (par1World.rand.nextInt(var8) == 0) { int var9 = this.idDropped(par5, par1World.rand, par7); this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var9, 1, this.damageDropped(par5))); } if ((par5 & 3) == 0 && par1World.rand.nextInt(200) == 0) { this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleRed, 1, 0)); } } } public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); } public boolean isOpaqueCube() { return !this.graphicsLevel; } @Override public String getTextureFile () { return XetosModCommonProxy.BLOCK_PNG; } public int getBlockTextureFromSideAndMetadata(int i, int j) { if((j & 3) == 1) { return blockIndexInTexture; } else { return blockIndexInTexture; } } @SideOnly(Side.CLIENT) /** * Pass true to draw this block using fancy graphics, or false for fast graphics. */ public void setGraphicsLevel(boolean par1) { this.graphicsLevel = par1; } @Override public boolean isShearable(ItemStack item, World world, int x, int y, int z) { return true; } @Override public boolean isLeaves(World world, int x, int y, int z) { return true; } @Override public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); return ret; } }
-
Generation in specific Biomes
Yeah, I know how to make a mob spawn in certain biomes, and I know how to make structures. I just don't know how to make a structure generate in only one biome, if that is possible. And for the mob part, I said spawn in or near a custom structure.
-
Generation in specific Biomes
Hi, I just wondered if there is a way to add generation to specific biomes, like having pyramids spawn only in desert biomes. And if that is possible, is it possible to make a mob only spawn inside a custom structure?
-
Help me, Error when opening server. [SOLVED]
Thanks man that worked!
-
Help me, Error when opening server. [SOLVED]
You know how to add it to SMP?
-
Help me, Error when opening server. [SOLVED]
Hi, Im Xetosphere and I keep getting this error when I'm trying out my mod in SMP. Please Help me.
-
Mob tutorial needed ! Please help.
Hi, I'm Xetosphere and I'm working on a mod. I was trying to make a mob, when I stuttered upon some problems. I have made the Entity for my mob, I've made a texture and I've made the mob in techne, but I don't know how to code the model in eclipse. Could someone please help me with this? Also could anyone tell me about a possible way of making blocks glow red?
-
I was modding 1.4.2 and got this error please help me.
When I got rid of the last block coded in, the game didn't crash... I tried to make the block again and checking it every step through that there wasn't any wrong coding, but it didn't work. Is this a bug with the recommended version for 1.4.2?
-
I was modding 1.4.2 and got this error please help me.
No, that's not the issue, I started it up the same day with the same stuff. Then I added some stuff myself, you know for the mod and then suddenly the game crashes.
-
I was modding 1.4.2 and got this error please help me.
Can someone help me with this error, I can't find it anywhere and I've been looking for a while now. I'm using the last mcp, the correct forge and it worked a few minutes ago. Here is the error
-
Doing some modding on 1.4.2 and suddenly... ERROR !HELP!
Thanks man, it seems like I forgot to put in on of the spaces in " f" ... (how embarassing) lol.
-
Doing some modding on 1.4.2 and suddenly... ERROR !HELP!
Doing some modding on 1.4.2 and suddenly I get an error when I try to test the mod I've created. Please someone help me. ForgeModLoader-client-0.log
IPS spam blocked by CleanTalk.