Removed fruit blocks in favor of having them drop from leaves (Like vanilla apples)

This commit is contained in:
Forstride 2016-01-31 00:45:26 -05:00
parent 3b2df4f5fe
commit 2e39cea6c0
23 changed files with 80 additions and 279 deletions

View file

@ -113,7 +113,6 @@ public class BOPBlocks
public static Block waterlily;
public static Block dirt;
public static Block stone_formations;
public static Block fruit_block;
public static Block ash_stone;
public static Block hard_sand;
public static Block hard_dirt;

View file

@ -35,7 +35,7 @@ public class BiomeGenFlowerField extends BOPBiome
this.setColor(4044093);
this.setTemperatureRainfall(0.6F, 0.7F);
this.addWeight(BOPClimates.WARM_TEMPERATE, 3);
this.addWeight(BOPClimates.WARM_TEMPERATE, 2);
this.spawnableCreatureList.add(new SpawnListEntry(EntityButterfly.class, 6, 2, 4));

View file

@ -1,135 +0,0 @@
/*******************************************************************************
* Copyright 2014-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.block;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import biomesoplenty.api.item.BOPItems;
public class BlockBOPFruit extends BlockBOPDecoration
{
// add properties
public static enum FruitType implements IStringSerializable
{
APPLE, PERSIMMON, PEACH, PEAR, PINECONE;
@Override
public String getName()
{
return this.name().toLowerCase();
}
@Override
public String toString()
{
return this.getName();
}
};
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", FruitType.class);
@Override
protected BlockState createBlockState() {return new BlockState(this, new IProperty[] { VARIANT });}
// implement IBOPBlock
@Override
public IProperty[] getPresetProperties() { return new IProperty[] {VARIANT}; }
@Override
public IProperty[] getNonRenderingProperties() { return null; }
@Override
public String getStateName(IBlockState state)
{
return ((FruitType) state.getValue(VARIANT)).getName() + "_block";
}
// constructor
public BlockBOPFruit() {
// set some defaults
this.setStepSound(Block.soundTypeGrass);
this.setBlockBoundsByRadiusAndHeight(0.25F, 0.25F, true);
this.setDefaultState( this.blockState.getBaseState().withProperty(VARIANT, FruitType.APPLE) );
this.setCreativeTab(null);
}
// map from state to meta and vice verca
@Override
public IBlockState getStateFromMeta(int meta)
{
return this.getDefaultState().withProperty(VARIANT, FruitType.values()[meta]);
}
@Override
public int getMetaFromState(IBlockState state)
{
return ((FruitType) state.getValue(VARIANT)).ordinal();
}
// only allow fruit to hang from leaves
@Override
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{
Block blockAbove = world.getBlockState(pos.up()).getBlock();
return (blockAbove instanceof BlockBOPLeaves) || blockAbove == Blocks.leaves || blockAbove == Blocks.leaves2;
}
// map states to the corresponding fruit item
public static Item getFruitItem(IBlockState state)
{
switch ((FruitType) state.getValue(VARIANT))
{
case PERSIMMON:
return BOPItems.persimmon;
case PEACH:
return BOPItems.peach;
case PEAR:
return BOPItems.pear;
case PINECONE:
return BOPItems.pinecone;
case APPLE: default:
return Items.apple;
}
}
// In creative mode, pick block to get the fruit item
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
Item item = getFruitItem(state);
int meta = damageDropped(state);
return new ItemStack(item, 1, meta);
}
// fruit blocks drop the corresponding fruit item when broken
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return getFruitItem(state);
}
// prevent fruit block meta value affecting fruit item dropped
@Override
public int damageDropped(IBlockState state)
{
return 0;
}
}

View file

@ -11,10 +11,6 @@ package biomesoplenty.common.block;
import java.util.List;
import java.util.Random;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.item.ItemBOPBlock;
import biomesoplenty.common.util.block.VariantPagingHelper;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.properties.IProperty;
@ -37,6 +33,11 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeColorHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.item.ItemBOPBlock;
import biomesoplenty.common.util.block.VariantPagingHelper;
// TODO: using fast graphics - transparent color is always rendered as black - can we override this somehow?
// TODO: using fast graphics - flowering leaves overlay seems to be tinted green - I think that is because it doesn't use distinct tintindexes on fast graphics
@ -249,27 +250,101 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
case RED_BIG_FLOWER: case YELLOW_BIG_FLOWER:
break;
case YELLOW_AUTUMN:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.persimmon, 1, 0);
}
break;
case ORANGE_AUTUMN:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.persimmon, 1, 0);
}
break;
case BAMBOO:
break;
case MAGIC:
break;
case UMBRAN:
break;
case DEAD:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.persimmon, 1, 0);
}
break;
case FIR:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.pinecone, 1, 0);
}
break;
case ETHEREAL:
break;
case ORIGIN:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(Items.apple, 1, 0);
}
break;
case PINK_CHERRY:
break;
case WHITE_CHERRY:
break;
case MAPLE:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.persimmon, 1, 0);
}
break;
case HELLBARK:
break;
case FLOWERING:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.peach, 1, 0);
}
break;
case JACARANDA:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.peach, 1, 0);
}
break;
case SACRED_OAK:
break;
case MANGROVE:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.pear, 1, 0);
}
break;
case PALM:
break;
case REDWOOD:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.pinecone, 1, 0);
}
break;
case WILLOW:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.pear, 1, 0);
}
break;
case PINE:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.pinecone, 1, 0);
}
break;
case MAHOGANY:
if (worldIn.rand.nextInt(chance) == 0)
{
fruit = new ItemStack(BOPItems.peach, 1, 0);
}
break;
default:
if (worldIn.rand.nextInt(chance) == 0)
{

View file

@ -47,7 +47,6 @@ import biomesoplenty.common.block.BlockBOPFence;
import biomesoplenty.common.block.BlockBOPFenceGate;
import biomesoplenty.common.block.BlockBOPFlesh;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPFruit;
import biomesoplenty.common.block.BlockBOPGem;
import biomesoplenty.common.block.BlockBOPGemOre;
import biomesoplenty.common.block.BlockBOPGeneric;
@ -118,7 +117,6 @@ public class ModBlocks
waterlily = registerBlock( new BlockBOPLilypad(), "waterlily" );
dirt = registerBlock( new BlockBOPDirt(), "dirt" );
stone_formations = registerBlock( new BlockBOPStoneFormations(), "stone_formations" );
fruit_block = registerBlock( new BlockBOPFruit(), "fruit_block" /*, creativeTab(null) */); // TODO: once the mechanism for farming fruit is established: remove creative tab
crystal = registerBlock( new BlockBOPCrystal(), "crystal" );
biome_block = registerBlock( new BlockBOPBiomeBlock(), "biome_block" );

View file

@ -182,8 +182,6 @@ public class ThaumcraftCompat
private static void addThaumcraftGolemsSupport()
{
addClickableCrop(BlockBOPPlant.paging.getVariantState(BOPPlants.BERRYBUSH));
FMLInterModComms.sendMessage("Thaumcraft", "harvestStandardCrop", new ItemStack(BOPBlocks.fruit_block, 1, 0));
FMLInterModComms.sendMessage("Thaumcraft", "harvestStandardCrop", new ItemStack(BOPBlocks.fruit_block, 1, 1));
}
private static void addAspectsToBlock(Block block, Aspect[] aspects, int[] amounts)

View file

@ -1,9 +0,0 @@
{
"variants": {
"variant=apple": { "model": "biomesoplenty:apple_block" },
"variant=persimmon": { "model": "biomesoplenty:persimmon_block" },
"variant=peach": { "model": "biomesoplenty:peach_block" },
"variant=pear": { "model": "biomesoplenty:pear_block" },
"variant=pinecone": { "model" : "biomesoplenty:pinecone_block" }
}
}

View file

@ -236,11 +236,6 @@ tile.flower_1.miners_delight.name=Miner's Delight
tile.flower_1.icy_iris.name=Icy Iris
tile.flower_1.rose.name=Rose
tile.flower_vine.name=Flowering Vines
tile.fruit_block.apple_block.name=Apple Block
tile.fruit_block.persimmon_block.name=Persimmon Block
tile.fruit_block.peach_block.name=Peach Block
tile.fruit_block.pear_block.name=Pear Block
tile.fruit_block.pinecone_block.name=Pinecone
tile.gem_block.amethyst_block.name=Block of Amethyst
tile.gem_block.ruby_block.name=Block of Ruby
tile.gem_block.peridot_block.name=Block of Peridot

View file

@ -1,6 +0,0 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/apple_block"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/peach_block"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/pear_block"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/persimmon_block"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "block/cross",
"textures": {
"cross": "biomesoplenty:blocks/pinecone_block"
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/apple_block"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/peach_block"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/pear_block"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/persimmon_block"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "biomesoplenty:blocks/pinecone_block"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B