From a460c31e867bf0dfa4030d897c767c4bc0966c5a Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 17 May 2014 07:47:02 -0400 Subject: [PATCH] Removed Biome Essence from loot chests, and added Biome Essence Pods --- .../common/blocks/BlockBOPGeneric.java | 50 ++++++++++++++++-- .../common/blocks/BlockBOPGrass.java | 6 +-- .../common/blocks/BlockBOPPlant.java | 2 +- .../biomesoplenty/common/core/BOPBlocks.java | 2 +- .../common/core/BOPVanillaCompat.java | 22 +------- .../assets/biomesoplenty/lang/en_US.lang | 2 +- .../textures/blocks/biomepod.png | Bin 0 -> 809 bytes .../textures/blocks/spectralsoil.png | Bin 339 -> 0 bytes .../textures/blocks/whitesand.png | Bin 0 -> 673 bytes 9 files changed, 52 insertions(+), 32 deletions(-) create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/biomepod.png delete mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/spectralsoil.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/whitesand.png diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java index 3d934afc0..b556a43a2 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_POD, CRYSTAL; } private IIcon texture; @@ -85,11 +90,11 @@ public class BlockBOPGeneric extends Block this.setStepSound(Block.soundTypePiston); break; - case SPECTRAL_SOIL: + case BIOME_POD: //TODO: this.setHardness this.setHardness(0.6F); //TODO setStepSound(Block.soundGravelFootstep) - this.setStepSound(soundTypeGravel); + this.setStepSound(soundTypeGlass); break; case CRYSTAL: @@ -142,8 +147,8 @@ public class BlockBOPGeneric extends Block texture = iconRegister.registerIcon("biomesoplenty:mudbrick"); break; - case SPECTRAL_SOIL: - texture = iconRegister.registerIcon("biomesoplenty:spectralsoil"); + case BIOME_POD: + texture = iconRegister.registerIcon("biomesoplenty:biomepod"); break; case CRYSTAL: @@ -169,6 +174,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_POD: + for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) + { + if (biome != null) + { + if (biome != BOPCBiomes.boneyard && biome != BOPCBiomes.visceralHeap && biome != BOPCBiomes.undergarden && biome != BOPCBiomes.corruptedSands && biome != BOPCBiomes.phantasmagoricInferno) + { + 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 f3ece558d..d04fecf2c 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBlocks.java +++ b/src/main/java/biomesoplenty/common/core/BOPBlocks.java @@ -142,7 +142,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_POD).setBlockName("biomePod")); 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 4caf3f41a..2dfe146be 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.biomePod.name=Biome Essence Pod tile.crystal.name=Celestial Crystal tile.rocks.limestone.name=Limestone diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/biomepod.png b/src/main/resources/assets/biomesoplenty/textures/blocks/biomepod.png new file mode 100644 index 0000000000000000000000000000000000000000..7a430bf6d327d92812a5b7b087cc17182e7b38ff GIT binary patch literal 809 zcmV+^1J?YBP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGirT_pArU8fCsc!%P02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qRNAp5A0007*Nkl=!m>Do`w)U4S`_d1ms?XQe)l`k`wFX>W;AoC(aDX0)O`+Qss!LB= z=wo9_1HL(6I}+dc;OP%Q)fphnWZ8xvx}vY#;e29km(Fgp+UygOnp=Nl8xov|x+09F zp9)XaSw@Ca1&(=H8acY|F1+($9R;V$Db5oo+${D1Tw9;&WZN{{1@zn& zFL+T%NEsI>E^!oJ_qVIR4K-_~xKLXdFTEbsdIu_m$2@VPo#vR~?Ut70M$nyPm1ej& zqKm#-in>}Cm^#~~YJeSCh8+Z#?7BPux1cgjqgyRK}&TA!hs zfSuTLH{4#UmpHrQJTFP|B>4B^UKZ$yW0a}(#PXLz(|F|>ikXR$2^ahIIZg5354t=U-JCYvY|!T0ypl{W9=l zoTBgIoW|if+8%ah=qrxZ9?%p&l@$wWb6Cy6+4*0u^?eVY(!V5u) zX|zO!`ha7gNCRD|>QfAj765eT=6Y*wHpY5o2A=87HFu_3#>mzim4OzyW}o3T^?jzX z6Y)(1(rh%gW)X@9lgSWH=)RyDQ`MRBBlSOl=DD|bjvnwYEK?UjlkdKE+YJC{zSj|$ nmrnbY?bL)`OJHguLksLbst+kTh|R)I00000NkvXXu0mjf#a?e( literal 0 HcmV?d00001 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 7aaf4e3f0ef6f81c7fdc1ac68cd3036f020aec83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L2E{@KYKsOr3@ zi(`m|f9gbAzC#8Q&c*BcWOo}HD7smdro5lgEB$5No>#7Z8k0nG>i;j5nO|GKKB4x` z0av}xBKNm{aJFEqSR0yI$f0JTKBJ4nT=P!IT&I`Ya=Ut*4&}aIeVMCdZRQ!?LFFgK6o6YaYMS_g?vPxUp9CL)E>hR(VIc+h1&-+T*EI>NDX>lSxB$ g%##z-D}OOPZ8lkKzw^LUpw}2YUHx3vIVCg!05Y$EK>z>% 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 0000000000000000000000000000000000000000..97b0f6079169a3a193c22b53dc17d7cb46ba0e38 GIT binary patch literal 673 zcmV;S0$%-zP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qRNAp5A0006INkl?7sgoN$bE6S|0qX+OO= zBtlp5S#X8;uD$+3^;o`}ZYj}-49pA^@r9c=OugQ@F%>CvpStNa z#MJp{$^)xz3DcpUPM0t6rz`yUY)*MYc*uKlGIT`33?)v9cK?zwLlr`eRunv zG?$;GuYK_cM0N8au@rxq?Hbc)4}lu^!}|MWtFbOb5UX-R|q`Ofi4hRISKpH($^%-M?_qey{F&WxeACjoHcHBfpb~)=En~SNJ zJgkw?)TL(FdDogD1q6-orkf`S-(Mbgb@l^+TCfUt2`W$*shr{U-g_^6nkngeA-;)J zK(~aPrwy`)s;NUJa|JTR`e3GMJ`h?WqOdA7tgR|VD)*S_qWR_9!A)D+ezLhmt`R7# zOGsytTLc6!?pII=TO?X|EkafmLN^G*E7rucn}khH;}N`dv%vC1ea4cS@qoOb1nY<= zv>_rCVAPxg=?h3BMK~>d#TKZsc(EtfEp-p;;OPOKkNoXF`=z|KD`CHK00000NkvXX Hu0mjfr?Dm? literal 0 HcmV?d00001