Fix gadget pages

This commit is contained in:
Graphica 2017-06-28 01:33:03 -04:00 committed by cnr
parent 53d29fc9c9
commit 4ef477159c
14 changed files with 95 additions and 36 deletions

View File

@ -33,12 +33,16 @@ public class ArrowTrailPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.ARROW_TRAIL) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -32,12 +32,16 @@ public class BalloonsPage extends GadgetPage
addGadget(gadget, slot);
if (gadget.isActive(getPlayer()))
{
addGlow(slot);
}
slot++;
if (slot == 17 || slot == 26)
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -33,12 +33,16 @@ public class DeathEffectPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.DEATH) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -33,12 +33,16 @@ public class DoubleJumpPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.DOUBLE_JUMP) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -38,12 +38,16 @@ public class HatPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.HAT) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -31,12 +31,16 @@ public class KitSelectorPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.KIT_SELECTOR) == gadget)
{
addGlow(slot);
}
slot++;
if (slot == 17 || slot == 26 || slot == 35)
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -32,13 +32,19 @@ public class MorphPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.MORPH) == gadget)
if (!(gadget instanceof MorphBlock))
addGlow(slot);
{
if (!(gadget instanceof MorphBlock))
{
addGlow(slot);
}
}
slot++;
if (slot == 17 || slot == 26 || slot == 35)
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -46,8 +46,10 @@ public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
addMount(mount, slot);
slot++;
if (slot == 17 || slot == 26)
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -34,8 +34,10 @@ public class MusicPage extends GadgetPage
slot++;
if (slot == 17)
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -31,12 +31,16 @@ public class ParticlePage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.PARTICLE) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17 || slot == 26 || slot == 35)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -231,16 +231,23 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
slot++;
if (slot == 17 || slot == 26)
if (slot % 9 == 8)
{
slot += 2;
}
}
slot = 49;
for (PetExtra petExtra : PetExtra.values())
{
List<String> itemLore = new ArrayList<String>();
if (!getPlugin().getPetManager().hasActivePet(getPlayer().getName()))
if (getPlugin().getPunishManager().GetClient(_player.getName()).IsMuted())
{
itemLore.add(C.cRed + "You may not rename pets while muted!");
getInventory().setItem(slot, new ShopItem(petExtra.getMaterial(), (byte)0, C.cRed + petExtra.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle());
}
else if (!getPlugin().getPetManager().hasActivePet(getPlayer().getName()))
{
itemLore.add(C.cWhite + "You must have an active pet to use this!");
getInventory().setItem(slot, new ShopItem(petExtra.getMaterial(), (byte)0, C.cRed + petExtra.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle());

View File

@ -38,12 +38,16 @@ public class TauntPage extends GadgetPage
addGadget(gadget, slot);
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.TAUNT) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 26)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -49,12 +49,16 @@ public class WinEffectPage extends GadgetPage
}
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.WIN_EFFECT) == gadget)
addGlow(slot);
{
addGlow(slot);
}
slot++;
if (slot == 17 || slot == 26)
slot += 2;
if (slot % 9 == 8)
{
slot += 2;
}
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()

View File

@ -1,9 +1,14 @@
package mineplex.core.cosmetic.ui.page.custompet.name;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilItem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.punish.PunishClient;
import net.minecraft.server.v1_8_R3.ItemStack;
import net.minecraft.server.v1_8_R3.Items;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClientManager;
@ -34,6 +39,7 @@ public class CustomPetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop
getButtonMap().put(0, new CloseCustomPetButton());
getButtonMap().put(1, new CloseCustomPetButton());
getButtonMap().put(2, new SelectCustomPetTagButton(this));
}
@Override