From a1ba2cffacabf7c8f08c85358bec43ece971ea19 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Thu, 13 Aug 2015 20:56:02 +0200 Subject: [PATCH 1/5] fixed needler not doing posion --- .../src/nautilus/game/arcade/kit/perks/PerkNeedler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java index ce4603693..3844440ba 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNeedler.java @@ -131,7 +131,7 @@ public class PerkNeedler extends SmashPerk DamageCause.THORNS, 1.1, true, true, false, damager.getName(), GetName()); - if(Manager.GetGame().GetTeam(event.GetDamageePlayer()) != Manager.GetGame().GetTeam(damager)) + if(!Manager.GetGame().GetTeam(event.GetDamageePlayer()).equals(Manager.GetGame().GetTeam(damager))) { Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false); } From 80588a308b0856ad58ef9da17d3aab007fe3969c Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Thu, 13 Aug 2015 21:03:48 +0200 Subject: [PATCH 2/5] balanaced brawler --- .../src/nautilus/game/arcade/kit/perks/PerkMammoth.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMammoth.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMammoth.java index e91dc9742..23134ec56 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMammoth.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMammoth.java @@ -14,7 +14,7 @@ public class PerkMammoth extends Perk { super("Mammoth", new String[] { - C.cGray + "Take 50% knockback and deal 150% knockback", + C.cGray + "Take 75% knockback and deal 125% knockback", }); } @@ -30,7 +30,7 @@ public class PerkMammoth extends Perk if (!Kit.HasKit(damager)) return; - event.AddKnockback(GetName(), 1.5d); + event.AddKnockback(GetName(), 1.25d); } @EventHandler(priority = EventPriority.HIGH) @@ -45,6 +45,6 @@ public class PerkMammoth extends Perk if (!Kit.HasKit(damagee)) return; - event.AddKnockback(GetName(), 0.5d); + event.AddKnockback(GetName(), 0.75d); } } From f5d934fe53de0c26cb00c10b22f747578f39a703 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 14 Aug 2015 00:37:43 -0500 Subject: [PATCH 3/5] Fixed sync db calls for pets. Make sure to add/remove pets in mysql. --- .../core/pet/repository/PetRepository.java | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/repository/PetRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/repository/PetRepository.java index 2ed20694b..85973eeb9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/repository/PetRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/repository/PetRepository.java @@ -26,14 +26,34 @@ public class PetRepository extends RepositoryBase _webAddress = webAddress; } - public void AddPet(PetChangeToken token) + public void AddPet(final PetChangeToken token) { new AsyncJsonWebCall(_webAddress + "Pets/AddPet").Execute(token); + + Plugin.getServer().getScheduler().runTaskAsynchronously(Plugin, new Runnable() + { + public void run() + { + executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName) + , new ColumnInt("petId", token.PetId) + , new ColumnInt("accountId", token.AccountId)); + } + }); } - public void RemovePet(PetChangeToken token) + public void RemovePet(final PetChangeToken token) { new AsyncJsonWebCall(_webAddress + "Pets/RemovePet").Execute(token); + + Plugin.getServer().getScheduler().runTaskAsynchronously(Plugin, new Runnable() + { + public void run() + { + executeUpdate("DELETE FROM accountPets WHERE petId = ? AND accountId = ?;" + , new ColumnInt("petId", token.PetId) + , new ColumnInt("accountId", token.AccountId)); + } + }); } public List GetPetExtras(List petExtraTokens) @@ -41,20 +61,26 @@ public class PetRepository extends RepositoryBase return new JsonWebCall(_webAddress + "Pets/GetPetExtras").Execute(new TypeToken>(){}.getType(), petExtraTokens); } - public void UpdatePet(PetChangeToken token) + public void UpdatePet(final PetChangeToken token) { new AsyncJsonWebCall(_webAddress + "Pets/UpdatePet").Execute(token); - - int rowsChanged = executeUpdate("UPDATE accountPets SET petName = ? WHERE petId = ? AND accountId = ?;", new ColumnVarChar("petName", 32, token.PetName) + + Plugin.getServer().getScheduler().runTaskAsynchronously(Plugin, new Runnable() + { + public void run() + { + int rowsChanged = executeUpdate("UPDATE accountPets SET petName = ? WHERE petId = ? AND accountId = ?;", new ColumnVarChar("petName", 32, token.PetName) + , new ColumnInt("petId", token.PetId) + , new ColumnInt("accountId", token.AccountId)); + + if (rowsChanged < 1) + { + executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName) , new ColumnInt("petId", token.PetId) , new ColumnInt("accountId", token.AccountId)); - - if (rowsChanged < 1) - { - executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName) - , new ColumnInt("petId", token.PetId) - , new ColumnInt("accountId", token.AccountId)); - } + } + } + }); } @Override From 33a6e4cb13c5b6366eb1947f4b5e53e2702defa4 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 14 Aug 2015 19:12:05 +1200 Subject: [PATCH 4/5] UtilEnt: Add CreatureLook method --- .../mineplex/core/common/util/UtilEnt.java | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index d87d16fa5..80358744b 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -4,21 +4,23 @@ import java.lang.reflect.Field; import java.util.HashMap; import java.util.LinkedList; import java.util.List; + import net.minecraft.server.v1_7_R4.EntityBat; import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.EntityEnderDragon; import net.minecraft.server.v1_7_R4.EntityHuman; import net.minecraft.server.v1_7_R4.EntityInsentient; -import net.minecraft.server.v1_7_R4.EntityLiving; +import net.minecraft.server.v1_7_R4.EntityTrackerEntry; import net.minecraft.server.v1_7_R4.Navigation; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation; import net.minecraft.server.v1_7_R4.PathfinderGoal; import net.minecraft.server.v1_7_R4.PathfinderGoalLookAtPlayer; import net.minecraft.server.v1_7_R4.PathfinderGoalMoveTowardsRestriction; import net.minecraft.server.v1_7_R4.PathfinderGoalRandomLookaround; import net.minecraft.server.v1_7_R4.PathfinderGoalSelector; +import net.minecraft.server.v1_7_R4.WorldServer; import org.bukkit.Bukkit; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -32,6 +34,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Giant; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import org.bukkit.util.Vector; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; @@ -582,6 +585,36 @@ public class UtilEnt return false; } + public static boolean CreatureLook(Entity ent, Entity target) + { + return CreatureLook(ent, target instanceof LivingEntity ? ((LivingEntity) target).getEyeLocation() : target.getLocation()); + } + + public static boolean CreatureLook(Entity ent, Location target) + { + Vector vec = UtilAlg.getTrajectory(ent.getLocation(), target); + + return CreatureLook(ent, UtilAlg.GetPitch(vec), UtilAlg.GetYaw(vec)); + } + + public static boolean CreatureLook(Entity ent, float pitch, float yaw) + { + if (!(ent instanceof Creature)) + return false; + + EntityCreature ec = ((CraftCreature) ent).getHandle(); + Location loc = ent.getLocation(); + + ec.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), yaw, pitch); + ec.al = true; + + EntityTrackerEntry entry = (EntityTrackerEntry) ((WorldServer) ec.world).tracker.trackedEntities.get(ec.getId()); + + entry.broadcast(new PacketPlayOutEntityHeadRotation(ec, (byte) (ec.yaw * 256.0F / 360.0F))); + + return true; + } + public static void CreatureMove(Entity ent, Location target, float speed) { if (!(ent instanceof Creature)) From 7fb85f24d1925f569147dc53103952a1821343bd Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 14 Aug 2015 19:15:35 +1200 Subject: [PATCH 5/5] UtilEnt: Change CreatureLook to support LivingEntity, not just Creature --- .../src/mineplex/core/common/util/UtilEnt.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index 80358744b..8b489c952 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -10,6 +10,7 @@ import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.EntityEnderDragon; import net.minecraft.server.v1_7_R4.EntityHuman; import net.minecraft.server.v1_7_R4.EntityInsentient; +import net.minecraft.server.v1_7_R4.EntityLiving; import net.minecraft.server.v1_7_R4.EntityTrackerEntry; import net.minecraft.server.v1_7_R4.Navigation; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation; @@ -599,10 +600,10 @@ public class UtilEnt public static boolean CreatureLook(Entity ent, float pitch, float yaw) { - if (!(ent instanceof Creature)) + if (!(ent instanceof LivingEntity)) return false; - EntityCreature ec = ((CraftCreature) ent).getHandle(); + EntityLiving ec = ((CraftLivingEntity) ent).getHandle(); Location loc = ent.getLocation(); ec.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), yaw, pitch);