mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-03-28 14:35:50 +01:00
Fixed Heroes death bug (maybe)... Time for testing!
This commit is contained in:
parent
1959ba5b85
commit
ff28bf1a87
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -53,6 +53,8 @@ import com.garbagemule.MobArena.waves.BossWave;
|
||||
import com.garbagemule.MobArena.waves.Wave;
|
||||
import com.garbagemule.MobArena.waves.Wave.WaveBranch;
|
||||
|
||||
import com.herocraftonline.dev.heroes.persistence.Hero;
|
||||
|
||||
public class Arena
|
||||
{
|
||||
private MobArena plugin;
|
||||
@ -179,6 +181,11 @@ public class Arena
|
||||
for (Player p : arenaPlayers)
|
||||
{
|
||||
p.teleport(arenaLoc);
|
||||
if (plugin.getHeroManager() != null)
|
||||
{
|
||||
Hero hero = plugin.getHeroManager().getHero(p);
|
||||
hero.setHealth(hero.getMaxHealth());
|
||||
}
|
||||
p.setHealth(20);
|
||||
assignClassPermissions(p);
|
||||
}
|
||||
@ -308,6 +315,11 @@ public class Arena
|
||||
{
|
||||
storePlayerData(p, loc);
|
||||
MAUtils.sitPets(p);
|
||||
if (plugin.getHeroManager() != null)
|
||||
{
|
||||
Hero hero = plugin.getHeroManager().getHero(p);
|
||||
hero.setHealth(hero.getMaxHealth());
|
||||
}
|
||||
p.setHealth(20);
|
||||
movePlayerToLobby(p);
|
||||
|
||||
@ -594,7 +606,15 @@ public class Arena
|
||||
private void clearPlayer(Player p)
|
||||
{
|
||||
if (healthMap.containsKey(p))
|
||||
p.setHealth(healthMap.remove(p));
|
||||
{
|
||||
int health = healthMap.remove(p);
|
||||
p.setHealth(health);
|
||||
if (plugin.getHeroManager() != null)
|
||||
{
|
||||
Hero hero = plugin.getHeroManager().getHero(p);
|
||||
hero.setHealth(health * hero.getMaxHealth() / 20);
|
||||
}
|
||||
}
|
||||
|
||||
// Put out fire.
|
||||
p.setFireTicks(0);
|
||||
|
@ -16,12 +16,15 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
|
||||
import com.nijiko.permissions.PermissionHandler;
|
||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
//import com.nijiko.permissions.PermissionHandler;
|
||||
//import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
import com.garbagemule.MobArena.util.FileUtils;
|
||||
import com.garbagemule.register.payment.Method;
|
||||
import com.garbagemule.register.payment.Methods;
|
||||
|
||||
import com.herocraftonline.dev.heroes.Heroes;
|
||||
import com.herocraftonline.dev.heroes.persistence.HeroManager;
|
||||
|
||||
/**
|
||||
* MobArena
|
||||
* @author garbagemule
|
||||
@ -32,7 +35,10 @@ public class MobArena extends JavaPlugin
|
||||
private ArenaMaster am;
|
||||
|
||||
// Permissions stuff
|
||||
private PermissionHandler permissionHandler;
|
||||
//private PermissionHandler permissionHandler;
|
||||
|
||||
// Heroes stuff
|
||||
private HeroManager heroManager = null;
|
||||
|
||||
// Economy stuff
|
||||
protected Methods Methods;
|
||||
@ -64,9 +70,10 @@ public class MobArena extends JavaPlugin
|
||||
FileUtils.fetchLibs(config);
|
||||
|
||||
// Set up permissions and economy
|
||||
setupPermissions();
|
||||
//setupPermissions();
|
||||
setupRegister();
|
||||
setupSpout();
|
||||
setupHeroes();
|
||||
|
||||
// Set up the ArenaMaster and the announcements
|
||||
am = new ArenaMaster(this);
|
||||
@ -158,7 +165,7 @@ public class MobArena extends JavaPlugin
|
||||
public static void warning(String msg) { Bukkit.getServer().getLogger().warning("[MobArena] " + msg); }
|
||||
public static void error(String msg) { Bukkit.getServer().getLogger().severe("[MobArena] " + msg); }
|
||||
|
||||
private void setupPermissions()
|
||||
/*private void setupPermissions()
|
||||
{
|
||||
if (permissionHandler != null)
|
||||
return;
|
||||
@ -167,7 +174,7 @@ public class MobArena extends JavaPlugin
|
||||
if (permissionsPlugin == null) return;
|
||||
|
||||
permissionHandler = ((Permissions) permissionsPlugin).getHandler();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void setupRegister()
|
||||
{
|
||||
@ -188,10 +195,23 @@ public class MobArena extends JavaPlugin
|
||||
hasSpout = spoutPlugin != null;
|
||||
}
|
||||
|
||||
private void setupHeroes()
|
||||
{
|
||||
Plugin heroes = this.getServer().getPluginManager().getPlugin("Heroes");
|
||||
if (heroes == null) return;
|
||||
|
||||
heroManager = ((Heroes) heroes).getHeroManager();
|
||||
}
|
||||
|
||||
public Configuration getConfig() { return config; }
|
||||
public ArenaMaster getAM() { return am; } // More convenient.
|
||||
public ArenaMaster getArenaMaster() { return am; }
|
||||
|
||||
public HeroManager getHeroManager()
|
||||
{
|
||||
return heroManager;
|
||||
}
|
||||
|
||||
private String getHeader()
|
||||
{
|
||||
String sep = System.getProperty("line.separator");
|
||||
|
Loading…
Reference in New Issue
Block a user