Protect placeStore. It's ugly and still needs work.

This commit is contained in:
GJ
2013-02-17 00:40:11 -05:00
parent f61aed9f6c
commit 1fe182babe
14 changed files with 90 additions and 46 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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;
}