Jump to content

The game crashed whilst exception in server tick loop Error: java.lang.NoSuchMethodError: 'void


Recommended Posts

Hey been wanting to get back into modded minecraft for a solo play and ive been running into this error and cant figure out what is causing. I thought it could have been optifine causing the issue and removed it from the folder but the issue still persists. it also looks like it only happens when i open up the settings menu.

Anyone have any ideads what it could be? 

My Error Log:

---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 2024-08-12 22:55:31
Description: Exception in server tick loop

java.lang.NoSuchMethodError: 'void net.minecraft.nbt.NbtIo.m_128955_(net.minecraft.nbt.CompoundTag, java.io.File)'
    at com.supermartijn642.chunkloaders.capability.PlayerActivityTracker.onWorldSave(PlayerActivityTracker.java:125) ~[Chunk-Loaders-Mod-Forge-1.20.4.jar!/:?] {re:classloading}
    at com.supermartijn642.chunkloaders.capability.__PlayerActivityTracker_onWorldSave_Save.invoke(.dynamic) ~[Chunk-Loaders-Mod-Forge-1.20.4.jar!/:?] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:58) ~[eventbus-6.2.0.jar!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:300) ~[eventbus-6.2.0.jar!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:281) ~[eventbus-6.2.0.jar!/:?] {}
    at net.minecraft.server.level.ServerLevel.m_8643_(ServerLevel.java:766) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.m_129885_(MinecraftServer.java:513) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver}
    at net.minecraft.client.server.IntegratedServer.m_129885_(IntegratedServer.java:449) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,xf:OptiFine:default}
    at net.minecraft.server.MinecraftServer.m_195514_(MinecraftServer.java:538) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver}
    at net.minecraft.client.server.IntegratedServer.m_5705_(IntegratedServer.java:112) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,xf:OptiFine:default}
    at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:673) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver}
    at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:256) ~[forge-1.20.4-49.0.51-client.jar!/:?] {re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver}
    at java.lang.Thread.run(Thread.java:833) ~[?:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.20.4
    Minecraft Version ID: 1.20.4
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 17.0.8, Microsoft
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
    Memory: 833957184 bytes (795 MiB) / 2147483648 bytes (2048 MiB) up to 2147483648 bytes (2048 MiB)
    CPUs: 12
    Processor Vendor: GenuineIntel
    Processor Name: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    Identifier: Intel64 Family 6 Model 158 Stepping 10
    Microarchitecture: Coffee Lake
    Frequency (GHz): 3.70
    Number of physical packages: 1
    Number of physical CPUs: 6
    Number of logical CPUs: 12
    Graphics card #0 name: NVIDIA GeForce RTX 3060
    Graphics card #0 vendor: NVIDIA (0x10de)
    Graphics card #0 VRAM (MB): 4095.00
    Graphics card #0 deviceId: 0x2487
    Graphics card #0 versionInfo: DriverVersion=32.0.15.6081
    Memory slot #0 capacity (MB): 8192.00
    Memory slot #0 clockSpeed (GHz): 3.20
    Memory slot #0 type: DDR4
    Memory slot #1 capacity (MB): 8192.00
    Memory slot #1 clockSpeed (GHz): 3.20
    Memory slot #1 type: DDR4
    Virtual memory max (MB): 28591.44
    Virtual memory used (MB): 13628.16
    Swap memory total (MB): 12288.00
    Swap memory used (MB): 28.00
    JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    Server Running: true
    Player Count: 1 / 8; [ServerPlayer['MrZero3'/261, l='ServerLevel[OF SOLO]', x=0.00, y=-6.00, z=0.00]]
    Data Packs: vanilla, mod:elevatorid, mod:mixinextras (incompatible), mod:supermartijn642configlib (incompatible), mod:distanthorizons (incompatible), mod:corail_spawners (incompatible), mod:jei (incompatible), mod:supermartijn642corelib (incompatible), mod:puzzleslib (incompatible), mod:chunkloaders (incompatible), mod:forgeconfigapiport (incompatible), mod:xbackpack (incompatible), mod:fallingtree (incompatible), mod:forge (incompatible), mod:xaerominimap (incompatible), mod:spikyspikes (incompatible)
    Enabled Feature Flags: minecraft:vanilla
    World Generation: Stable
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'
    Launched Version: 1.20.4-forge-49.0.51
    OptiFine Version: OptiFine_1.20.4_HD_U_I7
    OptiFine Build: 20240317-172634
    Render Distance Chunks: 12
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: RedHat_v34.1.zip
    OpenGlVersion: 4.6.0 NVIDIA 560.81
    OpenGlRenderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 12
    ModLauncher: 10.1.2
    ModLauncher launch target: forge_client
    ModLauncher naming: srg
    ModLauncher services: 
        / slf4jfixer PLUGINSERVICE 
        / runtimedistcleaner PLUGINSERVICE 
        / runtime_enum_extender PLUGINSERVICE 
        / object_holder_definalize PLUGINSERVICE 
        / capability_token_subclass PLUGINSERVICE 
        / accesstransformer PLUGINSERVICE 
        / eventbus PLUGINSERVICE 
        / mixin PLUGINSERVICE 
        / OptiFine TRANSFORMATIONSERVICE 
        / fml TRANSFORMATIONSERVICE 
        / mixin TRANSFORMATIONSERVICE 
    FML Language Providers: 
        lowcodefml@49
        [email protected]
        [email protected]
    Mod List: 
        forge-1.20.4-49.0.51-client.jar                   |Minecraft                     |minecraft                     |1.20.4              |DONE      |Manifest: NOSIGNATURE
        OpenBlocks-Elevator-Mod-Forge-1.20.4.jar          |Elevator Mod                  |elevatorid                    |1.20.4-1.9.2-forge  |DONE      |Manifest: NOSIGNATURE
        mixinextras-forge-0.3.5.jar                       |MixinExtras                   |mixinextras                   |0.3.5               |DONE      |Manifest: NOSIGNATURE
        SuperMartijn642s-Config-Lib-Forge-1.20.4.jar      |SuperMartijn642's Config Libra|supermartijn642configlib      |1.1.8               |DONE      |Manifest: NOSIGNATURE
        Distant-Horizons-Mod-Forge-1.20.4.jar             |Distant Horizons              |distanthorizons               |2.0.4-a-dev         |DONE      |Manifest: NOSIGNATURE
        Corail-Spawners-Mod-Forge-1.20.4.jar              |Corail Spawners               |corail_spawners               |1.20.2-035          |DONE      |Manifest: NOSIGNATURE
        jei-1.20.4-forge-17.3.0.2.jar                     |Just Enough Items             |jei                           |17.3.0.2            |DONE      |Manifest: NOSIGNATURE
        SuperMartijn642s-Core-Lib-Mod-Forge-1.20.4.jar    |SuperMartijn642's Core Lib    |supermartijn642corelib        |1.1.16a             |DONE      |Manifest: NOSIGNATURE
        Puzzles-Lib-Mod-Forge-1.20.4.jar                  |Puzzles Lib                   |puzzleslib                    |20.4.42             |DONE      |Manifest: NOSIGNATURE
        Chunk-Loaders-Mod-Forge-1.20.4.jar                |Chunk Loaders                 |chunkloaders                  |1.2.8a              |DONE      |Manifest: NOSIGNATURE
        Forge-Config-API-Port-Mod-Forge-1.20.4.jar        |Forge Config API Port         |forgeconfigapiport            |20.4.3              |DONE      |Manifest: NOSIGNATURE
        XBackpack-Mod-Forge-1.20.4.jar                    |XBackpack                     |xbackpack                     |1.20.4-4.0.0        |DONE      |Manifest: NOSIGNATURE
        Falling-Tree-Mod-Forge-Fabric-1.20.4.jar          |FallingTree                   |fallingtree                   |1.20.4.3            |DONE      |Manifest: NOSIGNATURE
        forge-1.20.4-49.0.51-universal.jar                |Forge                         |forge                         |49.0.51             |DONE      |Manifest: NOSIGNATURE
        Xaeros-Minimap-Mod-Forge-1.20.4.jar               |Xaero's Minimap               |xaerominimap                  |24.2.0              |DONE      |Manifest: NOSIGNATURE
        SpikySpikes-v20.4.1-1.20.4-Forge.jar              |Spiky Spikes                  |spikyspikes                   |20.4.1              |DONE      |Manifest: NOSIGNATURE
    Crash Report UUID: 5e2f2930-0369-408a-8a51-db84c1d555ce
    FML: 0.0
    Forge: net.minecraftforge:49.0.51

Edited by Shinsai
Missing info
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am creating a mod that adds new armor sets and changes how armor sets are crafted. When the player interacts with the block it fails to open the gui, but I get no error or stacktrace. All of my registration classes are being called correctly. LightArmorBenchScreen's constructor, render, and renderbg methods are not being called at all. Here is the code: package net.leeveygames.celestial.blocks.custom; import net.leeveygames.celestial.Celestial; import net.leeveygames.celestial.blocks.entity.CelestialBlockEntities; import net.leeveygames.celestial.blocks.entity.LightArmorBenchBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseEntityBlock; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.network.NetworkHooks; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class LightArmorBenchBlock extends BaseEntityBlock { public static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 12, 16); public LightArmorBenchBlock(Properties pProperties) { super(pProperties); } @Override public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { return SHAPE; } @Override public RenderShape getRenderShape(BlockState pState) { return RenderShape.MODEL; } @Override public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) { if (pState.getBlock() != pNewState.getBlock()) { BlockEntity blockEntity = pLevel.getBlockEntity(pPos); if (blockEntity instanceof LightArmorBenchBlockEntity) { ((LightArmorBenchBlockEntity) blockEntity).drops(); } } super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving); } @NotNull @Override public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHit) { if(pLevel.isClientSide()) return InteractionResult.SUCCESS; BlockEntity be = pLevel.getBlockEntity(pPos); if (be instanceof LightArmorBenchBlockEntity blockEntity) { ServerPlayer player = (ServerPlayer)pPlayer; Celestial.LOGGER.info("Opening Screen."); NetworkHooks.openScreen(player, blockEntity, pPos); } return InteractionResult.CONSUME; } @Nullable @Override public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { return new LightArmorBenchBlockEntity(pPos, pState); } @Nullable @Override public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) { if(pLevel.isClientSide()) { return null; } return createTickerHelper(pBlockEntityType, CelestialBlockEntities.LIGHT_ARMOR_BENCH_BLOCK_ENTITY.get(), (pLevel1, pPos, pState1, pBlockEntity) -> pBlockEntity.tick(pLevel1, pPos, pState1)); } }   package net.leeveygames.celestial.screen; import net.leeveygames.celestial.Celestial; import net.leeveygames.celestial.blocks.CelestialBlocks; import net.leeveygames.celestial.blocks.entity.LightArmorBenchBlockEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.*; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.SlotItemHandler; public class LightArmorBenchMenu extends AbstractContainerMenu { public final LightArmorBenchBlockEntity blockEntity; private final Level level; public LightArmorBenchMenu(int pContainerId, Inventory inv, FriendlyByteBuf extraData) { this(pContainerId, inv, inv.player.level().getBlockEntity(extraData.readBlockPos())); Celestial.LOGGER.info("Creating Light Armor Bench Menu. Client"); } public LightArmorBenchMenu(int pContainerId, Inventory inv, BlockEntity entity) { super(CelestialMenuTypes.LIGHT_ARMOR_BENCH_MENU.get(), pContainerId); Celestial.LOGGER.info("Creating Light Armor Bench Menu. Server"); checkContainerSize(inv, 2); blockEntity = ((LightArmorBenchBlockEntity) entity); this.level = inv.player.level(); addPlayerInventory(inv); addPlayerHotbar(inv); createLightArmorBenchSlots(blockEntity); } private void createLightArmorBenchSlots(LightArmorBenchBlockEntity blockEntity) { Celestial.LOGGER.info("Creating Light Armor Bench Slots."); this.blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { this.addSlot(new SlotItemHandler(iItemHandler, 0, 11, 15)); this.addSlot(new SlotItemHandler(iItemHandler, 1, 82, 33)); this.addSlot(new SlotItemHandler(iItemHandler, 2, 133, 33)); }); } // CREDIT GOES TO: diesieben07 | https://github.com/diesieben07/SevenCommons // must assign a slot number to each of the slots used by the GUI. // For this container, we can see both the tile inventory's slots as well as the player inventory slots and the hotbar. // Each time we add a Slot to the container, it automatically increases the slotIndex, which means // 0 - 8 = hotbar slots (which will map to the InventoryPlayer slot numbers 0 - 8) // 9 - 35 = player inventory slots (which map to the InventoryPlayer slot numbers 9 - 35) // 36 - 44 = TileInventory slots, which map to our TileEntity slot numbers 0 - 8) private static final int HOTBAR_SLOT_COUNT = 9; private static final int PLAYER_INVENTORY_ROW_COUNT = 3; private static final int PLAYER_INVENTORY_COLUMN_COUNT = 9; private static final int PLAYER_INVENTORY_SLOT_COUNT = PLAYER_INVENTORY_COLUMN_COUNT * PLAYER_INVENTORY_ROW_COUNT; private static final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT; private static final int VANILLA_FIRST_SLOT_INDEX = 0; private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT; // THIS YOU HAVE TO DEFINE! private static final int TE_INVENTORY_SLOT_COUNT = 2; // must be the number of slots you have! @Override public ItemStack quickMoveStack(Player playerIn, int pIndex) { Slot sourceSlot = slots.get(pIndex); if (sourceSlot == null || !sourceSlot.hasItem()) return ItemStack.EMPTY; //EMPTY_ITEM ItemStack sourceStack = sourceSlot.getItem(); ItemStack copyOfSourceStack = sourceStack.copy(); // Check if the slot clicked is one of the vanilla container slots if (pIndex < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) { // This is a vanilla container slot so merge the stack into the tile inventory if (!moveItemStackTo(sourceStack, TE_INVENTORY_FIRST_SLOT_INDEX, TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT, false)) { return ItemStack.EMPTY; // EMPTY_ITEM } } else if (pIndex < TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT) { // This is a TE slot so merge the stack into the players inventory if (!moveItemStackTo(sourceStack, VANILLA_FIRST_SLOT_INDEX, VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT, false)) { return ItemStack.EMPTY; } } else { System.out.println("Invalid slotIndex:" + pIndex); return ItemStack.EMPTY; } // If stack size == 0 (the entire stack was moved) set slot contents to null if (sourceStack.getCount() == 0) { sourceSlot.set(ItemStack.EMPTY); } else { sourceSlot.setChanged(); } sourceSlot.onTake(playerIn, sourceStack); return copyOfSourceStack; } @Override public boolean stillValid(Player pPlayer) { return stillValid(ContainerLevelAccess.create(level, blockEntity.getBlockPos()), pPlayer, CelestialBlocks.LIGHT_ARMOR_BENCH.get()); } private void addPlayerInventory(Inventory playerInventory) { Celestial.LOGGER.info("Creating Player Inventory."); for (int i = 0; i < 3; ++i) { for (int l = 0; l < 9; ++l) { this.addSlot(new Slot(playerInventory, l + i * 9 + 9, 8 + l * 18, 84 + i * 18)); } } } private void addPlayerHotbar(Inventory playerInventory) { Celestial.LOGGER.info("Creating Player Hotbar."); for (int i = 0; i < 9; ++i) { this.addSlot(new Slot(playerInventory, i, 8 + i * 18, 142)); } } }   package net.leeveygames.celestial.screen; import com.mojang.blaze3d.systems.RenderSystem; import net.leeveygames.celestial.Celestial; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; public class LightArmorBenchScreen extends AbstractContainerScreen<LightArmorBenchMenu> { private static final ResourceLocation TEXTURE = new ResourceLocation(Celestial.MOD_ID, "textures/gui/LightArmorBenchGUI.png"); public LightArmorBenchScreen(LightArmorBenchMenu pMenu, Inventory pPlayerInventory, Component pTitle) { super(pMenu, pPlayerInventory, pTitle); Celestial.LOGGER.info("Creating Light Armor Bench Screen."); this.imageWidth = 176; this.imageHeight = 166; } @Override protected void init() { Celestial.LOGGER.info("Screen init."); super.init(); } @Override protected void renderBg(GuiGraphics guiGraphics, float pPartialTick, int pMouseX, int pMouseY) { Celestial.LOGGER.info("Render Background Method."); RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, TEXTURE); guiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); } @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) { Celestial.LOGGER.info("Render Method."); renderBackground(guiGraphics); super.render(guiGraphics, mouseX, mouseY, delta); renderTooltip(guiGraphics, mouseX, mouseY); } }   package net.leeveygames.celestial.blocks.entity; import net.leeveygames.celestial.screen.LightArmorBenchMenu; import net.minecraft.client.gui.screens.inventory.FurnaceScreen; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.Container; import net.minecraft.world.Containers; import net.minecraft.world.MenuProvider; import net.minecraft.world.SimpleContainer; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ContainerData; import net.minecraft.world.inventory.FurnaceMenu; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class LightArmorBenchBlockEntity extends BlockEntity implements MenuProvider { private final ItemStackHandler itemHandler = new ItemStackHandler(3) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); LightArmorBenchBlockEntity.this.setChanged(); } }; private static final int INPUT_SLOT = 0; private static final int OUTPUT_SLOT = 1; private LazyOptional<IItemHandler> lazyItemHandler = LazyOptional.empty(); public LightArmorBenchBlockEntity(BlockPos pPos, BlockState pBlockState) { super(CelestialBlockEntities.LIGHT_ARMOR_BENCH_BLOCK_ENTITY.get(), pPos, pBlockState); } @Override public @NotNull <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) { if(cap == ForgeCapabilities.ITEM_HANDLER) { return lazyItemHandler.cast(); } return super.getCapability(cap, side); } @Override public void onLoad() { super.onLoad(); lazyItemHandler = LazyOptional.of(() -> itemHandler); } @Override public void invalidateCaps() { super.invalidateCaps(); lazyItemHandler.invalidate(); } public void drops() { SimpleContainer inventory = new SimpleContainer(itemHandler.getSlots()); for(int i = 0; i < itemHandler.getSlots(); i++) { inventory.setItem(i, itemHandler.getStackInSlot(i)); } Containers.dropContents(this.level, this.worldPosition, inventory); } @Override public Component getDisplayName() { return Component.translatable("block.celestial.light_armor_bench"); } @Nullable @Override public AbstractContainerMenu createMenu(int pContainerId, Inventory pPlayerInventory, Player pPlayer) { return new LightArmorBenchMenu(pContainerId, pPlayerInventory, this); } @Override protected void saveAdditional(CompoundTag pTag) { pTag.put("inventory", itemHandler.serializeNBT()); super.saveAdditional(pTag); } @Override public void load(CompoundTag pTag) { super.load(pTag); itemHandler.deserializeNBT(pTag.getCompound("inventory")); } public void tick(Level pLevel, BlockPos pPos, BlockState pState) { } }   Here is the console output: https://pastebin.com/krgExnYT
    • I couldn't find much usage, I found this and attempted to implement it. It doesn't seem to do anything though. I have this linked to a server to client packet... I have been at this since September seventh and have not made any progress. Blockpos and Blockstate are all pre-assigned variables, as is pLevel. I took the vertex consumer directly from LevelRenderer where I got this code from anyways. I didn't know what number to put into the ModelBakery.DESTROY_TYPES.get() so I just put the breakTime I used in the above code. Am I missing something?
    • Problematic part: [net.minecraft.server.network.ServerGamePacketListenerImpl/]: Gu57 lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "net.minecraft.resources.ResourceLocation.toString()" because "p_130086_" is null There is no crash, single player works, sadly it's not Hexerei Debug log: (can't use pastebin, cause 10 mb) https://drive.google.com/file/d/16ikQIx7nYjJtF4aJLy5KqFQHh6-jBNrd/view?usp=sharing
    • Something in the Alex's Caves mod is preventing Distant Horizons from rendering. However, I don't want to get rid of Alex's Caves, as it is a part of my personal modded experience. Can someone please find the issue for me?
  • Topics

×
×
  • Create New...

Important Information

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