Search in sources :

Example 11 with ModuleInstance

use of com.teamwizardry.wizardry.api.spell.module.ModuleInstance in project Wizardry by TeamWizardry.

the class WorktableGui method addModules.

private void addModules(ComponentSprite parent, ModuleType type) {
    int column = 0, row = 0;
    for (ModuleInstance module : ModuleRegistry.INSTANCE.getModules(type)) {
        TableModule tableModule = new TableModule(this, module, false, false);
        tableModule.setPos(new Vec2d(row * 16, column * 16));
        parent.add(tableModule);
        if (++row >= 3) {
            row = 0;
            column++;
        }
    }
}
Also used : ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance) Vec2d(com.teamwizardry.librarianlib.features.math.Vec2d)

Example 12 with ModuleInstance

use of com.teamwizardry.wizardry.api.spell.module.ModuleInstance in project Wizardry by TeamWizardry.

the class ComponentModifiers method set.

public void set() {
    List<GuiComponent> children = new ArrayList<>(getChildren());
    // units: none (modifier)
    int childrenSize = children.size();
    // units: pixels
    float slideInDist = childrenSize * PIXELS_PER_BAR;
    for (int i = 0; i < childrenSize; i++) {
        // units: pixels
        int lengthToTravel = (i + 1) * PIXELS_PER_BAR;
        // units: ticks
        float slideDuration = SLIDE_IN_DURATION * lengthToTravel / slideInDist;
        // units: ticks
        float waitDuration = SLIDE_IN_DURATION - slideDuration;
        GuiComponent bar = children.get(i);
        BasicAnimation<GuiComponent> animPlate = new BasicAnimation<>(bar, "pos.y");
        // Use Easing.easeInOutBack for the sexiest effect. Important: do it for BOTH!
        animPlate.setEasing(Easing.easeInBack);
        // units: pixels
        animPlate.setFrom(lengthToTravel - PIXELS_PER_BAR);
        // units: pixels
        animPlate.setTo(-PIXELS_PER_BAR);
        // units: ticks
        animPlate.setDuration(slideDuration);
        animPlate.setCompletion(bar::invalidate);
        add(new ScheduledEventAnimation(waitDuration, () -> add(animPlate)));
    }
    Runnable begin = () -> {
        TableModule selectedModule = worktable.selectedModule;
        if (selectedModule == null) {
            animationPlaying = false;
            return;
        }
        ModuleInstance module = selectedModule.getModule();
        ModuleInstanceModifier[] applicableModifiers = module.applicableModifiers();
        if (applicableModifiers == null || applicableModifiers.length <= 0) {
            animationPlaying = false;
            return;
        }
        ModuleInstanceModifier[] modifiers = module.applicableModifiers();
        if (modifiers == null) {
            animationPlaying = false;
            return;
        }
        // units: none
        int modifiersSize = modifiers.length;
        // units: pixels
        float slideOutDist = modifiersSize * PIXELS_PER_BAR;
        // units: ticks
        float outDuration = SLIDE_OUT_DURATION * modifiersSize;
        add(new ScheduledEventAnimation(SLIDE_IN_DURATION, () -> animationPlaying = false));
        for (int i = 0; i < modifiers.length; i++) {
            // units: pixels
            int lengthToTravel = (i + 1) * PIXELS_PER_BAR;
            // units: ticks
            float slideDuration = outDuration * lengthToTravel / slideOutDist;
            ModuleInstanceModifier modifier = modifiers[i];
            ComponentRect bar = new ComponentRect(0, 0, getSize().getXi(), PIXELS_PER_BAR);
            bar.getColor().setValue(new Color(0x80000000, true));
            TableModule tableModifier = new TableModule(worktable, modifier, false, true);
            tableModifier.setEnableTooltip(true);
            tableModifier.getTransform().setTranslateZ(80);
            bar.add(tableModifier);
            ComponentText text = new ComponentText(20, 4, ComponentText.TextAlignH.LEFT, ComponentText.TextAlignV.TOP);
            text.getText().setValue(TextFormatting.GREEN + modifier.getShortHandName());
            bar.add(text);
            bar.setVisible(true);
            BasicAnimation<ComponentRect> animPlate = new BasicAnimation<>(bar, "pos.y");
            // Use Easing.easeInOutBack for the sexiest effect. Important: do it for BOTH!
            animPlate.setEasing(Easing.easeOutBack);
            // units: pixels
            animPlate.setFrom(-PIXELS_PER_BAR);
            // units: pixels
            animPlate.setTo(lengthToTravel - PIXELS_PER_BAR);
            // units: ticks
            animPlate.setDuration(slideDuration);
            animPlate.setCompletion(() -> Minecraft.getMinecraft().player.playSound(ModSounds.WHOOSH, 1f, 1f));
            add(animPlate);
            bar.render.getTooltip().func((Function<GuiComponent, List<String>>) t -> {
                List<String> txt = new ArrayList<>();
                if (worktable.animationPlaying || tableModifier.getMouseOver())
                    return txt;
                txt.add(TextFormatting.GOLD + modifier.getReadableName());
                if (GuiScreen.isShiftKeyDown())
                    txt.add(TextFormatting.GRAY + modifier.getDescription());
                else
                    txt.add(TextFormatting.GRAY + LibrarianLib.PROXY.translate("wizardry.misc.sneak"));
                return txt;
            });
            bar.BUS.hook(GuiComponentEvents.MouseInEvent.class, event -> {
                bar.getColor().setValue(new Color(0x66000000, true));
            });
            bar.BUS.hook(GuiComponentEvents.MouseOutEvent.class, event -> {
                bar.getColor().setValue(new Color(0x80000000, true));
            });
            bar.BUS.hook(GuiComponentEvents.MouseDownEvent.class, event -> {
                if (event.component.getMouseOver()) {
                    bar.getColor().setValue(new Color(0x4D000000, true));
                }
            });
            bar.BUS.hook(GuiComponentEvents.MouseUpEvent.class, event -> {
                if (event.component.getMouseOver()) {
                    bar.getColor().setValue(new Color(0x80000000, true));
                }
            });
            bar.BUS.hook(GuiComponentEvents.MouseClickEvent.class, (event) -> {
                if (!event.component.getMouseOver())
                    return;
                if (worktable.selectedModule == null)
                    return;
                int j = worktable.selectedModule.hasData(Integer.class, modifier.getNBTKey()) ? worktable.selectedModule.getData(Integer.class, modifier.getNBTKey()) : 0;
                int status = -1;
                if (event.getButton() == EnumMouseButton.LEFT) {
                    AttributeRange cap = null;
                    for (AttributeRegistry.Attribute modifiersAssigned : worktable.selectedModule.getModule().getAttributeRanges().keySet()) {
                        for (AttributeModifier attribute : modifier.getAttributeModifiers()) {
                            if (modifiersAssigned.getNbtName().equals(attribute.getAttribute().getNbtName())) {
                                cap = worktable.selectedModule.getModule().getAttributeRanges().get(modifiersAssigned);
                                break;
                            }
                        }
                    }
                    if (cap != null && cap.max <= j) {
                        Minecraft.getMinecraft().player.playSound(ModSounds.SPELL_FAIL, 1f, 1f);
                        return;
                    }
                    Minecraft.getMinecraft().player.playSound(ModSounds.POP, 1f, 1f);
                    worktable.selectedModule.setData(Integer.class, modifier.getNBTKey(), ++j);
                    status = 0;
                    worktable.setToastMessage("", Color.GREEN);
                    worktable.syncToServer();
                } else if (event.getButton() == EnumMouseButton.RIGHT) {
                    if (worktable.selectedModule.hasData(Integer.class, modifier.getNBTKey())) {
                        if (j > 0) {
                            Minecraft.getMinecraft().player.playSound(ModSounds.ZOOM, 1f, 1f);
                            worktable.selectedModule.setData(Integer.class, modifier.getNBTKey(), --j);
                            if (j <= 0) {
                                Minecraft.getMinecraft().player.playSound(ModSounds.SPELL_FAIL, 1f, 1f);
                                worktable.selectedModule.removeData(Integer.class, modifier.getNBTKey());
                            }
                            status = 1;
                            worktable.syncToServer();
                        }
                        worktable.setToastMessage("", Color.GREEN);
                    } else
                        Minecraft.getMinecraft().player.playSound(ModSounds.SPELL_FAIL, 1f, 1f);
                }
                if (status == -1)
                    return;
                TableModule fakePlate = new TableModule(worktable, modifier, false, true);
                fakePlate.getTransform().setTranslateZ(80);
                worktable.getMainComponents().add(fakePlate);
                Vec2d from = tableModifier.thisPosToOtherContext(worktable.getMainComponents());
                Vec2d to = worktable.selectedModule.thisPosToOtherContext(worktable.getMainComponents()).add(worktable.selectedModule.getSize().sub(tableModifier.getSize()).mul(0.5f));
                KeyframeAnimation<TableModule> anim = new KeyframeAnimation<>(fakePlate, "pos");
                anim.setDuration(20);
                if (status == 0) {
                    Vec2d rand = from.add(RandUtil.nextDouble(-10, 10), RandUtil.nextDouble(-10, 10));
                    anim.setKeyframes(new Keyframe[] { new Keyframe(0, from, Easing.easeOutQuint), new Keyframe(0.3f, rand, Easing.easeOutQuint), new Keyframe(0.35f, rand, Easing.easeOutQuint), new Keyframe(1f, to, Easing.easeInOutQuint) });
                } else {
                    Vec2d rand = to.add(RandUtil.nextDouble(-10, 10), RandUtil.nextDouble(-10, 10));
                    anim.setKeyframes(new Keyframe[] { new Keyframe(0, to, Easing.easeOutQuint), new Keyframe(0.3f, rand, Easing.easeOutQuint), new Keyframe(0.35f, rand, Easing.easeOutQuint), new Keyframe(1f, from, Easing.easeInOutQuint) });
                }
                anim.setCompletion(fakePlate::invalidate);
                worktable.getMainComponents().add(anim);
                worktable.paper.BUS.fire(new TableModule.ModuleUpdateEvent());
            });
            add(bar);
        }
    };
    if (childrenSize > 0)
        add(new ScheduledEventAnimation(SLIDE_IN_DURATION + SPACER_DURATION, begin));
    else
        begin.run();
}
Also used : ComponentRect(com.teamwizardry.librarianlib.features.gui.components.ComponentRect) ModuleInstanceModifier(com.teamwizardry.wizardry.api.spell.module.ModuleInstanceModifier) LibrarianLib(com.teamwizardry.librarianlib.core.LibrarianLib) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Keyframe(com.teamwizardry.librarianlib.features.animator.animations.Keyframe) Minecraft(net.minecraft.client.Minecraft) ModSounds(com.teamwizardry.wizardry.init.ModSounds) Easing(com.teamwizardry.librarianlib.features.animator.Easing) Nonnull(javax.annotation.Nonnull) ScheduledEventAnimation(com.teamwizardry.librarianlib.features.animator.animations.ScheduledEventAnimation) KeyframeAnimation(com.teamwizardry.librarianlib.features.animator.animations.KeyframeAnimation) TextFormatting(net.minecraft.util.text.TextFormatting) EnumMouseButton(com.teamwizardry.librarianlib.features.gui.EnumMouseButton) AttributeRange(com.teamwizardry.wizardry.api.spell.attribute.AttributeRange) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance) GuiComponent(com.teamwizardry.librarianlib.features.gui.component.GuiComponent) ModuleInstanceShape(com.teamwizardry.wizardry.api.spell.module.ModuleInstanceShape) java.awt(java.awt) BasicAnimation(com.teamwizardry.librarianlib.features.animator.animations.BasicAnimation) GuiScreen(net.minecraft.client.gui.GuiScreen) List(java.util.List) AttributeRegistry(com.teamwizardry.wizardry.api.spell.attribute.AttributeRegistry) Vec2d(com.teamwizardry.librarianlib.features.math.Vec2d) GuiComponentEvents(com.teamwizardry.librarianlib.features.gui.component.GuiComponentEvents) ComponentText(com.teamwizardry.librarianlib.features.gui.components.ComponentText) RandUtil(com.teamwizardry.wizardry.api.util.RandUtil) AttributeModifier(com.teamwizardry.wizardry.api.spell.attribute.AttributeModifier) ArrayList(java.util.ArrayList) GuiComponent(com.teamwizardry.librarianlib.features.gui.component.GuiComponent) Vec2d(com.teamwizardry.librarianlib.features.math.Vec2d) ModuleInstanceModifier(com.teamwizardry.wizardry.api.spell.module.ModuleInstanceModifier) Function(java.util.function.Function) Keyframe(com.teamwizardry.librarianlib.features.animator.animations.Keyframe) KeyframeAnimation(com.teamwizardry.librarianlib.features.animator.animations.KeyframeAnimation) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance) BasicAnimation(com.teamwizardry.librarianlib.features.animator.animations.BasicAnimation) ScheduledEventAnimation(com.teamwizardry.librarianlib.features.animator.animations.ScheduledEventAnimation) AttributeModifier(com.teamwizardry.wizardry.api.spell.attribute.AttributeModifier) ComponentRect(com.teamwizardry.librarianlib.features.gui.components.ComponentRect) ComponentText(com.teamwizardry.librarianlib.features.gui.components.ComponentText) AttributeRange(com.teamwizardry.wizardry.api.spell.attribute.AttributeRange)

Example 13 with ModuleInstance

use of com.teamwizardry.wizardry.api.spell.module.ModuleInstance in project Wizardry by TeamWizardry.

the class ComponentSpellRecipe method components.

public static List<PaginationContext> components(GuiBook book) {
    List<PaginationContext> contexts = Lists.newArrayList();
    if (book.getBookItemStack().isEmpty())
        return contexts;
    ItemStack bookStack = book.getBookItemStack();
    if (!NBTHelper.getBoolean(bookStack, "has_spell", false))
        return contexts;
    NBTTagList moduleList = NBTHelper.getList(bookStack, NBTConstants.NBT.SPELL, net.minecraftforge.common.util.Constants.NBT.TAG_STRING);
    if (moduleList == null)
        return contexts;
    List<List<ModuleInstance>> spellModules = SpellUtils.deserializeModuleList(moduleList);
    List<ItemStack> spellItems = SpellUtils.getSpellItems(spellModules);
    spellModules = SpellUtils.getEssentialModules(spellModules);
    FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
    int widthOfSpace = fr.getStringWidth(" ");
    StringBuilder builder = new StringBuilder(LibrarianLib.PROXY.translate("wizardry.book.spell_recipe_structure") + "\n");
    for (List<ModuleInstance> spellModuleList : spellModules) {
        String margin = null;
        for (ModuleInstance module : spellModuleList) {
            if (margin == null) {
                margin = " - ";
                builder.append(margin).append(module.getReadableName()).append("\n");
            } else {
                int realLength = fr.getStringWidth(margin);
                int nbOfSpace = MathHelper.clamp(realLength / widthOfSpace, 0, 17);
                margin = StringUtils.repeat(" ", nbOfSpace) + "|_ ";
                builder.append(margin).append(module.getReadableName()).append("\n");
                if (nbOfSpace >= 16) {
                    builder.append("   ________________|").append("\n");
                    margin = "   ";
                }
            }
        }
    }
    String[] lines = builder.toString().split("\n");
    StringBuilder pageChunk = new StringBuilder();
    int count = 0;
    for (String line : lines) {
        pageChunk.append(line).append("\n");
        if (++count >= 16) {
            count = 0;
            pageFromString(book, contexts, pageChunk);
            pageChunk = new StringBuilder();
        }
    }
    if (count != 0)
        pageFromString(book, contexts, pageChunk);
    Consumer<ComponentVoid> applier = component -> {
    };
    for (int i = 0; i < spellItems.size(); i++) {
        ItemStack stack = spellItems.get(i);
        int index = i;
        applier = applier.andThen(component -> {
            ComponentStack componentStack = new ComponentStack((index % 4) * 32, (index / 4) * 16);
            componentStack.getStack().setValue(stack);
            component.add(componentStack);
            if (index != spellItems.size() - 1 && (index % 4) < 3) {
                ComponentSprite nextItem = new ComponentSprite(book.getHomeSprite(), 32 + (index % 4) * 32, (index / 4) * 16 + 13, 16, 8);
                nextItem.getColor().setValue(book.getBook().getHighlightColor());
                nextItem.getTransform().setRotate(Math.toRadians(180));
                component.add(nextItem);
            }
        });
        if ((index / 4) >= 9) {
            Consumer<ComponentVoid> spellApplier = applier;
            contexts.add(new PaginationContext(() -> {
                ComponentVoid component = new ComponentVoid(16, 16, book.getMainBookComponent().getSize().getXi() - 32, book.getMainBookComponent().getSize().getYi() - 32);
                spellApplier.accept(component);
                return component;
            }));
            applier = component -> {
            };
        }
    }
    Consumer<ComponentVoid> spellApplier = applier;
    contexts.add(new PaginationContext(() -> {
        ComponentVoid component = new ComponentVoid(16, 16, book.getMainBookComponent().getSize().getXi() - 32, book.getMainBookComponent().getSize().getYi() - 32);
        spellApplier.accept(component);
        return component;
    }));
    return contexts;
}
Also used : ComponentStack(com.teamwizardry.librarianlib.features.gui.components.ComponentStack) IBookGui(com.teamwizardry.librarianlib.features.gui.provided.book.IBookGui) LibrarianLib(com.teamwizardry.librarianlib.core.LibrarianLib) StringUtils(org.apache.commons.lang3.StringUtils) ComponentVoid(com.teamwizardry.librarianlib.features.gui.components.ComponentVoid) ItemStack(net.minecraft.item.ItemStack) NBTTagList(net.minecraft.nbt.NBTTagList) Lists(com.google.common.collect.Lists) Minecraft(net.minecraft.client.Minecraft) SpellUtils(com.teamwizardry.wizardry.api.spell.SpellUtils) ComponentSprite(com.teamwizardry.librarianlib.features.gui.components.ComponentSprite) PaginationContext(com.teamwizardry.librarianlib.features.gui.provided.book.context.PaginationContext) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance) Consumer(java.util.function.Consumer) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Bookmark(com.teamwizardry.librarianlib.features.gui.provided.book.context.Bookmark) FontRenderer(net.minecraft.client.gui.FontRenderer) Book(com.teamwizardry.librarianlib.features.gui.provided.book.hierarchy.book.Book) IBookElement(com.teamwizardry.librarianlib.features.gui.provided.book.hierarchy.IBookElement) MathHelper(net.minecraft.util.math.MathHelper) NBTHelper(com.teamwizardry.librarianlib.features.helpers.NBTHelper) ComponentText(com.teamwizardry.librarianlib.features.gui.components.ComponentText) NBTConstants(com.teamwizardry.wizardry.api.NBTConstants) NotNull(org.jetbrains.annotations.NotNull) ComponentStack(com.teamwizardry.librarianlib.features.gui.components.ComponentStack) ComponentSprite(com.teamwizardry.librarianlib.features.gui.components.ComponentSprite) PaginationContext(com.teamwizardry.librarianlib.features.gui.provided.book.context.PaginationContext) ComponentVoid(com.teamwizardry.librarianlib.features.gui.components.ComponentVoid) NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagList(net.minecraft.nbt.NBTTagList) List(java.util.List) FontRenderer(net.minecraft.client.gui.FontRenderer) ItemStack(net.minecraft.item.ItemStack) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance)

Example 14 with ModuleInstance

use of com.teamwizardry.wizardry.api.spell.module.ModuleInstance in project Wizardry by TeamWizardry.

the class RenderCodex method getSpellStructureLines.

public String[] getSpellStructureLines(ItemStack stack) {
    NBTTagList moduleList = NBTHelper.getList(stack, NBTConstants.NBT.SPELL, net.minecraftforge.common.util.Constants.NBT.TAG_STRING);
    if (moduleList == null)
        return new String[0];
    List<List<ModuleInstance>> spellModules = SpellUtils.deserializeModuleList(moduleList);
    spellModules = SpellUtils.getEssentialModules(spellModules);
    int page = NBTHelper.getInt(stack, "page", 0);
    FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
    int widthOfSpace = fr.getStringWidth(" ");
    StringBuilder builder = new StringBuilder("Spell Structure:\n");
    for (List<ModuleInstance> spellModuleList : spellModules) {
        String margin = null;
        for (ModuleInstance module : spellModuleList) {
            if (margin == null) {
                margin = " - ";
                builder.append(margin).append(module.getReadableName()).append("\n");
            } else {
                int realLength = fr.getStringWidth(margin);
                int nbOfSpace = MathHelper.clamp(realLength / widthOfSpace, 0, 17);
                margin = StringUtils.repeat(" ", nbOfSpace) + "|_ ";
                builder.append(margin).append(module.getReadableName()).append("\n");
                if (nbOfSpace >= 16) {
                    builder.append("   ________________|").append("\n");
                    margin = "   ";
                }
            }
        }
    }
    String[] lines = builder.toString().split("\n");
    StringBuilder pageChunk = new StringBuilder();
    int count = 0;
    int currentPage = 0;
    for (String line : lines) {
        pageChunk.append(line).append("\n");
        if (++count >= 16) {
            count = 0;
            if (currentPage >= page)
                return pageChunk.toString().split("\n");
            pageChunk = new StringBuilder();
        }
    }
    return pageChunk.toString().split("\n");
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) ArrayList(java.util.ArrayList) NBTTagList(net.minecraft.nbt.NBTTagList) List(java.util.List) FontRenderer(net.minecraft.client.gui.FontRenderer) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance)

Example 15 with ModuleInstance

use of com.teamwizardry.wizardry.api.spell.module.ModuleInstance in project Wizardry by TeamWizardry.

the class CommandDebug method execute.

@Override
public void execute(@NotNull MinecraftServer server, @NotNull ICommandSender sender, @NotNull String[] args) throws WrongUsageException {
    if (args.length < 2)
        throw new WrongUsageException(getUsage(sender));
    ModuleInstance module = ModuleRegistry.INSTANCE.getModule(args[1]);
    if (module == null) {
        notifyCommandListener(sender, this, "wizardry.command." + getName() + ".module_not_found");
        return;
    }
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " ________________________________________________\\\\");
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " | " + TextFormatting.GRAY + "Module " + module.getReadableName() + ":");
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Description           " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getDescription());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Item Stack            " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getItemStack().getDisplayName());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Burnout Fill          " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getBurnoutFill());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |  |_ " + TextFormatting.DARK_GREEN + "Burnout Multiplier" + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getBurnoutMultiplier());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Mana Drain           " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getManaDrain());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |  |_" + TextFormatting.DARK_GREEN + "Mana Multiplier     " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getManaMultiplier());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Power Multiplier     " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getPowerMultiplier());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Charge Up Time      " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getChargeupTime());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Cooldown Time        " + TextFormatting.GRAY + " | " + TextFormatting.GRAY + module.getCooldownTime());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Primary Color        " + TextFormatting.GRAY + " | " + TextFormatting.RED + module.getPrimaryColor().getRed() + TextFormatting.GRAY + ", " + TextFormatting.GREEN + module.getPrimaryColor().getGreen() + TextFormatting.GRAY + ", " + TextFormatting.BLUE + module.getPrimaryColor().getBlue());
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Secondary Color    " + TextFormatting.GRAY + " | " + TextFormatting.RED + module.getSecondaryColor().getRed() + TextFormatting.GRAY + ", " + TextFormatting.GREEN + module.getSecondaryColor().getGreen() + TextFormatting.GRAY + ", " + TextFormatting.BLUE + module.getSecondaryColor().getBlue());
    if (!module.getAttributeModifiers().isEmpty())
        notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Default AttributeRegistry");
    for (AttributeModifier attributeModifier : module.getAttributeModifiers()) notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |  |_ " + TextFormatting.GRAY + attributeModifier.toString());
    ModuleInstanceModifier[] modifierList = module.applicableModifiers();
    if (modifierList != null) {
        notifyCommandListener(sender, this, TextFormatting.YELLOW + " |  |_ " + TextFormatting.GREEN + "Applicable Modifiers ");
        for (ModuleInstanceModifier modifier : modifierList) notifyCommandListener(sender, this, TextFormatting.YELLOW + " |     |_ " + TextFormatting.DARK_GREEN + modifier.getNBTKey());
    }
    notifyCommandListener(sender, this, TextFormatting.YELLOW + " |________________________________________________//");
}
Also used : WrongUsageException(net.minecraft.command.WrongUsageException) AttributeModifier(com.teamwizardry.wizardry.api.spell.attribute.AttributeModifier) ModuleInstance(com.teamwizardry.wizardry.api.spell.module.ModuleInstance) ModuleInstanceModifier(com.teamwizardry.wizardry.api.spell.module.ModuleInstanceModifier)

Aggregations

ModuleInstance (com.teamwizardry.wizardry.api.spell.module.ModuleInstance)15 ModuleInstanceModifier (com.teamwizardry.wizardry.api.spell.module.ModuleInstanceModifier)7 Vec2d (com.teamwizardry.librarianlib.features.math.Vec2d)6 ArrayList (java.util.ArrayList)5 List (java.util.List)5 ItemStack (net.minecraft.item.ItemStack)4 NBTTagList (net.minecraft.nbt.NBTTagList)4 FontRenderer (net.minecraft.client.gui.FontRenderer)3 LibrarianLib (com.teamwizardry.librarianlib.core.LibrarianLib)2 BasicAnimation (com.teamwizardry.librarianlib.features.animator.animations.BasicAnimation)2 Keyframe (com.teamwizardry.librarianlib.features.animator.animations.Keyframe)2 KeyframeAnimation (com.teamwizardry.librarianlib.features.animator.animations.KeyframeAnimation)2 ScheduledEventAnimation (com.teamwizardry.librarianlib.features.animator.animations.ScheduledEventAnimation)2 GuiComponent (com.teamwizardry.librarianlib.features.gui.component.GuiComponent)2 GuiComponentEvents (com.teamwizardry.librarianlib.features.gui.component.GuiComponentEvents)2 ComponentRect (com.teamwizardry.librarianlib.features.gui.components.ComponentRect)2 ComponentSprite (com.teamwizardry.librarianlib.features.gui.components.ComponentSprite)2 ComponentText (com.teamwizardry.librarianlib.features.gui.components.ComponentText)2 ComponentVoid (com.teamwizardry.librarianlib.features.gui.components.ComponentVoid)2 Sprite (com.teamwizardry.librarianlib.features.sprite.Sprite)2