Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Luis_ST

Members
  • Joined

  • Last visited

Everything posted by Luis_ST

  1. this is now my Capability Provider: public static class Provider implements ICapabilitySerializable<CompoundNBT> { private ModItemStackHandler inventory = new ModItemStackHandler(); private PlayerEntity player; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> new CombinedInvWrapper(new InvWrapper(player.getInventoryEnderChest()), inventory)); public Provider(PlayerEntity playerIn) { this.player = playerIn; } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty(); } @Override public CompoundNBT serializeNBT() { return inventory.serializeNBT(); } @Override public void deserializeNBT(CompoundNBT nbt) { inventory.deserializeNBT(nbt); } } and now i got this error: java.lang.NullPointerException: The mod Capability<IModItemHandler> is null at net.luis.cave.events.entity.player.interact.block.OnEnderchest.lambda$PlayerInteract$0(OnEnderchest.java:41) ~[main/:?] {re:classloading} at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:292) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.luis.cave.events.entity.player.interact.block.OnEnderchest.PlayerInteract(OnEnderchest.java:40) ~[main/:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_29_OnEnderchest_PlayerInteract_RightClickBlock.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:803) ~[forge:?] {re:classloading} at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:327) ~[forge:?] {re:classloading} at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:986) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:45) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:12) ~[forge:?] {re:classloading} at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:758) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:741) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:735) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:721) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:667) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} RightClickBlock event: @SubscribeEvent public static void PlayerInteract(PlayerInteractEvent.RightClickBlock event) { PlayerEntity player = event.getPlayer(); BlockPos pos = event.getPos(); World world = event.getWorld(); BlockState state = world.getBlockState(pos); if (state.getBlock() == Blocks.ENDER_CHEST) { if (player instanceof ServerPlayerEntity) { event.setCanceled(true); ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; IItemHandlerModifiable itemHandlerModifiable = serverPlayer.getCapability(ModCapability.CAPABILITY, null).orElseThrow( () -> new NullPointerException("The mod Capability<IModItemHandler> is null")); if (itemHandlerModifiable != null) { NetworkHooks.openGui(serverPlayer, new SimpleNamedContainerProvider((id, inventory, playerIn) -> { return new ModEnderChestContainer(id, inventory, itemHandlerModifiable); }, CONTAINER_NAME), pos); } } } }
  2. like this: IItemHandlerModifiable itemHandlerModifiable = serverPlayer.getCapability(ModCapability.CAPABILITY, null).orElseThrow( () -> new NullPointerException("The mod Capability<IModItemHandler> is null")); why in the supplier? does it work on this way: if (!optional.isPresent()) { optional = LazyOptional.of(() -> { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); return invWrapper; }); } return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty();
  3. um den inhalt einer LazyOptional zu bekommen makes sense that means that should work now: private ModItemStackHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); private PlayerEntity player; public Provider(PlayerEntity playerIn) { this.player = playerIn; } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (!optional.isPresent()) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); optional = LazyOptional.of(() -> invWrapper); } return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty(); }
  4. I've tried a long time to find out is there another possibility? AttachCapabilitiesEvent: @SubscribeEvent public static void AttachCapabilities(AttachCapabilitiesEvent<Entity> event) { if (event.getObject() instanceof PlayerEntity && !(event.getObject() instanceof FakePlayer)) { PlayerEntity player = (PlayerEntity) event.getObject(); event.addCapability(new ResourceLocation("cave:extended_enderchest_gui"), new ModCapability.Provider(player)); } } PlayerInteractEvent: @SubscribeEvent public static void PlayerInteract(PlayerInteractEvent.RightClickBlock event) { PlayerEntity player = event.getPlayer(); BlockPos pos = event.getPos(); World world = event.getWorld(); BlockState state = world.getBlockState(pos); if (state.getBlock() == Blocks.ENDER_CHEST) { if (player instanceof ServerPlayerEntity) { event.setCanceled(true); ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; AtomicReference<IItemHandlerModifiable> itemHandlerModifiable = new AtomicReference<>(); Cave.LOGGER.debug("is my Present: " + serverPlayer.getCapability(ModCapability.CAPABILITY, null).isPresent()); serverPlayer.getCapability(ModCapability.CAPABILITY, null).ifPresent(capability -> itemHandlerModifiable.set(capability)); NetworkHooks.openGui(serverPlayer, new SimpleNamedContainerProvider((id, inventory, playerIn) -> { return new ModEnderChestContainer(id, inventory, itemHandlerModifiable.get()); }, CONTAINER_NAME), pos); } } } and my Capability (without Storage and Factory): public class ModCapability { @CapabilityInject(IModItemHandler.class) public static Capability<IModItemHandler> CAPABILITY = null; public ModCapability() { CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory()); } public static class Provider implements ICapabilitySerializable<CompoundNBT> { private ModItemStackHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); private PlayerEntity player; public Provider(PlayerEntity playerIn) { this.player = playerIn; } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (optional == null) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); optional = LazyOptional.of(() -> invWrapper); } return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty(); } @Override public CompoundNBT serializeNBT() { return inventory.serializeNBT(); } @Override public void deserializeNBT(CompoundNBT nbt) { inventory.deserializeNBT(nbt); } } }
  5. then it should work that way...? another thing i use AtomicReference to get the IItemHandlerModifiable: AtomicReference<IItemHandlerModifiable> itemHandlerModifiable = new AtomicReference<>(); serverPlayer.getCapability(ModCapability.CAPABILITY, null).ifPresent(capability -> itemHandlerModifiable.set(capability)); it should work like this because I've done it before with CapabilityItemHandler. But when I then right click the enderchest i got an error the IItemHandlerModifiable is null. when i use the debugger i get this: Cave.LOGGER.debug("is my Present: " + serverPlayer.getCapability(ModCapability.CAPABILITY, null).isPresent()); [10:11:46] [Server thread/DEBUG] [ne.lu.ca.Cave/]: is my Present: false but my AttachCapabilitiesEvent is executed so why is my capability null?
  6. i just looked at the register class of ContainerType (IForgeContainerType) and this class only needs a single parameter, the IContainerFactory therefore I don't understand what i should add as a parameter
  7. I found the error myself Sorry, I don't understand what you mean by parameters exactly, do I need to add something to my containertype? this is my containerType: public static final DeferredRegister<ContainerType<?>> CONTAINERS = DeferredRegister.create(ForgeRegistries.CONTAINERS, Cave.Mod_Id); public static final RegistryObject<ContainerType<ModEnderChestContainer>> ENDER_CHEST = CONTAINERS.register("mod_ender_chest", () -> IForgeContainerType.create(ModEnderChestContainer::new));
  8. what are you telling me? how do I register the IContainer Factory?
  9. i already have a constructor. but what do I have to do with IItemHandlerModifiable, how do I get an inventory from it beacuse when i want to add the solts i need an IInventory? nop but it return a LazyOptional which holds the IModItemHandler
  10. if i understand correctly i have to call the OContainerFactory in my code ? beacuse i got an error: "The constructor ModEnderChestContainer(int, PlayerInventory, IItemHandlerModifiable) is undefined" do i have to set a cast?
  11. that is what I have already created, what do I have to change here so that it works: is that server or client side? and how created i the other side? ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; IItemHandlerModifiable itemHandlerModifiable = (IModItemHandler) serverPlayer.getCapability(ModCapability.CAPABILITY); NetworkHooks.openGui(serverPlayer, new SimpleNamedContainerProvider((id, inventory, playerIn) -> { return new ModEnderChestContainer(id, inventory, itemHandlerModifiable); }, CONTAINER_NAME), pos);
  12. I have to open the container twice, once on the client and on the server? and if so I have to check with world.isRemote (client) and !world.isRemote (server) and my IItemHandlerModifiable I get from the player with getCapability? Whats the best way to do this?
  13. this is now my container class: Do I need the IInventory in the second constructor? If so, where do I get the inventory from when I open a container (from my Capability). if not what do I have to use instead public class ModEnderChestContainer extends Container { public ModEnderChestContainer(int id, PlayerInventory playerInventoryIn, PacketBuffer extraData) { super(ModContainerType.ENDER_CHEST.get(), id); } public ModEnderChestContainer(int id, PlayerInventory playerInventoryIn, IInventory inventory) { super(ModContainerType.ENDER_CHEST.get(), id); assertInventorySize(inventory, 6 * 9); int i = (6 - 4) * 18; for (int j = 0; j < 6; ++j) { for (int k = 0; k < 9; ++k) { this.addSlot(new Slot(inventory, k + j * 9, 8 + k * 18, 18 + j * 18)); } } for (int l = 0; l < 3; ++l) { for (int j1 = 0; j1 < 9; ++j1) { this.addSlot(new Slot(playerInventoryIn, j1 + l * 9 + 9, 8 + j1 * 18, 103 + l * 18 + i)); } } for (int i1 = 0; i1 < 9; ++i1) { this.addSlot(new Slot(playerInventoryIn, i1, 8 + i1 * 18, 161 + i)); } } public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { ItemStack itemstack = ItemStack.EMPTY; Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index < 6 * 9) { if (!this.mergeItemStack(itemstack1, 6 * 9, this.inventorySlots.size(), true)) { return ItemStack.EMPTY; } } else if (!this.mergeItemStack(itemstack1, 0, 6 * 9, false)) { return ItemStack.EMPTY; } if (itemstack1.isEmpty()) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } } return itemstack; } @Override public boolean canInteractWith(PlayerEntity playerIn) { return true; } }
  14. can i create a container like a chest? since the constructor of the chest contains an IInventory but I don't have one (like a chest has the tileentity) or do I need my capability there
  15. the error must be in the container because I have already checked everything else. i think i know where in the container i have to use the capability in the conatiner but i don't know how exactly. I know that I have to use the PlayerEntity#getCapability method, but what do I have to do with it? public class ModEnderChestContainer extends Container implements INamedContainerProvider { private static final ITextComponent CONTAINER_NAME = new TranslationTextComponent("container.enderchest"); public ModEnderChestContainer(int id, PlayerInventory playerInventory, PacketBuffer buffer) { super(ModContainerType.ENDER_CHEST.get(), id); } public ModEnderChestContainer(int id, PlayerInventory playerInventory) { super(ModContainerType.ENDER_CHEST.get(), id); } @Override public Container createMenu(int id, PlayerInventory playerInventoryIn, PlayerEntity player) { return ChestContainer.createGeneric9X3(id, playerInventoryIn); } @Override public ITextComponent getDisplayName() { return CONTAINER_NAME; } @Override public boolean canInteractWith(PlayerEntity playerIn) { return true; } public static ITextComponent getContainerName() { return CONTAINER_NAME; } }
  16. I fixed it. the problem with the slots remains my gui has no slots. and the screen is rendering weird but this is akulie the problem of the screenclass. but what must i change that the gui has the slots
  17. I forgot to take it from the constructor and didn't look at the code anymore🤦‍♂️ what do I have to change because the enderchest's normal inventory is currently being opened? this is the event i use: @Mod.EventBusSubscriber(modid=Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.FORGE) public class OnEnderchest { @SubscribeEvent public static void PlayerInteract(PlayerInteractEvent.RightClickBlock event) { PlayerEntity player = event.getPlayer(); BlockPos pos = event.getPos(); World world = event.getWorld(); BlockState state = world.getBlockState(pos); if (state.getBlock() == Blocks.ENDER_CHEST) { if (player instanceof ServerPlayerEntity) { event.setCanceled(true); ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; NetworkHooks.openGui(serverPlayer, new SimpleNamedContainerProvider((id, inventory, playerIn) -> { return new ModEnderChestContainer(id, inventory); }, ModEnderChestContainer.getContainerName()), pos); } } } } and the gui has no slots and looks like this:
  18. okay now this is my code: package net.luis.cave.init; import java.util.concurrent.Callable; import net.luis.cave.api.capability.IModItemHandler; import net.luis.cave.api.capability.ModItemStackHandler; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EnderChestInventory; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.INBT; import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability.IStorage; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import net.minecraftforge.items.wrapper.InvWrapper; public class ModCapability { @CapabilityInject(IModItemHandler.class) public static Capability<IModItemHandler> CAPABILITY = null; public ModCapability() { CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory()); } private static class Storage implements IStorage<IModItemHandler> { @Override public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) { return null; } @Override public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) { } } private static class Factory implements Callable<IModItemHandler> { @Override public IModItemHandler call() throws Exception { return null; } } public static class Provider implements ICapabilitySerializable<CompoundNBT> { private ModItemStackHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); private PlayerEntity player; public Provider(PlayerEntity playerIn) { this.player = playerIn; EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (optional == null) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); optional = LazyOptional.of(() -> invWrapper); } return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty(); } @Override public CompoundNBT serializeNBT() { return inventory.serializeNBT(); } @Override public void deserializeNBT(CompoundNBT nbt) { inventory.deserializeNBT(nbt); } } } but i got the same error again
  19. So I have to check getCapability whether the fields == are null, if they are the fields to initiate (call the same code that is in the constuctor)? so like this: @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (optional == null || inventory == null || invWrapper == null) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); optional = LazyOptional.of(() -> invWrapper); } return cap == CAPABILITY && cap != null ? (LazyOptional<T>) optional : LazyOptional.empty(); }
  20. I've understood that now, but which class / method do you mean exactly because I can't find a class with the name lazily initialize
  21. and how to do that? In addition, the error is not in getCapability but in the constructor because I call the constructor with the AttachCapabilitiesEvent and not getCapability public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); // -> invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); }
  22. What do you mean by "lazy initialization", does a simple "! = null" not work?
  23. so i have to create a temporary inventory or is there a way to initialize the inventory directly in the event? Or is there another way to add the capability to the player?
  24. i wasn't sure either but i tested it and when i used the method the block has a light level
  25. this is now my Capability but is this correct? public class ModCapability { @CapabilityInject(IModItemHandler.class) public static Capability<IModItemHandler> CAPABILITY = null; public ModCapability() { CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory()); } private static class Storage implements IStorage<IModItemHandler> { @Override public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) { return null; } @Override public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) { } } private static class Factory implements Callable<IModItemHandler> { @Override public IModItemHandler call() throws Exception { return null; } } public static class Provider implements ICapabilitySerializable<CompoundNBT> { private ModItemStackHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } @Override public CompoundNBT serializeNBT() { return inventory.serializeNBT(); } @Override public void deserializeNBT(CompoundNBT nbt) { inventory.deserializeNBT(nbt); } } } but when i now start the game i got an error: 2:21:05] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "net.minecraft.inventory.IInventory.getSizeInventory()" because the return value of "net.minecraftforge.items.wrapper.InvWrapper.getInv()" is null Index: 1 Listeners: 0: NORMAL 1: ASM: class net.luis.cave.events.capability.OnAttachCapabilitiesEvent AttachCapabilities(Lnet/minecraftforge/event/AttachCapabilitiesEvent;)V java.lang.NullPointerException: Cannot invoke "net.minecraft.inventory.IInventory.getSizeInventory()" because the return value of "net.minecraftforge.items.wrapper.InvWrapper.getInv()" is null at net.minecraftforge.items.wrapper.InvWrapper.getSlots(InvWrapper.java:61) at net.minecraftforge.items.wrapper.CombinedInvWrapper.<init>(CombinedInvWrapper.java:42) at net.luis.cave.init.ModCapability$Provider.<init>(ModCapability.java:61) at net.luis.cave.events.capability.OnAttachCapabilitiesEvent.AttachCapabilities(OnAttachCapabilitiesEvent.java:23) at net.minecraftforge.eventbus.ASMEventHandler_16_OnAttachCapabilitiesEvent_AttachCapabilities_AttachCapabilitiesEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:579) at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:573) at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48) at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44) at net.minecraft.entity.Entity.<init>(Entity.java:221) at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207) at net.minecraft.entity.player.PlayerEntity.<init>(PlayerEntity.java:160) at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:182) at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:419) at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:122) at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:66) at net.minecraft.network.NetworkManager.tick(NetworkManager.java:244) at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:151) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:898) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84) at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663) at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) at java.base/java.lang.Thread.run(Thread.java:832) [12:21:05] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 5f9c0c16-6096-44b4-a0a3-48d79100f726 [12:21:05] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking memory connection at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:154) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:898) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.inventory.IInventory.getSizeInventory()" because the return value of "net.minecraftforge.items.wrapper.InvWrapper.getInv()" is null at net.minecraftforge.items.wrapper.InvWrapper.getSlots(InvWrapper.java:61) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.items.wrapper.CombinedInvWrapper.<init>(CombinedInvWrapper.java:42) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.luis.cave.init.ModCapability$Provider.<init>(ModCapability.java:61) ~[main/:?] {re:classloading} at net.luis.cave.events.capability.OnAttachCapabilitiesEvent.AttachCapabilities(OnAttachCapabilitiesEvent.java:23) ~[main/:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_16_OnAttachCapabilitiesEvent_AttachCapabilities_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:579) ~[forge:?] {re:classloading} at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:573) ~[forge:?] {re:classloading} at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48) ~[forge:?] {re:classloading} at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44) ~[forge:?] {re:classloading} at net.minecraft.entity.Entity.<init>(Entity.java:221) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207) ~[forge:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.<init>(PlayerEntity.java:160) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:182) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:419) ~[forge:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:122) ~[forge:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:66) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkManager.tick(NetworkManager.java:244) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:151) ~[forge:?] {re:classloading} ... 6 more

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.