Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed May 31, 2015
1 parent 5f56420 commit d908f20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ general:

# Villager limit - this is per team player, so an island of 4 will have 4x this number
# Note that 10 villagers minimum are required to create an iron farm. Zero is unlimited.
villagerlimit: 11
villagerlimit: 0

# Hopper limit - max number of island hoppers. If exceeded, players will not be able
# to place a hopper block. Zero is unlimited. Excessive hoppers can add to lag.
Expand Down
4 changes: 2 additions & 2 deletions src/com/wasteofplastic/askyblock/GridManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ public Location getSafeHomeLocation(final UUID p, int number) {
}
}

plugin.getLogger().info("DEBUG: Home location either isn't safe, or does not exist so try the island");
//plugin.getLogger().info("DEBUG: Home location either isn't safe, or does not exist so try the island");
// Home location either isn't safe, or does not exist so try the island
// location
if (plugin.getPlayers().inTeam(p)) {
Expand Down Expand Up @@ -1018,7 +1018,7 @@ public boolean homeTeleport(final Player player, int number) {
new SafeSpotTeleport(plugin, player, plugin.getPlayers().getHomeLocation(player.getUniqueId(), number), number);
return true;
}
plugin.getLogger().info("DEBUG: home loc = " + home);
//plugin.getLogger().info("DEBUG: home loc = " + home);
player.teleport(home);
//player.sendBlockChange(home, Material.GLOWSTONE, (byte)0);
if (number ==1 ) {
Expand Down
11 changes: 7 additions & 4 deletions src/com/wasteofplastic/askyblock/listeners/IslandGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,15 @@ public void onVillagerSpawn(final CreatureSpawnEvent e) {
return;
}
int limit = Settings.villagerLimit * Math.max(1,plugin.getPlayers().getMembers(island.getOwner()).size());
plugin.getLogger().info("DEBUG: villager limit = " + limit);
long time = System.nanoTime();
//plugin.getLogger().info("DEBUG: villager limit = " + limit);
//long time = System.nanoTime();
int pop = island.getPopulation();
plugin.getLogger().info("DEBUG: time = " + ((System.nanoTime() - time)*0.000000001));
//plugin.getLogger().info("DEBUG: time = " + ((System.nanoTime() - time)*0.000000001));
if (pop >= limit) {
plugin.getLogger().info("DEBUG: stopped a villager spawning!");
plugin.getLogger().warning(
"Island at " + island.getCenter().getBlockX() + "," + island.getCenter().getBlockZ() + " hit the island villager limit of "
+ limit);
//plugin.getLogger().info("Stopped villager spawning on island " + island.getCenter());
// Get all players in the area
List<Entity> players = e.getEntity().getNearbyEntities(10,10,10);
for (Entity player: players) {
Expand Down

0 comments on commit d908f20

Please sign in to comment.