mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Protect placeStore. It's ugly and still needs work.
This commit is contained in:
@ -130,7 +130,7 @@ public class Herbalism {
|
||||
|
||||
for (int y = 0; y <= 2; y++) {
|
||||
Block relativeBlock = block.getRelative(BlockFace.UP, y);
|
||||
if (relativeBlock.getType() == blockType && !mcMMO.placeStore.isTrue(relativeBlock)) {
|
||||
if (relativeBlock.getType() == blockType && !mcMMO.p.isPlaced(relativeBlock)) {
|
||||
dropAmount++;
|
||||
}
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class Herbalism {
|
||||
greenThumbWheat(block, player, plugin);
|
||||
}
|
||||
else {
|
||||
if (!mcMMO.placeStore.isTrue(block)) {
|
||||
if (!mcMMO.p.isPlaced(block)) {
|
||||
dropItem = herbalismBlock.getDropItem();
|
||||
xp = herbalismBlock.getXpGain();
|
||||
}
|
||||
@ -332,8 +332,8 @@ public class Herbalism {
|
||||
|
||||
case RED_ROSE:
|
||||
case YELLOW_FLOWER:
|
||||
if (mcMMO.placeStore.isTrue(block)) {
|
||||
mcMMO.placeStore.setFalse(block);
|
||||
if (mcMMO.p.isPlaced(block)) {
|
||||
mcMMO.p.setNotPlaced(block);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class BlastMiningDropEventHandler {
|
||||
McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();
|
||||
|
||||
for (Block block : droppedOres) {
|
||||
if (!mcMMO.placeStore.isTrue(block)) {
|
||||
if (!mcMMO.p.isPlaced(block)) {
|
||||
Mining.miningXP(mcMMOPlayer, block, block.getType());
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ public class BlastMiningDropEventHandler {
|
||||
droppedOres.add(block);
|
||||
Mining.miningDrops(block, location, type);
|
||||
|
||||
if (!mcMMO.placeStore.isTrue(block)) {
|
||||
if (!mcMMO.p.isPlaced(block)) {
|
||||
for (int i = 1 ; i < dropMultiplier ; i++) {
|
||||
droppedOres.add(block);
|
||||
Mining.miningDrops(block, location, type);
|
||||
|
@ -67,7 +67,7 @@ public class CallOfTheWildEventHandler {
|
||||
return;
|
||||
|
||||
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
|
||||
mcMMO.placeStore.addSpawnedPet(entity);
|
||||
mcMMO.p.setIsSpawned(entity);
|
||||
|
||||
((Tameable) entity).setOwner(player);
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class TamingManager extends SkillManager {
|
||||
* @param event The event to award XP for
|
||||
*/
|
||||
public void awardTamingXP(EntityTameEvent event) {
|
||||
if (mcMMO.placeStore.isSpawnedMob(event.getEntity())) {
|
||||
if (mcMMO.p.isSpawned(event.getEntity())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -459,8 +459,8 @@ public final class CombatTools {
|
||||
baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
|
||||
}
|
||||
}
|
||||
else if (!mcMMO.placeStore.isSpawnedMob(target)) {
|
||||
if (target instanceof Animals && !mcMMO.placeStore.isSpawnedPet(target)) {
|
||||
else if (!mcMMO.p.isSpawned(target)) {
|
||||
if (target instanceof Animals) {
|
||||
if (ModChecks.isCustomEntity(target)) {
|
||||
baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public final class TreeFeller {
|
||||
* @param treeFellerBlocks List of blocks to be removed
|
||||
*/
|
||||
private static void handleBlock(Block block, List<Block> futureCenterBlocks, List<Block> treeFellerBlocks) {
|
||||
if (!BlockChecks.treeFellerCompatible(block) || mcMMO.placeStore.isTrue(block) || treeFellerBlocks.contains(block)) {
|
||||
if (!BlockChecks.treeFellerCompatible(block) || mcMMO.p.isPlaced(block) || treeFellerBlocks.contains(block)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user