update to v2.0.4
This commit is contained in:
@@ -91,7 +91,7 @@ public class DragonManager {
|
||||
|
||||
}
|
||||
public static MyDragon judge(){
|
||||
if(Config.special_dragon_jude_mode.equalsIgnoreCase("edge")){
|
||||
if(Config.special_dragon_jude_mode.equalsIgnoreCase("weight")){
|
||||
int cnt = 0, random = ThreadLocalRandom.current().nextInt(0, sum);
|
||||
for(MyDragon cur : dragons){
|
||||
if(cnt <= random && cnt + cur.edge > random){
|
||||
@@ -110,6 +110,16 @@ public class DragonManager {
|
||||
}
|
||||
return cur;
|
||||
}
|
||||
else if(Config.special_dragon_jude_mode.equalsIgnoreCase("edge")){
|
||||
int cnt = 0, random = ThreadLocalRandom.current().nextInt(0, sum);
|
||||
for(MyDragon cur : dragons){
|
||||
if(cnt <= random && cnt + cur.edge > random){
|
||||
return cur;
|
||||
}
|
||||
cnt += cur.edge;
|
||||
}
|
||||
error("\"edge\" in \"special_dragon_jude_mode\" of config.yml is deprecated!Please use \"weight\" instead.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static void setSpecialKey(Entity e, String key){
|
||||
@@ -242,6 +252,12 @@ public class DragonManager {
|
||||
mp.clear();
|
||||
dragon_names.clear();
|
||||
}
|
||||
|
||||
public static void setAttribute(EnderDragon dragon, Attribute attribute, double amount){
|
||||
AttributeInstance instance = dragon.getAttribute(attribute);
|
||||
assert instance != null;
|
||||
instance.setBaseValue(amount);
|
||||
}
|
||||
public static void modifyAttribute(EnderDragon dragon, Attribute attribute, double amount){
|
||||
AttributeInstance instance = dragon.getAttribute(attribute);
|
||||
assert instance != null;
|
||||
@@ -278,10 +294,14 @@ public class DragonManager {
|
||||
}
|
||||
if(battle.getRespawnPhase() == DragonBattle.RespawnPhase.NONE){
|
||||
Location cen = battle.getEndPortalLocation();
|
||||
if(cen == null) {
|
||||
battle.initiateRespawn();
|
||||
cen = battle.getEndPortalLocation();
|
||||
if(cen == null){
|
||||
error("The world_the_end is unloaded.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
placeEndCrystals(world,cen);
|
||||
battle.initiateRespawn();
|
||||
return true;
|
||||
@@ -311,10 +331,15 @@ public class DragonManager {
|
||||
Field field = battle.getClass().getDeclaredField("o");
|
||||
field.setAccessible(true);
|
||||
Object BlockPosition = field.get(battle);
|
||||
if(BlockPosition == null){
|
||||
if (this.DragonBattle_e == null) this.DragonBattle_e = battle.getClass().getMethod("e");
|
||||
this.DragonBattle_e.invoke(battle);
|
||||
BlockPosition = field.get(battle);
|
||||
if(BlockPosition == null){
|
||||
error("The world_the_end is unloaded.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(this.getX == null) this.getX = BlockPosition.getClass().getMethod("getX");
|
||||
if(this.getY == null) this.getY = BlockPosition.getClass().getMethod("getY");
|
||||
if(this.getZ == null) this.getZ = BlockPosition.getClass().getMethod("getZ");
|
||||
|
||||
Reference in New Issue
Block a user