diff --git a/Plugins/Libraries/craftbukkit.jar b/Plugins/Libraries/craftbukkit.jar index 7c8da476c..7905def16 100644 Binary files a/Plugins/Libraries/craftbukkit.jar and b/Plugins/Libraries/craftbukkit.jar differ diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/GadgetManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/GadgetManager.java index 7ae6ccaaf..fd6b978df 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/GadgetManager.java @@ -35,6 +35,11 @@ public class GadgetManager extends MiniPlugin _gadgets.add(new Halloween2013_BatGun(this)); _gadgets.add(new Halloween2013_Helmet(this)); } + + public HashSet getGadgets() + { + return _gadgets; + } //Disallows two armor gadgets in same slot. public void RemoveArmor(Player player, ArmorSlot slot) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_BatGun.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_BatGun.java index 280181d1c..58650fcc5 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_BatGun.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_BatGun.java @@ -16,7 +16,7 @@ public class Halloween2013_BatGun extends ItemGadget { public Halloween2013_BatGun(GadgetManager manager) { - super(manager, "Halloween2013_BatGun", "Bat Gun", Material.COAL_BLOCK, (byte)0); + super(manager, "Halloween2013_BatGun", "Bat Gun", 10000, Material.COAL_BLOCK, (byte)0); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_Helmet.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_Helmet.java index b28470779..a939c9649 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_Helmet.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/Halloween2013_Helmet.java @@ -15,7 +15,7 @@ public class Halloween2013_Helmet extends ArmorGadget { public Halloween2013_Helmet(GadgetManager manager) { - super(manager, "Halloween2013_Helmet", "Pumpkin Kings Head", ArmorSlot.Helmet, Material.PUMPKIN, (byte)0); + super(manager, "Halloween2013_Helmet", "Pumpkin Kings Head", -1, ArmorSlot.Helmet, Material.PUMPKIN, (byte)0); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ArmorGadget.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ArmorGadget.java index 4027d217a..324010883 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ArmorGadget.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ArmorGadget.java @@ -22,17 +22,15 @@ public abstract class ArmorGadget extends Gadget private Material _material; private byte _data; - public ArmorGadget(GadgetManager manager, String code, String name, ArmorSlot slot, Material mat, byte data) + public ArmorGadget(GadgetManager manager, String code, String name, int cost, ArmorSlot slot, Material mat, byte data) { - super(manager, code, name); + super(manager, code, name, cost); _slot = slot; _material = mat; _data = data; } - - public ArmorSlot GetSlot() { return _slot; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/Gadget.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/Gadget.java index fda6fbcfc..ce0eee6ca 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/Gadget.java @@ -19,13 +19,15 @@ public abstract class Gadget implements Listener private String _code; private String _name; + private int _cost; - public Gadget(GadgetManager manager, String code, String name) + public Gadget(GadgetManager manager, String code, String name, int cost) { Manager = manager; _code = code; _name = name; + _cost = cost; Manager.GetPlugin().getServer().getPluginManager().registerEvents(this, Manager.GetPlugin()); } @@ -40,6 +42,11 @@ public abstract class Gadget implements Listener return _code; } + public int getCost() + { + return _cost; + } + public HashSet GetOwners() { return _owners; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java index 85d16b9b6..68ef6de1d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java @@ -16,9 +16,9 @@ public abstract class ItemGadget extends Gadget private Material _material; private byte _data; - public ItemGadget(GadgetManager manager, String code, String name, Material mat, byte data) + public ItemGadget(GadgetManager manager, String code, String name, int cost, Material mat, byte data) { - super(manager, code, name); + super(manager, code, name, cost); _material = mat; _data = data; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/ActivatePetButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/ActivatePetButton.java new file mode 100644 index 000000000..dcc0228e4 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/ActivatePetButton.java @@ -0,0 +1,24 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.pet.Pet; +import mineplex.core.shop.item.IButton; + +public class ActivatePetButton implements IButton +{ + private Pet _pet; + private GadgetPage _page; + + public ActivatePetButton(Pet pet, GadgetPage page) + { + _pet = pet; + _page = page; + } + + @Override + public void Clicked(Player player) + { + _page.ActivatePet(player, _pet); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/CloseButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/CloseButton.java new file mode 100644 index 000000000..1f0692b63 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/CloseButton.java @@ -0,0 +1,14 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class CloseButton implements IButton +{ + @Override + public void Clicked(Player player) + { + player.closeInventory(); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/DeactivatePetButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/DeactivatePetButton.java new file mode 100644 index 000000000..eea196bec --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/DeactivatePetButton.java @@ -0,0 +1,24 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.pet.Pet; +import mineplex.core.shop.item.IButton; + +public class DeactivatePetButton implements IButton +{ + private Pet _pet; + private GadgetPage _page; + + public DeactivatePetButton(Pet pet, GadgetPage page) + { + _pet = pet; + _page = page; + } + + @Override + public void Clicked(Player player) + { + _page.DeactivatePet(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java new file mode 100644 index 000000000..1ff7c96ed --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java @@ -0,0 +1,165 @@ +package mineplex.hub.gadget.ui; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.server.v1_6_R3.EntityPlayer; +import net.minecraft.server.v1_6_R3.Item; +import net.minecraft.server.v1_6_R3.Packet100OpenWindow; +import net.minecraft.server.v1_6_R3.Packet103SetSlot; + +import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Player; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.CurrencyType; +import mineplex.core.common.util.C; +import mineplex.core.donation.DonationManager; +import mineplex.core.pet.Pet; +import mineplex.core.pet.PetExtra; +import mineplex.core.pet.PetManager; +import mineplex.core.pet.PetShop; +import mineplex.core.shop.item.ShopItem; +import mineplex.core.shop.page.AnvilContainer; +import mineplex.core.shop.page.ShopPageBase; +import mineplex.hub.gadget.GadgetManager; +import mineplex.hub.gadget.types.Gadget; +import mineplex.hub.mount.MountManager; + +public class GadgetPage extends ShopPageBase +{ + private MountManager _mountPlugin; + + public GadgetPage(GadgetManager plugin, GadgetShop shop, MountManager mountPlugin, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player, 45); + + _mountPlugin = mountPlugin; + + BuildPage(); + } + + protected void BuildPage() + { + int slot = 1; + + for (Gadget gadget : Plugin.getGadgets()) + { + List itemLore = new ArrayList(); + + itemLore.add(C.cYellow + gadget.getCost() + " Gems"); + itemLore.add(C.cBlack); + + if (DonationManager.Get(Player.getName()).OwnsUnknownPackage(pet.GetPetName())) + { + if (Plugin.hasActivePet(Player.getName()) && Plugin.getActivePet(Player.getName()).getType() == pet.GetPetType()) + { + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Deactivate " + Plugin.Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new DeactivatePetButton(pet, this)); + } + else + { + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Activate " + Plugin.Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new ActivatePetButton(pet, this)); + } + } + else + { + if (DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Gems) >= pet.GetCost(CurrencyType.Gems)) + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new PetButton(pet, this)); + else + setItem(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + + slot++; + } + + slot = 22; + for (PetExtra petExtra : Plugin.GetFactory().GetPetExtras()) + { + List itemLore = new ArrayList(); + + if (!Plugin.hasActivePet(Player.getName())) + { + itemLore.add(C.cWhite + "You must have an active pet to use this!"); + getInventory().setItem(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, C.cRed + petExtra.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle()); + } + else + { + AddButton(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, "Rename " + Plugin.getActivePet(Player.getName()).getCustomName() + " for " + C.cYellow + petExtra.GetCost(CurrencyType.Gems) + C.cGreen + " Gems", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new RenamePetButton(this)); + } + + slot++; + } + } + + protected void addGadget(Gadget gadget) + { + List itemLore = new ArrayList(); + + itemLore.add(C.cYellow + gadget.getCost() + " Gems"); + itemLore.add(C.cBlack); + + if (DonationManager.Get(Player.getName()).OwnsUnknownPackage(gadget.GetCode())) + { + if (Plugin.hasActivePet(Player.getName()) && Plugin.getActivePet(Player.getName()).getType() == pet.GetPetType()) + { + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Deactivate " + Plugin.Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new DeactivatePetButton(pet, this)); + } + else + { + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Activate " + Plugin.Get(Player).GetPets().get(pet.GetPetType()), new String[] {}, 1, false, false), new ActivatePetButton(pet, this)); + } + } + else + { + if (DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Gems) >= pet.GetCost(CurrencyType.Gems)) + AddButton(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new PetButton(pet, this)); + else + setItem(slot, new ShopItem(Material.MONSTER_EGG, (byte)pet.GetPetType().getTypeId(), "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + } + + public void PurchasePet(final Player player, final Pet pet) + { + renamePet(player, pet, true); + } + + public void renameCurrentPet(Player player) + { + PlayAcceptSound(player); + Creature currentPet = Plugin.getActivePet(player.getName()); + renamePet(player, new Pet(currentPet.getCustomName(), currentPet.getType(), 1), false); + } + + public void renamePet(Player player, Pet pet, boolean petPurchase) + { + PlayAcceptSound(player); + + PetTagPage petTagPage = new PetTagPage(Plugin, Shop, ClientManager, DonationManager, "Repairing", Player, pet, petPurchase); + EntityPlayer entityPlayer = ((CraftPlayer)Player).getHandle(); + int containerCounter = entityPlayer.nextContainerCounter(); + entityPlayer.playerConnection.sendPacket(new Packet100OpenWindow(containerCounter, 8, "Repairing", 9, true)); + entityPlayer.activeContainer = new AnvilContainer(entityPlayer.inventory, petTagPage.getInventory()); + entityPlayer.activeContainer.windowId = containerCounter; + entityPlayer.activeContainer.addSlotListener(entityPlayer); + entityPlayer.playerConnection.sendPacket(new Packet103SetSlot(containerCounter, 0, new net.minecraft.server.v1_6_R3.ItemStack(Item.NAME_TAG))); + + Shop.SetCurrentPageForPlayer(Player, petTagPage); + } + + public void ActivatePet(Player player, Pet pet) + { + PlayAcceptSound(player); + Plugin.AddPetOwner(player, pet.GetPetType(), player.getLocation()); + Player.closeInventory(); + } + + public void DeactivatePet(Player player) + { + PlayAcceptSound(player); + Plugin.RemovePet(player, true); + Player.closeInventory(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetShop.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetShop.java new file mode 100644 index 000000000..f8db6ea11 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetShop.java @@ -0,0 +1,29 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.CurrencyType; +import mineplex.core.donation.DonationManager; +import mineplex.core.shop.ShopBase; +import mineplex.core.shop.page.ShopPageBase; +import mineplex.hub.gadget.GadgetManager; +import mineplex.hub.mount.MountManager; + +public class GadgetShop extends ShopBase +{ + private MountManager _mountManager; + + public GadgetShop(GadgetManager plugin, MountManager mountManager, CoreClientManager manager, DonationManager donationManager) + { + super(plugin, manager, donationManager, "Gadget Shop", CurrencyType.Gems); + + _mountManager = mountManager; + } + + @Override + protected ShopPageBase> BuildPagesFor(Player player) + { + return new GadgetPage(Plugin, this, _mountManager, ClientManager, DonationManager, " Gadgets", player); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetButton.java new file mode 100644 index 000000000..0615b1dc4 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetButton.java @@ -0,0 +1,24 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.pet.Pet; +import mineplex.core.shop.item.IButton; + +public class PetButton implements IButton +{ + private Pet _pet; + private GadgetPage _page; + + public PetButton(Pet pet, GadgetPage page) + { + _pet = pet; + _page = page; + } + + @Override + public void Clicked(Player player) + { + _page.PurchasePet(player, _pet); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetSorter.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetSorter.java new file mode 100644 index 000000000..4e8b2d9f6 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetSorter.java @@ -0,0 +1,16 @@ +package mineplex.hub.gadget.ui; + +import java.util.Comparator; + +import mineplex.core.pet.Pet; + +public class PetSorter implements Comparator +{ + public int compare(Pet a, Pet b) + { + if (a.GetPetType().getTypeId() < b.GetPetType().getTypeId()) + return -1; + + return 1; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetTagPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetTagPage.java new file mode 100644 index 000000000..d0bc059e4 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/PetTagPage.java @@ -0,0 +1,107 @@ +package mineplex.hub.gadget.ui; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.CurrencyType; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.donation.DonationManager; +import mineplex.core.pet.Pet; +import mineplex.core.pet.PetExtra; +import mineplex.core.pet.PetManager; +import mineplex.core.pet.PetShop; +import mineplex.core.pet.repository.token.PetChangeToken; +import mineplex.core.pet.repository.token.PetToken; +import mineplex.core.shop.page.ConfirmationPage; +import mineplex.core.shop.page.ShopPageBase; +import net.minecraft.server.v1_6_R3.Item; +import net.minecraft.server.v1_6_R3.ItemStack; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +public class PetTagPage extends ShopPageBase +{ + private String _tagName = "Pet Tag"; + private Pet _pet; + private boolean _petPurchase; + + public PetTagPage(PetManager plugin, PetShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, Pet pet, boolean petPurchase) + { + super(plugin, shop, clientManager, donationManager, name, player, 3); + + _pet = pet; + _petPurchase = petPurchase; + + BuildPage(); + + Player.setLevel(5); + } + + @Override + protected void BuildPage() + { + inventory.setItem(0, new ItemStack(Item.NAME_TAG)); + + ButtonMap.put(0, new CloseButton()); + ButtonMap.put(1, new CloseButton()); + ButtonMap.put(2, new SelectTagButton(this)); + } + + @Override + public void PlayerClosed() + { + super.PlayerClosed(); + + Player.setLevel(0); + } + + public void SelectTag() + { + if (ChatColor.stripColor(_tagName).length() > 16) + { + UtilPlayer.message(Player, F.main(Plugin.GetName(), ChatColor.RED + "Pet name cannot be longer than 16 characters.")); + PlayDenySound(Player); + + return; + } + + PetExtra tag = new PetExtra("Rename " + _pet.GetName() + " to " + _tagName, Material.NAME_TAG, 1000); + + _pet.setDisplayName(C.cGreen + "Purchase " + _tagName); + + Shop.OpenPageForPlayer(Player, new ConfirmationPage(Plugin, Shop, ClientManager, DonationManager, new Runnable() + { + public void run() + { + PetChangeToken token = new PetChangeToken(); + token.Name = Player.getName(); + token.PetType = _pet.GetPetType().toString(); + token.PetName = _tagName; + + PetToken petToken = new PetToken(); + petToken.PetType = token.PetType; + + if (_petPurchase) + { + Plugin.GetRepository().AddPet(token); + Plugin.addPetOwnerToQueue(Player.getName(), _pet.GetPetType()); + } + else + { + Plugin.GetRepository().UpdatePet(token); + } + + Plugin.Get(Player).GetPets().put(_pet.GetPetType(), token.PetName); + + Player.closeInventory(); + } + }, null, _petPurchase ? _pet : tag, CurrencyType.Gems, Player)); + } + + public void SetTagName(String tagName) + { + _tagName = tagName; + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/RenamePetButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/RenamePetButton.java new file mode 100644 index 000000000..1d5c2dbe3 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/RenamePetButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class RenamePetButton implements IButton +{ + private GadgetPage _page; + + public RenamePetButton(GadgetPage page) + { + _page = page; + } + + @Override + public void Clicked(Player player) + { + _page.renameCurrentPet(player); + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/SelectTagButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/SelectTagButton.java new file mode 100644 index 000000000..9eaa88db7 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/SelectTagButton.java @@ -0,0 +1,21 @@ +package mineplex.hub.gadget.ui; + +import org.bukkit.entity.Player; + +import mineplex.core.shop.item.IButton; + +public class SelectTagButton implements IButton +{ + private PetTagPage _page; + + public SelectTagButton(PetTagPage page) + { + _page = page; + } + + @Override + public void Clicked(Player player) + { + _page.SelectTag(); + } +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_6_R3/EntityGhast.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_6_R3/EntityGhast.java index 645bb830e..34340bc9a 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_6_R3/EntityGhast.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_6_R3/EntityGhast.java @@ -63,6 +63,11 @@ public class EntityGhast extends EntityFlying implements IMonster { this.motY += d1 / d3 * 0.1D; this.motZ += d2 / d3 * 0.1D; + double d5 = this.i - this.locX; + double d6 = this.bn - this.locZ; + + this.aN = this.yaw = -((float) Math.atan2(d5, d6)) * 180.0F / 3.1415927F; + return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java index fc5545a35..13da1c74e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java @@ -40,7 +40,8 @@ public class MobGhast extends CreatureBase @Override public void Update(UpdateEvent event) { - + if (event.getType() == UpdateType.TICK) + Move(); } private void Move()