Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex into MC_1.8
Conflicts: Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java
This commit is contained in:
commit
3a0781b3c7
@ -55,7 +55,7 @@ public class MotdManager implements Listener, Runnable
|
||||
|
||||
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
|
||||
//String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
|
||||
String motdLine = " §4§l§n H A L L O W E E N H O R R O R §f";
|
||||
String motdLine = " §2§l§n M O N S T E R M A Z E §f";
|
||||
//String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►";
|
||||
//String motdLine = " §d§lRank Sale §a§l40% Off");
|
||||
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
|
||||
|
@ -109,7 +109,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
itemLore.add(C.cWhite + "Your Ammo : " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()));
|
||||
}
|
||||
|
||||
if (gadget.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(gadget.GetName()))
|
||||
if (gadget.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(gadget.GetName()) || getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()) > 0)
|
||||
{
|
||||
if (gadget.GetActive().contains(getPlayer()))
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
}
|
||||
|
||||
//Owned
|
||||
if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(pet.GetPetName()))
|
||||
if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType()))
|
||||
{
|
||||
String petName = getPlugin().getPetManager().Get(getPlayer()).GetPets().get(pet.GetPetType());
|
||||
if (petName == null)
|
||||
|
@ -20,6 +20,8 @@ import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.MorphGadget;
|
||||
import mineplex.core.inventory.ClientItem;
|
||||
import mineplex.core.inventory.data.Item;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -179,10 +181,11 @@ public class MorphWither extends MorphGadget
|
||||
@EventHandler
|
||||
public void legendOwner(PlayerJoinEvent event)
|
||||
{
|
||||
// TODO HARDCODED Wither Morph Database Item Id - 550
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.LEGEND))
|
||||
{
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
Manager.getInventoryManager().Get(event.getPlayer().getName()).addItem(new ClientItem(new Item(550, GetName()), 1));
|
||||
}
|
||||
}
|
||||
|
||||
public void setWitherData(String text, double healthPercent)
|
||||
|
@ -9,6 +9,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.inventory.ClientItem;
|
||||
import mineplex.core.inventory.data.Item;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
@ -46,9 +48,10 @@ public class ParticleLegend extends ParticleGadget
|
||||
@EventHandler
|
||||
public void legendOwner(PlayerJoinEvent event)
|
||||
{
|
||||
// TODO HARDCODED Legendary Aura Database Item Id - 552
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.LEGEND))
|
||||
{
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
Manager.getInventoryManager().Get(event.getPlayer().getName()).addItem(new ClientItem(new Item(552, GetName()), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,8 +73,10 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
private NautHashMap<String, String> _petRenameQueue = new NautHashMap<String, String>();
|
||||
private DonationManager _donationManager;
|
||||
private CoreClientManager _clientManager;
|
||||
private InventoryManager _inventoryManager;
|
||||
|
||||
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore, String webAddress)
|
||||
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
|
||||
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore, String webAddress)
|
||||
{
|
||||
super("Pet Manager", plugin);
|
||||
|
||||
@ -85,6 +87,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
_blockRestore = restore;
|
||||
_donationManager = donationManager;
|
||||
_clientManager = clientManager;
|
||||
_inventoryManager = inventoryManager;
|
||||
|
||||
_activePetOwners = new NautHashMap<String, Creature>();
|
||||
_failedAttempts = new NautHashMap<String, Integer>();
|
||||
@ -149,10 +152,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
Rank rank = _clientManager.Get(p).GetRank();
|
||||
if (rank.has(Rank.LEGEND))
|
||||
{
|
||||
_donationManager.Get(p.getName()).AddUnknownSalesPackagesOwned("Widder");
|
||||
}
|
||||
|
||||
if (rank.has(Rank.LEGEND))
|
||||
{
|
||||
if (!Get(p).GetPets().containsKey(EntityType.WITHER))
|
||||
Get(p).GetPets().put(EntityType.WITHER, "Widder");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddPetOwner(Player player, EntityType entityType, Location location)
|
||||
|
@ -10,5 +10,4 @@ public class Pumpkin extends Pet
|
||||
{
|
||||
super("Pumpling", EntityType.ZOMBIE, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,12 +51,22 @@ public class PetReward extends UnknownPackageReward
|
||||
petToken.PetType = token.PetType;
|
||||
|
||||
_petManager.GetRepository().AddPet(token);
|
||||
// _petManager.addPetOwnerToQueue(player.getName(), _petEntity);
|
||||
|
||||
_petManager.Get(player).GetPets().put(_petEntity, token.PetName);
|
||||
|
||||
_inventoryManager.addItemToInventory(player, _petEntity.toString(), 1);
|
||||
|
||||
return super.giveRewardCustom(player);
|
||||
return getFakeRewardData(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGiveReward(Player player)
|
||||
{
|
||||
if (DonationManager.Get(player.getName()) == null)
|
||||
{
|
||||
System.out.println("Could not give reward " + getPackageName() + " to Offline Player: " + player.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
return !_petManager.Get(player).GetPets().containsKey(_petEntity);
|
||||
}
|
||||
}
|
||||
|
@ -6,15 +6,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.reward.Reward;
|
||||
import mineplex.core.reward.RewardData;
|
||||
import mineplex.core.reward.RewardManager;
|
||||
import mineplex.core.reward.RewardRarity;
|
||||
|
||||
/**
|
||||
* Created by shaun on 14-09-12.
|
||||
*/
|
||||
public class UnknownPackageReward extends Reward
|
||||
{
|
||||
private DonationManager _donationManager;
|
||||
protected DonationManager DonationManager;
|
||||
private ItemStack _itemStack;
|
||||
private String _name;
|
||||
private String _packageName;
|
||||
@ -22,7 +18,7 @@ public class UnknownPackageReward extends Reward
|
||||
public UnknownPackageReward(DonationManager donationManager, String name, String packageName, ItemStack itemStack, RewardRarity rarity, int weight)
|
||||
{
|
||||
super(rarity, weight);
|
||||
_donationManager = donationManager;
|
||||
DonationManager = donationManager;
|
||||
_name = name;
|
||||
_packageName = packageName;
|
||||
_itemStack = itemStack;
|
||||
@ -31,7 +27,7 @@ public class UnknownPackageReward extends Reward
|
||||
@Override
|
||||
protected RewardData giveRewardCustom(Player player)
|
||||
{
|
||||
_donationManager.PurchaseUnknownSalesPackage(null, player.getName(), _donationManager.getClientManager().Get(player).getAccountId(), _packageName, true, 0, true);
|
||||
DonationManager.PurchaseUnknownSalesPackage(null, player.getName(), DonationManager.getClientManager().Get(player).getAccountId(), _packageName, true, 0, true);
|
||||
|
||||
return new RewardData(getRarity().getColor() + _name, _itemStack, getRarity());
|
||||
}
|
||||
@ -39,13 +35,13 @@ public class UnknownPackageReward extends Reward
|
||||
@Override
|
||||
public boolean canGiveReward(Player player)
|
||||
{
|
||||
if (_donationManager.Get(player.getName()) == null)
|
||||
if (DonationManager.Get(player.getName()) == null)
|
||||
{
|
||||
System.out.println("Could not give reward " + _packageName + " to Offline Player: " + player.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
return !_donationManager.Get(player.getName()).OwnsUnknownPackage(_packageName);
|
||||
return !DonationManager.Get(player.getName()).OwnsUnknownPackage(_packageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.ignore.IgnoreManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.memory.MemoryFix;
|
||||
import mineplex.core.message.MessageManager;
|
||||
@ -102,7 +103,8 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
preferenceManager.GiveItem = true;
|
||||
Creature creature = new Creature(this);
|
||||
NpcManager npcManager = new NpcManager(this, creature);
|
||||
PetManager petManager = new PetManager(this, clientManager, donationManager, disguiseManager, creature, blockRestore, webServerAddress);
|
||||
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
||||
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, webServerAddress);
|
||||
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
||||
|
||||
//Main Modules
|
||||
@ -123,7 +125,7 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
|
||||
|
||||
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
|
||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, new ConditionManager(this), disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish);
|
||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, new ConditionManager(this), disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish);
|
||||
|
||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
//Admin
|
||||
private boolean _gadgetsEnabled = true;
|
||||
|
||||
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager, PacketHandler packetHandler, Punish punish)
|
||||
public HubManager(JavaPlugin plugin, BlockRestore blockRestore, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, ConditionManager conditionManager, DisguiseManager disguiseManager, TaskManager taskManager, Portal portal, PartyManager partyManager, PreferencesManager preferences, PetManager petManager, PollManager pollManager, StatsManager statsManager, AchievementManager achievementManager, HologramManager hologramManager, NpcManager npcManager, PersonalServerManager personalServerManager, PacketHandler packetHandler, Punish punish)
|
||||
{
|
||||
super("Hub Manager", plugin);
|
||||
|
||||
@ -187,7 +187,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
_news = new NewsManager(this);
|
||||
|
||||
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
|
||||
_inventoryManager = new InventoryManager(plugin, clientManager);
|
||||
_inventoryManager = inventoryManager;
|
||||
new BenefitManager(plugin, clientManager, _inventoryManager);
|
||||
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager);
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class Arcade extends JavaPlugin
|
||||
|
||||
//Inventory
|
||||
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
||||
PetManager petManager = new PetManager(this, _clientManager, _donationManager, disguiseManager, creature, blockRestore, webServerAddress);
|
||||
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore, webServerAddress);
|
||||
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
|
||||
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager);
|
||||
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, null);
|
||||
|
@ -41,7 +41,7 @@ public class PerkHorsePet extends Perk
|
||||
C.cGray + "You have a loyal horse companion.",
|
||||
});
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||
//Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user