@@ -0,0 +1,1699 @@
+package org.squiddev.plethora.integration.vanilla.method;%0A%0Aimport dan200.computercraft.api.lua.LuaException;%0Aimport net.minecraft.entity.player.EntityPlayerMP;%0Aimport net.minecraft.init.Items;%0Aimport net.minecraft.inventory.EntityEquipmentSlot;%0Aimport net.minecraft.item.ItemStack;%0Aimport org.squiddev.plethora.api.method.BasicObjectMethod;%0Aimport org.squiddev.plethora.api.method.IContext;%0Aimport org.squiddev.plethora.api.method.IMethod;%0Aimport org.squiddev.plethora.api.method.IPartialContext;%0Aimport org.squiddev.plethora.api.reference.ItemSlot;%0A%0Aimport javax.annotation.Nonnull;%0Aimport javax.annotation.Nullable;%0A%0Aimport static org.squiddev.plethora.api.method.ArgumentHelper.optBoolean;%0A%0A@IMethod.Inject(ItemSlot.class)%0Apublic class MethodItemElytraActivate extends BasicObjectMethod%3CItemSlot%3E %7B%0A%09public MethodItemElytraActivate() %7B%0A%09%09super(%22setActive%22, true, %22function(%5Bactive:boolean%5D) -- Set whether these elytra are active or not.%22);%0A%09%7D%0A%0A%09@Override%0A%09public boolean canApply(@Nonnull IPartialContext%3CItemSlot%3E context) %7B%0A%09%09ItemSlot slot = context.getTarget();%0A%09%09ItemStack stack = slot.getStack();%0A%0A%09%09if (stack == null %7C%7C stack.getItem() != Items.ELYTRA) return false;%0A%0A%09%09EntityPlayerMP player = context.getContext(EntityPlayerMP.class);%0A%09%09return player != null && player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) == stack;%0A%09%7D%0A%0A%09@Nullable%0A%09@Override%0A%09public Object%5B%5D apply(@Nonnull IContext%3CItemSlot%3E context, @Nonnull Object%5B%5D args) throws LuaException %7B%0A%09%09boolean enabled = optBoolean(args, 0, true);%0A%0A%09%09EntityPlayerMP player = context.getContext(EntityPlayerMP.class);%0A%09%09if (enabled) %7B%0A%09%09%09player.setElytraFlying();%0A%09%09%7D else %7B%0A%09%09%09player.clearElytraFlying();%0A%09%09%7D%0A%0A%09%09return null;%0A%09%7D%0A%7D%0A

Add method to enable/disable elytra