diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java index 3d934afc0..21c32b9a6 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java @@ -6,15 +6,20 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; import biomesoplenty.BiomesOPlenty; import biomesoplenty.api.BOPItemHelper; +import biomesoplenty.api.content.BOPCBiomes; public class BlockBOPGeneric extends Block { public enum BlockType { - ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, SPECTRAL_SOIL, CRYSTAL; + ASH_STONE, HARD_SAND, HARD_DIRT, HARD_ICE, DRIED_DIRT, CRAG_ROCK, MUD_BRICK, BIOME_BLOCK, CRYSTAL; } private IIcon texture; @@ -23,6 +28,7 @@ public class BlockBOPGeneric extends Block public BlockBOPGeneric(Material material, BlockType type) { super(material); + this.setHarvestLevel("pickaxe", 3, 7); this.type = type; //TODO: this.setCreativeTab() @@ -85,11 +91,11 @@ public class BlockBOPGeneric extends Block this.setStepSound(Block.soundTypePiston); break; - case SPECTRAL_SOIL: + case BIOME_BLOCK: //TODO: this.setHardness this.setHardness(0.6F); //TODO setStepSound(Block.soundGravelFootstep) - this.setStepSound(soundTypeGravel); + this.setStepSound(soundTypeGlass); break; case CRYSTAL: @@ -142,8 +148,8 @@ public class BlockBOPGeneric extends Block texture = iconRegister.registerIcon("biomesoplenty:mudbrick"); break; - case SPECTRAL_SOIL: - texture = iconRegister.registerIcon("biomesoplenty:spectralsoil"); + case BIOME_BLOCK: + texture = iconRegister.registerIcon("biomesoplenty:biomeblock"); break; case CRYSTAL: @@ -169,6 +175,41 @@ public class BlockBOPGeneric extends Block return Item.getItemFromBlock(this); } } + + @Override + //TODO: dropBlockAsItemWithChance() + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int metadata, float chance, int fortune) + { + if (world.isRemote) + return; + + switch (type) + { + case BIOME_BLOCK: + for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) + { + if (biome != null) + { + if (biome != BOPCBiomes.boneyard && biome != BOPCBiomes.visceralHeap && biome != BOPCBiomes.undergarden && biome != BOPCBiomes.corruptedSands && biome != BOPCBiomes.phantasmagoricInferno && biome != BOPCBiomes.lushRiver && biome != BOPCBiomes.dryRiver && biome != BiomeGenBase.beach && biome != BiomeGenBase.coldBeach && biome != BiomeGenBase.stoneBeach && biome != BiomeGenBase.frozenOcean && biome != BiomeGenBase.frozenRiver && biome != BiomeGenBase.hell && biome != BiomeGenBase.river && biome != BiomeGenBase.sky && biome != BiomeGenBase.ocean && biome != BiomeGenBase.deepOcean) + { + ItemStack biomeEssence = new ItemStack(BOPItemHelper.get("biomeEssence")); + + biomeEssence.setTagCompound(new NBTTagCompound()); + + biomeEssence.getTagCompound().setInteger("biomeID", biome.biomeID); + + if (world.rand.nextInt(75) == 0) + { + this.dropBlockAsItem(world, x, y, z, biomeEssence); + } + } + } + } + + default: + break; + } + } @Override //TODO damageDropped() diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPGrass.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPGrass.java index 60df38289..04ed692ad 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPGrass.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPGrass.java @@ -165,7 +165,7 @@ public class BlockBOPGrass extends Block if (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2) { //TODO: setBlock() - world.setBlock(x, y, z, BOPBlockHelper.get("spectralSoil"), 0, 2); + world.setBlock(x, y, z, Blocks.end_stone, 0, 2); } else if (world.getBlockLightValue(x, y + 1, z) >= 9) { @@ -178,7 +178,7 @@ public class BlockBOPGrass extends Block Block block = world.getBlock(rX, rY + 1, rZ); //TODO: getBlock() - if (world.getBlock(rX, rY, rZ) == BOPBlockHelper.get("spectralSoil") && world.getBlockLightValue(rX, rY + 1, rZ) >= 4 && world.getBlockLightOpacity(rX, rY + 1, rZ) <= 2) + if (world.getBlock(rX, rY, rZ) == Blocks.end_stone && world.getBlockLightValue(rX, rY + 1, rZ) >= 4 && world.getBlockLightOpacity(rX, rY + 1, rZ) <= 2) { //TODO: setBlock() world.setBlock(rX, rY, rZ, BOPBlockHelper.get("bopGrass"), 0, 2); @@ -217,7 +217,7 @@ public class BlockBOPGrass extends Block public Item getItemDropped(int metadata, Random random, int fortune) { //TODO: getItemFromBlock() getItemFromBlock() - return metadata == 0 ? Item.getItemFromBlock(BOPBlockHelper.get("spectralSoil")) : Item.getItemFromBlock(Blocks.dirt); + return metadata == 0 ? Item.getItemFromBlock(Blocks.end_stone) : Item.getItemFromBlock(Blocks.dirt); } } diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPPlant.java index 525bf9c2b..f1dd4de26 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPPlant.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPPlant.java @@ -172,7 +172,7 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable return block == Blocks.water && reedwater != Blocks.water; case 15: // Root - return root != Blocks.air && (root == Blocks.grass || root == Blocks.dirt || root == Blocks.farmland || root == BOPBlockHelper.get("longGrass") || root == BOPBlockHelper.get("spectralSoil")); + return root != Blocks.air && (root == Blocks.grass || root == Blocks.dirt || root == Blocks.farmland || root == BOPBlockHelper.get("longGrass")); default: return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == BOPBlockHelper.get("overgrownNetherrack"); diff --git a/src/main/java/biomesoplenty/common/core/BOPBlocks.java b/src/main/java/biomesoplenty/common/core/BOPBlocks.java index 6c9558ac1..186cbe59a 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBlocks.java +++ b/src/main/java/biomesoplenty/common/core/BOPBlocks.java @@ -146,7 +146,7 @@ public class BOPBlocks registerBlock(new BlockBOPGeneric(Material.sand, BlockType.HARD_SAND).setBlockName("hardSand")); registerBlock(new BlockBOPGeneric(Material.rock, BlockType.HARD_DIRT).setBlockName("hardDirt")); - registerBlock(new BlockBOPGeneric(Material.sand, BlockType.SPECTRAL_SOIL).setBlockName("spectralSoil")); + registerBlock(new BlockBOPGeneric(Material.glass, BlockType.BIOME_BLOCK).setBlockName("biomeBlock")); registerBlock(new BlockBOPGeneric(Material.glass, BlockType.CRYSTAL).setBlockName("crystal")); diff --git a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java index 5671f1af9..0df9f1655 100644 --- a/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java +++ b/src/main/java/biomesoplenty/common/core/BOPVanillaCompat.java @@ -2,6 +2,7 @@ package biomesoplenty.common.core; import biomesoplenty.api.BOPBlockHelper; import biomesoplenty.api.BOPItemHelper; +import biomesoplenty.api.content.BOPCBiomes; import biomesoplenty.common.configuration.BOPConfigurationMisc; import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviourDart; import biomesoplenty.common.entities.projectiles.dispenser.DispenserBehaviourMudball; @@ -67,27 +68,6 @@ public class BOPVanillaCompat bonusChest.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("wadingBoots"), 1, 0), 1, 1, 5)); bonusChest.addItem(new WeightedRandomChestContent(new ItemStack(BOPItemHelper.get("flippers"), 1, 0), 1, 1, 5)); - - for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) - { - if (biome != null) - { - ItemStack biomeEssence = new ItemStack(BOPItemHelper.get("biomeEssence")); - - biomeEssence.setTagCompound(new NBTTagCompound()); - - biomeEssence.getTagCompound().setInteger("biomeID", biome.biomeID); - - desertTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - dungeon.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - jungleTemple.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 2)); - mineshaft.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - strongholdCorridor.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - strongholdCrossing.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - strongholdLibrary.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 3)); - bonusChest.addItem(new WeightedRandomChestContent(biomeEssence, 1, 1, 1)); - } - } } } diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index e5e4158b7..b922a2e66 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -8,7 +8,7 @@ tile.hardIce.name=Hardened Ice tile.driedDirt.name=Dried Dirt tile.cragRock.name=Crag Rock tile.mudBricks.name=Mud Bricks -tile.spectralSoil.name=Spectral Soil +tile.biomeBlock.name=Biome Essence Ore tile.crystal.name=Celestial Crystal tile.rocks.limestone.name=Limestone diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/biomeblock.png b/src/main/resources/assets/biomesoplenty/textures/blocks/biomeblock.png new file mode 100644 index 000000000..e2c02777c Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/biomeblock.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/spectralsoil.png b/src/main/resources/assets/biomesoplenty/textures/blocks/spectralsoil.png deleted file mode 100644 index 7aaf4e3f0..000000000 Binary files a/src/main/resources/assets/biomesoplenty/textures/blocks/spectralsoil.png and /dev/null differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/whitesand.png b/src/main/resources/assets/biomesoplenty/textures/blocks/whitesand.png new file mode 100644 index 000000000..97b0f6079 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/whitesand.png differ