Merge branch 'update/kingppc' into develop

This commit is contained in:
cnr 2017-05-01 22:07:46 -07:00
commit 2a92d312b2
8 changed files with 29 additions and 16 deletions

View File

@ -36,6 +36,7 @@ import mineplex.core.gadget.gadgets.particle.king.types.Peasant;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.HologramManager;
import mineplex.core.mount.event.MountActivateEvent;
import mineplex.core.pet.event.PetSpawnEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -668,6 +669,10 @@ public class CastleManager extends MiniPlugin
}
}
/**
* Stops players from using mounts inside the castle
* @param event
*/
@EventHandler
public void onMount(MountActivateEvent event)
{
@ -677,4 +682,14 @@ public class CastleManager extends MiniPlugin
if (isInsideCastle(event.getPlayer().getLocation()))
event.setCancelled(true);
}
@EventHandler
public void onPetSpawn(PetSpawnEvent event)
{
if (!isHub())
return;
if (isInsideCastle(event.getLocation()))
event.setCancelled(true);
}
}

View File

@ -70,9 +70,9 @@ import mineplex.core.disguise.disguises.DisguiseVillager;
import mineplex.core.disguise.disguises.DisguiseWither;
import mineplex.core.disguise.disguises.DisguiseZombie;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.particle.king.CastleManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.pet.event.PetSpawnEvent;
import mineplex.core.pet.repository.PetRepository;
import mineplex.core.pet.repository.token.ClientPetTokenWrapper;
import mineplex.core.updater.UpdateType;
@ -97,7 +97,6 @@ public class PetManager extends MiniClientPlugin<PetClient>
private DonationManager _donationManager;
private CoreClientManager _clientManager;
private InventoryManager _inventoryManager;
private CastleManager _castleManager;
private Map<Entity, FlyingPetManager> _flyingPets = new HashMap<>();
private Map<Entity, TrueLoveData> _trueLovePets = new HashMap<>();
@ -110,8 +109,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
private ShapeWings _cupidWingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0, 0, 0), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore,
CastleManager castleManager)
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore)
{
super("Pet Manager", plugin);
@ -216,11 +214,11 @@ public class PetManager extends MiniClientPlugin<PetClient>
return;
}
if (_castleManager.isInsideCastle(location))
{
UtilPlayer.message(player, F.main("Pets", "You cannot spawn a pet inside the castle!"));
PetSpawnEvent petSpawnEvent = new PetSpawnEvent(player, petType.getEntityType(), location);
Bukkit.getPluginManager().callEvent(petSpawnEvent);
if (petSpawnEvent.isCancelled())
return;
}
Entity pet;
EntityType entityType = petType.getEntityType();

View File

@ -23,17 +23,17 @@ public class PetSpawnEvent extends Event implements Cancellable
_location = location;
}
public Player GetPlayer()
public Player getPlayer()
{
return _player;
}
public EntityType GetEntityType()
public EntityType getEntityType()
{
return _entityType;
}
public Location GetLocation()
public Location getLocation()
{
return _location;
}

View File

@ -123,7 +123,7 @@ public class ClansHub extends JavaPlugin
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
HologramManager hologramManager = new HologramManager(this, packetHandler);
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
PollManager pollManager = new PollManager(this, clientManager, donationManager);
//Main Modules

View File

@ -147,7 +147,7 @@ public class Hub extends JavaPlugin implements IRelation
_npcManager = npcManager;
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, true);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
PollManager pollManager = new PollManager(this, clientManager, donationManager);
//new TournamentManager(this, clientManager, donationManager);

View File

@ -202,7 +202,7 @@ public class Arcade extends JavaPlugin
//Inventory
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
CastleManager castleManager = new CastleManager(this, _clientManager, hologramManager, false);
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore);
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);

View File

@ -129,7 +129,7 @@ public class Hub extends JavaPlugin
// Inventory
CastleManager castleManager = new CastleManager(this, _clientManager, hologramManager, false);
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
PetManager petManager = new PetManager(this, _clientManager, _donationManager, inventoryManager, disguiseManager, creature, blockRestore);
MountManager mountManager = new MountManager(this, _clientManager, _donationManager, blockRestore, disguiseManager);
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager,
preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);

View File

@ -252,7 +252,7 @@ public class GemHunters extends JavaPlugin
// :(
CastleManager castleManager = new CastleManager(this, clientManager, hologramManager, false);
MountManager mountManager = new MountManager(this, clientManager, donationManager, blockRestore, disguiseManager);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, castleManager);
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore);
ProjectileManager projectileManager = new ProjectileManager(this);
GadgetManager gadgetManager = new GadgetManager(this, clientManager, donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito, castleManager);
ThankManager thankManager = new ThankManager(this, clientManager, donationManager);