• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Wtf. That should not be possible. Please post a Git repo of your mod.
    • I've been running a modded 1.15.2 run and just got this crash. I've enchanted before without issue, but I enchanted a stone sword and attempted to hover over to see the enchants, and this report came up. From what I can tell it's a strange interaction between forge, optifine, quark, and apotheosis with enchantment, but I could be wrong, and I'm not sure if it's solely on the mod-side or something with forge. I wasn't able to find info on this crash on any of those mod pages, and I replicated the crash in the player inventory as well as the enchanting table GUI. Any help would be greatly appreciated!    
    • I was aware that my array solution is not the best, thanks for the tip.   The error only shows up if i call NetworkHooks.openGui.
    • First of all, ifPresent is just not the right choice here, as you can see by the ugly 1-element-array-hack you have to do. You most likely want orElseThrow.   The error you see here is not caused by the GUI code at all. It is called by you sending a custom payload packet without registering the channel properly.
    • Hello, i'm trying to create a new crafting table but i always get the same error while trying to open the container: [m[33m[20:11:54] [Render thread/WARN] [minecraft/ClientPlayNetHandler]: Unknown custom packet identifier: professionsmod:main My Crafting Table Block Code: public class SmithCraftingTableBlock extends Block{ public SmithCraftingTableBlock(Properties properties) { super(properties); } @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ActionResultType type[] = { ActionResultType.PASS }; if (worldIn.isRemote) { player.getCapability(CapabilityProfession.PROFESSION, null).ifPresent(iProfession -> { if(iProfession.getProfession() == profession.SMITH) { type[0] = ActionResultType.SUCCESS; } }); return type[0]; } else { player.getCapability(CapabilityProfession.PROFESSION, null).ifPresent(iProfession -> { if(iProfession.getProfession() == profession.SMITH) { type[0] = ActionResultType.SUCCESS; NetworkHooks.openGui((ServerPlayerEntity) player, new SmithContainerProvider(pos)); } }); return type[0]; } } }   ContainerProvider: public class SmithContainerProvider implements INamedContainerProvider{ //private BlockPos pos; private static final ITextComponent name = new TranslationTextComponent("container.smithcrafting"); //public SmithContainerProvider(BlockPos pos) { // this.pos = pos; //} @Override public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity p_createMenu_3_) { return new SmithCraftingContainer(windowId, playerInventory/*, new PacketBuffer(Unpooled.buffer(8, 8)).writeBlockPos(pos)*/); } @Override public ITextComponent getDisplayName() { return name; } }   I believe the problem is caused by NetworkHooks.openGui because i'm probably not sending the PacketBuffer the right way. I tried it in many different ways and i suspect that the error was sent from handleCustomPayload in ClientPlayNetHandler, however, i can't figure out a possible solution. If i do this with TileEntity, then there is no such problem. Everything else works fine. Your help would be greatly appreciated.   PS: This is my first time ever using a forum. Some parts of the code are really ugly in my opinion but i'm only a beginner. Atleast i understand most Java and OOP concepts.  
  • Topics

  • Who's Online (See full list)