Build fixed. Bukkit, I hate breaking changes!

However, this is not tested *at all*. Try it if you're brave enough ^^
This commit is contained in:
main() 2012-03-01 16:55:37 +01:00
parent 8c63cac4c5
commit 873d878252
2 changed files with 19 additions and 13 deletions

View File

@ -189,7 +189,9 @@ public class MVWorld implements MultiverseWorld {
// Things I haven't converted yet.
this.getMobExceptions();
this.getWorldBlacklist().addAll(worldSection.getList("worldblacklist", new ArrayList<String>()));
List<String> tempWorldBlacklist = worldSection.getStringList("worldblacklist");
if (tempWorldBlacklist != null)
this.getWorldBlacklist().addAll(tempWorldBlacklist);
// Enable and do the save.
this.canSave = true;
@ -334,16 +336,19 @@ public class MVWorld implements MultiverseWorld {
// TODO: Migrate this method.
private void getMobExceptions() {
List<String> temp;
temp = this.worldSection.getList("animals.exceptions", new ArrayList<String>());
temp = this.worldSection.getStringList("animals.exceptions");
// Add Animals to the exclusion list
for (String s : temp) {
this.masterList.get("animals").add(s.toUpperCase());
if (temp != null) {
for (String s : temp) {
this.masterList.get("animals").add(s.toUpperCase());
}
}
temp = this.worldSection.getList("monsters.exceptions", new ArrayList<String>());
temp = this.worldSection.getStringList("monsters.exceptions");
// Add Monsters to the exclusion list
for (String s : temp) {
this.masterList.get("monsters").add(s.toUpperCase());
if (temp != null) {
for (String s : temp) {
this.masterList.get("monsters").add(s.toUpperCase());
}
}
}

View File

@ -21,6 +21,7 @@ import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
@ -71,7 +72,7 @@ public class TestWorldProperties {
private PlayerJoinEvent playerJoinEvent;
private PlayerRespawnEvent playerRespawnBed;
private PlayerRespawnEvent playerRespawnNormal;
private Entity mockEntity;
private HumanEntity mockHumanEntity;
private EntityRegainHealthEvent entityRegainHealthEvent;
private FoodLevelChangeEvent entityFoodLevelChangeEvent;
private FoodLevelChangeEvent entityFoodLevelRiseEvent;
@ -327,17 +328,17 @@ public class TestWorldProperties {
when(playerRespawnNormal.getPlayer()).thenReturn(mockPlayer);
when(playerRespawnNormal.isBedSpawn()).thenReturn(false);
//// Entity events
mockEntity = mock(Entity.class);
mockHumanEntity = mock(HumanEntity.class);
// entity regain health
entityRegainHealthEvent = PowerMockito.mock(EntityRegainHealthEvent.class);
when(entityRegainHealthEvent.getRegainReason()).thenReturn(RegainReason.REGEN);
when(mockEntity.getLocation()).thenReturn(new Location(mvWorld.getCBWorld(), 0, 0, 0));
when(entityRegainHealthEvent.getEntity()).thenReturn(mockEntity);
when(mockHumanEntity.getLocation()).thenReturn(new Location(mvWorld.getCBWorld(), 0, 0, 0));
when(entityRegainHealthEvent.getEntity()).thenReturn(mockHumanEntity);
// entity food level change event
entityFoodLevelChangeEvent = PowerMockito.mock(FoodLevelChangeEvent.class);
// this won't do anything since we're not mocking a player,
// but the plugin should be able to handle this!
when(entityFoodLevelChangeEvent.getEntity()).thenReturn(mockEntity);
when(entityFoodLevelChangeEvent.getEntity()).thenReturn(mockHumanEntity);
entityFoodLevelRiseEvent = PowerMockito.mock(FoodLevelChangeEvent.class);
when(mockPlayer.getFoodLevel()).thenReturn(2);
when(entityFoodLevelRiseEvent.getEntity()).thenReturn(mockPlayer);