Last active
August 29, 2015 14:10
-
-
Save cmoore/a825f222f9c9f4fd585a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utils { | |
public static List<Chest> find_all_chests(World world) { | |
List<Chest> chests = new ArrayList(); | |
int tile_entities = 0; | |
for (Chunk c : world.getLoadedChunks()) { | |
for (BlockState b : c.getTileEntities()) { | |
tile_entities++; | |
Bukkit.getLogger().info("U WOT M8: " + b.toString()); | |
if (b instanceof Chest || b instanceof DoubleChest) { | |
// if (b.getType() == Material.CHEST) { | |
Bukkit.getLogger().info("Looky there."); | |
chests.add((Chest) b); | |
} | |
} | |
} | |
Bukkit.getLogger().info("Found " + String.valueOf(tile_entities) + " TileEntities."); | |
return chests; | |
} | |
} | |
/* | |
[21:03:46 INFO]: Hunger Games V3 1825 60 -2641 3 0 DIRT | |
[21:03:46 INFO]: Hunger Games V3 1861 80 -2068 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1861 62 -2070 9 0 STATIONARY_WATER | |
[21:03:46 INFO]: Hunger Games V3 1861 62 -2068 9 0 STATIONARY_WATER | |
[21:03:46 INFO]: Hunger Games V3 1861 74 -2070 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1861 74 -2068 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1861 68 -2070 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1861 68 -2068 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1861 80 -2070 0 0 AIR | |
[21:03:46 INFO]: Hunger Games V3 1739 56 -2077 9 0 STATIONARY_WATER | |
*/ |
ryantheleach
commented
Dec 4, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment