diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index a5b4990..1bfde2e 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 02bda6c..ae424a5 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.10.0 +version: 3.10.0a commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/ItemCubeUtils.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/ItemCubeUtils.java index 6ea75e1..f2f25b7 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/ItemCubeUtils.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/ItemCubeUtils.java @@ -10,6 +10,8 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Hopper; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -70,4 +72,13 @@ public class ItemCubeUtils { } return reject_items; } + public static boolean SomeoneHasAFilterCubeOpen() { + for (Player p : Bukkit.getOnlinePlayers()) { + if (p.getOpenInventory()!=null && p.getOpenInventory().getTopInventory()!=null && p.getOpenInventory().getTopInventory().getType()==InventoryType.HOPPER) { + TwosideKeeper.log("Keep this open! "+p.getName()+" is using it!", 0); + return true; + } + } + return false; + } } diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index e07e78d..636e1a6 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -287,6 +287,10 @@ public class PlayerStructure { workable.set("spleef_wins", spleef_wins); workable.set("sounds_enabled", sounds_enabled); workable.set("hasDied", hasDied); + workable.set("lifestealstacks", lifestealstacks); + workable.set("weaponcharges", weaponcharges); + workable.set("damagepool", damagepool); + workable.set("vendetta_amt", vendetta_amt); //ConfigurationSection deathlootlist = workable.createSection("deathloot"); if (DeathManager.deathStructureExists(Bukkit.getPlayer(name))) { DeathStructure ds = DeathManager.getDeathStructure(Bukkit.getPlayer(name)); @@ -331,6 +335,10 @@ public class PlayerStructure { workable.addDefault("spleef_pts", spleef_pts); workable.addDefault("spleef_wins", spleef_wins); workable.addDefault("hasDied", hasDied); + workable.addDefault("damagepool", damagepool); + workable.addDefault("weaponcharges", weaponcharges); + workable.addDefault("lifestealstacks", lifestealstacks); + workable.addDefault("vendetta_amt", vendetta_amt); workable.options().copyDefaults(); @@ -353,8 +361,13 @@ public class PlayerStructure { this.deathloc_y = workable.getDouble("deathloc_y"); this.deathloc_z = workable.getDouble("deathloc_z"); this.deathloc_world = workable.getString("deathloc_world"); + this.damagepool = workable.getDouble("damagepool"); + this.lifestealstacks = workable.getInt("lifestealstacks"); + this.weaponcharges = workable.getInt("weaponcharges"); + this.lastattacked = TwosideKeeper.getServerTickTime(); + this.lastcombat = TwosideKeeper.getServerTickTime(); - if (this.hasDied) { + /*if (this.hasDied) { List deathlootlist = new ArrayList(); ConfigurationSection deathlootsection = workable.getConfigurationSection("deathloot"); for (int i=0;ip.getInventory().getItem(40).getType().getMaxDurability()) { + p.getInventory().setItem(40, new ItemStack(Material.AIR)); + } } } /*if (ev.getRightClicked() instanceof Monster) { @@ -4319,6 +4322,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } } + if (c.getWorld().getName().equalsIgnoreCase("FilterCube") && + ItemCubeUtils.SomeoneHasAFilterCubeOpen()) { + ev.setCancelled(true); + } } public void updateMonsterFlags(LivingEntity m) {