v0.88.1 - Default rewards

This commit is contained in:
Garbage Mule 2011-06-03 16:43:08 +02:00
parent a48859be6b
commit 9b795c3174
4 changed files with 24 additions and 7 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: MobArena name: MobArena
main: com.garbagemule.MobArena.MobArena main: com.garbagemule.MobArena.MobArena
version: 0.88 version: 0.88.1
commands: commands:
mobarena: mobarena:
description: Base command for MobArena description: Base command for MobArena

View File

@ -75,9 +75,12 @@ public class MAMonsterListener extends EntityListener
return; return;
if (event.getReason() == TargetReason.FORGOT_TARGET) if (event.getReason() == TargetReason.FORGOT_TARGET)
event.setCancelled(true); event.setTarget(MASpawnThread.getClosestPlayer(event.getEntity()));
if (event.getReason() == TargetReason.TARGET_DIED) if (event.getReason() == TargetReason.TARGET_DIED)
event.setTarget(MASpawnThread.getClosestPlayer(event.getEntity())); event.setTarget(MASpawnThread.getClosestPlayer(event.getEntity()));
if (event.getReason() == TargetReason.CLOSEST_PLAYER)
event.setTarget(MASpawnThread.getClosestPlayer(event.getEntity()));
} }
} }

View File

@ -316,13 +316,27 @@ public class MAUtils
int wave; int wave;
String rewards; String rewards;
/* Check if the keys exist in the config-file, if not, /* Check if the keys exist in the config-file, if not, set some. */
* simply return the empty map. */ if (c.getKeys("rewards.waves." + type) == null)
List<String> waves = c.getKeys("rewards.waves." + type); {
if (waves == null) if (type.equals("every"))
return result; {
c.setProperty("rewards.waves.every.3", "feather, bone, stick");
c.setProperty("rewards.waves.every.5", "dirt:4, gravel:4, stone:4");
c.setProperty("rewards.waves.every.10", "iron_ingot:10, gold_ingot:8");
}
else if (type.equals("after"))
{
c.setProperty("rewards.waves.after.7", "minecart, storage_minecart, powered_minecart");
c.setProperty("rewards.waves.after.13", "iron_sword, iron_pickaxe, iron_spade");
c.setProperty("rewards.waves.after.16", "diamon_sword");
}
// Else, put all the rewards in the map. c.save();
}
List<String> waves = c.getKeys("rewards.waves." + type);
// Put all the rewards in the map.
for (String n : waves) for (String n : waves)
{ {
if (!n.matches("[0-9]+")) if (!n.matches("[0-9]+"))