Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-12-14 20:50:35 -05:00
commit eefa4de838
4 changed files with 26 additions and 5 deletions

View File

@ -141,9 +141,14 @@ public class PetManager extends MiniClientPlugin<PetClient>
} }
Creature pet = (Creature)_creatureModule.SpawnEntity(location, entityType); Creature pet = (Creature)_creatureModule.SpawnEntity(location, entityType);
pet.setCustomNameVisible(true);
pet.setCustomName(Get(player).GetPets().get(entityType));
//Named Pet
if (Get(player).GetPets().get(entityType) != null && Get(player).GetPets().get(entityType).length() > 0)
{
//pet.setCustomNameVisible(true);
pet.setCustomName(Get(player).GetPets().get(entityType));
}
if (pet instanceof Zombie) if (pet instanceof Zombie)
{ {
((Zombie) pet).setBaby(true); ((Zombie) pet).setBaby(true);

View File

@ -14,7 +14,7 @@ public enum RewardRarity
* (Fireworks, sounds, etc) * (Fireworks, sounds, etc)
*/ */
COMMON("Common", cAqua), UNCOMMON("Uncommon", cGreen), RARE("Rare", cGold), LEGENDARY("Legendary", cRed); OTHER("Other", cWhite), COMMON("Common", cAqua), UNCOMMON("Uncommon", cGreen), RARE("Rare", cGold), LEGENDARY("Legendary", cRed);
private String _name; private String _name;
private String _color; private String _color;

View File

@ -14,6 +14,7 @@ import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -57,6 +58,8 @@ import mineplex.core.pet.PetManager;
import mineplex.core.portal.Portal; import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager; import mineplex.core.preferences.PreferencesManager;
import mineplex.core.projectile.ProjectileManager; import mineplex.core.projectile.ProjectileManager;
import mineplex.core.reward.RewardRarity;
import mineplex.core.reward.rewards.PetReward;
import mineplex.core.stats.StatsManager; import mineplex.core.stats.StatsManager;
import mineplex.core.status.ServerStatusManager; import mineplex.core.status.ServerStatusManager;
import mineplex.core.task.TaskManager; import mineplex.core.task.TaskManager;
@ -114,6 +117,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private DisguiseManager _disguiseManager; private DisguiseManager _disguiseManager;
private DonationManager _donationManager; private DonationManager _donationManager;
private ConditionManager _conditionManager; private ConditionManager _conditionManager;
private PetManager _petManager;
private Creature _creature; private Creature _creature;
private DamageManager _damageManager; private DamageManager _damageManager;
private Explosion _explosionManager; private Explosion _explosionManager;
@ -174,6 +178,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
// Modules // Modules
_blockRestore = new BlockRestore(plugin); _blockRestore = new BlockRestore(plugin);
_blood = blood; _blood = blood;
@ -216,6 +221,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_inventoryManager = inventoryManager; _inventoryManager = inventoryManager;
_cosmeticManager = cosmeticManager; _cosmeticManager = cosmeticManager;
_portal = portal; _portal = portal;
_petManager = petManager;
// Shop // Shop
_arcadeShop = new ArcadeShop(this, clientManager, donationManager); _arcadeShop = new ArcadeShop(this, clientManager, donationManager);
@ -1074,4 +1080,12 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{ {
return _idleManager; return _idleManager;
} }
public void rewardPet(Player player, String pet, EntityType type)
{
PetReward reward = new PetReward(_petManager, _inventoryManager, _donationManager, pet, pet, type, RewardRarity.OTHER, 0);
if (reward.canGiveReward(player))
reward.giveReward(null, player);
}
} }

View File

@ -10,6 +10,7 @@ import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.CraftServer; import org.bukkit.craftbukkit.v1_7_R4.CraftServer;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -33,6 +34,7 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo; import mineplex.core.packethandler.PacketInfo;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.reward.rewards.PetReward;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -455,8 +457,8 @@ public class Christmas extends SoloGame
for (Player player : GetPlayers(false)) for (Player player : GetPlayers(false))
{ {
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), player.getUniqueId(), "Christmas Elf", false, 0, true); Manager.rewardPet(player, "Christmas Elf", EntityType.VILLAGER);
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), player.getUniqueId(), "Christmas Elf Pet", false, 0, true);
Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false); Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false);
Manager.GetGame().AddGems(player, 10, "Participation", false); Manager.GetGame().AddGems(player, 10, "Participation", false);
} }