mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
Fixing remaining NPEs with custom blocks using vanilla IDs.
This commit is contained in:
parent
cd5df82d72
commit
cafed2d98c
@ -219,7 +219,7 @@ public class Mining {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (ModChecks.isCustomMiningBlock(block) && ModChecks.getCustomBlock(block) != null) {
|
if (ModChecks.isCustomMiningBlock(block)) {
|
||||||
CustomBlock customBlock = ModChecks.getCustomBlock(block);
|
CustomBlock customBlock = ModChecks.getCustomBlock(block);
|
||||||
int minimumDropAmount = customBlock.getMinimumDropAmount();
|
int minimumDropAmount = customBlock.getMinimumDropAmount();
|
||||||
int maximumDropAmount = customBlock.getMaximumDropAmount();
|
int maximumDropAmount = customBlock.getMaximumDropAmount();
|
||||||
@ -308,7 +308,7 @@ public class Mining {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (ModChecks.isCustomMiningBlock(block) && ModChecks.getCustomBlock(block) != null) {
|
if (ModChecks.isCustomMiningBlock(block)) {
|
||||||
xp += ModChecks.getCustomBlock(block).getXpGain();
|
xp += ModChecks.getCustomBlock(block).getXpGain();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -365,7 +365,7 @@ public class Mining {
|
|||||||
int durabilityLoss = Config.getInstance().getAbilityToolDamage();
|
int durabilityLoss = Config.getInstance().getAbilityToolDamage();
|
||||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||||
|
|
||||||
if (ModChecks.isCustomMiningBlock(block) && ModChecks.getCustomBlock(block) != null) {
|
if (ModChecks.isCustomMiningBlock(block)) {
|
||||||
if (ModChecks.getCustomBlock(block).getTier() < tier) {
|
if (ModChecks.getCustomBlock(block).getTier() < tier) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,11 +76,14 @@ public class ModChecks {
|
|||||||
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
||||||
|
|
||||||
if (customBlocksEnabled && blocksInstance.customMiningBlocks.contains(item)) {
|
if (customBlocksEnabled && blocksInstance.customMiningBlocks.contains(item)) {
|
||||||
return true;
|
for (CustomBlock b : blocksInstance.customBlocks) {
|
||||||
}
|
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
|
||||||
else {
|
return true;
|
||||||
return false;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,11 +97,14 @@ public class ModChecks {
|
|||||||
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
||||||
|
|
||||||
if (blocksInstance.customLeaves.contains(item)) {
|
if (blocksInstance.customLeaves.contains(item)) {
|
||||||
return true;
|
for (CustomBlock b : blocksInstance.customBlocks) {
|
||||||
}
|
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
|
||||||
else {
|
return true;
|
||||||
return false;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,11 +118,14 @@ public class ModChecks {
|
|||||||
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
||||||
|
|
||||||
if (blocksInstance.customLogs.contains(item)) {
|
if (blocksInstance.customLogs.contains(item)) {
|
||||||
return true;
|
for (CustomBlock b : blocksInstance.customBlocks) {
|
||||||
}
|
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
|
||||||
else {
|
return true;
|
||||||
return false;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,11 +139,14 @@ public class ModChecks {
|
|||||||
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
item.setData(new MaterialData(block.getTypeId(), block.getData()));
|
||||||
|
|
||||||
if (blocksInstance.customOres.contains(item)) {
|
if (blocksInstance.customOres.contains(item)) {
|
||||||
return true;
|
for (CustomBlock b : blocksInstance.customBlocks) {
|
||||||
}
|
if ((b.getItemID() == block.getTypeId()) && (b.getDataValue() == block.getData())) {
|
||||||
else {
|
return true;
|
||||||
return false;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user