mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-25 14:24:40 +00:00
Updated Api. Deleted duplcates. Removed tool refiller.
This commit is contained in:
1 parent
317ec69c85
commit
74a3b1eb74
174 files changed
+16657
-3115
No files matched your search
@@ -1,47 +1,47 @@
|
||||
package ic2.api.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
/**
|
||||
* Blocks on this whitelist will not resist an explosion but won't be destroyed.
|
||||
* <p/>
|
||||
*
|
||||
* The explosion code by default ignores blocks which absorb more than 1000 explosion power to
|
||||
* prevent abusing personal safes, Trade-O-Mats and other blocks to serve as a cheap and
|
||||
* invulnerable reactor chambers. Said blocks will not shield the explosion and won't get
|
||||
* destroyed.
|
||||
*/
|
||||
public final class ExplosionWhitelist {
|
||||
/**
|
||||
* Add a block to the whitelist.
|
||||
*
|
||||
* @param block block to add
|
||||
*/
|
||||
public static void addWhitelistedBlock(Block block) {
|
||||
whitelist.add(block);
|
||||
}
|
||||
/**
|
||||
* Add a block to the whitelist.
|
||||
*
|
||||
* @param block block to add
|
||||
*/
|
||||
public static void addWhitelistedBlock(Block block) {
|
||||
whitelist.add(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a block from the whitelist.
|
||||
*
|
||||
* @param block block to remove
|
||||
*/
|
||||
public static void removeWhitelistedBlock(Block block) {
|
||||
whitelist.remove(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a block is on the whitelist.
|
||||
*
|
||||
* @param block block to check if whitelisted
|
||||
* @return Whether the block is whitelisted
|
||||
*/
|
||||
public static boolean isBlockWhitelisted(Block block) {
|
||||
return whitelist.contains(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a block from the whitelist.
|
||||
*
|
||||
* @param block block to remove
|
||||
*/
|
||||
public static void removeWhitelistedBlock(Block block) {
|
||||
whitelist.remove(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a block is on the whitelist.
|
||||
*
|
||||
* @param block block to check if whitelisted
|
||||
* @return Whether the block is whitelisted
|
||||
*/
|
||||
public static boolean isBlockWhitelisted(Block block) {
|
||||
return whitelist.contains(block);
|
||||
}
|
||||
|
||||
private static Set<Block> whitelist = new HashSet<Block>();
|
||||
private static Set<Block> whitelist = new HashSet<Block>();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user