mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	nope.avi
Revert "Protect placeStore. It's ugly and still needs work."
This reverts commit 1fe182babe.
			
			
This commit is contained in:
		@@ -65,17 +65,17 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        Block futureEmptyBlock = event.getBlock().getRelative(direction); // Block that would be air after piston is finished
 | 
					        Block futureEmptyBlock = event.getBlock().getRelative(direction); // Block that would be air after piston is finished
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (Block b : blocks) {
 | 
					        for (Block b : blocks) {
 | 
				
			||||||
            if (mcMMO.p.isPlaced(b)) {
 | 
					            if (mcMMO.placeStore.isTrue(b)) {
 | 
				
			||||||
                b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true));
 | 
					                b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true));
 | 
				
			||||||
                if (b.equals(futureEmptyBlock)) {
 | 
					                if (b.equals(futureEmptyBlock)) {
 | 
				
			||||||
                    mcMMO.p.setNotPlaced(b);
 | 
					                    mcMMO.placeStore.setFalse(b);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (Block b : blocks) {
 | 
					        for (Block b : blocks) {
 | 
				
			||||||
            if (b.getRelative(direction).hasMetadata("pistonTrack")) {
 | 
					            if (b.getRelative(direction).hasMetadata("pistonTrack")) {
 | 
				
			||||||
                mcMMO.p.setIsPlaced(b.getRelative(direction));
 | 
					                mcMMO.placeStore.setTrue(b.getRelative(direction));
 | 
				
			||||||
                b.getRelative(direction).removeMetadata("pistonTrack", plugin);
 | 
					                b.getRelative(direction).removeMetadata("pistonTrack", plugin);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -111,7 +111,7 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /* Check if the blocks placed should be monitored so they do not give out XP in the future */
 | 
					        /* Check if the blocks placed should be monitored so they do not give out XP in the future */
 | 
				
			||||||
        if (BlockChecks.shouldBeWatched(block)) {
 | 
					        if (BlockChecks.shouldBeWatched(block)) {
 | 
				
			||||||
            mcMMO.p.setIsPlaced(block);
 | 
					            mcMMO.placeStore.setTrue(block);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (Repair.anvilMessagesEnabled) {
 | 
					        if (Repair.anvilMessagesEnabled) {
 | 
				
			||||||
@@ -169,7 +169,7 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* MINING */
 | 
					        /* MINING */
 | 
				
			||||||
        else if (BlockChecks.canBeSuperBroken(block) && ItemChecks.isPickaxe(heldItem) && player.hasPermission("mcmmo.skills.mining") && !mcMMO.p.isPlaced(block)) {
 | 
					        else if (BlockChecks.canBeSuperBroken(block) && ItemChecks.isPickaxe(heldItem) && player.hasPermission("mcmmo.skills.mining") && !mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
            MiningManager miningManager = new MiningManager(mcMMOPlayer);
 | 
					            MiningManager miningManager = new MiningManager(mcMMOPlayer);
 | 
				
			||||||
            miningManager.miningBlockCheck(block);
 | 
					            miningManager.miningBlockCheck(block);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -179,7 +179,7 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* WOOD CUTTING */
 | 
					        /* WOOD CUTTING */
 | 
				
			||||||
        else if (BlockChecks.isLog(block) && player.hasPermission("mcmmo.skills.woodcutting") && !mcMMO.p.isPlaced(block)) {
 | 
					        else if (BlockChecks.isLog(block) && player.hasPermission("mcmmo.skills.woodcutting") && !mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
            if (profile.getAbilityMode(AbilityType.TREE_FELLER) && player.hasPermission("mcmmo.ability.woodcutting.treefeller") && ItemChecks.isAxe(heldItem)) {
 | 
					            if (profile.getAbilityMode(AbilityType.TREE_FELLER) && player.hasPermission("mcmmo.ability.woodcutting.treefeller") && ItemChecks.isAxe(heldItem)) {
 | 
				
			||||||
                Woodcutting.beginTreeFeller(mcMMOPlayer, block);
 | 
					                Woodcutting.beginTreeFeller(mcMMOPlayer, block);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -196,7 +196,7 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* EXCAVATION */
 | 
					        /* EXCAVATION */
 | 
				
			||||||
        else if (BlockChecks.canBeGigaDrillBroken(block) && ItemChecks.isShovel(heldItem) && player.hasPermission("mcmmo.skills.excavation") && !mcMMO.p.isPlaced(block)) {
 | 
					        else if (BlockChecks.canBeGigaDrillBroken(block) && ItemChecks.isShovel(heldItem) && player.hasPermission("mcmmo.skills.excavation") && !mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
            Excavation.excavationProcCheck(block, mcMMOPlayer);
 | 
					            Excavation.excavationProcCheck(block, mcMMOPlayer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
 | 
					            if (profile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)) {
 | 
				
			||||||
@@ -205,8 +205,8 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* Remove metadata from placed watched blocks */
 | 
					        /* Remove metadata from placed watched blocks */
 | 
				
			||||||
        if (BlockChecks.shouldBeWatched(block) && mcMMO.p.isPlaced(block)) {
 | 
					        if (BlockChecks.shouldBeWatched(block) && mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
            mcMMO.p.setNotPlaced(block);
 | 
					            mcMMO.placeStore.setFalse(block);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -233,7 +233,7 @@ public class BlockListener implements Listener {
 | 
				
			|||||||
        if (player.hasPermission("mcmmo.ability.herbalism.hylianluck") && ItemChecks.isSword(heldItem)) {
 | 
					        if (player.hasPermission("mcmmo.ability.herbalism.hylianluck") && ItemChecks.isSword(heldItem)) {
 | 
				
			||||||
            Herbalism.hylianLuck(block, player, event);
 | 
					            Herbalism.hylianLuck(block, player, event);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if (BlockChecks.canBeFluxMined(block) && ItemChecks.isPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH) && player.hasPermission("mcmmo.ability.smelting.fluxmining") && !mcMMO.p.isPlaced(block)) {
 | 
					        else if (BlockChecks.canBeFluxMined(block) && ItemChecks.isPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH) && player.hasPermission("mcmmo.ability.smelting.fluxmining") && !mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
            SmeltingManager smeltingManager = new SmeltingManager(Users.getPlayer(player));
 | 
					            SmeltingManager smeltingManager = new SmeltingManager(Users.getPlayer(player));
 | 
				
			||||||
            smeltingManager.fluxMining(event);
 | 
					            smeltingManager.fluxMining(event);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,13 +65,13 @@ public class EntityListener implements Listener {
 | 
				
			|||||||
        if (entity instanceof FallingBlock) {
 | 
					        if (entity instanceof FallingBlock) {
 | 
				
			||||||
            Block block = event.getBlock();
 | 
					            Block block = event.getBlock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (mcMMO.p.isPlaced(block) && !mcMMO.p.isSpawned(entity)) {
 | 
					            if (mcMMO.placeStore.isTrue(block) && !mcMMO.placeStore.isSpawnedMob(entity)) {
 | 
				
			||||||
                mcMMO.p.setNotPlaced(block);
 | 
					                mcMMO.placeStore.setFalse(block);
 | 
				
			||||||
                mcMMO.p.setIsSpawned(entity);
 | 
					                mcMMO.placeStore.addSpawnedMob(entity);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (mcMMO.p.isSpawned(entity)) {
 | 
					            else if (mcMMO.placeStore.isSpawnedMob(entity)) {
 | 
				
			||||||
                mcMMO.p.setIsPlaced(block);
 | 
					                mcMMO.placeStore.setTrue(block);
 | 
				
			||||||
                mcMMO.p.setNotSpawned(entity);
 | 
					                mcMMO.placeStore.removeSpawnedMob(entity);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -208,7 +208,7 @@ public class EntityListener implements Listener {
 | 
				
			|||||||
        entity.setFireTicks(0);
 | 
					        entity.setFireTicks(0);
 | 
				
			||||||
        BleedTimer.remove(entity);
 | 
					        BleedTimer.remove(entity);
 | 
				
			||||||
        Archery.arrowRetrievalCheck(entity);
 | 
					        Archery.arrowRetrievalCheck(entity);
 | 
				
			||||||
        mcMMO.p.setNotSpawned(entity);
 | 
					        mcMMO.placeStore.removeSpawnedMob(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -225,7 +225,7 @@ public class EntityListener implements Listener {
 | 
				
			|||||||
        SpawnReason reason = event.getSpawnReason();
 | 
					        SpawnReason reason = event.getSpawnReason();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (reason == SpawnReason.SPAWNER || reason == SpawnReason.SPAWNER_EGG) {
 | 
					        if (reason == SpawnReason.SPAWNER || reason == SpawnReason.SPAWNER_EGG) {
 | 
				
			||||||
            mcMMO.p.setIsSpawned(event.getEntity());
 | 
					            mcMMO.placeStore.addSpawnedMob(event.getEntity());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,9 +38,9 @@ public class WorldListener implements Listener {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (mcMMO.p.isPlaced(event.getLocation().getBlock())) {
 | 
					        if (mcMMO.placeStore.isTrue(event.getLocation().getBlock())) {
 | 
				
			||||||
            for (BlockState block : event.getBlocks()) {
 | 
					            for (BlockState block : event.getBlocks()) {
 | 
				
			||||||
                mcMMO.p.setNotPlaced(block.getBlock());
 | 
					                mcMMO.placeStore.setFalse(block.getBlock());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -73,7 +73,7 @@ public class WorldListener implements Listener {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
 | 
					    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
 | 
				
			||||||
    public void onWorldUnload(WorldUnloadEvent event) {
 | 
					    public void onWorldUnload(WorldUnloadEvent event) {
 | 
				
			||||||
        mcMMO.p.setUnloaded(event.getWorld());
 | 
					        mcMMO.placeStore.unloadWorld(event.getWorld());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -83,7 +83,9 @@ public class WorldListener implements Listener {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
 | 
					    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
 | 
				
			||||||
    public void onChunkUnload(ChunkUnloadEvent event) {
 | 
					    public void onChunkUnload(ChunkUnloadEvent event) {
 | 
				
			||||||
        mcMMO.p.setUnloaded(event.getChunk(), event.getWorld());
 | 
					        Chunk chunk = event.getChunk();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        mcMMO.placeStore.chunkUnloaded(chunk.getX(), chunk.getZ(), event.getWorld());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -98,7 +100,7 @@ public class WorldListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for (Entity entity : entities) {
 | 
					        for (Entity entity : entities) {
 | 
				
			||||||
            if (entity instanceof LivingEntity || entity instanceof FallingBlock) {
 | 
					            if (entity instanceof LivingEntity || entity instanceof FallingBlock) {
 | 
				
			||||||
                mcMMO.p.setLoaded(chunk, event.getWorld(), entities);
 | 
					                mcMMO.placeStore.loadChunk(chunk.getX(), chunk.getZ(), event.getWorld(), entities);
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,11 +8,8 @@ import java.util.List;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import net.shatteredlands.shatt.backup.ZipLibrary;
 | 
					import net.shatteredlands.shatt.backup.ZipLibrary;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Chunk;
 | 
					 | 
				
			||||||
import org.bukkit.OfflinePlayer;
 | 
					import org.bukkit.OfflinePlayer;
 | 
				
			||||||
import org.bukkit.World;
 | 
					 | 
				
			||||||
import org.bukkit.block.Block;
 | 
					import org.bukkit.block.Block;
 | 
				
			||||||
import org.bukkit.entity.Entity;
 | 
					 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.plugin.PluginManager;
 | 
					import org.bukkit.plugin.PluginManager;
 | 
				
			||||||
import org.bukkit.plugin.java.JavaPlugin;
 | 
					import org.bukkit.plugin.java.JavaPlugin;
 | 
				
			||||||
@@ -66,7 +63,7 @@ public class mcMMO extends JavaPlugin {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public static mcMMO p;
 | 
					    public static mcMMO p;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private ChunkManager placeStore;
 | 
					    public static ChunkManager placeStore;
 | 
				
			||||||
    public static RepairManager repairManager;
 | 
					    public static RepairManager repairManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Jar Stuff
 | 
					    // Jar Stuff
 | 
				
			||||||
@@ -422,48 +419,4 @@ public class mcMMO extends JavaPlugin {
 | 
				
			|||||||
    public void toggleXpEventEnabled() {
 | 
					    public void toggleXpEventEnabled() {
 | 
				
			||||||
        xpEventEnabled = !xpEventEnabled;
 | 
					        xpEventEnabled = !xpEventEnabled;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public boolean isPlaced(Block block) {
 | 
					 | 
				
			||||||
        return placeStore.isTrue(block);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setNotPlaced(Block block) {
 | 
					 | 
				
			||||||
        placeStore.setFalse(block);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setIsPlaced(Block block) {
 | 
					 | 
				
			||||||
        placeStore.setTrue(block);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public boolean isSpawned(Entity entity) {
 | 
					 | 
				
			||||||
        return placeStore.isSpawnedMob(entity);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setIsSpawned(Entity entity) {
 | 
					 | 
				
			||||||
        placeStore.addSpawnedMob(entity);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setNotSpawned(Entity entity) {
 | 
					 | 
				
			||||||
        placeStore.removeSpawnedMob(entity);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setUnloaded(World world) {
 | 
					 | 
				
			||||||
        placeStore.unloadWorld(world);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setUnloaded(Chunk chunk, World world) {
 | 
					 | 
				
			||||||
        placeStore.chunkUnloaded(chunk.getX(), chunk.getZ(), world);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void setLoaded(Chunk chunk, World world, Entity[] entities) {
 | 
					 | 
				
			||||||
        placeStore.loadChunk(chunk.getX(), chunk.getZ(), world, entities);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void cleanMobLists() {
 | 
					 | 
				
			||||||
        placeStore.cleanMobLists();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public ChunkManager getChunkStore() {
 | 
					 | 
				
			||||||
        return placeStore;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,6 @@ public class MobStoreCleaner implements Runnable {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void run() {
 | 
					    public void run() {
 | 
				
			||||||
        mcMMO.p.cleanMobLists();
 | 
					        mcMMO.placeStore.cleanMobLists();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -22,11 +22,11 @@ public class StickyPistonTracker implements Runnable {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!mcMMO.p.isPlaced(originalBlock)) {
 | 
					        if (!mcMMO.placeStore.isTrue(originalBlock)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        mcMMO.p.setNotPlaced(originalBlock);
 | 
					        mcMMO.placeStore.setFalse(originalBlock);
 | 
				
			||||||
        mcMMO.p.setIsPlaced(newBlock);
 | 
					        mcMMO.placeStore.setTrue(newBlock);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -130,7 +130,7 @@ public class Herbalism {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for (int y = 0;  y <= 2; y++) {
 | 
					        for (int y = 0;  y <= 2; y++) {
 | 
				
			||||||
            Block relativeBlock = block.getRelative(BlockFace.UP, y);
 | 
					            Block relativeBlock = block.getRelative(BlockFace.UP, y);
 | 
				
			||||||
            if (relativeBlock.getType() == blockType && !mcMMO.p.isPlaced(relativeBlock)) {
 | 
					            if (relativeBlock.getType() == blockType && !mcMMO.placeStore.isTrue(relativeBlock)) {
 | 
				
			||||||
                dropAmount++;
 | 
					                dropAmount++;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -177,7 +177,7 @@ public class Herbalism {
 | 
				
			|||||||
                greenThumbWheat(block, player, plugin);
 | 
					                greenThumbWheat(block, player, plugin);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                if (!mcMMO.p.isPlaced(block)) {
 | 
					                if (!mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
                    dropItem = herbalismBlock.getDropItem();
 | 
					                    dropItem = herbalismBlock.getDropItem();
 | 
				
			||||||
                    xp = herbalismBlock.getXpGain();
 | 
					                    xp = herbalismBlock.getXpGain();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@@ -332,8 +332,8 @@ public class Herbalism {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            case RED_ROSE:
 | 
					            case RED_ROSE:
 | 
				
			||||||
            case YELLOW_FLOWER:
 | 
					            case YELLOW_FLOWER:
 | 
				
			||||||
                if (mcMMO.p.isPlaced(block)) {
 | 
					                if (mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
                    mcMMO.p.setNotPlaced(block);
 | 
					                    mcMMO.placeStore.setFalse(block);
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -51,7 +51,7 @@ public class BlastMiningDropEventHandler {
 | 
				
			|||||||
        McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();
 | 
					        McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (Block block : droppedOres) {
 | 
					        for (Block block : droppedOres) {
 | 
				
			||||||
            if (!mcMMO.p.isPlaced(block)) {
 | 
					            if (!mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
                Mining.miningXP(mcMMOPlayer, block, block.getType());
 | 
					                Mining.miningXP(mcMMOPlayer, block, block.getType());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -66,7 +66,7 @@ public class BlastMiningDropEventHandler {
 | 
				
			|||||||
                droppedOres.add(block);
 | 
					                droppedOres.add(block);
 | 
				
			||||||
                Mining.miningDrops(block, location, type);
 | 
					                Mining.miningDrops(block, location, type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!mcMMO.p.isPlaced(block)) {
 | 
					                if (!mcMMO.placeStore.isTrue(block)) {
 | 
				
			||||||
                    for (int i = 1 ; i < dropMultiplier ; i++) {
 | 
					                    for (int i = 1 ; i < dropMultiplier ; i++) {
 | 
				
			||||||
                        droppedOres.add(block);
 | 
					                        droppedOres.add(block);
 | 
				
			||||||
                        Mining.miningDrops(block, location, type);
 | 
					                        Mining.miningDrops(block, location, type);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,7 @@ public class CallOfTheWildEventHandler {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
 | 
					        LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
 | 
				
			||||||
        mcMMO.p.setIsSpawned(entity);
 | 
					        mcMMO.placeStore.addSpawnedPet(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ((Tameable) entity).setOwner(player);
 | 
					        ((Tameable) entity).setOwner(player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ public class TamingManager extends SkillManager {
 | 
				
			|||||||
     * @param event The event to award XP for
 | 
					     * @param event The event to award XP for
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public void awardTamingXP(EntityTameEvent event) {
 | 
					    public void awardTamingXP(EntityTameEvent event) {
 | 
				
			||||||
        if (mcMMO.p.isSpawned(event.getEntity())) {
 | 
					        if (mcMMO.placeStore.isSpawnedMob(event.getEntity())) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -459,8 +459,8 @@ public final class CombatTools {
 | 
				
			|||||||
                baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
 | 
					                baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if (!mcMMO.p.isSpawned(target)) {
 | 
					        else if (!mcMMO.placeStore.isSpawnedMob(target)) {
 | 
				
			||||||
            if (target instanceof Animals) {
 | 
					            if (target instanceof Animals && !mcMMO.placeStore.isSpawnedPet(target)) {
 | 
				
			||||||
                if (ModChecks.isCustomEntity(target)) {
 | 
					                if (ModChecks.isCustomEntity(target)) {
 | 
				
			||||||
                    baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
 | 
					                    baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,7 +112,7 @@ public final class TreeFeller {
 | 
				
			|||||||
     * @param treeFellerBlocks List of blocks to be removed
 | 
					     * @param treeFellerBlocks List of blocks to be removed
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private static void handleBlock(Block block, List<Block> futureCenterBlocks, List<Block> treeFellerBlocks) {
 | 
					    private static void handleBlock(Block block, List<Block> futureCenterBlocks, List<Block> treeFellerBlocks) {
 | 
				
			||||||
        if (!BlockChecks.treeFellerCompatible(block) || mcMMO.p.isPlaced(block) || treeFellerBlocks.contains(block)) {
 | 
					        if (!BlockChecks.treeFellerCompatible(block) || mcMMO.placeStore.isTrue(block) || treeFellerBlocks.contains(block)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -619,9 +619,11 @@ public class HashChunkManager implements ChunkManager {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
 | 
					        List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
 | 
				
			||||||
        for (Entity entity : tempSpawnedMobs) {
 | 
					        for (Entity entity : tempSpawnedMobs) {
 | 
				
			||||||
            if (entity.isDead() || !entity.isValid()) {
 | 
					            if (entity.isDead())
 | 
				
			||||||
 | 
					                mobsToRemove.add(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!entity.isValid())
 | 
				
			||||||
                mobsToRemove.add(entity);
 | 
					                mobsToRemove.add(entity);
 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        spawnedMobs.removeAll(mobsToRemove);
 | 
					        spawnedMobs.removeAll(mobsToRemove);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@ public class BlockStoreConversionZDirectory implements Runnable {
 | 
				
			|||||||
        this.world = world;
 | 
					        this.world = world;
 | 
				
			||||||
        this.scheduler = mcMMO.p.getServer().getScheduler();
 | 
					        this.scheduler = mcMMO.p.getServer().getScheduler();
 | 
				
			||||||
        this.manager = new HashChunkletManager();
 | 
					        this.manager = new HashChunkletManager();
 | 
				
			||||||
        this.newManager = (HashChunkManager) mcMMO.p.getChunkStore();
 | 
					        this.newManager = (HashChunkManager) mcMMO.placeStore;
 | 
				
			||||||
        this.dataDir = dataDir;
 | 
					        this.dataDir = dataDir;
 | 
				
			||||||
        this.xDir = xDir;
 | 
					        this.xDir = xDir;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user