This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
0
package net.minecraft.src; import java.util.Random; public class mod_rainbow extends BaseMod { //Biomes public static final BiomeGenBase RainbowW = (new BiomeGenRbow(128)).setBiomeName("Rainbow World"); //Blocks public static final Block RainbowOre = (new BlockRainbowOre(200 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowOre.png")).setHardness(5.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundMetalFootstep).setBlockName("RainbowOre")); public static final Block RainbowGrass = (new BlockRainbowGrass (201 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowGrass.png")).setHardness(5.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGrassFootstep).setBlockName("RainbowGrass")); public static final Block RainbowDirt = (new BlockRainbowGrass (202 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowDirt.png")).setHardness(5.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGrassFootstep).setBlockName("RainbowDirt")); public static final Block RainbowLeaf = (new BlockRbowLeaf (203 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowLeaf.png")).setHardness(1.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGlassFootstep).setBlockName("RainbowLeaf")); public static final Block RainbowLog = (new BlockRbowLog (205 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowLog.png")).setHardness(1.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGlassFootstep).setBlockName("RainbowLog")); public static final Block RainbowLogB = (new BlockRainbowLogBottom (204 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowLogBottom.png")).setHardness(1.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGlassFootstep).setBlockName("RainbowLogB")); public static final Block RainbowSapling = (new BlockRainbowSapling (204 ,ModLoader.addOverride("/terrain.png", "/blocks/RainbowSapling.png")).setHardness(1.0F).setResistance(1F).setLightValue(0.7F).setStepSound(Block.soundGlassFootstep).setBlockName("RainbowSapling")); //Items public static final Item Rainbow = (new ItemRainbow(1000).setItemName ("Rainbow")); public static final Item GCoal = (new ItemGenModifyedCoal(1003).setMaxStackSize(64).setItemName("GCoal")); public static final Item Banana = (new ItemFood(1001, 10, 4, false)).setItemName("Banana"); public static final Item Apple = (new ItemFood(1001, 10, 4, false)).setItemName("Apple"); public static final Item RainPick = (new ItemPickaxe(1002,EnumToolMaterial.EMERALD)).setItemName("RainPick"); public void load() { ModLoader.addBiome(RainbowW); RainPick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Tools/RainbowPick.png"); Banana.iconIndex = ModLoader.addOverride("/gui/items.png","/Food/Banana.png"); Rainbow.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/Rainbow.png"); GCoal.iconIndex = ModLoader.addOverride("/gui/items.png","/Fuel/RainbowCoal"); GCoal.iconIndex = ModLoader.addOverride("/gui/items.png","/Food/RainbowApple"); //Registering ModLoader.registerBlock(RainbowOre); ModLoader.registerBlock(RainbowGrass); ModLoader.registerBlock(RainbowDirt); ModLoader.registerBlock(RainbowLeaf); ModLoader.registerBlock(RainbowLog); ModLoader.registerBlock(RainbowLogB); ModLoader.registerBlock(RainbowSapling); //Adding Names ModLoader.addName(RainbowOre,"Rainbow Ore"); ModLoader.addName(Rainbow,"Rainbow"); ModLoader.addName(Banana, "Banana"); ModLoader.addName(RainPick,"Super Pickaxe"); ModLoader.addName(GCoal,"Gen Modificated Coal"); ModLoader.addName(RainbowGrass,"RainbowGrass"); ModLoader.addName(RainbowDirt,"RainbowDirt"); ModLoader.addName(RainbowLeaf,"RainbowLeaf"); ModLoader.addName(RainbowLog,"RainbowLog"); ModLoader.addName(RainbowLogB,"RainbowLogBottom"); ModLoader.addName(RainbowSapling,"Rainbow Sapling"); ModLoader.addName(Apple,"Rainbow Apple"); //Crafting Recipes ModLoader.addRecipe(new ItemStack(mod_rainbow.RainbowOre, 1, 1), new Object[] { "SSS", "RRR","BBB", 'S', Item.paper, 'R', Item.clay, 'B', Item.seeds }); ModLoader.addRecipe(new ItemStack(mod_rainbow.RainPick, 1, 1), new Object[] { "RRR", "YSY","YSY", 'S', Item.stick, Character.valueOf('R'), Item.emerald }); ModLoader.addRecipe(new ItemStack(mod_rainbow.RainPick, 1, 1), new Object[] { "RRR", "YSY","YSY", 'S', Item.stick, Character.valueOf('R'), Item.emerald }); ModLoader.addRecipe(new ItemStack(mod_rainbow.GCoal, 1, 1), new Object[] { "YYY", "YSY","YYY", 'S', Item.coal, 'Y', Item.goldNugget }); //Smelting Recipes //Shapeless Recipes ModLoader.addShapelessRecipe(new ItemStack(mod_rainbow.Rainbow, 1, 1), new Object[] { Item.diamond }); } //Generation public void generateSurface(World world, Random random, int i, int j, Random rand, int chunkX, int chunkZ) { for(int k = 0; k < 5; k++) { int randPosX = i + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = j + random.nextInt(16); (new WorldGenMinable(RainbowOre.blockID, 17)).generate(world, random, randPosX, randPosY, randPosZ); } BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ); WorldGenRbowtree tree = new WorldGenRbowtree(); if(biome instanceof BiomeGenRbow) { for(int x = 0; x < 8; x++) { tree = new WorldGenRbowtree(); int Xcoord = chunkX + rand.nextInt(16); int Zcoord = chunkZ + rand.nextInt(16); int z = world.getHeightValue(Xcoord, Zcoord); tree.generate(world, rand, Xcoord, i, Zcoord); } } } //Fuel public int addFuel(int par1, int par2) { if(par1 == GCoal.iconIndex) { return 9600; } if(par1 == RainbowOre.blockID) { return 14400; } return 0; } public String getVersion() { return "1.4.7"; } }
package net.minecraft.src; import java.util.Random; public class WorldGenRbowtree extends WorldGenerator { public WorldGenRbowtree() { } public boolean generate(World world, Random random, int i, int j, int k) { int l = random.nextInt(1) + 4; boolean flag = true; if(j < 1 || j + l + 1 > 256) { return false; } for(int i1 = j; i1 <= j + 1 + l; i1++) { byte byte0 = 1; if(i1 == j) { byte0 = 0; } if(i1 >= (j + 1 + l) - 2) { byte0 = 2; } for(int i2 = i - byte0; i2 <= i + byte0 && flag; i2++) { for(int l2 = k - byte0; l2 <= k + byte0 && flag; l2++) { if(i1 >= 0 && i1 < 256) { int j3 = world.getBlockId(i2, i1, l2); if(j3 != 0 && j3 != mod_rainbow.RainbowLeaf.blockID) //Change this to your leaf block. { flag = false; } } else { flag = false; } } } } if(!flag) { return false; } int j1 = world.getBlockId(i, j - 1, k); if(j1 != mod_rainbow.RainbowGrass.blockID && j1 != mod_rainbow.RainbowDirt.blockID || j >= 256 - l - 1) //This determines on what blocks your tree can generate. { return false; } world.setBlock(i, j - 1, k, mod_rainbow.RainbowDirt.blockID); //Also determines what block your tree can generate on. for(int k1 = (j - 3) + l; k1 <= j + l; k1++) { int j2 = k1 - (j + l); int i3 = 1 - j2 / 2; for(int k3 = i - i3; k3 <= i + i3; k3++) { int l3 = k3 - i; for(int i4 = k - i3; i4 <= k + i3; i4++) { int j4 = i4 - k; if((Math.abs(l3) != i3 || Math.abs(j4) != i3 || random.nextInt(2) != 0 && j2 != 0) && !Block.opaqueCubeLookup[world.getBlockId(k3, k1, i4)]) { setBlockAndMetadata(world, k3, k1, i4, mod_rainbow.RainbowLeaf.blockID, 0); //Change to your leaf block. } } } } for(int l1 = 0; l1 < l; l1++) { int k2 = world.getBlockId(i, j + l1, k); if(k2 == 0 || k2 == mod_rainbow.RainbowLeaf.blockID) { setBlockAndMetadata(world, i, j + l1, k, mod_rainbow.RainbowLog.blockID, 0); //Change to your wood block. } } return true; } }
package net.minecraft.src; import java.util.Random; public class BlockRbowLeaf extends BlockLeavesBase { private int baseIndexInPNG; int adjacentTreeBlocks[]; protected BlockRbowLeaf(int i, int j) { super(i, j, Material.leaves, false); setTickRandomly(true); } public int getBlockColor() { double d = 0.5D; double d1 = 1.0D; return 0; } public void onBlockRemoval(World world, int i, int j, int k) { int l = 1; int i1 = l + 1; if(world.checkChunksExist(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1)) { for(int j1 = -l; j1 <= l; j1++) { for(int k1 = -l; k1 <= l; k1++) { for(int l1 = -l; l1 <= l; l1++) { int i2 = world.getBlockId(i + j1, j + k1, k + l1); if(i2 == mod_rainbow.RainbowSapling.blockID) //Change to your sapling block. { int j2 = world.getBlockMetadata(i + j1, j + k1, k + l1); world.setBlockMetadata(i + j1, j + k1, k + l1, j2 | 8); } } } } } } public void updateTick(World world, int i, int j, int k, Random random) { if(world.isRemote) { return; } int l = world.getBlockMetadata(i, j, k); if((l & 8) != 0 && (l & 4) == 0) { byte byte0 = 4; int i1 = byte0 + 1; byte byte1 = 32; int j1 = byte1 * byte1; int k1 = byte1 / 2; if(adjacentTreeBlocks == null) { adjacentTreeBlocks = new int[byte1 * byte1 * byte1]; } if(world.checkChunksExist(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1)) { for(int l1 = -byte0; l1 <= byte0; l1++) { for(int k2 = -byte0; k2 <= byte0; k2++) { for(int i3 = -byte0; i3 <= byte0; i3++) { int k3 = world.getBlockId(i + l1, j + k2, k + i3); if(k3 == mod_rainbow.RainbowLog.blockID) //Change to your wood block. { adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = 0; continue; } if(k3 == mod_rainbow.RainbowLeaf.blockID) //Change to your leaf block. { adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -2; } else { adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -1; } } } } for(int i2 = 1; i2 <= 4; i2++) { for(int l2 = -byte0; l2 <= byte0; l2++) { for(int j3 = -byte0; j3 <= byte0; j3++) { for(int l3 = -byte0; l3 <= byte0; l3++) { if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] != i2 - 1) { continue; } if(adjacentTreeBlocks[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) { adjacentTreeBlocks[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2; } if(adjacentTreeBlocks[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) { adjacentTreeBlocks[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2; } if(adjacentTreeBlocks[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] == -2) { adjacentTreeBlocks[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] = i2; } if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] == -2) { adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] = i2; } if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] == -2) { adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] = i2; } if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] == -2) { adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] = i2; } } } } } } int j2 = adjacentTreeBlocks[k1 * j1 + k1 * byte1 + k1]; if(j2 >= 0) { world.setBlockMetadata(i, j, k, l & -9); } else { removeLeaves(world, i, j, k); } } } private void removeLeaves(World world, int i, int j, int k) { dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0); world.setBlockWithNotify(i, j, k, 0); } public int quantityDropped(Random random) { return random.nextInt(20) != 0 ? 0 : 1; } public int idDropped(int i, Random random, int j) { return mod_rainbow.RainbowSapling.blockID; //Makes your leaves drop your type of sapling. } public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1) { super.dropBlockAsItemWithChance(world, i, j, k, l, f, i1); if (!world.isRemote && (l & 3) == 0 && world.rand.nextInt(50) == 0) { dropBlockAsItem_do(world, i, j, k, new ItemStack(mod_rainbow.Apple, 1, 0)); //Makes your leaf have a 1/50 chance to drop an apple. } } public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) { if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.iconIndex) { entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1); dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.leaves.blockID, 1, l & 3)); } else { super.harvestBlock(world, entityplayer, i, j, k, l); } } public int damageDropped(int i) { return i & 3; } public boolean isOpaqueCube() { return !graphicsLevel; } public int getBlockTextureFromSideAndMetadata(int i, int j) { if((j & 3) == 1) { return blockIndexInTexture; }else{ return blockIndexInTexture; } } public void setGraphicsLevel(boolean flag) { graphicsLevel = flag; } public void onEntityWalking(World world, int i, int j, int k, Entity entity) { super.onEntityWalking(world, i, j, k, entity); } }
package net.minecraft.src; import java.util.Random; public class BlockRbowLog extends Block { protected BlockRbowLog(int i, int e) { super(i, Material.wood); } public int quantityDropped(Random random) { return 1; } public int idDropped(int i, Random random, int j) { return mod_rainbow.RainbowLog.blockID; //Change to your wood block } public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) { super.harvestBlock(world, entityplayer, i, j, k, l); } public void onBlockRemoval(World world, int i, int j, int k) { byte byte0 = 4; int l = byte0 + 1; if(world.checkChunksExist(i - l, j - l, k - l, i + l, j + l, k + l)) { for(int i1 = -byte0; i1 <= byte0; i1++) { for(int j1 = -byte0; j1 <= byte0; j1++) { for(int k1 = -byte0; k1 <= byte0; k1++) { int l1 = world.getBlockId(i + i1, j + j1, k + k1); if(l1 != mod_rainbow.RainbowLeaf.blockID) //Change to your leaf block. { continue; } int i2 = world.getBlockMetadata(i + i1, j + j1, k + k1); if((i2 & 8) == 0) { world.setBlockMetadata(i + i1, j + j1, k + k1, i2 | 8); } } } } } } public int getBlockTextureFromSideAndMetadata(int i, int j) { if(i == 0) return mod_rainbow.RainbowLogB.blockID; if(i == 1) return mod_rainbow.RainbowLogB.blockID; if(i == 2) return mod_rainbow.RainbowLog.blockID; if(i == 3) return mod_rainbow.RainbowLog.blockID; if(i == 4) return mod_rainbow.RainbowLog.blockID; if(i == 5) return mod_rainbow.RainbowLog.blockID; if(j == 1) { return 116; } return j != 2 ? 20 : 117; } public int damageDropped(int i) { return i; } }
package net.minecraft.src; import java.util.Random; public class BlockRainbowSapling extends BlockFlower { protected BlockRainbowSapling(int i, int j) { super(i, j); float f = 0.4F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); } protected boolean canThisPlantGrowOnThisBlockID(int i) { return i == mod_rainbow.RainbowGrass.blockID; //Makes this grow on grass. } public void updateTick(World world, int i, int j, int k, Random random) { if(world.isRemote) { return; } super.updateTick(world, i, j, k, random); if(world.getBlockLightValue(i, j + 1, k) >= 9 && random.nextInt(7) == 0) { int l = world.getBlockMetadata(i, j, k); if((l & 8) == 0) { world.setBlockMetadataWithNotify(i, j, k, l | 8); } else { growTree(world, i, j, k, random); } } } public int getBlockTextureFromSideAndMetadata(int i, int j) { j &= 3; if(j == 1) { return blockIndexInTexture; //63 } if(j == 2) { return blockIndexInTexture; //79 } else { return blockIndexInTexture; } } public void growTree(World world, int i, int j, int k, Random random) { int l = world.getBlockMetadata(i, j, k) & 3; world.setBlock(i, j, k, 0); Object obj = null; obj = new WorldGenRbowtree(); if(!((WorldGenerator) (obj)).generate(world, random, i, j, k)) { world.setBlockAndMetadata(i, j, k, blockID, l); } } public int damageDropped(int i) { return i & 3; } }
package net.minecraft.src; import java.util.Random; public class BiomeGenRbow extends BiomeGenBase { public BiomeGenRbow(int par1) { super(par1); this.spawnableCreatureList.clear(); this.spawnableMonsterList.clear(); this.spawnableWaterCreatureList.clear(); this.topBlock = (byte)mod_rainbow.RainbowGrass.blockID; this.fillerBlock = (byte)mod_rainbow.RainbowDirt.blockID; this.minHeight = -0.4F; this.maxHeight = 0.54F; }}
0
mod_rainbow:
WorldGenRbowtree
BlockRbowLeaf
BlockRbowLog
BlockRainbowSapling
BiomeGenRbow
0
0
I would really like to join your server
0
0
0
0
0
/spawnpoint @p 1436 64 638
it did not work. Why?
0
0
0
0
0
0
0