diff --git a/src/minecraft/assets/biomesoplenty/lang/en_US.xml b/src/minecraft/assets/biomesoplenty/lang/en_US.xml index d892d07bf..83d08d12c 100644 --- a/src/minecraft/assets/biomesoplenty/lang/en_US.xml +++ b/src/minecraft/assets/biomesoplenty/lang/en_US.xml @@ -87,6 +87,7 @@ White Cherry Sapling Hellbark Sapling Jacaranda Sapling + Persimmon Sapling Acacia Sapling Mangrove Sapling @@ -98,6 +99,7 @@ Willow Ivy Apple Leaves + Persimmon Leaves Bamboo Mud Bricks Stairs Origin Grass Block diff --git a/src/minecraft/assets/biomesoplenty/textures/blocks/sapling_persimmon.png b/src/minecraft/assets/biomesoplenty/textures/blocks/sapling_persimmon.png new file mode 100644 index 000000000..cfbc0957c Binary files /dev/null and b/src/minecraft/assets/biomesoplenty/textures/blocks/sapling_persimmon.png differ diff --git a/src/minecraft/biomesoplenty/api/BlockReferences.java b/src/minecraft/biomesoplenty/api/BlockReferences.java index 72b279896..dc4ad9a5c 100644 --- a/src/minecraft/biomesoplenty/api/BlockReferences.java +++ b/src/minecraft/biomesoplenty/api/BlockReferences.java @@ -64,6 +64,8 @@ public class BlockReferences { appleLeaves (Blocks.leavesFruit, 3), appleLeavesFruitless (Blocks.leavesFruit, 0), + persimmonLeaves (Blocks.leavesFruit2, 3), + persimmonLeavesFruitless (Blocks.leavesFruit2, 3), bamboo (Blocks.bamboo, 0), @@ -96,6 +98,7 @@ public class BlockReferences { originSapling (Blocks.saplings, 9), yellowAutumnSapling (Blocks.saplings, 1), bambooSapling (Blocks.saplings, 2), + persimmonSapling (Blocks.saplings, 15), mud (Blocks.mud, 0), driedDirt (Blocks.driedDirt, 0), diff --git a/src/minecraft/biomesoplenty/api/Blocks.java b/src/minecraft/biomesoplenty/api/Blocks.java index db6ca30ac..b32483a0c 100644 --- a/src/minecraft/biomesoplenty/api/Blocks.java +++ b/src/minecraft/biomesoplenty/api/Blocks.java @@ -70,6 +70,7 @@ public class Blocks public static Optional leaves2 = Optional.absent(); public static Optional leavesColorized = Optional.absent(); public static Optional leavesFruit = Optional.absent(); + public static Optional leavesFruit2 = Optional.absent(); public static Optional foliage = Optional.absent(); public static Optional plants = Optional.absent(); public static Optional flatPlants = Optional.absent(); diff --git a/src/minecraft/biomesoplenty/biomes/BiomeGenAutumnHills.java b/src/minecraft/biomesoplenty/biomes/BiomeGenAutumnHills.java index 0755122e9..87d94e965 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeGenAutumnHills.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeGenAutumnHills.java @@ -10,7 +10,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; import biomesoplenty.configuration.BOPConfiguration; import biomesoplenty.worldgen.WorldGenDeadTree; -import biomesoplenty.worldgen.WorldGenDeadTree2; +import biomesoplenty.worldgen.WorldGenPersimmon; import biomesoplenty.worldgen.WorldGenTaiga4; public class BiomeGenAutumnHills extends BiomeGenBase @@ -49,7 +49,7 @@ public class BiomeGenAutumnHills extends BiomeGenBase @Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return par1Random.nextInt(9) == 0 ? new WorldGenDeadTree(false) : (par1Random.nextInt(6) == 0 ? new WorldGenTaiga4(false) : this.worldGeneratorTrees); + return par1Random.nextInt(9) == 0 ? new WorldGenDeadTree(false) : (par1Random.nextInt(6) == 0 ? new WorldGenTaiga4(false) : (par1Random.nextInt(5) == 0 ? new WorldGenPersimmon(false) : this.worldGeneratorTrees)); } /** @@ -64,6 +64,6 @@ public class BiomeGenAutumnHills extends BiomeGenBase @Override public int getBiomeFoliageColor() { - return 13024603; + return 12897365; } } diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPPersimmonLeaves.java b/src/minecraft/biomesoplenty/blocks/BlockBOPPersimmonLeaves.java new file mode 100644 index 000000000..546481e3e --- /dev/null +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPPersimmonLeaves.java @@ -0,0 +1,354 @@ +package biomesoplenty.blocks; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeavesBase; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.FakePlayer; +import net.minecraftforge.common.IShearable; +import biomesoplenty.BiomesOPlenty; +import biomesoplenty.api.Blocks; +import biomesoplenty.api.Items; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPPersimmonLeaves extends BlockLeavesBase implements IShearable +{ + private Icon[][] textures; + private Icon[] betterTextures; + int[] adjacentTreeBlocks; + + public BlockBOPPersimmonLeaves(int blockID) + { + super(blockID, Material.leaves, false); + setBurnProperties(this.blockID, 30, 60); + this.setTickRandomly(true); + setHardness(0.2F); + setLightOpacity(1); + setStepSound(Block.soundGrassFootstep); + this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[3][4]; + if(Loader.isModLoaded("BetterGrassAndLeavesMod")) + for (int i = 0; i < 4; ++i) + { + textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_round"); + textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast"); + textures[2][i] = iconRegister.registerIcon("biomesoplenty:better_leaves_persimmon" + i); + } + else + for (int i = 0; i < 4; ++i) + { + textures[0][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fancy"); + textures[1][i] = iconRegister.registerIcon("biomesoplenty:leaves_persimmon" + i + "_fast"); + } + } + + public Icon getIconBetterLeaves(int metadata, float randomIndex) + { + return textures[2][metadata & 3]; + } + + public Icon getIconFallingLeaves(int metadata) + { + return textures[1][metadata & 3]; + } + + + @Override + public Icon getIcon(int side, int meta) + { + return textures[(!isOpaqueCube() ? 0 : 1)][meta & 3]; + } + + @Override + public boolean isOpaqueCube() + { + return Block.leaves.isOpaqueCube(); + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + list.add(new ItemStack(blockID, 1, 0)); + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World world, int x, int y, int z, Random random) + { + if (world.canLightningStrikeAt(x, y + 1, z) && !world.doesBlockHaveSolidTopSurface(x, y - 1, z) && random.nextInt(15) == 1) + { + double d0 = x + random.nextFloat(); + double d1 = y - 0.05D; + double d2 = z + random.nextFloat(); + world.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + + super.randomDisplayTick(world, x, y, z, random); + + } + + @Override + public void breakBlock(World world, int x, int y, int z, int par5, int par6) + { + byte radius = 1; + int bounds = radius + 1; + + if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) { + for (int i = -radius; i <= radius; ++i) { + for (int j = -radius; j <= radius; ++j) { + for (int k = -radius; k <= radius; ++k) + { + int blockID = world.getBlockId(x + i, y + j, z + k); + + if (Block.blocksList[blockID] != null) { + Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k); + } + } + } + } + } + } + + @Override + public void updateTick(World world, int x, int y, int z, Random random) + { + if (world.isRemote) + return; + + int meta = world.getBlockMetadata(x, y, z); + if (random.nextInt(10) == 0) + if (meta > 0) + if ((meta & 3) < 3) { + world.setBlock(x, y, z, blockID, ++meta, 3); + } + + if ((meta & 8) != 0/* && (meta & 4) == 0*/) + { + byte b0 = 4; + int i1 = b0 + 1; + byte b1 = 32; + int j1 = b1 * b1; + int k1 = b1 / 2; + + if (adjacentTreeBlocks == null) + { + adjacentTreeBlocks = new int[b1 * b1 * b1]; + } + + int l1; + + if (world.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1)) + { + int i2; + int j2; + int k2; + + for (l1 = -b0; l1 <= b0; ++l1) + { + for (i2 = -b0; i2 <= b0; ++i2) + { + for (j2 = -b0; j2 <= b0; ++j2) + { + k2 = world.getBlockId(x + l1, y + i2, z + j2); + + Block block = Block.blocksList[k2]; + + if (block != null && block.canSustainLeaves(world, x + l1, y + i2, z + j2)) + { + adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0; + } + else if (block != null && block.isLeaves(world, x + l1, y + i2, z + j2)) + { + adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; + } + else + { + adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1; + } + } + } + } + + for (l1 = 1; l1 <= 4; ++l1) + { + for (i2 = -b0; i2 <= b0; ++i2) + { + for (j2 = -b0; j2 <= b0; ++j2) + { + for (k2 = -b0; k2 <= b0; ++k2) + { + if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) + { + if (adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) + { + adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; + } + + if (adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) + { + adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; + } + + if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) + { + adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1; + } + + if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) + { + adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1; + } + + if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) + { + adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1; + } + + if (adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) + { + adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1; + } + } + } + } + } + } + } + + l1 = adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1]; + + if (l1 >= 0) + { + world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + } + else + { + this.removeLeaves(world, x, y, z); + } + } + } + + private void removeLeaves(World world, int x, int y, int z) + { + this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + world.setBlockToAir(x, y, z); + } + + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + int meta = world.getBlockMetadata(x, y, z); + if ((meta & 3) == 3) + { + world.setBlock(x, y, z, blockID, meta - 3, 3); + EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(Items.food.get(), 1, 8)); + + if (!world.isRemote) { + world.spawnEntityInWorld(entityitem); + if (!(player instanceof FakePlayer)) + entityitem.onCollideWithPlayer(player); + } + return true; + } + else + return false; + } + + @Override + public int idDropped(int par1, Random par2Random, int par3) + { + return Blocks.saplings.get().blockID; + } + + @Override + public int damageDropped(int meta) + { + return 15; + } + + @Override + public int quantityDropped(Random random) + { + return random.nextInt(20) == 0 ? 1 : 0; + } + + @Override + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int par7) + { + if (world.isRemote) + return; + + if (world.rand.nextInt(20) == 0) + { + int var9 = this.idDropped(meta, world.rand, par7); + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(var9, 1, this.damageDropped(meta))); + } + + if ((meta & 3) == 3) { + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8)); + } else if ((meta & 3) == 2 && world.rand.nextInt(8) == 0) { + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8)); + } else if ((meta & 3) == 1 && world.rand.nextInt(16) == 0) { + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8)); + } else if ((meta & 3) == 0 && world.rand.nextInt(32) == 0) { + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8)); + } + } + + @Override + public boolean isShearable(ItemStack item, World world, int x, int y, int z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1, 0)); + return ret; + } + + @SideOnly(Side.CLIENT) + public void setGraphicsLevel(boolean par1) + { + graphicsLevel = par1; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return true; + } + + @Override + public void beginLeavesDecay(World world, int x, int y, int z) + { + world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4); + } + + @Override + public boolean isLeaves(World world, int x, int y, int z) + { + return true; + } +} \ No newline at end of file diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java b/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java index 2bcf6e247..7d2ae4de7 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPSapling.java @@ -29,12 +29,13 @@ import biomesoplenty.worldgen.WorldGenNetherBush; import biomesoplenty.worldgen.WorldGenOminous1; import biomesoplenty.worldgen.WorldGenOminous2; import biomesoplenty.worldgen.WorldGenOriginTree; +import biomesoplenty.worldgen.WorldGenPersimmon; import biomesoplenty.worldgen.WorldGenPromisedTree; import biomesoplenty.worldgen.WorldGenTaiga9; public class BlockBOPSapling extends BlockSapling { - private static final String[] saplings = new String[] {"apple", "yellowautumn", "bamboo", "magic", "dark", "dead", "fir", "holy", "orangeautumn", "origin", "pinkcherry", "maple", "whitecherry", "hellbark", "jacaranda"}; + private static final String[] saplings = new String[] {"apple", "yellowautumn", "bamboo", "magic", "dark", "dead", "fir", "holy", "orangeautumn", "origin", "pinkcherry", "maple", "whitecherry", "hellbark", "jacaranda", "persimmon"}; private Icon[] textures; private static final int TYPES = 15; @@ -209,6 +210,10 @@ public class BlockBOPSapling extends BlockSapling case 14: // Jacaranda obj = new WorldGenJacaranda(false); break; + + case 15: // Persimmon + obj = new WorldGenPersimmon(false); + break; } } diff --git a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java index 0bcda2199..0b320f4ee 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java @@ -23,6 +23,7 @@ import biomesoplenty.blocks.BlockBOPLeaves.LeafCategory; import biomesoplenty.blocks.BlockBOPLog; import biomesoplenty.blocks.BlockBOPLog.LogCategory; import biomesoplenty.blocks.BlockBOPMushroom; +import biomesoplenty.blocks.BlockBOPPersimmonLeaves; import biomesoplenty.blocks.BlockBOPPetals; import biomesoplenty.blocks.BlockBOPPlank; import biomesoplenty.blocks.BlockBOPPlant; @@ -63,6 +64,7 @@ import biomesoplenty.itemblocks.ItemBlockLog; import biomesoplenty.itemblocks.ItemBlockMoss; import biomesoplenty.itemblocks.ItemBlockMud; import biomesoplenty.itemblocks.ItemBlockMushroom; +import biomesoplenty.itemblocks.ItemBlockPersimmonLeaves; import biomesoplenty.itemblocks.ItemBlockPetals; import biomesoplenty.itemblocks.ItemBlockPlank; import biomesoplenty.itemblocks.ItemBlockPlant; @@ -93,6 +95,7 @@ public class BOPBlocks Blocks.shearBlockIds.put(Blocks.leaves2.get().blockID, 15.0F); Blocks.shearBlockIds.put(Blocks.leavesColorized.get().blockID, 15.0F); Blocks.shearBlockIds.put(Blocks.leavesFruit.get().blockID, 15.0F); + Blocks.shearBlockIds.put(Blocks.leavesFruit2.get().blockID, 15.0F); MinecraftForge.setBlockHarvestLevel(Blocks.holyGrass.get(), 1, "shovel", 0); MinecraftForge.setBlockHarvestLevel(Blocks.mud.get(), "shovel", 0); @@ -134,6 +137,7 @@ public class BOPBlocks Blocks.ashStone = Optional.of(new BlockBOPGeneric(BOPConfiguration.IDs.ashStoneID, Material.rock, BlockType.ASH_STONE)); Blocks.hardIce = Optional.of(new BlockBOPGeneric(BOPConfiguration.IDs.hardIceID, Material.rock, BlockType.HARD_ICE)); Blocks.leavesFruit = Optional.of((new BlockBOPAppleLeaves(BOPConfiguration.IDs.leavesFruitID)).setUnlocalizedName("bop.leavesFruit")); + Blocks.leavesFruit2 = Optional.of((new BlockBOPPersimmonLeaves(BOPConfiguration.IDs.leavesFruit2ID)).setUnlocalizedName("bop.leavesFruit2")); Blocks.bamboo = Optional.of(new BlockBamboo(BOPConfiguration.IDs.bambooID).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("bop.bamboo")); Blocks.mudBrick = Optional.of(new BlockBOPGeneric(BOPConfiguration.IDs.mudBrickBlockID, Material.rock, BlockType.MUD_BRICK)); Blocks.mudBricksStairs = Optional.of((new BlockBOPStairs(BOPConfiguration.IDs.mudBrickStairsID, Blocks.redRock.get(), Category.MUD_BRICKS)).setHardness(1.0F).setUnlocalizedName("bop.mudBricksStairs")); @@ -220,6 +224,7 @@ public class BOPBlocks GameRegistry.registerBlock(Blocks.ashStone.get(), "bop.ashStone"); GameRegistry.registerBlock(Blocks.hardIce.get(), "bop.hardIce"); GameRegistry.registerBlock(Blocks.leavesFruit.get(), ItemBlockAppleLeaves.class, "bop.leavesFruit"); + GameRegistry.registerBlock(Blocks.leavesFruit2.get(), ItemBlockPersimmonLeaves.class, "bop.leavesFruit2"); GameRegistry.registerBlock(Blocks.bamboo.get(), ItemBlockBamboo.class, "bop.bamboo"); GameRegistry.registerBlock(Blocks.mudBrick.get(), "bop.mudBrick"); GameRegistry.registerBlock(Blocks.mudBricksStairs.get(), "bop.mudBricksStairs"); diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index bc166bafc..ffee35236 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -569,6 +569,7 @@ public class BOPConfiguration public static int foliageID; public static int leavesFruitID; + public static int leavesFruit2ID; public static int bambooID; public static int mudBrickBlockID; public static int mudBrickStairsID; @@ -918,6 +919,8 @@ public class BOPConfiguration puddleID = config.getBlock("Puddle ID", 1980, null).getInt(); graveID = config.getBlock("Grave ID", 1981, null).getInt(); + + leavesFruit2ID = config.getBlock("Fruit Leaf Block 2 ID", 1982, null).getInt(); // Get Item ID's foodID = config.getItem("Food ID", 21003, null).getInt(); diff --git a/src/minecraft/biomesoplenty/integration/ForestryIntegration.java b/src/minecraft/biomesoplenty/integration/ForestryIntegration.java index 318a6b676..bd175a9de 100644 --- a/src/minecraft/biomesoplenty/integration/ForestryIntegration.java +++ b/src/minecraft/biomesoplenty/integration/ForestryIntegration.java @@ -181,6 +181,7 @@ public class ForestryIntegration EnumTemperature.normalBiomeIds.add(BOPConfiguration.IDs.extremeHillsNewID); EnumTemperature.normalBiomeIds.add(BOPConfiguration.IDs.forestNewID); EnumTemperature.normalBiomeIds.add(BOPConfiguration.IDs.forestHillsNewID); + EnumTemperature.normalBiomeIds.add(BOPConfiguration.IDs.autumnHillsID); EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.beachGravelID); EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.beachOvergrownID); @@ -223,6 +224,7 @@ public class ForestryIntegration EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.extremeHillsNewID); EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.forestNewID); EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.forestHillsNewID); + EnumHumidity.normalBiomeIds.add(BOPConfiguration.IDs.autumnHillsID); //Cold- Normal @@ -297,6 +299,7 @@ public class ForestryIntegration GlobalManager.leafBlockIds.add(Blocks.leaves2.get().blockID); GlobalManager.leafBlockIds.add(Blocks.leavesColorized.get().blockID); GlobalManager.leafBlockIds.add(Blocks.leavesFruit.get().blockID); + GlobalManager.leafBlockIds.add(Blocks.leavesFruit2.get().blockID); GlobalManager.dirtBlockIds.add(Blocks.ash.get().blockID); GlobalManager.dirtBlockIds.add(Blocks.hardDirt.get().blockID); @@ -342,6 +345,7 @@ public class ForestryIntegration BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.leaves2.get(), 1, OreDictionary.WILDCARD_VALUE)); BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.leavesColorized.get(), 1, OreDictionary.WILDCARD_VALUE)); BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.leavesFruit.get(), 1, OreDictionary.WILDCARD_VALUE)); + BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.leavesFruit2.get(), 1, OreDictionary.WILDCARD_VALUE)); BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.bamboo.get(), 1, 0)); BackpackManager.backpackItems[FORESTER].add(new ItemStack(Blocks.petals.get(), 1, OreDictionary.WILDCARD_VALUE)); } diff --git a/src/minecraft/biomesoplenty/integration/ThaumcraftIntegration.java b/src/minecraft/biomesoplenty/integration/ThaumcraftIntegration.java index 8b10271d7..e8d67c389 100644 --- a/src/minecraft/biomesoplenty/integration/ThaumcraftIntegration.java +++ b/src/minecraft/biomesoplenty/integration/ThaumcraftIntegration.java @@ -73,6 +73,7 @@ public class ThaumcraftIntegration { ThaumcraftApi.registerObjectTag(getBID("darkLeaves"), getBMeta("darkLeaves"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.DARKNESS, 1)); ThaumcraftApi.registerObjectTag(getBID("deadLeaves"), getBMeta("deadLeaves"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.DEATH, 1)); ThaumcraftApi.registerObjectTag(getBID("appleLeaves"), getBMeta("appleLeaves"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.LIFE, 1)); + ThaumcraftApi.registerObjectTag(getBID("persimmonLeaves"), getBMeta("persimmonLeaves"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.LIFE, 1)); ThaumcraftApi.registerObjectTag(getBID("acaciaLeaves"), getBMeta("acaciaLeaves"), (new AspectList()).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("firLeaves"), getBMeta("firLeaves"), (new AspectList()).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("mangroveLeaves"), getBMeta("mangroveLeaves"), (new AspectList()).add(Aspect.PLANT, 2)); @@ -107,6 +108,7 @@ public class ThaumcraftIntegration { ThaumcraftApi.registerObjectTag(getBID("pinkCherrySapling"), getBMeta("pinkCherrySapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("whiteCherrySapling"), getBMeta("whiteCherrySapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("appleSapling"), getBMeta("appleSapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); + ThaumcraftApi.registerObjectTag(getBID("persimmonSapling"), getBMeta("persimmonSapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("originSapling"), getBMeta("originSapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("yellowAutumnSapling"), getBMeta("yellowAutumnSapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); ThaumcraftApi.registerObjectTag(getBID("pineSapling"), getBMeta("pineSapling"), (new AspectList()).add(Aspect.TREE, 2).add(Aspect.PLANT, 2)); @@ -212,9 +214,9 @@ public class ThaumcraftIntegration { ThaumcraftApi.registerObjectTag(getBID("anenome"), getBMeta("anenome"), (new AspectList()).add(Aspect.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("swampFlower"), getBMeta("swampFlower"), (new AspectList()).add(Aspect.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("wildFlower"), getBMeta("wildFlower"), (new AspectList()).add(Aspect.PLANT, 4)); - ThaumcraftApi.registerObjectTag(getBID("daisy"), getBMeta("daisy"), (new AspectList()).add(Aspect.PLANT, 4)); + ThaumcraftApi.registerObjectTag(getBID("cosmos"), getBMeta("cosmos"), (new AspectList()).add(Aspect.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("dandelion"), getBMeta("dandelion"), (new AspectList()).add(Aspect.PLANT, 4)); - ThaumcraftApi.registerObjectTag(getBID("tulip"), getBMeta("tulip"), (new AspectList()).add(Aspect.PLANT, 4)); + ThaumcraftApi.registerObjectTag(getBID("daffodil"), getBMeta("daffodil"), (new AspectList()).add(Aspect.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("aloe"), getBMeta("aloe"), (new AspectList()).add(Aspect.PLANT, 4).add(Aspect.PLANT, 4)); ThaumcraftApi.registerObjectTag(getBID("clover"), getBMeta("clover"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.PLANT, 1)); ThaumcraftApi.registerObjectTag(getBID("lilyflower"), getBMeta("lilyflower"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.PLANT, 1).add(Aspect.WATER, 1)); diff --git a/src/minecraft/biomesoplenty/integration/TreeCapitatorIntegration.java b/src/minecraft/biomesoplenty/integration/TreeCapitatorIntegration.java index 04ddfc659..70cbe71af 100644 --- a/src/minecraft/biomesoplenty/integration/TreeCapitatorIntegration.java +++ b/src/minecraft/biomesoplenty/integration/TreeCapitatorIntegration.java @@ -33,7 +33,7 @@ public class TreeCapitatorIntegration tree.setString("treeName", "vanilla_oak"); tree.setString("logs", ""); tree.setString("leaves", String.format("%d,4; %d,12; %d,7; %d,15; %d; %d,0; %d,8; %d,2; %d,10; 18,2; 18,10", - leaves1, leaves1, leaves1, leaves1, Blocks.leavesFruit.get().blockID, leaves2, leaves2, leaves2, leaves2)); + leaves1, leaves1, leaves1, leaves1, Blocks.leavesFruit.get().blockID, Blocks.leavesFruit2.get().blockID, leaves2, leaves2, leaves2, leaves2)); tree.setBoolean("requireLeafDecayCheck", false); treeList.appendTag(tree); diff --git a/src/minecraft/biomesoplenty/itemblocks/ItemBlockPersimmonLeaves.java b/src/minecraft/biomesoplenty/itemblocks/ItemBlockPersimmonLeaves.java new file mode 100644 index 000000000..511ae9b7a --- /dev/null +++ b/src/minecraft/biomesoplenty/itemblocks/ItemBlockPersimmonLeaves.java @@ -0,0 +1,25 @@ +package biomesoplenty.itemblocks; + +import net.minecraft.item.ItemBlock; +import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemBlockPersimmonLeaves extends ItemBlock +{ + @SideOnly(Side.CLIENT) + private Icon texture; + + public ItemBlockPersimmonLeaves(int par1) + { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } +} \ No newline at end of file diff --git a/src/minecraft/biomesoplenty/itemblocks/ItemBlockSapling.java b/src/minecraft/biomesoplenty/itemblocks/ItemBlockSapling.java index 47c638aa6..01c4196b9 100644 --- a/src/minecraft/biomesoplenty/itemblocks/ItemBlockSapling.java +++ b/src/minecraft/biomesoplenty/itemblocks/ItemBlockSapling.java @@ -7,7 +7,7 @@ import net.minecraft.util.Icon; public class ItemBlockSapling extends ItemBlock { - private static final String[] saplings = new String[] {"apple", "yellowautumn", "bamboo", "magic", "dark", "dead", "fir", "holy", "orangeautumn", "origin", "pinkcherry", "maple", "whitecherry", "hellbark", "jacaranda"}; + private static final String[] saplings = new String[] {"apple", "yellowautumn", "bamboo", "magic", "dark", "dead", "fir", "holy", "orangeautumn", "origin", "pinkcherry", "maple", "whitecherry", "hellbark", "jacaranda", "persimmon"}; private static final int MAX = 14; public ItemBlockSapling(int par1) diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenPersimmon.java b/src/minecraft/biomesoplenty/worldgen/WorldGenPersimmon.java new file mode 100644 index 000000000..61c707ac3 --- /dev/null +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenPersimmon.java @@ -0,0 +1,148 @@ +package biomesoplenty.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.Blocks; + +public class WorldGenPersimmon extends WorldGenerator +{ + public WorldGenPersimmon(boolean par1) + { + super(par1); + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + int var6 = par2Random.nextInt(3) + 5; + boolean flag = true; + + if (par4 >= 1 && par4 + var6 + 1 <= 256) + { + int var8; + int var10; + int var11; + int var12; + int var99; + + for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) + { + byte var9 = 1; + + if (var8 == par4) + { + var9 = 0; + } + + if (var8 >= par4 + 1 + var6 - 2) + { + var9 = 2; + } + + for (var10 = par3 - var9; var10 <= par3 + var9 && flag; ++var10) + { + for (var11 = par5 - var9; var11 <= par5 + var9 && flag; ++var11) + { + if (var8 >= 0 && var8 < 256) + { + var12 = par1World.getBlockId(var10, var8, var11); + + Block block = Block.blocksList[var12]; + + if (var12 != 0 && (block != null && !block.isLeaves(par1World, var10, var8, var11))) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + return false; + else + { + var8 = par1World.getBlockId(par3, par4 - 1, par5); + + if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) + { + this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); + int var16; + + for (var16 = par4 - 3 + var6; var16 <= par4 + var6; ++var16) + { + var10 = var16 - (par4 + var6); + var11 = 1 - var10 / 2; + + for (var12 = par3 - var11; var12 <= par3 + var11; ++var12) + { + int var13 = var12 - par3; + + for (int var14 = par5 - var11; var14 <= par5 + var11; ++var14) + { + int var15 = var14 - par5; + + if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) + { + var99 = par2Random.nextInt(50); + + if (var99 == 44) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 3); + } + else if (var99 ==30) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 2); + } + else if (var99 == 15) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 2); + } + else if (var99 == 10) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 1); + } + else if (var99 == 5) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 1); + } + else if (var99 == 0) + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 1); + } + else + { + this.setBlockAndMetadata(par1World, var12, var16, var14, Blocks.leavesFruit2.get().blockID, 0); + } + } + } + } + } + + for (var16 = 0; var16 < var6; ++var16) + { + var10 = par1World.getBlockId(par3, par4 + var16, par5); + + Block block = Block.blocksList[var10]; + + if (var10 == 0 || block == null || block.isLeaves(par1World, par3, par4 + var16, par5)) + { + this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 0); + } + } + + return true; + } else + return false; + } + } else + return false; + } +}