Added jockeys and chickens to the list of spawn rules that must comply.

Fixed set bows not properly dropping from monsters.
testdev
sigonasr2 8 years ago
parent fd495c8ea5
commit 6bfec6a3ce
  1. BIN
      TwosideKeeper.jar
  2. 8
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  3. 20
      src/sig/plugin/TwosideKeeper/MonsterController.java
  4. 6
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -600,7 +600,7 @@ public class Loot {
if (item.getType().toString().contains("SWORD")) { if (item.getType().toString().contains("SWORD")) {
item.setType(Material.BOW); item.setType(Material.BOW);
} else } else
if (!item.getType().toString().contains("LEATHER")) { if (!item.getType().name().contains("LEATHER") && !item.getType().name().contains("BOW")) {
allowed = false; allowed = false;
} }
set_name = prefix+"Jamdak Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType()); set_name = prefix+"Jamdak Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
@ -609,7 +609,7 @@ public class Loot {
if (item.getType().toString().contains("SWORD")) { if (item.getType().toString().contains("SWORD")) {
item.setType(Material.BOW); item.setType(Material.BOW);
} else } else
if (!item.getType().toString().contains("LEATHER")) { if (!item.getType().toString().contains("LEATHER") && !item.getType().name().contains("BOW")) {
allowed = false; allowed = false;
} }
set_name = prefix+"Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType()); set_name = prefix+"Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
@ -618,7 +618,7 @@ public class Loot {
if (item.getType().toString().contains("SWORD")) { if (item.getType().toString().contains("SWORD")) {
item.setType(Material.BOW); item.setType(Material.BOW);
} else } else
if (!item.getType().toString().contains("LEATHER")) { if (!item.getType().toString().contains("LEATHER") && !item.getType().name().contains("BOW")) {
allowed = false; allowed = false;
} }
set_name = prefix+"Alikahn Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType()); set_name = prefix+"Alikahn Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
@ -627,7 +627,7 @@ public class Loot {
if (item.getType().toString().contains("SWORD")) { if (item.getType().toString().contains("SWORD")) {
item.setType(Material.BOW); item.setType(Material.BOW);
} else } else
if (!item.getType().toString().contains("LEATHER")) { if (!item.getType().toString().contains("LEATHER") && !item.getType().name().contains("BOW")) {
allowed = false; allowed = false;
} }
set_name = prefix+"Lorasaadi Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType()); set_name = prefix+"Lorasaadi Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());

@ -54,15 +54,17 @@ public class MonsterController {
//Modify spawning algorithm. //Modify spawning algorithm.
int ylv = ent.getLocation().getBlockY(); int ylv = ent.getLocation().getBlockY();
if (minion) { if (minion) {
TwosideKeeper.log(" Minion modifier",TwosideKeeper.SPAWN_DEBUG_LEVEL); if (meetsConditionsToSpawn(ent)) {
ylv+=16; TwosideKeeper.log(" Minion modifier",TwosideKeeper.SPAWN_DEBUG_LEVEL);
ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,Integer.MAX_VALUE,1)); ylv+=16;
ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,Integer.MAX_VALUE,0)); ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,Integer.MAX_VALUE,1));
ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Integer.MAX_VALUE,3)); ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,Integer.MAX_VALUE,0));
ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,Integer.MAX_VALUE,4)); ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Integer.MAX_VALUE,3));
if (isZombieLeader(ent)) { //Not allowed. We do not want more leaders from Minions to be spawning. ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,Integer.MAX_VALUE,4));
ent.remove(); if (isZombieLeader(ent)) { //Not allowed. We do not want more leaders from Minions to be spawning.
return false; ent.remove();
return false;
}
} }
} else } else
if (!meetsConditionsToSpawn(ent) && if (!meetsConditionsToSpawn(ent) &&

@ -5469,7 +5469,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) || ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) ||
ev.getSpawnReason().equals(SpawnReason.VILLAGE_INVASION) || ev.getSpawnReason().equals(SpawnReason.VILLAGE_INVASION) ||
ev.getSpawnReason().equals(SpawnReason.CHUNK_GEN) || ev.getSpawnReason().equals(SpawnReason.CHUNK_GEN) ||
ev.getSpawnReason().equals(SpawnReason.SLIME_SPLIT))) { ev.getSpawnReason().equals(SpawnReason.SLIME_SPLIT) ||
ev.getSpawnReason().equals(SpawnReason.MOUNT) ||
ev.getSpawnReason().equals(SpawnReason.JOCKEY))) {
TwosideKeeper.log("Spawned a "+GenericFunctions.GetEntityDisplayName(ev.getEntity()),TwosideKeeper.SPAWN_DEBUG_LEVEL); TwosideKeeper.log("Spawned a "+GenericFunctions.GetEntityDisplayName(ev.getEntity()),TwosideKeeper.SPAWN_DEBUG_LEVEL);
if (ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) || ev.getSpawnReason().equals(SpawnReason.VILLAGE_INVASION)) { if (ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) || ev.getSpawnReason().equals(SpawnReason.VILLAGE_INVASION)) {
//Remove this one and spawn another one. //Remove this one and spawn another one.
@ -5518,7 +5520,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
} else { } else {
log("Reason for spawn: "+ev.getSpawnReason().toString(),4); log("Reason for spawn: "+ev.getSpawnReason().toString()+" for Entity "+GenericFunctions.GetEntityDisplayName(ev.getEntity()),1);
} }
if (ev.getSpawnReason().equals(SpawnReason.SPAWNER)) { if (ev.getSpawnReason().equals(SpawnReason.SPAWNER)) {
if (MonsterController.isZombieLeader(ev.getEntity())) { if (MonsterController.isZombieLeader(ev.getEntity())) {

Loading…
Cancel
Save