Added persimmon trees
This commit is contained in:
parent
19e4583983
commit
9eff663d5e
15 changed files with 560 additions and 8 deletions
|
@ -87,6 +87,7 @@
|
|||
<entry key="tile.bop.saplings.whitecherrySapling.name">White Cherry Sapling</entry>
|
||||
<entry key="tile.bop.saplings.hellbarkSapling.name">Hellbark Sapling</entry>
|
||||
<entry key="tile.bop.saplings.jacarandaSapling.name">Jacaranda Sapling</entry>
|
||||
<entry key="tile.bop.saplings.persimmonSapling.name">Persimmon Sapling</entry>
|
||||
|
||||
<entry key="tile.bop.colorizedSaplings.acaciaSapling.name">Acacia Sapling</entry>
|
||||
<entry key="tile.bop.colorizedSaplings.mangroveSapling.name">Mangrove Sapling</entry>
|
||||
|
@ -98,6 +99,7 @@
|
|||
<entry key="tile.bop.willow.name">Willow</entry>
|
||||
<entry key="tile.bop.ivy.name">Ivy</entry>
|
||||
<entry key="tile.bop.leavesFruit.name">Apple Leaves</entry>
|
||||
<entry key="tile.bop.leavesFruit2.name">Persimmon Leaves</entry>
|
||||
<entry key="tile.bop.bamboo.name">Bamboo</entry>
|
||||
<entry key="tile.bop.mudBricksStairs.name">Mud Bricks Stairs</entry>
|
||||
<entry key="tile.bop.originGrass.name">Origin Grass Block</entry>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 380 B |
|
@ -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),
|
||||
|
|
|
@ -70,6 +70,7 @@ public class Blocks
|
|||
public static Optional<? extends Block> leaves2 = Optional.absent();
|
||||
public static Optional<? extends Block> leavesColorized = Optional.absent();
|
||||
public static Optional<? extends Block> leavesFruit = Optional.absent();
|
||||
public static Optional<? extends Block> leavesFruit2 = Optional.absent();
|
||||
public static Optional<? extends Block> foliage = Optional.absent();
|
||||
public static Optional<? extends Block> plants = Optional.absent();
|
||||
public static Optional<? extends Block> flatPlants = Optional.absent();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
354
src/minecraft/biomesoplenty/blocks/BlockBOPPersimmonLeaves.java
Normal file
354
src/minecraft/biomesoplenty/blocks/BlockBOPPersimmonLeaves.java
Normal file
|
@ -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<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, 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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
@ -919,6 +920,8 @@ public class BOPConfiguration
|
|||
|
||||
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();
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
|
|
148
src/minecraft/biomesoplenty/worldgen/WorldGenPersimmon.java
Normal file
148
src/minecraft/biomesoplenty/worldgen/WorldGenPersimmon.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue