mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Protect our managers.
This commit is contained in:
@ -63,7 +63,7 @@ public class Herbalism {
|
||||
protected static int calculateCatciAndSugarDrops(BlockState blockState) {
|
||||
Block block = blockState.getBlock();
|
||||
Material blockType = blockState.getType();
|
||||
int dropAmount = mcMMO.placeStore.isTrue(block) ? 0 : 1;
|
||||
int dropAmount = mcMMO.getPlaceStore().isTrue(block) ? 0 : 1;
|
||||
|
||||
// Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally
|
||||
for (int y = 1; y < 3; y++) {
|
||||
@ -73,8 +73,8 @@ public class Herbalism {
|
||||
break;
|
||||
}
|
||||
|
||||
if (mcMMO.placeStore.isTrue(relativeBlock)) {
|
||||
mcMMO.placeStore.setFalse(relativeBlock);
|
||||
if (mcMMO.getPlaceStore().isTrue(relativeBlock)) {
|
||||
mcMMO.getPlaceStore().setFalse(relativeBlock);
|
||||
}
|
||||
else {
|
||||
dropAmount++;
|
||||
|
@ -118,7 +118,7 @@ public class HerbalismManager extends SkillManager {
|
||||
Material material = blockState.getType();
|
||||
boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.SUGAR_CANE_BLOCK);
|
||||
|
||||
if (oneBlockPlant && mcMMO.placeStore.isTrue(blockState)) {
|
||||
if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -206,8 +206,8 @@ public class HerbalismManager extends SkillManager {
|
||||
|
||||
case RED_ROSE:
|
||||
case YELLOW_FLOWER:
|
||||
if (mcMMO.placeStore.isTrue(blockState)) {
|
||||
mcMMO.placeStore.setFalse(blockState);
|
||||
if (mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
mcMMO.getPlaceStore().setFalse(blockState);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -139,13 +139,13 @@ public class MiningManager extends SkillManager{
|
||||
|
||||
for (BlockState blockState : ores) {
|
||||
if (Misc.getRandom().nextFloat() < (yield + oreBonus)) {
|
||||
if (!mcMMO.placeStore.isTrue(blockState)) {
|
||||
if (!mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
xp += Mining.getBlockXp(blockState);
|
||||
}
|
||||
|
||||
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack(1)); // Initial block that would have been dropped
|
||||
|
||||
if (!mcMMO.placeStore.isTrue(blockState)) {
|
||||
if (!mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
for (int i = 1; i < dropMultiplier; i++) {
|
||||
Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class RepairManager extends SkillManager {
|
||||
Player player = getPlayer();
|
||||
int itemId = item.getTypeId();
|
||||
|
||||
Repairable repairable = mcMMO.repairableManager.getRepairable(itemId);
|
||||
Repairable repairable = mcMMO.getRepairableManager().getRepairable(itemId);
|
||||
|
||||
// Permissions checks on material and item types
|
||||
if (!repairable.getRepairItemType().getPermissions(player)) {
|
||||
|
@ -25,7 +25,7 @@ public class SmeltingManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canUseFluxMining(BlockState blockState) {
|
||||
return getSkillLevel() >= Smelting.fluxMiningUnlockLevel && BlockUtils.affectedByFluxMining(blockState) && Permissions.fluxMining(getPlayer()) && !mcMMO.placeStore.isTrue(blockState);
|
||||
return getSkillLevel() >= Smelting.fluxMiningUnlockLevel && BlockUtils.affectedByFluxMining(blockState) && Permissions.fluxMining(getPlayer()) && !mcMMO.getPlaceStore().isTrue(blockState);
|
||||
}
|
||||
|
||||
public boolean canUseVanillaXpBoost() {
|
||||
|
@ -248,7 +248,7 @@ public final class Woodcutting {
|
||||
* @param treeFellerBlocks List of blocks to be removed
|
||||
*/
|
||||
private static void handleBlock(BlockState blockState, List<BlockState> futureCenterBlocks, List<BlockState> treeFellerBlocks) {
|
||||
if (!BlockUtils.affectedByTreeFeller(blockState) || mcMMO.placeStore.isTrue(blockState) || treeFellerBlocks.contains(blockState)) {
|
||||
if (!BlockUtils.affectedByTreeFeller(blockState) || mcMMO.getPlaceStore().isTrue(blockState) || treeFellerBlocks.contains(blockState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user