mirror of
https://github.com/Eaglercraft-Archive/EaglercraftX-1.8-workspace.git
synced 2026-06-21 10:33:43 +02:00
u23
This commit is contained in:
@@ -10,6 +10,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
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.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
@@ -137,6 +138,25 @@ public class BlockCrops extends BlockBush implements IGrowable {
|
||||
return Items.wheat;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) {
|
||||
super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, 0);
|
||||
if (!world.isRemote) {
|
||||
int j = ((Integer) iblockstate.getValue(AGE)).intValue();
|
||||
if (j >= 7) {
|
||||
int k = 3 + i;
|
||||
|
||||
for (int l = 0; l < k; ++l) {
|
||||
if (world.rand.nextInt(15) <= j) {
|
||||
spawnAsEntity(world, blockpos, new ItemStack(this.getSeed(), 1, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user