Github is annoying me about this, but I don't know what it is

This commit is contained in:
LCastr0 2016-07-24 13:18:33 -03:00
parent 0dce530438
commit 195a82f78f
31 changed files with 511 additions and 155 deletions

View File

@ -32,6 +32,7 @@ public class SkinData
public final static SkinData SNOWMAN = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTk4Nzk5NDIsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzEzMTgxYWViODQzODk3NzM1ZDQwMmIyNDk2OTQxNmZkYjBjZTM0YTZiOTM3ODE2MjQzNzU2ZTlkYWU1OGUzIn19fQ==","NZvsNu+HQ5uvGWq6O8VNDGq9A145bmk2IkHiz916uRVPMRqqCI/zwhKWNLlFACE/feuLkhYAois29ec6sVVOtHIoNA+S5q1Mb/Vjc3TJQxzqmx2FZOhJiIttFwYuo9WomQKBqrPMSJ9tpQig4wzoqldeeTjWC3dLz7JeX+gkzinryVjG7NNN9L5hXK5/BBxRcrtwmXJfUlSANyrd8RZW7mEUgU8yxlzdqTu0w7bZLjQNd4vciwoF3NelXDorMIIqiHTkuQesG91Njtu25VCUDK3nXbqEnZw2ZtxB5fT5G2Omm/vkNSRXc0P7iqchVowdYQcMlQUsp65xpkBbFS4LwjzDkYIfLmF++hePb8z72Gz77FxhO5sRLGreSH227McyL/0CtWNKm9ZZIfQtZZjEZTj9+eiJMCloCMg3yWa1VBOiLHzz0wY6gGklccIImPyXEg7E0dIK8qYseJMhmmBNZ8pDOkbUDp3mRlrQ2iyClgQkbuR63j79IBUaCxmsa3NnrAtaJklzd9mzkHXfMBh2XT7Gl8AhJS6JK5kCvip1rBBI8yjrsjE/E+lyJ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/k0m86bfZObe2RsCEgBe8GSF35cyYRou0qTvk+00hEr+jpxeat0e9JHe163jI/Ew9XPeGd6eT8GTy4iyJM0O/y1MlsRjUec=");
// Comments this out for now, so it doesn't load the player profile
// A better way to do this would check for the properties when getting the skull or the skin
@ -41,9 +42,9 @@ public class SkinData
//public final static SkinData CHISS = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTk1NDI5NjgyNDEsInByb2ZpbGVJZCI6IjFkMmJmZTYxN2ViZDQ0NWRiYTdkODM1NGEwZmZkMWVhIiwicHJvZmlsZU5hbWUiOiJDaGlzcyIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTg3MmNkMzRjY2IzMTIxYjRjNmEzOGFjM2JmOGVkM2UwMzk3YmQ2YTg4NDI4YjdhZmM2ZTUyNTI4NTVhMzQzIiwibWV0YWRhdGEiOnsibW9kZWwiOiJzbGltIn19fX0=", "hNTLRA2acZYx2dM90lnJN8FMK/ceD3+AxKNdD5FrXzxGtYL4C1Jr/vbTE0UosmwFP3wScNEW/fuDOjeZRjZHMJdvgDZMlMK/5KDhOY6sj/RS9RckztsgummSyjH/hdDn7TWWfhZLMbiia/K0VReI9eq2yD6zGQpvMlz5hB/5SX5YHWXvCah3TL4UzYSlSVDlwY/Q3sVuIZUr8m/LIXJwniJKLGo6tUgtiJd9eseOsbBpVjzCUtLD8A9WBe2/eODgmLfqEvXESIoDRG8vL2nPSXWma/YolYHIl32/i+ZxVD7dRRaXQFYSiLI24EtzX1pPhMjyaTLazP9abH43J6J31w02pKM7N/xTa62020L/YfRRKGT5lygEDb1NMoSpAjszPxah+Ra2/L+yUWEI8cMES6I4mIJ00tclPjWK01xhIn3tqg+y2gqsGHwPhu/7vmF5NirNfKFw0qciKNBfbCAF7ae+mkUKjmAPuvBUBqQb7BOcpNVWsCo/XvzmiZZ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R8fdaUKRMcpBgEs+ZGe2U9EVVS/ZcBCjB7S+1Ne2bPzPFzTQPuBoMgggo1xbxBmQ5NyhYo4gwgj/xjSLIhb+5h7ioN1URfSRcfYdVv6RRO9l/u9l09jEom8y/jGRviefpEr+/e9iAl5Dd/6nzQgosBQja3NSfqYZmyuet2eI9zu61CObDTpR6yaCbNgBe/lWofRfULdpJpgjb4UNTBom3q82FcCiOe02OekGPw4+YlilhICBhajF5JzN8FKAdqI1osDcX3KuJgikYIW3voNaOP5YN3GXgilJNdou20KFC8ICq68HglgX7/0rLrWKIEoswnINIM6HcJbQuXncVPwQhV6K34Hlt/Na60=");
private Property _skinProperty;
//private Property _skinProperty;
public SkinData(String value, String signature)
/*public SkinData(String value, String signature)
{
_skinProperty = new Property("textures", value, signature);
}
@ -51,18 +52,45 @@ public class SkinData
public SkinData(GameProfile profile)
{
_skinProperty = profile.getProperties().get("textures").iterator().next();
}*/
private String _value;
private String _signature;
private Property _property;
public SkinData(String value, String signature)
{
_value = value;
_signature = signature;
}
public SkinData(GameProfile gameProfile)
{
Property property = gameProfile.getProperties().get("textures").iterator().next();
_value = property.getValue();
_signature = property.getSignature();
}
public SkinData(Player player)
{
this(((CraftPlayer)player).getProfile());
}
public Property getSkinProperty()
{
if (_property == null)
{
Property property = new Property("textures", _value, _signature);
_property = property;
}
return _property;
}
public ItemStack getSkull()
{
NBTTagCompound arrayElement = new NBTTagCompound();
arrayElement.setString("Value", _skinProperty.getValue());
arrayElement.setString("Signature", _skinProperty.getSignature());
arrayElement.setString("Value", getSkinProperty().getValue());
arrayElement.setString("Signature", getSkinProperty().getSignature());
NBTTagList textures = new NBTTagList();
textures.add(arrayElement);
@ -95,11 +123,6 @@ public class SkinData
return stack;
}
public Property getProperty()
{
return new Property(_skinProperty.getName(), _skinProperty.getValue(), _skinProperty.getSignature());
}
public static String getUnusedSkullName()
{
_nameCount++;

View File

@ -2,25 +2,12 @@ package mineplex.core.disguise.disguises;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.skin.SkinData;
import net.minecraft.server.v1_8_R3.*;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.UtilPlayer;
import net.minecraft.server.v1_8_R3.EntityPlayer;
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
import net.minecraft.server.v1_8_R3.IntHashMap;
import net.minecraft.server.v1_8_R3.EntityHuman;
import net.minecraft.server.v1_8_R3.MathHelper;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R3.WorldServer;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import net.minecraft.server.v1_8_R3.WorldSettings;
import org.bukkit.entity.Entity;
public class DisguisePlayer extends DisguiseHuman
@ -60,7 +47,7 @@ public class DisguisePlayer extends DisguiseHuman
public void setSkinData(SkinData skin)
{
_profile.getProperties().put("textures", skin.getProperty());
_profile.getProperties().put("textures", skin.getSkinProperty());
}
/**

View File

@ -3,104 +3,65 @@ package mineplex.core.gadget;
import java.util.*;
import java.util.function.Predicate;
import mineplex.core.gadget.commands.LockCosmeticsCommand;
import mineplex.core.gadget.event.GadgetChangeEvent;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom;
import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom;
import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom;
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
import mineplex.core.gadget.gadgets.hat.*;
import mineplex.core.gadget.gadgets.morph.*;
import mineplex.core.gadget.gadgets.outfit.windupsuit.*;
import mineplex.core.gadget.gadgets.particle.*;
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
import mineplex.core.gadget.gadgets.wineffect.*;
import mineplex.core.gadget.persistence.UserGadgetPersistence;
import mineplex.core.gadget.set.*;
import mineplex.core.gadget.types.*;
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.*;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.commands.AmmoCommand;
import mineplex.core.gadget.commands.LockCosmeticsCommand;
import mineplex.core.gadget.commands.UnlockCosmeticsCommand;
import mineplex.core.gadget.event.GadgetChangeEvent;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom;
import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord;
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan;
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
import mineplex.core.gadget.gadgets.death.candycane.DeathCandyCane;
import mineplex.core.gadget.gadgets.death.cupidslove.DeathCupidsBrokenHeart;
import mineplex.core.gadget.gadgets.death.emerald.DeathEmerald;
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom;
import mineplex.core.gadget.gadgets.death.frostlord.DeathFrostLord;
import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
import mineplex.core.gadget.gadgets.death.titan.DeathTitan;
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom;
import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord;
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan;
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitGameModifier;
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
import mineplex.core.gadget.gadgets.item.ItemBatGun;
import mineplex.core.gadget.gadgets.item.ItemBow;
import mineplex.core.gadget.gadgets.item.ItemCoal;
import mineplex.core.gadget.gadgets.item.ItemCoinBomb;
import mineplex.core.gadget.gadgets.item.ItemDuelingSword;
import mineplex.core.gadget.gadgets.item.ItemEtherealPearl;
import mineplex.core.gadget.gadgets.item.ItemFirework;
import mineplex.core.gadget.gadgets.item.ItemFleshHook;
import mineplex.core.gadget.gadgets.item.ItemFlowerGift;
import mineplex.core.gadget.gadgets.item.ItemFreezeCannon;
import mineplex.core.gadget.gadgets.item.ItemLovePotion;
import mineplex.core.gadget.gadgets.item.ItemMelonLauncher;
import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
import mineplex.core.gadget.gadgets.item.ItemSnowball;
import mineplex.core.gadget.gadgets.item.ItemTNT;
import mineplex.core.gadget.gadgets.hat.HatItem;
import mineplex.core.gadget.gadgets.hat.HatType;
import mineplex.core.gadget.gadgets.item.*;
import mineplex.core.gadget.gadgets.morph.*;
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots;
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate;
@ -110,20 +71,30 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald;
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.frostlord.ParticleFrostLord;
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
import mineplex.core.gadget.gadgets.particle.*;
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.cupidslove.ParticleHeart;
import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald;
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
import mineplex.core.gadget.gadgets.particle.frostlord.ParticleFrostLord;
import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan;
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
import mineplex.core.gadget.gadgets.wineffect.*;
import mineplex.core.gadget.persistence.UserGadgetPersistence;
import mineplex.core.gadget.set.*;
import mineplex.core.gadget.set.suits.SetRaveSuit;
import mineplex.core.gadget.set.suits.SetSpaceSuit;
import mineplex.core.gadget.types.*;
import mineplex.core.gadget.types.OutfitGadget.ArmorSlot;
import mineplex.core.hologram.HologramManager;
import mineplex.core.incognito.IncognitoManager;
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.mount.MountManager;
import mineplex.core.mount.event.MountActivateEvent;
@ -131,6 +102,18 @@ import mineplex.core.packethandler.PacketHandler;
import mineplex.core.pet.PetManager;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.projectile.ProjectileManager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class GadgetManager extends MiniPlugin
{
@ -147,6 +130,7 @@ public class GadgetManager extends MiniPlugin
private final PacketHandler _packetManager;
private final HologramManager _hologramManager;
private final OutfitWindUpSuitBoosterManager _boosterManager;
private final IncognitoManager _incognitoManager;
private NautHashMap<GadgetType, List<Gadget>> _gadgets;
@ -162,9 +146,9 @@ public class GadgetManager extends MiniPlugin
private boolean _gadgetsEnabled = true;
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
DisguiseManager disguiseManager, BlockRestore blockRestore, ProjectileManager projectileManager, AchievementManager achievementManager,
PacketHandler packetHandler, HologramManager hologramManager)
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
DisguiseManager disguiseManager, BlockRestore blockRestore, ProjectileManager projectileManager, AchievementManager achievementManager,
PacketHandler packetHandler, HologramManager hologramManager, IncognitoManager incognitoManager)
{
super("Gadget Manager", plugin);
@ -182,6 +166,7 @@ public class GadgetManager extends MiniPlugin
_hologramManager = hologramManager;
_userGadgetPersistence = new UserGadgetPersistence(this);
_boosterManager = new OutfitWindUpSuitBoosterManager(this);
_incognitoManager = incognitoManager;
createGadgets();
createSets();
@ -278,6 +263,8 @@ public class GadgetManager extends MiniPlugin
addGadget(new MorphTitan(this));
addGadget(new MorphSnowman(this));
addGadget(new MorphUncleSam(this));
addGadget(new MorphSquid(this));
addGadget(new MorphMetalMan(this));
// Particles
addGadget(new ParticleFoot(this));
@ -919,6 +906,12 @@ public class GadgetManager extends MiniPlugin
{
if (!_gadgetsEnabled)
event.setCancelled(true);
Player player = event.getPlayer();
if (_incognitoManager.Get(player).Hidden && event.getGadget().getGadgetType() == GadgetType.PARTICLE)
{
event.setCancelled(true);
player.sendMessage(F.main("Cosmetics", "You cannot enable particles while vanished!"));
}
}
@EventHandler

View File

@ -56,7 +56,7 @@ public class MorphBat extends MorphGadget implements IThrown
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseBat disguise = new DisguiseBat(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -67,7 +67,7 @@ public class MorphBat extends MorphGadget implements IThrown
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);

View File

@ -39,7 +39,7 @@ public class MorphBlaze extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseBlaze disguise = new DisguiseBlaze(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -50,7 +50,7 @@ public class MorphBlaze extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -48,7 +48,7 @@ public class MorphBlock extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
_active.put(player, new BlockForm(this, player, Material.EMERALD_BLOCK));
}
@ -56,7 +56,7 @@ public class MorphBlock extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
BlockForm form = _active.remove(player);

View File

@ -67,7 +67,7 @@ public class MorphBunny extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseRabbit disguise = new DisguiseRabbit(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -82,7 +82,7 @@ public class MorphBunny extends MorphGadget
public void disableCustom(Player player, boolean message)
{
_jumpCharge.remove(player);
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.removePotionEffect(PotionEffectType.SPEED);

View File

@ -45,7 +45,7 @@ public class MorphChicken extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseChicken disguise = new DisguiseChicken(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -56,7 +56,7 @@ public class MorphChicken extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);

View File

@ -33,7 +33,7 @@ public class MorphCow extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseCow disguise = new DisguiseCow(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -44,7 +44,7 @@ public class MorphCow extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -47,7 +47,7 @@ public class MorphCreeper extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseCreeper disguise = new DisguiseCreeper(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -58,7 +58,7 @@ public class MorphCreeper extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -44,7 +44,7 @@ public class MorphEnderman extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseEnderman disguise = new DisguiseEnderman(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -55,7 +55,7 @@ public class MorphEnderman extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);

View File

@ -1,5 +1,133 @@
package mineplex.core.gadget.gadgets.morph;
public class MorphMetalMan
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.skin.SkinData;
import mineplex.core.common.util.*;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetSelectLocationEvent;
import mineplex.core.gadget.gadgets.particle.unrelated.MetalManEffect;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.recharge.Recharge;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
public class MorphMetalMan extends MorphGadget
{
private Map<UUID, Integer> _playerColors = new HashMap<>();
public MorphMetalMan(GadgetManager manager)
{
super(manager, "Metal Man Morph", UtilText.splitLinesToArray(new String[]{"Placeholder"}, LineFormat.LORE),
0, Material.IRON_INGOT, (byte) 0);
}
@Override
public void enableCustom(Player player, boolean message)
{
applyArmor(player, message);
DisguisePlayer disguisePlayer = new DisguisePlayer(player);
disguisePlayer.setProfile(new GameProfile(UUID.randomUUID(), C.cYellow + "Metal " + C.cRed + "Man"));
SkinData metalMan = SkinData.METAL_MAN;
disguisePlayer.setSkinData(metalMan);
disguisePlayer.setSendSkinDataToSelf(true);
Manager.getDisguiseManager().disguise(disguisePlayer);
}
@Override
public void disableCustom(Player player, boolean message)
{
removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}
@EventHandler
public void onPlayerClick(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (!isActive(player))
return;
if (!UtilEvent.isAction(event, UtilEvent.ActionType.L))
return;
if (!Recharge.Instance.use(player, getName(), 1000, false, false, "Cosmetics"))
return;
// Creates colored laser
HashSet<Material> ignore = new HashSet<Material>();
ignore.add(Material.AIR);
Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5);
GadgetSelectLocationEvent gadgetSelectLocationEvent = new GadgetSelectLocationEvent(player, this, loc);
Bukkit.getServer().getPluginManager().callEvent(gadgetSelectLocationEvent);
// Checks to see if it's a valid location
if (gadgetSelectLocationEvent.isCancelled())
{
if (gadgetSelectLocationEvent.canShowMessage())
{
UtilPlayer.message(player, F.main("Gadget", "You cannot use the laser on this area!"));
}
return;
}
// Creates the particle beam
int color = 0;
if (_playerColors.containsKey(player.getUniqueId()))
{
color = _playerColors.get(player.getUniqueId());
}
MetalManEffect metalManEffect = new MetalManEffect(player.getEyeLocation(), loc, color, Manager.getPlugin());
increaseColor(player.getUniqueId());
metalManEffect.start();
// Creates the explosion and knockback players
loc.getWorld().createExplosion(loc, 0f);
UtilParticle.PlayParticle(UtilParticle.ParticleType.HUGE_EXPLOSION, loc, 3f, 3f, 3f, 0, 32, UtilParticle.ViewDist.MAX, UtilServer.getPlayers());
HashMap<Player, Double> players = UtilPlayer.getInRadius(loc, 12d);
for (Player ent : players.keySet())
{
if (Manager.collideEvent(player, this, ent))
continue;
double mult = players.get(ent);
//Knockback
UtilAction.velocity(ent, UtilAlg.getTrajectory(loc, ent.getLocation()), 2 * mult, false, 0, 1 + 1 * mult, 10, true);
}
}
public void increaseColor(UUID uuid)
{
if (_playerColors.containsKey(uuid))
{
int color = _playerColors.get(uuid);
if (color == 0)
color = 1;
else
color = 0;
_playerColors.put(uuid, color);
}
else
{
_playerColors.put(uuid, 0);
}
}
}

View File

@ -46,7 +46,7 @@ public class MorphPig extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguisePig disguise = new DisguisePig(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -57,7 +57,7 @@ public class MorphPig extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -30,7 +30,7 @@ public class MorphPumpkinKing extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
disguise.showArmor();
@ -48,7 +48,7 @@ public class MorphPumpkinKing extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.getInventory().setHelmet(null);
}

View File

@ -45,7 +45,7 @@ public class MorphSlime extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseSlime disguise = new DisguiseSlime(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -67,7 +67,7 @@ public class MorphSlime extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -57,7 +57,7 @@ public class MorphSnowman extends MorphGadget
@Override
public void enableCustom(Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseSnowman disguise = new DisguiseSnowman(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -68,7 +68,7 @@ public class MorphSnowman extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -1,5 +1,91 @@
package mineplex.core.gadget.gadgets.morph;
public class MorphSquid
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilText;
import mineplex.core.disguise.disguises.DisguiseSquid;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerToggleSneakEvent;
public class MorphSquid extends MorphGadget implements IThrown
{
public MorphSquid(GadgetManager manager)
{
super(manager, "Squid Morph", UtilText.splitLinesToArray(new String[]{"Placeholder"}, LineFormat.LORE),
0, Material.MONSTER_EGG, (byte) 0);
}
@Override
public void enableCustom(Player player, boolean message)
{
applyArmor(player, message);
DisguiseSquid disguiseSquid = new DisguiseSquid(player);
disguiseSquid.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
Manager.getDisguiseManager().disguise(disguiseSquid);
}
@Override
public void disableCustom(Player player, boolean message)
{
removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}
@EventHandler
public void onSneak(PlayerToggleSneakEvent event)
{
Player player = event.getPlayer();
if (!player.isSneaking())
return;
if (!isActive(player))
return;
if (!Recharge.Instance.use(player, getName(), 1000, false, false, "Cosmetics"))
return;
UtilAction.velocity(player, player.getLocation().getDirection(), 0.8, false, 0, 0.5, 0.8, true);
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.RAW_FISH));
UtilAction.velocity(item, player.getLocation().getDirection(),
0.01, true, -0.3, 1.5, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
data.getThrown().remove();
}
@Override
public void Idle(ProjectileUser data)
{
data.getThrown().remove();
}
@Override
public void Expire(ProjectileUser data)
{
data.getThrown().remove();
}
}

View File

@ -60,7 +60,7 @@ public class MorphTitan extends MorphGadget
@Override
public void enableCustom(Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseGuardian disguise = new DisguiseGuardian(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -72,7 +72,7 @@ public class MorphTitan extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);

View File

@ -35,7 +35,7 @@ public class MorphUncleSam extends MorphGadget
@Override
public void enableCustom(Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguisePlayer disguisePlayer = new DisguisePlayer(player);
disguisePlayer.setProfile(new GameProfile(UUID.randomUUID(), C.cRed + "Uncle " + C.cBlue + "Sam"));
@ -48,7 +48,7 @@ public class MorphUncleSam extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -55,7 +55,7 @@ public class MorphVillager extends MorphGadget implements IThrown
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
DisguiseVillager disguise = new DisguiseVillager(player);
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
@ -66,7 +66,7 @@ public class MorphVillager extends MorphGadget implements IThrown
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
}

View File

@ -58,7 +58,7 @@ public class MorphWither extends MorphGadget
@Override
public void enableCustom(final Player player, boolean message)
{
this.ApplyArmor(player, message);
this.applyArmor(player, message);
player.setMaxHealth(300);
player.setHealth(300);
@ -75,7 +75,7 @@ public class MorphWither extends MorphGadget
@Override
public void disableCustom(Player player, boolean message)
{
this.RemoveArmor(player);
this.removeArmor(player);
Manager.getDisguiseManager().undisguise(player);
player.setAllowFlight(false);

View File

@ -9,6 +9,7 @@ public abstract class Effect
public int _ticksToRun = 20, _ticks = 0, _task;
public long _delay = 1;
public EffectLocation _effectLocation;
public EffectLocation _targetLocation;
protected JavaPlugin _javaPlugin;
public Effect(int ticks, EffectLocation effectLocation, JavaPlugin javaPlugin)
@ -53,4 +54,14 @@ public abstract class Effect
public abstract void runEffect();
public void setTargetLocation(EffectLocation effectLocation)
{
_targetLocation = effectLocation;
}
public EffectLocation getTargetLocation()
{
return _targetLocation;
}
}

View File

@ -1,5 +1,50 @@
package mineplex.core.gadget.gadgets.particle.unrelated;
public class MetalManEffect
import java.awt.*;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.particles.ColoredParticle;
import mineplex.core.common.util.particles.DustSpellColor;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
public class MetalManEffect extends Effect
{
private int _particles = 100;
private int _color;
private Vector _vector;
public MetalManEffect(Location location, Location target, int color, JavaPlugin javaPlugin)
{
super(20, new EffectLocation(location), javaPlugin);
_color = color;
setTargetLocation(new EffectLocation(target));
}
@Override
public void runEffect()
{
Location location = _effectLocation.getFixedLocation().clone();
if (_vector == null)
{
Location targetLoc = getTargetLocation().getFixedLocation().clone();
Vector link = targetLoc.toVector().subtract(location.toVector());
float length = (float) link.length();
link.normalize();
Vector vector = link.multiply(length / _particles);
_vector = vector;
}
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
new DustSpellColor((_color == 0) ? Color.YELLOW : Color.RED), _effectLocation.getLocation().clone());
Location loc = location.clone().subtract(_vector);
for (int i = 0; i < _particles; i++)
{
loc.add(_vector);
coloredParticle.setLocation(loc);
coloredParticle.display(UtilParticle.ViewDist.LONG);
}
}
}

View File

@ -1,5 +1,31 @@
package mineplex.core.gadget.gadgets.particle.unrelated;
public class SquidEffect
import java.util.Random;
import mineplex.core.common.util.UtilParticle;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class SquidEffect extends Effect
{
private int _particles = 50;
public SquidEffect(Player player, JavaPlugin javaPlugin)
{
super(1, new EffectLocation(player), javaPlugin);
}
@Override
public void runEffect()
{
Random random = new Random();
for (int i = 0; i < _particles; i++)
{
int x = random.nextInt(2) - 1, y = random.nextInt(2) - 1, z = random.nextInt(2) - 1;
UtilParticle.PlayParticle(UtilParticle.ParticleType.DRIP_WATER,
_effectLocation.getLocation().clone().add(x, y, z), 0f, 0f, 0f, 0f, 2, UtilParticle.ViewDist.NORMAL);
}
}
}

View File

@ -1,5 +1,41 @@
package mineplex.core.gadget.powerplayclub;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.UUID;
import mineplex.core.common.util.BukkitFuture;
import mineplex.core.database.PlayerKeyValueRepository;
public class PowerPlayClubManager
{
public final PlayerKeyValueRepository<Integer> _repository;
public PowerPlayClubManager()
{
_repository = new PlayerKeyValueRepository<>("powerPlayClub", PreparedStatement::setInt, ResultSet::getInt);
}
public Integer getPlayerMonths(UUID uuid)
{
final int[] months = {0};
_repository.getAll(uuid).thenCompose(BukkitFuture.accept(values ->
{
if (values.containsKey("monthsLeft"))
months[0] = values.get("monthsLeft");
}));
return months[0];
}
public void addPlayerMonths(UUID uuid, int months)
{
_repository.put(uuid, "monthsLeft", getPlayerMonths(uuid) + months);
}
public void decreasePlayerMonths(UUID uuid, int months)
{
_repository.put(uuid, "monthsLeft", getPlayerMonths(uuid) - months);
}
}

View File

@ -16,7 +16,7 @@ public abstract class MorphGadget extends Gadget
super(manager, GadgetType.MORPH, name, desc, cost, mat, data);
}
public void ApplyArmor(Player player, boolean message)
public void applyArmor(Player player, boolean message)
{
Manager.removeGadgetType(player, GadgetType.MORPH, this);
@ -26,7 +26,7 @@ public abstract class MorphGadget extends Gadget
UtilPlayer.message(player, F.main("Gadget", "You morphed into " + F.elem(getName()) + "."));
}
public void RemoveArmor(Player player)
public void removeArmor(Player player)
{
if (_active.remove(player))
UtilPlayer.message(player, F.main("Gadget", "You unmorphed from " + F.elem(getName()) + "."));

View File

@ -53,6 +53,7 @@ public class RewardPool
VALENTINES_GIFT(false),
ILLUMINATED(false),
FREEDOM(false),
OMEGA(false),
CARL_SPINNER(true);
private boolean _useDuplicates;

View File

@ -18,7 +18,9 @@ public enum TreasureType
ILLUMINATED(C.cAqua + "Illuminated Treasure", "Illuminated Chest", "Illuminated", RewardType.IlluminatedChest, Material.CHEST, TreasureStyle.ILLUMINATED, RewardPool.Type.ILLUMINATED, true, 20000),
FREEDOM(C.cRed + "Freedom " + C.cBlue + "Treasure", "Freedom Treasure", "Freedom", RewardType.FreedomChest, Material.CHEST, TreasureStyle.FREEDOM, RewardPool.Type.FREEDOM, true, 35000);
FREEDOM(C.cRed + "Freedom " + C.cBlue + "Treasure", "Freedom Treasure", "Freedom", RewardType.FreedomChest, Material.CHEST, TreasureStyle.FREEDOM, RewardPool.Type.FREEDOM, true, 35000),
OMEGA(C.cBlue + "Omega Treasure", "Omega Treasure", "Omega", )
private final String _name;
private final RewardType _rewardType;

View File

@ -1,12 +1,10 @@
package mineplex.enjinTranslator;
import java.text.SimpleDateFormat;
import java.util.AbstractMap;
import java.util.Date;
import java.util.Iterator;
import java.util.*;
import java.util.Map.Entry;
import java.util.UUID;
import mineplex.core.gadget.powerplayclub.PowerPlayClubManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -35,6 +33,7 @@ public class Enjin extends MiniPlugin implements CommandExecutor
private DonationManager _donationManager;
private InventoryManager _inventoryManager;
private PurchaseManager _purchaseManager;
private PowerPlayClubManager _powerPlayClubManager;
private NautHashMap<String, Entry<UUID, Long>> _cachedUUIDs = new NautHashMap<String, Entry<UUID, Long>>();
private static Object _commandLock = new Object();
@ -43,13 +42,14 @@ public class Enjin extends MiniPlugin implements CommandExecutor
private SimpleDateFormat _dateFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
public Enjin(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager)
public Enjin(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, PowerPlayClubManager powerPlayClubManager)
{
super("Enjin", plugin);
_clientManager = clientManager;
_donationManager = donationManager;
_inventoryManager = inventoryManager;
_powerPlayClubManager = powerPlayClubManager;
_purchaseManager = new PurchaseManager(plugin);
@ -293,4 +293,22 @@ public class Enjin extends MiniPlugin implements CommandExecutor
return true;
}
protected boolean checkForPowerPlayClub(String[] args, final String name, final UUID playerUUID, final CoreClient client)
{
if (args.length != 3 || !args[0].equalsIgnoreCase("powerplayclub"))
return false;
if (args[1].equalsIgnoreCase("month"))
{
_powerPlayClubManager.addPlayerMonths(playerUUID, 1);
}
else
{
_powerPlayClubManager.addPlayerMonths(playerUUID, 12);
}
return true;
}
}

View File

@ -1,4 +1,13 @@
package mineplex.hub;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
@ -91,15 +100,6 @@ import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
public class HubManager extends MiniClientPlugin<HubClient>
{
// Snowman!
@ -191,7 +191,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
_mountManager = new MountManager(_plugin, clientManager, donationManager, blockRestore, _disguiseManager);
_inventoryManager = inventoryManager;
new BenefitManager(plugin, clientManager, _inventoryManager);
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager);
_gadgetManager = new GadgetManager(_plugin, clientManager, donationManager, _inventoryManager, _mountManager, petManager, preferences, disguiseManager, blockRestore, new ProjectileManager(plugin), achievementManager, packetHandler, hologramManager, incognito);
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
YoutubeManager youtubeManager = new YoutubeManager(plugin, clientManager, donationManager);

View File

@ -158,7 +158,7 @@ public class Arcade extends JavaPlugin
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
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, packetHandler, hologramManager);
GadgetManager gadgetManager = new GadgetManager(this, _clientManager, _donationManager, inventoryManager, mountManager, petManager, preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
BoosterManager boosterManager = new BoosterManager(this, _serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager);
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, null, boosterManager);
cosmeticManager.setInterfaceSlot(6);