Skip to content

Commit

Permalink
Removed useless Island#getTileEntityCount(Material, World)
Browse files Browse the repository at this point in the history
  • Loading branch information
Poslovitch committed Jul 19, 2018
1 parent e15ed63 commit e9d3914
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/main/java/us/tastybento/bskyblock/database/objects/Island.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,45 +280,6 @@ public int getRank(User user) {
return members.getOrDefault(user.getUniqueId(), RanksManager.VISITOR_RANK);
}

/**
* @param material - Material
* @return count of how many tile entities of type mat are on the island at last count. Counts are done when a player places
* a tile entity.
*/
public int getTileEntityCount(Material material, World world) {
int result = 0;
for (int x = getMinProtectedX() /16; x <= (getMinProtectedX() + getProtectionRange() - 1)/16; x++) {
for (int z = getMinProtectedZ() /16; z <= (getMinProtectedZ() + getProtectionRange() - 1)/16; z++) {
for (BlockState holder : world.getChunkAt(x, z).getTileEntities()) {
if (onIsland(holder.getLocation())) {
if (holder.getType() == material) {
result++;
} else if (material.equals(Material.REDSTONE_COMPARATOR_OFF)) {
if (holder.getType().equals(Material.REDSTONE_COMPARATOR_ON)) {
result++;
}
} else if (material.equals(Material.FURNACE)) {
if (holder.getType().equals(Material.BURNING_FURNACE)) {
result++;
}
} else if (material.toString().endsWith("BANNER") && holder.getType().toString().endsWith("BANNER")) {
result++;
} else if ((material.equals(Material.WALL_SIGN) || material.equals(Material.SIGN_POST))
&& (holder.getType().equals(Material.WALL_SIGN) || holder.getType().equals(Material.SIGN_POST))) {
result++;
}
}
}
for (Entity holder : world.getChunkAt(x, z).getEntities()) {
if (holder.getType().toString().equals(material.toString()) && onIsland(holder.getLocation())) {
result++;
}
}
}
}
return result;
}

@Override
public String getUniqueId() {
return uniqueId;
Expand Down

0 comments on commit e9d3914

Please sign in to comment.