mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 21:15:28 +02:00
Fix issue with tracking falling sand & gravel.
This commit is contained in:
@@ -9,6 +9,7 @@ import java.util.List;
|
||||
import net.shatteredlands.shatt.backup.ZipLibrary;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@@ -96,6 +97,7 @@ public class mcMMO extends JavaPlugin {
|
||||
|
||||
private HashMap<String, String> aliasMap = new HashMap<String, String>(); //Alias - Command
|
||||
private HashMap<Integer, String> tntTracker = new HashMap<Integer, String>();
|
||||
private HashMap<Integer, Block> fallingBlockTracker = new HashMap<Integer, Block>();
|
||||
|
||||
private static Database database;
|
||||
public static mcMMO p;
|
||||
@@ -519,6 +521,44 @@ public class mcMMO extends JavaPlugin {
|
||||
tntTracker.remove(tntID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an ID value to the FallingBlock tracker.
|
||||
*
|
||||
* @param fallingBlockID The EntityID of the FallingBlock
|
||||
*/
|
||||
public void addToFallingBlockTracker(int fallingBlockID, Block sourceBlock) {
|
||||
fallingBlockTracker.put(fallingBlockID, sourceBlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if a given FallingBlock Entity is tracked.
|
||||
*
|
||||
* @param tntID The EntityID of the FallingBlock
|
||||
* @return true if the FallingBlock is being tracked, false otherwise
|
||||
*/
|
||||
public boolean fallingBlockIsTracked(int fallingBlockID) {
|
||||
return fallingBlockTracker.containsKey(fallingBlockID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the initial location of the FallingBlock.
|
||||
*
|
||||
* @param fallingBlockID The EntityID of the FallingBlock
|
||||
* @return the Player who detonated it
|
||||
*/
|
||||
public Block getSourceBlock(int fallingBlockID) {
|
||||
return fallingBlockTracker.get(fallingBlockID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove FallingBlock from the tracker after it lands.
|
||||
*
|
||||
* @param fallingBlockID The EntityID of the FallingBlock
|
||||
*/
|
||||
public void removeFromFallingBlockTracker(int fallingBlockID) {
|
||||
fallingBlockTracker.remove(fallingBlockID);
|
||||
}
|
||||
|
||||
public static String getMainDirectory() {
|
||||
return mainDirectory;
|
||||
}
|
||||
|
Reference in New Issue
Block a user