Fix disabling not removing chicken and add description

This commit is contained in:
Sam 2018-03-29 00:45:12 +01:00 committed by Alexander Meech
parent 49d738dd98
commit e9c2346814
2 changed files with 21 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
@ -32,10 +33,15 @@ public class ItemMaryPoppins extends ItemGadget
public ItemMaryPoppins(GadgetManager manager) public ItemMaryPoppins(GadgetManager manager)
{ {
super(manager, "Umbrella", new String[] super(manager, "Nanny's Umbrella", new String[]
{ {
C.cGray + "It's Supercarlshardilicouscakewarsaloucous",
C.cGray + "even though the sound",
C.cGray + "of it is something quite",
C.cGray + "atrocious."
}, CostConstants.POWERPLAY_BONUS, Material.STICK, (byte) 0, TimeUnit.SECONDS.toMillis(20), null); }, CostConstants.POWERPLAY_BONUS, Material.STICK, (byte) 0, TimeUnit.SECONDS.toMillis(20), null);
Free = false;
} }
@Override @Override
@ -85,7 +91,7 @@ public class ItemMaryPoppins extends ItemGadget
displayUmbrella(location.add(UtilAlg.getRight(location.getDirection()).multiply(0.5))); displayUmbrella(location.add(UtilAlg.getRight(location.getDirection()).multiply(0.5)));
} }
if (chicken.getPassenger() == null || UtilEnt.isGrounded(chicken)) if (!chicken.isValid() || chicken.getPassenger() == null || UtilEnt.isGrounded(chicken))
{ {
chicken.eject(); chicken.eject();
chicken.remove(); chicken.remove();
@ -97,6 +103,17 @@ public class ItemMaryPoppins extends ItemGadget
}, 20, 1); }, 20, 1);
} }
@Override
public void disableCustom(Player player, boolean message)
{
super.disableCustom(player, message);
if (player.getVehicle() != null)
{
player.getVehicle().remove();
}
}
private void displayUmbrella(Location location) private void displayUmbrella(Location location)
{ {
for (double y = 0; y < 1.5; y += 0.1) for (double y = 0; y < 1.5; y += 0.1)

View File

@ -48,7 +48,7 @@ public class PowerPlayClubRewards
.put(YearMonth.of(2018, Month.JANUARY), new UnknownSalesPackageItem("Mob Bomb")) .put(YearMonth.of(2018, Month.JANUARY), new UnknownSalesPackageItem("Mob Bomb"))
.put(YearMonth.of(2018, Month.FEBRUARY), new UnknownSalesPackageItem("Play Catch")) .put(YearMonth.of(2018, Month.FEBRUARY), new UnknownSalesPackageItem("Play Catch"))
.put(YearMonth.of(2018, Month.MARCH), new UnknownSalesPackageItem("Connect 4")) .put(YearMonth.of(2018, Month.MARCH), new UnknownSalesPackageItem("Connect 4"))
.put(YearMonth.of(2018, Month.APRIL), new UnknownSalesPackageItem("Umbrella")) .put(YearMonth.of(2018, Month.APRIL), new UnknownSalesPackageItem("Nanny's Umbrella"))
.build(); .build();
public interface PowerPlayClubItem public interface PowerPlayClubItem