Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix apatite ore crash #85

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/forestry/core/blocks/BlockResourceOre.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
******************************************************************************/
package forestry.core.blocks;

import static forestry.Forestry.isDreamcraftLoaded;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -52,7 +54,7 @@ public BlockResourceOre() {
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int metadata, float par6, int par7) {
super.dropBlockAsItemWithChance(world, x, y, z, metadata, par6, par7);

if (metadata == 0) {
if (metadata == 0 && !isDreamcraftLoaded) {
this.dropXpOnBlockBreak(world, x, y, z, MathHelper.getRandomIntegerInRange(world.rand, 1, 4));
}
}
Expand All @@ -61,7 +63,7 @@ public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> drops = new ArrayList<>();

if (metadata == ResourceType.APATITE.ordinal()) {
if (metadata == ResourceType.APATITE.ordinal() && !isDreamcraftLoaded) {
int fortuneModifier = world.rand.nextInt(fortune + 2) - 1;
if (fortuneModifier < 0) {
fortuneModifier = 0;
Expand Down