This commit is contained in:
eaglercraft
2024-02-19 02:02:25 -08:00
parent 2ebb5d6da9
commit 401ebe2324
1261 changed files with 12766 additions and 138431 deletions

View File

@@ -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.
*/