Removed Biome Essence from loot chests, and added Biome Essence Pods
This commit is contained in:
parent
60f01c2191
commit
a460c31e86
9 changed files with 52 additions and 32 deletions
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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"));
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 809 B |
Binary file not shown.
Before Width: | Height: | Size: 339 B |
Binary file not shown.
After Width: | Height: | Size: 673 B |
Loading…
Reference in a new issue