Не открывается инвентарь

Версия Minecraft
1.12.2
API
Forge
9
0
Переписываю сурс мода ModularWarfare переписал класс
ContainerInventoryModified.java:
package com.modularwarfare.common.container;

import com.modularwarfare.common.backpacks.ItemBackpack;
import com.modularwarfare.common.capability.extraslots.CapabilityExtra;
import com.modularwarfare.common.capability.extraslots.IExtraItemHandler;
import com.modularwarfare.common.guns.ItemGun;
import com.modularwarfare.utility.ModUtil;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/***
 * Modified copy of Vanilla's Player inventory
 */
public class ContainerInventoryModified extends Container {

    private static final EntityEquipmentSlot[] EQUIPMENT_SLOTS = new EntityEquipmentSlot[]{EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST,
            EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
    public final InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2);
    public final InventoryCraftResult craftResult = new InventoryCraftResult();
    private final EntityPlayer thePlayer;
    public IExtraItemHandler extra;
    public boolean isLocalWorld;

    public ContainerInventoryModified(final InventoryPlayer playerInv, final boolean isLocalWorld, final EntityPlayer player) {
        this.isLocalWorld = isLocalWorld;
        this.thePlayer = player;
        this.onCraftMatrixChanged(this.craftMatrix);

        this.updateBackpack(playerInv,player);
    }

    public void addSlots(final InventoryPlayer playerInv, final EntityPlayer player, final int levelBackpack) {
        this.inventorySlots.clear();
        this.inventoryItemStacks.clear();

        this.extra = player.getCapability(CapabilityExtra.CAPABILITY, null);

        this.addSlotToContainer(new SlotCrafting(playerInv.player, this.craftMatrix, this.craftResult, 0, 154, 28));

        for (int i = 0; i < 2; ++i) {
            for (int j = 0; j < 2; ++j) {
                this.addSlotToContainer(new Slot(this.craftMatrix, j + (i * 2), 116 + (j * 18), 18 + (i * 18)));
            }
        }

        for (int k = 0; k < 4; k++) {
            final EntityEquipmentSlot slot = EQUIPMENT_SLOTS[k];
            this.addSlotToContainer(new Slot(playerInv, 36 + (3 - k), 8, 8 + (k * 18)) {
                @Override
                public int getSlotStackLimit() {
                    return 1;
                }

                @Override
                public boolean isItemValid(final ItemStack stack) {
                    return stack.getItem().isValidArmor(stack, slot, player);
                }

                @Override
                public boolean canTakeStack(final EntityPlayer playerIn) {
                    final ItemStack itemstack = this.getStack();
                    return !itemstack.isEmpty() && !playerIn.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) ? false
                            : super.canTakeStack(playerIn);
                }

                @Override
                public String getSlotTexture() {
                    return ItemArmor.EMPTY_SLOT_NAMES[slot.getIndex()];
                }
            });
        }

        // Second light gray slots bar
        for (int i = 0; i < levelBackpack; ++i) {
            for (int j = 0; j < 9; ++j) {
                this.addSlotToContainer(new Slot(playerInv, j + ((i + 1) * 9), 8 + (j * 18), 102 - 12 + (i * 18)));
            }
        }

        // First light gray slots bar
        for (int i = 0; i < 9; ++i) {
            this.addSlotToContainer(new Slot(playerInv, i, 8 + (i * 18), 166 - 12));
        }

        // This is for the OFFHAND MouseHover
        this.addSlotToContainer(new Slot(playerInv, 40, 76, 62) {
            @Override
            @Nullable
            @SideOnly(Side.CLIENT)
            public String getSlotTexture() {
                return "minecraft:items/empty_armor_slot_shield";
            }
        });

        this.addSlotToContainer(new SlotBackpack(this.extra, 0, ModUtil.BACKPACK_SLOT_OFFSET_X, ModUtil.BACKPACK_SLOT_OFFSET_Y + 1) {
            @Override
            public void onSlotChanged() {
                ContainerInventoryModified.this.updateBackpack(playerInv, player);
                super.onSlotChanged();
            }
        });


        this.addSlotToContainer(new SlotVest(this.extra, 1, ModUtil.BACKPACK_SLOT_OFFSET_X, ModUtil.BACKPACK_SLOT_OFFSET_Y + 1 + 18) {
            @Override
            public void onSlotChanged() {
                ContainerInventoryModified.this.updateBackpack(playerInv,player);
                super.onSlotChanged();
            }
        });

    }


    private void updateBackpack(final InventoryPlayer playerInv, final EntityPlayer player) {
        if (this.extra.getStackInSlot(0).hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) {
            final IItemHandler backpackInvent = this.extra.getStackInSlot(0).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);


            this.addSlots(playerInv,player,backpackInvent.getSlots()/4-1);


            }
        }


    @Override
    public void onCraftMatrixChanged(final IInventory par1IInventory) {
        this.slotChangedCraftingGrid(this.thePlayer.getEntityWorld(), this.thePlayer, this.craftMatrix, this.craftResult);
    }

    @Override
    public void onContainerClosed(final EntityPlayer player) {
        super.onContainerClosed(player);
        this.craftResult.clear();

        if (!player.world.isRemote) {
            this.clearContainer(player, player.world, this.craftMatrix);
        }
    }

    @Override
    public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
        return true;
    }

    @Override
    public ItemStack transferStackInSlot(final EntityPlayer playerIn, final int index) {
        ItemStack itemstack = ItemStack.EMPTY;
        final Slot slot = this.inventorySlots.get(index);

        if ((slot != null) && slot.getHasStack()) {
            final ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();
            final EntityEquipmentSlot entityequipmentslot = EntityLiving.getSlotForItemStack(itemstack);


            if (itemstack1.isEmpty()) {
                slot.putStack(ItemStack.EMPTY);
            } else {
                slot.onSlotChanged();
            }

            if (itemstack1.getCount() == itemstack.getCount()) {
                return ItemStack.EMPTY;
            }

            final ItemStack itemstack2 = slot.onTake(playerIn, itemstack1);

            if (index == 0) {
                playerIn.dropItem(itemstack2, false);
            }
        }

        return itemstack;
    }

    @Override
    public boolean canMergeSlot(final ItemStack stack, final Slot slot) {
        return (slot.inventory != this.craftResult) && super.canMergeSlot(stack, slot);
    }
}
При открытии инветаря ничего не происходит
latest.log:
[23:38:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[23:38:06] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2855 for Minecraft 1.12.2 loading
[23:38:06] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_341, running on Windows 11:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_341\jre
[23:38:06] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[23:38:06] [main/ERROR] [FML]: Full: C:\Users\Light\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[23:38:06] [main/ERROR] [FML]: Trimmed: c:/users/light/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[23:38:06] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[23:38:06] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
[23:38:06] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[23:38:06] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[23:38:06] [main/INFO] [FML]: Searching O:\ModularWarfare-6d48e29816a1c9964f8fa2f4136e2ce87abeed46\run\.\mods for mods
[23:38:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[23:38:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[23:38:08] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[23:38:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[23:38:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[23:38:08] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[23:38:08] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[23:38:08] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[23:38:09] [Client thread/INFO] [net.minecraft.client.Minecraft]: Setting user: Player996
[23:38:12] [Client thread/WARN] [net.minecraft.client.settings.GameSettings]: Skipping bad option: lastServer:
[23:38:12] [Client thread/INFO] [net.minecraft.client.Minecraft]: LWJGL Version: 2.9.4
[23:38:13] [Client thread/INFO] [FML]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 11 (amd64) version 10.0
    Java Version: 1.8.0_341, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 500672304 bytes (477 MB) / 625999872 bytes (597 MB) up to 1894252544 bytes (1806 MB)
    JVM Flags: 0 total;
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML:
    Loaded coremods (and transformers):
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 516.94' Renderer: 'NVIDIA GeForce GTX 1650/PCIe/SSE2'
[23:38:13] [Client thread/INFO] [FML]: MinecraftForge v14.23.5.2855 Initialized
[23:38:13] [Client thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
[23:38:13] [Client thread/INFO] [FML]: Invalid recipe found with multiple oredict ingredients in the same ingredient...
[23:38:13] [Client thread/INFO] [FML]: Replaced 1227 ore ingredients
[23:38:14] [Client thread/INFO] [FML]: Searching O:\ModularWarfare-6d48e29816a1c9964f8fa2f4136e2ce87abeed46\run\.\mods for mods
[23:38:15] [Client thread/ERROR] [FML]: Unable to read a class file correctly
java.lang.IllegalArgumentException: null
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) [ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
[23:38:15] [Client thread/ERROR] [FML]: There was a problem reading the entry module-info.class in the jar C:\Users\Light\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm-util\6.2\a9690730f92cc79eeadc20e400ebb41eccce10b1\asm-util-6.2.jar - probably a corrupt zip
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/WARN] [FML]: Zip file asm-util-6.2.jar failed to read properly, it will be ignored
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) ~[JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/ERROR] [FML]: Unable to read a class file correctly
java.lang.IllegalArgumentException: null
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) [ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
[23:38:15] [Client thread/ERROR] [FML]: There was a problem reading the entry module-info.class in the jar C:\Users\Light\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm-analysis\6.2\c7d9a90d221cbb977848d2c777eb3aa7637e89df\asm-analysis-6.2.jar - probably a corrupt zip
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/WARN] [FML]: Zip file asm-analysis-6.2.jar failed to read properly, it will be ignored
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) ~[JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/ERROR] [FML]: Unable to read a class file correctly
java.lang.IllegalArgumentException: null
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) [ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
[23:38:15] [Client thread/ERROR] [FML]: There was a problem reading the entry module-info.class in the jar C:\Users\Light\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm-tree\6.2\61570e046111559f38d4e0e580c005f75988c0a6\asm-tree-6.2.jar - probably a corrupt zip
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/WARN] [FML]: Zip file asm-tree-6.2.jar failed to read properly, it will be ignored
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) ~[JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/ERROR] [FML]: Unable to read a class file correctly
java.lang.IllegalArgumentException: null
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) [ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
[23:38:15] [Client thread/ERROR] [FML]: There was a problem reading the entry module-info.class in the jar C:\Users\Light\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\6.2\1b6c4ff09ce03f3052429139c2a68e295cae6604\asm-6.2.jar - probably a corrupt zip
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/WARN] [FML]: Zip file asm-6.2.jar failed to read properly, it will be ignored
net.minecraftforge.fml.common.LoaderException: java.lang.IllegalArgumentException

    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:63) ~[ASMModParser.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.findClassesASM(JarDiscoverer.java:102) ~[JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:77) [JarDiscoverer.class:?]
    at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:47) [ContainerType.class:?]
    at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:74) [ModCandidate.class:?]
    at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:93) [ModDiscoverer.class:?]
    at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:427) [Loader.class:?]
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:568) [Loader.class:?]
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:467) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_341]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_341]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_341]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_341]
    at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[asm-debug-all-5.2.jar:5.2]
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
    at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]
    ... 23 more
[23:38:15] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[23:38:15] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 303737400 nanos
[23:38:16] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, modularwarfare] at CLIENT
[23:38:16] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, modularwarfare] at SERVER
[23:38:17] [Client thread/INFO] [STDOUT]: [com.modularwarfare.ModConfig:<init>:51]: Comparing version 1.0.13f to 1.0.13f
[23:38:17] [Client thread/INFO] [net.minecraft.client.resources.SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:ModularWarfare, FMLFileResourcePack:ModularWarfare : prototype, FMLFileResourcePack:ModularWarfare : prototype-1.0.13f-contentpack.zip
[23:38:17] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[23:38:17] [Client thread/INFO] [FML]: Found 1168 ObjectHolder annotations
[23:38:17] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[23:38:17] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[23:38:17] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[23:38:17] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[23:38:17] [Client thread/INFO] [modularwarfare]: Registered content pack
[23:38:19] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: OUTDATED Target: 14.23.5.2859
[23:38:23] [Client thread/INFO] [FML]: Applying holder lookups
[23:38:23] [Client thread/INFO] [FML]: Holder lookups applied
[23:38:23] [Client thread/INFO] [FML]: Applying holder lookups
[23:38:23] [Client thread/INFO] [FML]: Holder lookups applied
[23:38:23] [Client thread/INFO] [FML]: Applying holder lookups
[23:38:23] [Client thread/INFO] [FML]: Holder lookups applied
[23:38:23] [Client thread/INFO] [FML]: Applying holder lookups
[23:38:23] [Client thread/INFO] [FML]: Holder lookups applied
[23:38:23] [Client thread/INFO] [FML]: Injecting itemstacks
[23:38:23] [Client thread/INFO] [FML]: Itemstack injection complete
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundHandler]: File modularwarfare:sounds/m14/shoot1.ogg does not exist, cannot add it to event modularwarfare:prototype.m14.shoot
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundHandler]: File modularwarfare:sounds/m14/shoot1.ogg does not exist, cannot add it to event modularwarfare:prototype.m14.shoot
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.mosin_nagant.sup
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.l115a3.sup
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.spas12.distant
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.mp5.shoot.sup
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.m14s.distant
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.p88.distant
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:prototype.sks.sup
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:omw.fiveseven.distant
[23:38:25] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Missing sound for event: modularwarfare:human.other.whistle
[23:38:25] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager]: Starting up SoundSystem...
[23:38:25] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: Initializing LWJGL OpenAL
[23:38:25] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[23:38:25] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager]: OpenAL initialized.
[23:38:26] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager]: Sound engine started
[23:38:30] [Client thread/INFO] [FML]: Max texture size: 16384
[23:38:32] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap]: Created: 1024x1024 textures-atlas
[23:38:33] [Client thread/INFO] [FML]: Applying holder lookups
[23:38:33] [Client thread/INFO] [FML]: Holder lookups applied
[23:38:33] [Client thread/INFO] [FML]: Injecting itemstacks
[23:38:33] [Client thread/INFO] [FML]: Itemstack injection complete
[23:38:34] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods
[23:38:34] [Client thread/WARN] [net.minecraft.client.settings.GameSettings]: Skipping bad option: lastServer:
[23:38:34] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows]: Narrator library for x64 successfully loaded
[23:38:34] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient]: Could not authorize you against Realms server: Invalid session id
[23:38:37] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer]: Starting integrated minecraft server version 1.12.2
[23:38:37] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer]: Generating keypair
[23:38:37] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[23:38:38] [Server thread/INFO] [FML]: Applying holder lookups
[23:38:38] [Server thread/INFO] [FML]: Holder lookups applied
[23:38:38] [Server thread/INFO] [FML]: Loading dimension 0 (New World) ([email protected])
[23:38:38] [Server thread/INFO] [net.minecraft.advancements.AdvancementList]: Loaded 488 advancements
[23:38:38] [Server thread/INFO] [FML]: Loading dimension -1 (New World) ([email protected])
[23:38:38] [Server thread/INFO] [FML]: Loading dimension 1 (New World) ([email protected])
[23:38:38] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Preparing start region for level 0
[23:38:39] [Server thread/INFO] [FML]: Unloading dimension -1
[23:38:39] [Server thread/INFO] [FML]: Unloading dimension 1
[23:38:39] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer]: Changing view distance to 12, from 10
[23:38:40] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[23:38:40] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[23:38:40] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[23:38:40] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[23:38:40] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[23:38:40] [Server thread/INFO] [net.minecraft.server.management.PlayerList]: Player996[local:E:7d74dc7e] logged in with entity id 126 at (-420.5, 4.0, 280.5)
[23:38:40] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Player996 joined the game
[23:38:42] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer]: Saving and pausing game...
[23:38:42] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving chunks for level 'New World'/overworld
[23:38:52] [Client thread/INFO] [net.minecraft.client.Minecraft]: Stopping!
[23:38:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
[23:38:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving players
[23:38:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds
[23:38:52] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving chunks for level 'New World'/overworld
[23:38:52] [Server thread/INFO] [FML]: Unloading dimension 0
[23:38:52] [Server thread/INFO] [FML]: Applying holder lookups
[23:38:52] [Server thread/INFO] [FML]: Holder lookups applied
[23:38:52] [Client thread/INFO] [net.minecraft.client.audio.SoundManager]: SoundSystem shutting down...
[23:38:53] [Client thread/WARN] [net.minecraft.client.audio.SoundManager]: Author: Paul Lamb, www.paulscode.com
 
9
0
Отправка пакета:
@SubscribeEvent

    public void onGuiLaunch(GuiOpenEvent event) {

        if (ModConfig.INSTANCE.enableModifiedInventory) {

            if (event.getGui() != null && event.getGui().getClass() == GuiInventory.class) {

                final EntityPlayer player = Minecraft.getMinecraft().player;

                if (!player.isCreative()) {

                    event.setCanceled(true);

                    ModularWarfare.NETWORK.sendToServer(new PacketOpenGui(0));

                }

            }

        }

    }
Обработка пакета:
package com.modularwarfare.common.network;

import com.modularwarfare.ModularWarfare;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetHandler;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.FMLEmbeddedChannel;
import net.minecraftforge.fml.common.network.FMLOutboundHandler;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * ModularWarfare packet handler class. Directs packet data to packet classes.
 *
 * @author ModularWarfare
 * With much inspiration from http://www.minecraftforge.net/wiki/Netty_Packet_Handling
 */
@ChannelHandler.Sharable
public class NetworkHandler extends MessageToMessageCodec<FMLProxyPacket, PacketBase> {
    //Map of channels for each side
    private EnumMap<Side, FMLEmbeddedChannel> channels;
    //The list of registered packets. Should contain no more than 256 packets.
    private LinkedList<Class<? extends PacketBase>> packets = new LinkedList<Class<? extends PacketBase>>();
    //Whether or not ModularWarfare has initialised yet. Once true, no more packets may be registered.
    private boolean modInitialised = false;

    /**
     * Store received packets in these queues and have the main Minecraft threads use these
     */
    private ConcurrentLinkedQueue<PacketBase> receivedPacketsClient = new ConcurrentLinkedQueue<PacketBase>();
    private HashMap<String, ConcurrentLinkedQueue<PacketBase>> receivedPacketsServer = new HashMap<String, ConcurrentLinkedQueue<PacketBase>>();

    /**
     * Registers a packet with the handler
     */
    public boolean registerPacket(Class<? extends PacketBase> cl) {
        if (packets.size() > 256) {
            ModularWarfare.LOGGER.warn("Packet limit exceeded in Modular Warfare packet handler by packet " + cl.getCanonicalName() + ".");
            return false;
        }
        if (packets.contains(cl)) {
            ModularWarfare.LOGGER.warn("Tried to register " + cl.getCanonicalName() + " packet class twice.");
            return false;
        }
        if (modInitialised) {
            ModularWarfare.LOGGER.warn("Tried to register packet " + cl.getCanonicalName() + " after mod initialisation.");
            return false;
        }

        packets.add(cl);
        return true;
    }

    @Override
    protected void encode(ChannelHandlerContext ctx, PacketBase msg, List<Object> out) throws Exception {
        try {
            //Define a new buffer to store our data upon encoding
            ByteBuf encodedData = Unpooled.buffer();
            //Get the packet class
            Class<? extends PacketBase> cl = msg.getClass();

            //If this packet has not been registered by our handler, reject it
            if (!packets.contains(cl))
                throw new NullPointerException("Packet not registered : " + cl.getCanonicalName());

            //Like a packet ID. Stored as the first entry in the packet code for recognition
            byte discriminator = (byte) packets.indexOf(cl);
            encodedData.writeByte(discriminator);
            //Get the packet class to encode our packet
            msg.encodeInto(ctx, encodedData);

            //Convert our packet into a Forge packet to get it through the Netty system
            FMLProxyPacket proxyPacket = new FMLProxyPacket(new PacketBuffer(encodedData.copy()), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
            //Add our packet to the outgoing packet queue
            out.add(proxyPacket);
        } catch (Exception e) {
            ModularWarfare.LOGGER.error("ERROR encoding packet");
            ModularWarfare.LOGGER.throwing(e);
        }
    }

    @Override
    protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception {
        try {
            //Get the encoded data from the incoming packet
            ByteBuf encodedData = msg.payload();
            //Get the class for interpreting this packet
            byte discriminator = encodedData.readByte();
            Class<? extends PacketBase> cl = packets.get(discriminator);

            //If this discriminator returns no class, reject it
            if (cl == null)
                throw new NullPointerException("Packet not registered for discriminator : " + discriminator);

            //Create an empty packet and decode our packet data into it
            PacketBase packet = cl.newInstance();
            packet.decodeInto(ctx, encodedData.slice());
            //Check the side and handle our packet accordingly
            switch (FMLCommonHandler.instance().getEffectiveSide()) {
                case CLIENT: {
                    receivedPacketsClient.offer(packet);
                    //packet.handleClientSide(getClientPlayer());
                    break;
                }
                case SERVER: {
                    INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
                    EntityPlayer player = ((NetHandlerPlayServer) netHandler).player;
                    if (!receivedPacketsServer.containsKey(player.getName()))
                        receivedPacketsServer.put(player.getName(), new ConcurrentLinkedQueue<PacketBase>());
                    receivedPacketsServer.get(player.getName()).offer(packet);
                    //packet.handleServerSide();
                    break;
                }
            }
        } catch (Exception e) {
            ModularWarfare.LOGGER.error("ERROR decoding packet");
            ModularWarfare.LOGGER.throwing(e);
        }
    }

    public void handleClientPackets() {
        for (PacketBase packet = receivedPacketsClient.poll(); packet != null; packet = receivedPacketsClient.poll()) {
            packet.handleClientSide(getClientPlayer());
        }
    }

    public void handleServerPackets() {
        for (String playerName : receivedPacketsServer.keySet()) {
            ConcurrentLinkedQueue<PacketBase> receivedPacketsFromPlayer = receivedPacketsServer.get(playerName);
            EntityPlayerMP player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerByUsername(playerName);
            for (PacketBase packet = receivedPacketsFromPlayer.poll(); packet != null; packet = receivedPacketsFromPlayer.poll()) {
                packet.handleServerSide(player);
            }
        }
    }

    /**
     * Initialisation method called from FMLInitializationEvent in ModularWarfare
     */
    public void initialise() {
        channels = NetworkRegistry.INSTANCE.newChannel("ModularWarfare", this);

        registerPacket(PacketGunFire.class);
        registerPacket(PacketPlaySound.class);
        registerPacket(PacketPlayHitmarker.class);
        registerPacket(PacketGunSwitchMode.class);
        registerPacket(PacketGunReload.class);
        registerPacket(PacketGunReloadSound.class);
        registerPacket(PacketGunAddAttachment.class);
        registerPacket(PacketGunUnloadAttachment.class);
        registerPacket(PacketClientAnimation.class);
        registerPacket(PacketGunTrail.class);
        registerPacket(PacketAimingRequest.class);
        registerPacket(PacketAimingReponse.class);
        registerPacket(PacketDecal.class);
        registerPacket(PacketOpenNormalInventory.class);
        registerPacket(PacketOpenExtraArmorInventory.class);
        registerPacket(PacketSyncBackWeapons.class);
        registerPacket(PacketBulletSnap.class);
        registerPacket(PacketPlayerHit.class);

        registerPacket(PacketSyncExtraSlot.class);
        registerPacket(PacketOpenGui.class);
        registerPacket(PacketExplosion.class);
        registerPacket(PacketClientKillFeedEntry.class);

        registerPacket(PacketFlashClient.class);
    }

    /**
     * Post-Initialisation method called from FMLPostInitializationEvent in ModularWarfare
     * Logically sorts the packets client and server side to ensure a matching ordering
     */
    public void postInitialise() {
        if (modInitialised)
            return;

        modInitialised = true;
        //Define our comparator on the fly and apply it to our list
        Collections.sort(packets,
                new Comparator<Class<? extends PacketBase>>() {
                    @Override
                    public int compare(Class<? extends PacketBase> c1, Class<? extends PacketBase> c2) {
                        int com = String.CASE_INSENSITIVE_ORDER.compare(c1.getCanonicalName(), c2.getCanonicalName());
                        if (com == 0)
                            com = c1.getCanonicalName().compareTo(c2.getCanonicalName());
                        return com;
                    }
                });
    }

    @SideOnly(Side.CLIENT)
    private EntityPlayer getClientPlayer() {
        return Minecraft.getMinecraft().player;
    }

    /**
     * Send a packet to all players
     */
    public void sendToAll(PacketBase packet) {
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
        channels.get(Side.SERVER).writeAndFlush(packet);
    }

    /**
     * Send a packet to a player
     */
    public void sendTo(PacketBase packet, EntityPlayerMP player) {
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
        channels.get(Side.SERVER).writeAndFlush(packet);
    }

    /**
     * Send a packet to all around a point
     */
    public void sendToAllAround(PacketBase packet, NetworkRegistry.TargetPoint point) {
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
        channels.get(Side.SERVER).writeAndFlush(packet);
    }

    /**
     * Send a packet to all in a dimension
     */
    public void sendToDimension(PacketBase packet, int dimensionID) {
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionID);
        channels.get(Side.SERVER).writeAndFlush(packet);
    }

    /**
     * Send a packet to the server
     */
    public void sendToServer(PacketBase packet) {
        channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
        channels.get(Side.CLIENT).writeAndFlush(packet);
    }


    /**
     * Sends this message to everyone tracking an entity.
     * The {@link IMessageHandler} for this message type should be on the CLIENT side.
     * This is not equivalent to {@link #(IMessage, NetworkRegistry.TargetPoint)}
     * because entities have different tracking distances based on their type.
     */
    public void sendToAllTracking(PacketBase packet, Entity entity) {
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TRACKING_ENTITY);
        channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entity);
        channels.get(Side.SERVER).writeAndFlush(packet);
    }

    //Vanilla packets follow

    /**
     * Send a packet to all players
     */
    public void sendToAll(Packet packet) {
        FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendPacketToAllPlayers(packet);
    }

    /**
     * Send a packet to a player
     */
    public void sendTo(Packet packet, EntityPlayerMP player) {
        player.connection.sendPacket(packet);
    }

    /**
     * Send a packet to all around a point
     */
    public void sendToAllAround(Packet packet, NetworkRegistry.TargetPoint point) {
        FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendToAllNearExcept(null, point.x, point.y, point.z, point.range, point.dimension, packet);
    }

    /**
     * Send a packet to all in a dimension
     */
    public void sendToDimension(Packet packet, int dimensionID) {
        FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendPacketToAllPlayersInDimension(packet, dimensionID);
    }

    /**
     * Send a packet to the server
     */
    public void sendToServer(Packet packet) {
        Minecraft.getMinecraft().player.connection.sendPacket(packet);
    }

    /**
     * Send a packet to all around a point without having to create one's own TargetPoint
     */
    public void sendToAllAround(PacketBase packet, double x, double y, double z, float range, int dimension) {
        sendToAllAround(packet, new NetworkRegistry.TargetPoint(dimension, x, y, z, range));
    }
}
 
Последнее редактирование:
779
37
106
Отменяй эвент после того как открываешь инвентарь, иначе всё, что находится дальше, не вызывается.
setCanceled(boolean) - return от мира эвентов (грубо говоря).
И открывать гуишки надо через игрока. У тебя там нигде не открывается ничего.
 
Последнее редактирование:
9
0
Да
PacketOpenGui:
package com.modularwarfare.common.network;

import com.modularwarfare.ModularWarfare;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;

public class PacketOpenGui extends PacketBase {

    public int guiID;

    public PacketOpenGui() {
    }

    public PacketOpenGui(final int guiID) {
        this.guiID = guiID;
    }


    @Override
    public void encodeInto(ChannelHandlerContext ctx, ByteBuf data) {
        data.writeInt(this.guiID);
    }

    @Override
    public void decodeInto(ChannelHandlerContext ctx, ByteBuf data) {
        this.guiID = data.readInt();
    }

    @Override
    public void handleServerSide(EntityPlayerMP entityPlayer) {
        entityPlayer.getServerWorld().addScheduledTask(() -> entityPlayer.openGui(ModularWarfare.INSTANCE, 0, entityPlayer.getServerWorld(), 0, 0, 0));
    }

    @Override
    public void handleClientSide(EntityPlayer entityPlayer) {

    }

}
 
Сверху