diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index b771a80..748ff76 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 16bb68d..f452405 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.7.3-alpha5 +version: 3.7.3-alpha6 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 1de71f6..671b5ef 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -2649,16 +2649,16 @@ public class GenericFunctions { @Deprecated public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, boolean truedmg) { - DealDamageToMob(dmg,target,damager); + DealDamageToMob(dmg,target,damager,null); } public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager) { - DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager)); + DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager),null); } - public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager) { + public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact) { if (damager!=null && (target instanceof Monster)) { Monster m = (Monster)target; m.setTarget(damager); @@ -2675,7 +2675,15 @@ public class GenericFunctions { TwosideKeeper.log(GenericFunctions.GetEntityDisplayName(damager)+"->"+ GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,2); double oldhp=((LivingEntity)target).getHealth(); - GenericFunctions.subtractHealth(target, damager, dmg); + GenericFunctions.subtractHealth(target, damager, dmg, artifact); + if (artifact!=null && + GenericFunctions.isArtifactEquip(artifact) && + (damager instanceof Player)) { + Player p = (Player)damager; + double ratio = 1.0-NewCombat.CalculateDamageReduction(1,target,p); + AwakenedArtifact.addPotentialEXP(damager.getEquipment().getItemInMainHand(), (int)((ratio*20)+5), p); + NewCombat.increaseArtifactArmorXP(p,(int)(ratio*10)+1); + } TwosideKeeper.log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)target).getHealth()+" HP",3); } @@ -2784,8 +2792,11 @@ public class GenericFunctions { public static double getAbilityValue(ArtifactAbility ab, ItemStack weapon) { return ArtifactAbility.calculateValue(ab, weapon.getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ab, weapon)); } - public static void subtractHealth(LivingEntity entity, LivingEntity damager, double dmg) { + subtractHealth(entity,damager,dmg,null); + } + + public static void subtractHealth(LivingEntity entity, LivingEntity damager, double dmg, ItemStack artifact) { if (damager instanceof Player) { TwosideKeeper.log("Damage goes from "+dmg+"->"+(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER),5); entity.damage(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,damager); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java index 660025b..99cff0a 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java @@ -814,4 +814,8 @@ public class WorldShop { return true; } } + + public static boolean canPlaceShopSignOnBlock(Location block_loc) { + return (!shopSignExists(block_loc) && GenericFunctions.isDumpableContainer(block_loc.getBlock().getType())); + } } diff --git a/src/sig/plugin/TwosideKeeper/NewCombat.java b/src/sig/plugin/TwosideKeeper/NewCombat.java index e34c93b..02570ca 100644 --- a/src/sig/plugin/TwosideKeeper/NewCombat.java +++ b/src/sig/plugin/TwosideKeeper/NewCombat.java @@ -346,7 +346,7 @@ public class NewCombat { Monster mon = (Monster)finallist.get(i); double finaldmg = CalculateDamageReduction(GenericFunctions.getAbilityValue(ArtifactAbility.ERUPTION, p.getEquipment().getItemInMainHand()),mon,null); addToPlayerLogger(p,ChatColor.BLUE+"Eruption",finaldmg); - GenericFunctions.DealDamageToMob(finaldmg, mon, p); + GenericFunctions.DealDamageToMob(finaldmg, mon, p, p.getEquipment().getItemInMainHand()); mon.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20,15)); //Attempt to dig out the blocks below. for (int x=-1;x<2;x++) { @@ -904,7 +904,8 @@ public class NewCombat { for (int i=0;i trimNonLivingEntities(List entitylist) { + public static List trimNonLivingEntities(List entitylist) { List livinglist = new ArrayList(); for (int i=0;i20) { + ev.setCancelled(true); + log("Denied chicken spawn.",4); + } + if ((ev.getSpawnReason().equals(SpawnReason.NATURAL) || ev.getSpawnReason().equals(SpawnReason.SPAWNER_EGG) || ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) || @@ -4277,14 +4285,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener { log("Dealing "+dmgdealt+" damage. Player is "+Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]).getName(),4); double reduceddmg = CalculateDamageReduction(dmgdealt,affected.get(i),null); DamageLogger.AddNewCalculation(Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]), ChatColor.GREEN+"Earth Wave", dmgdealt, reduceddmg); - GenericFunctions.DealDamageToMob(reduceddmg, affected.get(i), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2])); + GenericFunctions.DealDamageToMob(reduceddmg, affected.get(i), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]).getEquipment().getItemInMainHand()); } else if (ev.getEntity().getCustomName().contains("LD ")) { double dmgdealt=Double.parseDouble(ev.getEntity().getCustomName().split(" ")[1]); log("Dealing "+dmgdealt+" damage. Player is "+Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]).getName(),4); double reduceddmg = CalculateDamageReduction(dmgdealt,affected.get(i),null); DamageLogger.AddNewCalculation(Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]), ChatColor.GREEN+"Line Drive", dmgdealt, reduceddmg); - GenericFunctions.DealDamageToMob(reduceddmg, affected.get(i), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2])); + GenericFunctions.DealDamageToMob(reduceddmg, affected.get(i), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]), Bukkit.getPlayer(ev.getEntity().getCustomName().split(" ")[2]).getEquipment().getItemInMainHand()); ((Monster)affected.get(i)).addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,2,100));} } } else { diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java index 8191470..34616a1 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java @@ -185,6 +185,9 @@ public final class TwosideKeeperAPI { public static void removeWorldShopDisplayItem(Sign s) { WorldShop.removeShopItem(s); } + public static boolean canPlaceShopSignOnBlock(Location block_loc) { + return WorldShop.canPlaceShopSignOnBlock(block_loc); + } //Recycling Center COMMANDS. public static boolean isRecyclingCenter(Block b) {