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
main: com.garbagemule.MobArena.MobArena
version: 0.88
version: 0.88.1
commands:
mobarena:
description: Base command for MobArena

View File

@ -75,9 +75,12 @@ public class MAMonsterListener extends EntityListener
return;
if (event.getReason() == TargetReason.FORGOT_TARGET)
event.setCancelled(true);
event.setTarget(MASpawnThread.getClosestPlayer(event.getEntity()));
if (event.getReason() == TargetReason.TARGET_DIED)
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;
String rewards;
/* Check if the keys exist in the config-file, if not,
* simply return the empty map. */
/* Check if the keys exist in the config-file, if not, set some. */
if (c.getKeys("rewards.waves." + type) == null)
{
if (type.equals("every"))
{
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");
}
c.save();
}
List<String> waves = c.getKeys("rewards.waves." + type);
if (waves == null)
return result;
// Else, put all the rewards in the map.
// Put all the rewards in the map.
for (String n : waves)
{
if (!n.matches("[0-9]+"))