Skip to content

Commit

Permalink
Fixed NPE in VillageWatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunternif committed Feb 10, 2014
1 parent 76a4bb2 commit 7d48214
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hunternif/mc/atlas/ext/VillageWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Set;

import net.minecraft.village.Village;
import net.minecraft.village.VillageCollection;
import net.minecraft.village.VillageDoorInfo;
import net.minecraft.world.World;
import net.minecraftforge.event.EventPriority;
Expand Down Expand Up @@ -37,8 +38,9 @@ public void onPopulateChunk(PopulateChunkEvent.Post event) {
}

public void visitAllUnvisitedVillages(World world) {
List<Village> villages = world.villageCollectionObj.getVillageList();
for (Village village : villages) {
VillageCollection villageCollection = world.villageCollectionObj;
if (villageCollection == null) return;
for (Village village : (List<Village>) villageCollection.getVillageList()) {
if (!visited.contains(village)) {
visitVillage(world, village);
}
Expand Down

0 comments on commit 7d48214

Please sign in to comment.