Fixed lores
Fixed icons Removed sleigh, chicken mount and wind up suit from menus Added javadocs to sleigh
This commit is contained in:
parent
83ba1cb26e
commit
6de2df5cc4
@ -1,8 +1,12 @@
|
|||||||
package mineplex.core.cosmetic.ui.page;
|
package mineplex.core.cosmetic.ui.page;
|
||||||
|
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.time.format.TextStyle;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -15,8 +19,10 @@ import mineplex.core.account.CoreClientManager;
|
|||||||
import mineplex.core.common.currency.GlobalCurrency;
|
import mineplex.core.common.currency.GlobalCurrency;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
import mineplex.core.common.util.banner.CountryFlag;
|
import mineplex.core.common.util.banner.CountryFlag;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
@ -149,7 +155,18 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -14)
|
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -14)
|
||||||
{
|
{
|
||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
itemLore.add(C.cBlue + "Found in Power Play Club");
|
YearMonth yearMonth = gadget.getYearMonth();
|
||||||
|
if (yearMonth != null)
|
||||||
|
{
|
||||||
|
int year = yearMonth.getYear();
|
||||||
|
Month month = yearMonth.getMonth();
|
||||||
|
String monthName = month.getDisplayName(TextStyle.FULL, Locale.US);
|
||||||
|
itemLore.addAll(UtilText.splitLine(C.cBlue + "Monthly Power Play Club Reward for " + monthName + " " + year, LineFormat.LORE));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemLore.add(C.cBlue + "Found in Power Play Club");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rank Unlocks
|
//Rank Unlocks
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package mineplex.core.cosmetic.ui.page;
|
package mineplex.core.cosmetic.ui.page;
|
||||||
|
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.time.format.TextStyle;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -11,6 +15,8 @@ import org.bukkit.event.inventory.ClickType;
|
|||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.currency.GlobalCurrency;
|
import mineplex.core.common.currency.GlobalCurrency;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
import mineplex.core.cosmetic.ui.button.MountButton;
|
import mineplex.core.cosmetic.ui.button.MountButton;
|
||||||
@ -105,7 +111,18 @@ public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
else if (mount.getCost(GlobalCurrency.TREASURE_SHARD) == -14)
|
else if (mount.getCost(GlobalCurrency.TREASURE_SHARD) == -14)
|
||||||
{
|
{
|
||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
itemLore.add(C.cBlue + "Found in Power Play Club");
|
YearMonth yearMonth = mount.getYearMonth();
|
||||||
|
if (yearMonth != null)
|
||||||
|
{
|
||||||
|
int year = yearMonth.getYear();
|
||||||
|
Month month = yearMonth.getMonth();
|
||||||
|
String monthName = month.getDisplayName(TextStyle.FULL, Locale.US);
|
||||||
|
itemLore.addAll(UtilText.splitLine(C.cBlue + "Monthly Power Play Club Reward for " + monthName + " " + year, LineFormat.LORE));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemLore.add(C.cBlue + "Found in Power Play Club");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rank Unlocks
|
//Rank Unlocks
|
||||||
|
@ -37,7 +37,6 @@ import mineplex.core.disguise.DisguiseManager;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.gadget.commands.AmmoCommand;
|
import mineplex.core.gadget.commands.AmmoCommand;
|
||||||
import mineplex.core.gadget.commands.LockCosmeticsCommand;
|
import mineplex.core.gadget.commands.LockCosmeticsCommand;
|
||||||
import mineplex.core.gadget.commands.ReindeerTestCommand;
|
|
||||||
import mineplex.core.gadget.commands.UnlockCosmeticsCommand;
|
import mineplex.core.gadget.commands.UnlockCosmeticsCommand;
|
||||||
import mineplex.core.gadget.event.GadgetChangeEvent;
|
import mineplex.core.gadget.event.GadgetChangeEvent;
|
||||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||||
@ -117,7 +116,6 @@ import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
|||||||
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphPig;
|
import mineplex.core.gadget.gadgets.morph.MorphPig;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSleigh;
|
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSquid;
|
import mineplex.core.gadget.gadgets.morph.MorphSquid;
|
||||||
@ -139,10 +137,6 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
|
|||||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
|
||||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
|
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
|
||||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
|
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
|
||||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoots;
|
|
||||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitChestplate;
|
|
||||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitHelmet;
|
|
||||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitLeggings;
|
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||||
@ -188,7 +182,6 @@ import mineplex.core.gadget.set.SetVampire;
|
|||||||
import mineplex.core.gadget.set.SetWisdom;
|
import mineplex.core.gadget.set.SetWisdom;
|
||||||
import mineplex.core.gadget.set.suits.SetRaveSuit;
|
import mineplex.core.gadget.set.suits.SetRaveSuit;
|
||||||
import mineplex.core.gadget.set.suits.SetSpaceSuit;
|
import mineplex.core.gadget.set.suits.SetSpaceSuit;
|
||||||
import mineplex.core.gadget.set.suits.SetWindUpSuit;
|
|
||||||
import mineplex.core.gadget.types.ArrowEffectGadget;
|
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||||
import mineplex.core.gadget.types.DeathEffectGadget;
|
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||||
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||||
@ -283,7 +276,6 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addCommand(new UnlockCosmeticsCommand(this));
|
addCommand(new UnlockCosmeticsCommand(this));
|
||||||
addCommand(new LockCosmeticsCommand(this));
|
addCommand(new LockCosmeticsCommand(this));
|
||||||
addCommand(new AmmoCommand(this));
|
addCommand(new AmmoCommand(this));
|
||||||
addCommand(new ReindeerTestCommand(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSets()
|
private void createSets()
|
||||||
@ -296,7 +288,8 @@ public class GadgetManager extends MiniPlugin
|
|||||||
//Costumes
|
//Costumes
|
||||||
addSet(new SetRaveSuit(this));
|
addSet(new SetRaveSuit(this));
|
||||||
addSet(new SetSpaceSuit(this));
|
addSet(new SetSpaceSuit(this));
|
||||||
addSet(new SetWindUpSuit(this));
|
// Hidden in this update
|
||||||
|
//addSet(new SetWindUpSuit(this));
|
||||||
addSet(new SetParty(this));
|
addSet(new SetParty(this));
|
||||||
addSet(new SetCupidsLove(this));
|
addSet(new SetCupidsLove(this));
|
||||||
addSet(new SetEmerald(this));
|
addSet(new SetEmerald(this));
|
||||||
@ -342,10 +335,11 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new OutfitSpaceSuitLeggings(this));
|
addGadget(new OutfitSpaceSuitLeggings(this));
|
||||||
addGadget(new OutfitSpaceSuitBoots(this));
|
addGadget(new OutfitSpaceSuitBoots(this));
|
||||||
|
|
||||||
addGadget(new OutfitWindUpSuitHelmet(this));
|
// Hidden in this update
|
||||||
|
/*addGadget(new OutfitWindUpSuitHelmet(this));
|
||||||
addGadget(new OutfitWindUpSuitChestplate(this));
|
addGadget(new OutfitWindUpSuitChestplate(this));
|
||||||
addGadget(new OutfitWindUpSuitLeggings(this));
|
addGadget(new OutfitWindUpSuitLeggings(this));
|
||||||
addGadget(new OutfitWindUpSuitBoots(this));
|
addGadget(new OutfitWindUpSuitBoots(this));*/
|
||||||
|
|
||||||
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
|
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
|
||||||
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
|
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
|
||||||
@ -372,11 +366,11 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new MorphSquid(this));
|
addGadget(new MorphSquid(this));
|
||||||
addGadget(new MorphWitch(this));
|
addGadget(new MorphWitch(this));
|
||||||
addGadget(new MorphGrimReaper(this));
|
addGadget(new MorphGrimReaper(this));
|
||||||
// Not being added in this update!
|
|
||||||
//addGadget(new MorphMetalMan(this));
|
|
||||||
addGadget(new MorphTurkey(this));
|
addGadget(new MorphTurkey(this));
|
||||||
addGadget(new MorphSleigh(this));
|
// Hidden in this update
|
||||||
|
//addGadget(new MorphSleigh(this));
|
||||||
|
//addGadget(new MorphMetalMan(this));
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
addGadget(new ParticleFoot(this));
|
addGadget(new ParticleFoot(this));
|
||||||
addGadget(new ParticleFireRings(this));
|
addGadget(new ParticleFireRings(this));
|
||||||
|
@ -2,6 +2,8 @@ package mineplex.core.gadget.gadgets.morph;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -34,8 +36,9 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
public class MorphSleigh extends MorphGadget
|
public class MorphSleigh extends MorphGadget
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO JAVADOCS + LIMIT AMOUNT OF SLEIGHS
|
/**
|
||||||
|
* Directions of the Sleigh, with the correct coord for the player to be teleported and the schematic name
|
||||||
|
*/
|
||||||
public enum SleighDirection
|
public enum SleighDirection
|
||||||
{
|
{
|
||||||
NORTH("SleighMorphNorth.schematic", 0.5, 4.5),
|
NORTH("SleighMorphNorth.schematic", 0.5, 4.5),
|
||||||
@ -80,7 +83,7 @@ public class MorphSleigh extends MorphGadget
|
|||||||
|
|
||||||
public MorphSleigh(GadgetManager manager)
|
public MorphSleigh(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Sleigh Morph", UtilText.splitLinesToArray(new String[]{"Placeholder"}, LineFormat.LORE), -14, Material.STAINED_CLAY, (byte) 14);
|
super(manager, "Sleigh Morph", UtilText.splitLinesToArray(new String[]{"Placeholder"}, LineFormat.LORE), -14, Material.STAINED_CLAY, (byte) 14, YearMonth.of(2016, Month.DECEMBER));
|
||||||
// Loads sleigh schematics
|
// Loads sleigh schematics
|
||||||
for (SleighDirection sleighDirection : SleighDirection.values())
|
for (SleighDirection sleighDirection : SleighDirection.values())
|
||||||
{
|
{
|
||||||
@ -117,6 +120,11 @@ public class MorphSleigh extends MorphGadget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activates the sleigh effect when left-clicking
|
||||||
|
* This will be changed in the next releases
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void activateSleigh(PlayerInteractEvent event)
|
public void activateSleigh(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
@ -166,6 +174,10 @@ public class MorphSleigh extends MorphGadget
|
|||||||
_sleighs.put(player, sleigh);
|
_sleighs.put(player, sleigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops player from leaving the sleigh if it's activte
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLeaveVehicle(VehicleExitEvent event)
|
public void onLeaveVehicle(VehicleExitEvent event)
|
||||||
{
|
{
|
||||||
@ -179,6 +191,10 @@ public class MorphSleigh extends MorphGadget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates positions in the hub map
|
||||||
|
* TODO add arcade positions
|
||||||
|
*/
|
||||||
private void buildPositions()
|
private void buildPositions()
|
||||||
{
|
{
|
||||||
_positions.add(new SleighPosition(-11, 143, -30, SleighDirection.SOUTH, -9.5, 145.5, -28.5));
|
_positions.add(new SleighPosition(-11, 143, -30, SleighDirection.SOUTH, -9.5, 145.5, -28.5));
|
||||||
@ -192,6 +208,10 @@ public class MorphSleigh extends MorphGadget
|
|||||||
_positions.add(new SleighPosition(136, 116, 85, SleighDirection.WEST, 140.5, 118.5, 86.5));
|
_positions.add(new SleighPosition(136, 116, 85, SleighDirection.WEST, 140.5, 118.5, 86.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes sleighs if they run out of time, or moves them if they still have time
|
||||||
|
* @param event
|
||||||
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdate(UpdateEvent event)
|
public void onUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package mineplex.core.gadget.gadgets.morph;
|
package mineplex.core.gadget.gadgets.morph;
|
||||||
|
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
@ -43,7 +46,7 @@ public class MorphSquid extends MorphGadget implements IThrown
|
|||||||
C.cWhite + "Swim to enable Fast Swimming",
|
C.cWhite + "Swim to enable Fast Swimming",
|
||||||
C.cWhite + "Sneak to shoot a fish above you"
|
C.cWhite + "Sneak to shoot a fish above you"
|
||||||
}, LineFormat.LORE),
|
}, LineFormat.LORE),
|
||||||
-14, Material.INK_SACK, (byte) 0);
|
-14, Material.INK_SACK, (byte) 0, YearMonth.of(2016, Month.SEPTEMBER));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package mineplex.core.gadget.gadgets.morph;
|
package mineplex.core.gadget.gadgets.morph;
|
||||||
|
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -9,6 +12,7 @@ import org.bukkit.event.player.PlayerToggleSneakEvent;
|
|||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import mineplex.core.common.skin.SkinData;
|
import mineplex.core.common.skin.SkinData;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.LineFormat;
|
import mineplex.core.common.util.LineFormat;
|
||||||
import mineplex.core.common.util.UtilText;
|
import mineplex.core.common.util.UtilText;
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
@ -22,8 +26,13 @@ public class MorphTurkey extends MorphGadget
|
|||||||
|
|
||||||
public MorphTurkey(GadgetManager manager)
|
public MorphTurkey(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Turkey Morph", UtilText.splitLinesToArray(new String[]{"Placeholder"},
|
super(manager, "Turkey Morph", UtilText.splitLinesToArray(new String[]
|
||||||
LineFormat.LORE), 0, Material.GLASS, (byte) 0);
|
{
|
||||||
|
C.cGray + "Gobble, Gobble, please don't stuff me!",
|
||||||
|
C.blankLine,
|
||||||
|
C.cWhite + "Sneak to gobble."
|
||||||
|
},
|
||||||
|
LineFormat.LORE), -14, Material.COOKED_CHICKEN, (byte) 0, YearMonth.of(2016, Month.NOVEMBER));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package mineplex.core.gadget.gadgets.morph;
|
package mineplex.core.gadget.gadgets.morph;
|
||||||
|
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -31,7 +34,7 @@ public class MorphWitch extends MorphGadget
|
|||||||
super(manager, "Witch Morph", UtilText.splitLinesToArray(new String[]{
|
super(manager, "Witch Morph", UtilText.splitLinesToArray(new String[]{
|
||||||
C.cWhite + "Press sneak to summon your trusty bat and start brewing"
|
C.cWhite + "Press sneak to summon your trusty bat and start brewing"
|
||||||
}, LineFormat.LORE),
|
}, LineFormat.LORE),
|
||||||
-14, Material.SKULL_ITEM, (byte) 3);
|
-14, Material.SKULL_ITEM, (byte) 3, YearMonth.of(2016, Month.OCTOBER));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -16,6 +16,9 @@ import mineplex.core.common.util.UtilParticle;
|
|||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSleigh;
|
import mineplex.core.gadget.gadgets.morph.MorphSleigh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the sleigh effect for the Sleigh Morph
|
||||||
|
*/
|
||||||
public class Sleigh
|
public class Sleigh
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -41,6 +44,9 @@ public class Sleigh
|
|||||||
(sleighPosition.getDirection() == MorphSleigh.SleighDirection.WEST) ? 90f : -90f;
|
(sleighPosition.getDirection() == MorphSleigh.SleighDirection.WEST) ? 90f : -90f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the sleigh effect
|
||||||
|
*/
|
||||||
public void startEffect()
|
public void startEffect()
|
||||||
{
|
{
|
||||||
_originalLocation = _player.getLocation().clone();
|
_originalLocation = _player.getLocation().clone();
|
||||||
@ -55,6 +61,9 @@ public class Sleigh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops the sleigh effect
|
||||||
|
*/
|
||||||
public void stopEffect()
|
public void stopEffect()
|
||||||
{
|
{
|
||||||
restoreBlocks();
|
restoreBlocks();
|
||||||
@ -63,6 +72,13 @@ public class Sleigh
|
|||||||
_sleighPosition.setUsed(false);
|
_sleighPosition.setUsed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pastes the schematic for the sleigh
|
||||||
|
* @param origin The location where the sleigh schematic will be placed
|
||||||
|
* @param playerX The X coord where player will be teleported
|
||||||
|
* @param playerZ The Z coord where player will be teleported
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
private void pasteSchematic(Location origin, int playerX, int playerZ) throws IOException
|
private void pasteSchematic(Location origin, int playerX, int playerZ) throws IOException
|
||||||
{
|
{
|
||||||
restoreBlocks();
|
restoreBlocks();
|
||||||
@ -97,6 +113,10 @@ public class Sleigh
|
|||||||
_arrow.setPassenger(_player);
|
_arrow.setPassenger(_player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates sleigh to look like its moving
|
||||||
|
* @return true if the sleigh was moved, false if the time is over (3 seconds)
|
||||||
|
*/
|
||||||
public boolean update()
|
public boolean update()
|
||||||
{
|
{
|
||||||
_moves++;
|
_moves++;
|
||||||
@ -135,11 +155,17 @@ public class Sleigh
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plays sleigh sound to the player
|
||||||
|
*/
|
||||||
public void playSound()
|
public void playSound()
|
||||||
{
|
{
|
||||||
_player.playSound(_player.getLocation(), Sound.ORB_PICKUP, 1f, 1f);
|
_player.playSound(_player.getLocation(), Sound.ORB_PICKUP, 1f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restores the blocks that were changed from pasting the schematic
|
||||||
|
*/
|
||||||
private void restoreBlocks()
|
private void restoreBlocks()
|
||||||
{
|
{
|
||||||
for (Map.Entry<Location, Material> entry : _oldBlockMaterials.entrySet())
|
for (Map.Entry<Location, Material> entry : _oldBlockMaterials.entrySet())
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
package mineplex.core.gadget.gadgets.morph.managers.sleigh;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
|
|
||||||
public class SleighBlock
|
|
||||||
{
|
|
||||||
|
|
||||||
private int _x, _y, _z;
|
|
||||||
private Material _material;
|
|
||||||
private byte _data;
|
|
||||||
private boolean _middle;
|
|
||||||
|
|
||||||
public SleighBlock(int x, int y, int z, Material material, int data, boolean middle)
|
|
||||||
{
|
|
||||||
_x = x;
|
|
||||||
_y = y;
|
|
||||||
_z = z;
|
|
||||||
_material = material;
|
|
||||||
_data = (byte) data;
|
|
||||||
_middle = middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX()
|
|
||||||
{
|
|
||||||
return _x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY()
|
|
||||||
{
|
|
||||||
return _y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getZ()
|
|
||||||
{
|
|
||||||
return _z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Material getMaterial()
|
|
||||||
{
|
|
||||||
return _material;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte getData()
|
|
||||||
{
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMiddle()
|
|
||||||
{
|
|
||||||
return _middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -2,6 +2,9 @@ package mineplex.core.gadget.gadgets.morph.managers.sleigh;
|
|||||||
|
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSleigh;
|
import mineplex.core.gadget.gadgets.morph.MorphSleigh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles positions from Sleigh and player, and the direction of the sleigh and player
|
||||||
|
*/
|
||||||
public class SleighPosition
|
public class SleighPosition
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,170 +0,0 @@
|
|||||||
package mineplex.core.gadget.gadgets.morph.managers.sleigh;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
|
||||||
import org.bukkit.entity.Arrow;
|
|
||||||
import org.bukkit.entity.Horse;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.util.EulerAngle;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
|
|
||||||
public class SleighReindeer
|
|
||||||
{
|
|
||||||
|
|
||||||
private enum AntlerPosition
|
|
||||||
{
|
|
||||||
SOUTH(0.4, 0.2, 0.6, 0.7, 4.0, 2.0),
|
|
||||||
NORTH(-0.3, -0.25, -0.5, -0.6, 4.0, 2.0);
|
|
||||||
|
|
||||||
private double _xA, _xB, _zA, _zB, _angleA, _angleB;
|
|
||||||
|
|
||||||
AntlerPosition(double xA, double xB, double zA, double zB, double angleA, double angleB)
|
|
||||||
{
|
|
||||||
_xA = xA;
|
|
||||||
_xB = xB;
|
|
||||||
_zA = zA;
|
|
||||||
_zB = zB;
|
|
||||||
_angleA = angleA;
|
|
||||||
_angleB = angleB;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getxA()
|
|
||||||
{
|
|
||||||
return _xA;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getxB()
|
|
||||||
{
|
|
||||||
return _xB;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getzA()
|
|
||||||
{
|
|
||||||
return _zA;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getzB()
|
|
||||||
{
|
|
||||||
return _zB;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getAngleA()
|
|
||||||
{
|
|
||||||
return _angleA;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getAngleB()
|
|
||||||
{
|
|
||||||
return _angleB;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Location _location;
|
|
||||||
private int _yaw;
|
|
||||||
private Horse _horse;
|
|
||||||
private Arrow _base;
|
|
||||||
private ArmorStand _hornA;
|
|
||||||
private ArmorStand _hornB;
|
|
||||||
|
|
||||||
public SleighReindeer(Location location, int yaw)
|
|
||||||
{
|
|
||||||
_location = location;
|
|
||||||
_yaw = yaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void spawn()
|
|
||||||
{
|
|
||||||
_location.setYaw(_yaw);
|
|
||||||
_base = _location.getWorld().spawn(_location.clone().subtract(0, 1.5, 0), Arrow.class);
|
|
||||||
UtilEnt.Vegetate(_base, true);
|
|
||||||
UtilEnt.ghost(_base, true, true);
|
|
||||||
|
|
||||||
_horse = _location.getWorld().spawn(_location, Horse.class);
|
|
||||||
_horse.setStyle(Horse.Style.NONE);
|
|
||||||
_horse.setColor(Horse.Color.CREAMY);
|
|
||||||
_horse.setVariant(Horse.Variant.HORSE);
|
|
||||||
_horse.setCustomName("Rudolph");
|
|
||||||
_horse.setCustomNameVisible(true);
|
|
||||||
|
|
||||||
//_base.setPassenger(_horse);
|
|
||||||
|
|
||||||
createAntlers();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void remove()
|
|
||||||
{
|
|
||||||
_horse.remove();
|
|
||||||
_base.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void move(int x, int z)
|
|
||||||
{
|
|
||||||
_horse.eject();
|
|
||||||
_base.remove();
|
|
||||||
_base = _location.getWorld().spawn(_location.clone().subtract(0, 1.5, 0).add(x, 0, z), Arrow.class);
|
|
||||||
UtilEnt.Vegetate(_base, true);
|
|
||||||
UtilEnt.ghost(_base, true, true);
|
|
||||||
Location horseLocation = _location.clone().subtract(0, 0.5, 0).add(x, 0, z);
|
|
||||||
horseLocation.setYaw(_yaw);
|
|
||||||
_horse.teleport(horseLocation);
|
|
||||||
//_base.setPassenger(_horse);
|
|
||||||
UtilEnt.Vegetate(_horse, true);
|
|
||||||
UtilEnt.ghost(_horse, true, false);
|
|
||||||
_hornA.remove();
|
|
||||||
_hornB.remove();
|
|
||||||
createAntlers();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createAntlers()
|
|
||||||
{
|
|
||||||
AntlerPosition antlerPosition = AntlerPosition.SOUTH;
|
|
||||||
|
|
||||||
switch (_yaw)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
antlerPosition = AntlerPosition.SOUTH;
|
|
||||||
break;
|
|
||||||
case 180:
|
|
||||||
antlerPosition = AntlerPosition.NORTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Location hornALoc = _horse.getLocation().clone().add(.4, 1, .6);
|
|
||||||
Location hornBLoc = _horse.getLocation().clone().add(.2, 1, .7);
|
|
||||||
|
|
||||||
ArmorStand hornA = hornALoc.getWorld().spawn(hornALoc, ArmorStand.class);
|
|
||||||
hornA.setVisible(false);
|
|
||||||
hornA.setGravity(false);
|
|
||||||
hornA.getEquipment().setItemInHand(new ItemStack(Material.DEAD_BUSH));
|
|
||||||
hornA.setRightArmPose(new EulerAngle(0, 4, 0));
|
|
||||||
|
|
||||||
ArmorStand hornB = hornBLoc.getWorld().spawn(hornBLoc, ArmorStand.class);
|
|
||||||
hornB.setVisible(false);
|
|
||||||
hornB.setGravity(false);
|
|
||||||
hornB.getEquipment().setItemInHand(new ItemStack(Material.DEAD_BUSH));
|
|
||||||
hornB.setRightArmPose(new EulerAngle(0, 2, 0));
|
|
||||||
|
|
||||||
_hornA = hornA;
|
|
||||||
_hornB = hornB;*/
|
|
||||||
|
|
||||||
Location hornALoc = _horse.getLocation().clone().add(antlerPosition.getxA(), 1, antlerPosition.getzA());
|
|
||||||
Location hornBLoc = _horse.getLocation().clone().add(antlerPosition.getxB(), 1, antlerPosition.getzB());
|
|
||||||
|
|
||||||
ArmorStand hornA = hornALoc.getWorld().spawn(hornALoc, ArmorStand.class);
|
|
||||||
hornA.setVisible(false);
|
|
||||||
hornA.setGravity(false);
|
|
||||||
hornA.getEquipment().setItemInHand(new ItemStack(Material.DEAD_BUSH));
|
|
||||||
hornA.setRightArmPose(new EulerAngle(0, antlerPosition.getAngleA(), 0));
|
|
||||||
|
|
||||||
ArmorStand hornB = hornBLoc.getWorld().spawn(hornBLoc, ArmorStand.class);
|
|
||||||
hornB.setVisible(false);
|
|
||||||
hornB.setGravity(false);
|
|
||||||
hornB.getEquipment().setItemInHand(new ItemStack(Material.DEAD_BUSH));
|
|
||||||
hornB.setRightArmPose(new EulerAngle(0, antlerPosition.getAngleB(), 0));
|
|
||||||
|
|
||||||
_hornA = hornA;
|
|
||||||
_hornB = hornB;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.gadget.types;
|
package mineplex.core.gadget.types;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -31,19 +32,43 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
private String[] _alternativePackageNames;
|
private String[] _alternativePackageNames;
|
||||||
|
|
||||||
private boolean _free;
|
private boolean _free;
|
||||||
|
|
||||||
|
private YearMonth _yearMonth = null;
|
||||||
|
|
||||||
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data)
|
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data)
|
||||||
{
|
{
|
||||||
this(manager, gadgetType, name, desc, cost, mat, data, 1);
|
this(manager, gadgetType, name, desc, cost, mat, data, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, YearMonth yearMonth)
|
||||||
|
{
|
||||||
|
this(manager, gadgetType, name, desc, cost, mat, data, yearMonth, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity, String... alternativesalepackageNames)
|
||||||
|
{
|
||||||
|
super(name, mat, data, desc, cost, quantity);
|
||||||
|
|
||||||
|
_gadgetType = gadgetType;
|
||||||
|
KnownPackage = false;
|
||||||
|
_free = false;
|
||||||
|
|
||||||
|
_alternativePackageNames = alternativesalepackageNames;
|
||||||
|
if(_alternativePackageNames == null) { _alternativePackageNames = new String[0]; }
|
||||||
|
|
||||||
|
Manager = manager;
|
||||||
|
|
||||||
|
Manager.getPlugin().getServer().getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity, String... alternativesalepackageNames)
|
public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, YearMonth yearMonth, int quantity, String... alternativesalepackageNames)
|
||||||
{
|
{
|
||||||
super(name, mat, data, desc, cost, quantity);
|
super(name, mat, data, desc, cost, quantity);
|
||||||
|
|
||||||
_gadgetType = gadgetType;
|
_gadgetType = gadgetType;
|
||||||
KnownPackage = false;
|
KnownPackage = false;
|
||||||
_free = false;
|
_free = false;
|
||||||
|
_yearMonth = yearMonth;
|
||||||
|
|
||||||
_alternativePackageNames = alternativesalepackageNames;
|
_alternativePackageNames = alternativesalepackageNames;
|
||||||
if(_alternativePackageNames == null) { _alternativePackageNames = new String[0]; }
|
if(_alternativePackageNames == null) { _alternativePackageNames = new String[0]; }
|
||||||
@ -83,6 +108,11 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
{
|
{
|
||||||
return _active.contains(player);
|
return _active.contains(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public YearMonth getYearMonth()
|
||||||
|
{
|
||||||
|
return _yearMonth;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event)
|
public void onPlayerQuit(PlayerQuitEvent event)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package mineplex.core.gadget.types;
|
package mineplex.core.gadget.types;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -15,6 +17,11 @@ public abstract class MorphGadget extends Gadget
|
|||||||
{
|
{
|
||||||
super(manager, GadgetType.MORPH, name, desc, cost, mat, data);
|
super(manager, GadgetType.MORPH, name, desc, cost, mat, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MorphGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, YearMonth yearMonth)
|
||||||
|
{
|
||||||
|
super(manager, GadgetType.MORPH, name, desc, cost, mat, data, yearMonth);
|
||||||
|
}
|
||||||
|
|
||||||
public void applyArmor(Player player, boolean message)
|
public void applyArmor(Player player, boolean message)
|
||||||
{
|
{
|
||||||
|
@ -1,26 +1,28 @@
|
|||||||
package mineplex.core.mount;
|
package mineplex.core.mount;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityCreature;
|
||||||
|
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
||||||
|
import org.bukkit.entity.Horse;
|
||||||
|
import org.bukkit.entity.Horse.Color;
|
||||||
|
import org.bukkit.entity.Horse.Style;
|
||||||
|
import org.bukkit.entity.Horse.Variant;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
|
||||||
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
|
||||||
import org.bukkit.entity.Horse.Variant;
|
|
||||||
import org.bukkit.entity.Horse;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.Horse.Color;
|
|
||||||
import org.bukkit.entity.Horse.Style;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
public class HorseMount extends Mount<SingleEntityMountData<Horse>>
|
public class HorseMount extends Mount<SingleEntityMountData<Horse>>
|
||||||
{
|
{
|
||||||
@ -29,7 +31,7 @@ public class HorseMount extends Mount<SingleEntityMountData<Horse>>
|
|||||||
protected Variant _variant;
|
protected Variant _variant;
|
||||||
protected double _jump;
|
protected double _jump;
|
||||||
protected Material _armor;
|
protected Material _armor;
|
||||||
|
|
||||||
public HorseMount(MountManager manager, String name, String[] desc, Material displayMaterial, byte displayData, int cost, Color color, Style style, Variant variant, double jump, Material armor)
|
public HorseMount(MountManager manager, String name, String[] desc, Material displayMaterial, byte displayData, int cost, Color color, Style style, Variant variant, double jump, Material armor)
|
||||||
{
|
{
|
||||||
super (manager, name, displayMaterial, displayData, desc, cost);
|
super (manager, name, displayMaterial, displayData, desc, cost);
|
||||||
@ -41,6 +43,18 @@ public class HorseMount extends Mount<SingleEntityMountData<Horse>>
|
|||||||
_jump = jump;
|
_jump = jump;
|
||||||
_armor = armor;
|
_armor = armor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HorseMount(MountManager manager, String name, String[] desc, Material displayMaterial, byte displayData, int cost, Color color, Style style, Variant variant, double jump, Material armor, YearMonth yearMonth)
|
||||||
|
{
|
||||||
|
super (manager, name, displayMaterial, displayData, desc, cost, yearMonth);
|
||||||
|
KnownPackage = false;
|
||||||
|
|
||||||
|
_color = color;
|
||||||
|
_style = style;
|
||||||
|
_variant = variant;
|
||||||
|
_jump = jump;
|
||||||
|
_armor = armor;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void UpdateHorse(UpdateEvent event)
|
public void UpdateHorse(UpdateEvent event)
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
package mineplex.core.mount;
|
package mineplex.core.mount;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import java.time.YearMonth;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import java.util.HashMap;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import java.util.HashSet;
|
||||||
import mineplex.core.mount.event.MountActivateEvent;
|
|
||||||
import mineplex.core.shop.item.SalesPackageBase;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -14,8 +13,11 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import mineplex.core.common.util.F;
|
||||||
import java.util.HashSet;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.mount.event.MountActivateEvent;
|
||||||
|
import mineplex.core.shop.item.SalesPackageBase;
|
||||||
|
|
||||||
public abstract class Mount<T extends MountData> extends SalesPackageBase implements Listener
|
public abstract class Mount<T extends MountData> extends SalesPackageBase implements Listener
|
||||||
{
|
{
|
||||||
@ -23,6 +25,8 @@ public abstract class Mount<T extends MountData> extends SalesPackageBase implem
|
|||||||
protected HashMap<Player, T> _active = new HashMap<Player, T>();
|
protected HashMap<Player, T> _active = new HashMap<Player, T>();
|
||||||
|
|
||||||
public MountManager Manager;
|
public MountManager Manager;
|
||||||
|
|
||||||
|
private YearMonth _yearMonth = null;
|
||||||
|
|
||||||
public Mount(MountManager manager, String name, Material material, byte displayData, String[] description, int coins)
|
public Mount(MountManager manager, String name, Material material, byte displayData, String[] description, int coins)
|
||||||
{
|
{
|
||||||
@ -33,6 +37,17 @@ public abstract class Mount<T extends MountData> extends SalesPackageBase implem
|
|||||||
Manager.getPlugin().getServer().getPluginManager().registerEvents(this, Manager.getPlugin());
|
Manager.getPlugin().getServer().getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mount(MountManager manager, String name, Material material, byte displayData, String[] description, int coins, YearMonth yearMonth)
|
||||||
|
{
|
||||||
|
super(name, material, displayData, description, coins);
|
||||||
|
|
||||||
|
Manager = manager;
|
||||||
|
|
||||||
|
_yearMonth = yearMonth;
|
||||||
|
|
||||||
|
Manager.getPlugin().getServer().getPluginManager().registerEvents(this, Manager.getPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
public final void enable(Player player)
|
public final void enable(Player player)
|
||||||
{
|
{
|
||||||
MountActivateEvent gadgetEvent = new MountActivateEvent(player, this);
|
MountActivateEvent gadgetEvent = new MountActivateEvent(player, this);
|
||||||
@ -99,4 +114,9 @@ public abstract class Mount<T extends MountData> extends SalesPackageBase implem
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public YearMonth getYearMonth()
|
||||||
|
{
|
||||||
|
return _yearMonth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import mineplex.core.disguise.DisguiseManager;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.mount.types.MountBabyReindeer;
|
import mineplex.core.mount.types.MountBabyReindeer;
|
||||||
import mineplex.core.mount.types.MountCart;
|
import mineplex.core.mount.types.MountCart;
|
||||||
import mineplex.core.mount.types.MountChicken;
|
|
||||||
import mineplex.core.mount.types.MountDragon;
|
import mineplex.core.mount.types.MountDragon;
|
||||||
import mineplex.core.mount.types.MountFreedomHorse;
|
import mineplex.core.mount.types.MountFreedomHorse;
|
||||||
import mineplex.core.mount.types.MountFrost;
|
import mineplex.core.mount.types.MountFrost;
|
||||||
@ -77,7 +76,8 @@ public class MountManager extends MiniPlugin
|
|||||||
_types.add(new MountValentinesSheep(this));
|
_types.add(new MountValentinesSheep(this));
|
||||||
_types.add(new MountFreedomHorse(this));
|
_types.add(new MountFreedomHorse(this));
|
||||||
_types.add(new MountNightmareSteed(this));
|
_types.add(new MountNightmareSteed(this));
|
||||||
_types.add(new MountChicken(this));
|
// Hidden in this update
|
||||||
|
//_types.add(new MountChicken(this));
|
||||||
//_types.add(new MountSheep(this));
|
//_types.add(new MountSheep(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mineplex.core.mount.types;
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
import java.time.Month;
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||||
@ -36,9 +38,9 @@ public class MountChicken extends HorseMount
|
|||||||
super(manager, "Chicken Mount",
|
super(manager, "Chicken Mount",
|
||||||
UtilText.splitLinesToArray(new String[]
|
UtilText.splitLinesToArray(new String[]
|
||||||
{
|
{
|
||||||
"Placeholder"
|
"This isn't flying! It is falling with style."
|
||||||
}, LineFormat.LORE),
|
}, LineFormat.LORE),
|
||||||
Material.GLASS, (byte) 0, -1, Horse.Color.BLACK, Horse.Style.NONE, Horse.Variant.HORSE, 2.0, Material.AIR);
|
Material.FEATHER, (byte) 0, -1, Horse.Color.BLACK, Horse.Style.NONE, Horse.Variant.HORSE, 2.0, Material.AIR, YearMonth.of(2017, Month.JANUARY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -348,7 +348,6 @@ public class TreasureLocation implements Listener
|
|||||||
{
|
{
|
||||||
if (_currentTreasure.getPlayer().equals(player))
|
if (_currentTreasure.getPlayer().equals(player))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double toDistanceFromCenter = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5).distanceSquared(event.getTo());
|
double toDistanceFromCenter = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5).distanceSquared(event.getTo());
|
||||||
|
Loading…
Reference in New Issue
Block a user