Jump to content

Can´t load my world with mods.


maxiggdb

Recommended Posts

Hello guys. first,sorry for my bad english. I hope you can help me. I made a minecraft map with mods, that i was installing each one while I was needing. I mean, I create a map with no mods (It´s "the swan" bunker form LOST tv series), and started to build. If i was needing for example coocking stuff, I install one more mod and load the world. there are 37 mods required for this map and it´s made in 1.12.2.

The problem is: I was some time with not working in the map and I installed forge for 1.16.4. Somehow i lost my forge 1.12.2 installation don´t remember why. Now I have installed the same version of forge and the mods againg and there are some problems with some mods or forge version. I tried to install one by one and loading the world (one by one XD). The mod I think is in trouble is "RetroComputers 3.0.2".

But I tried to disable that mod and load and the map still doesn´t loading. I have the world save and the mod list in a backup, but there´s no way... 

I hope anyone who knows about loading modded maps or something could help me. As you can see the map was a hard work to do and I love it. Thank you all the same! 

 

Edited by maxiggdb
Link to comment
Share on other sites

here are the crash reports with the mod list. 

 

---- Minecraft Crash Report ----

WARNING: coremods are present:
  ForgelinPlugin (Forgelin-1.8.3.jar)
  CreativePatchingLoader (CreativeCore_v1.10.61_mc1.12.2 (1).jar)
  FMLPlugin (albedo-1.12.2-1.1.0.jar)
  Techguns Core (techguns-1.12.2-2.0.2.0_pre3.2.jar)
  MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar)
  CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)
Contact their authors BEFORE contacting forge

// Uh... Did I do that?

Time: 4/11/22 10:43 PM
Description: Updating screen events

java.lang.IllegalArgumentException: Name and ID cannot both be blank
    at com.mojang.authlib.GameProfile.<init>(GameProfile.java:26)
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.a(Unknown Source)
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(Unknown Source)
    at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2421)
    at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)
    at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)
    at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)
    at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)
    at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)
    at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.a.m.main(Unknown Source)


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

-- Head --
Thread: Client thread
Stacktrace:
    at com.mojang.authlib.GameProfile.<init>(GameProfile.java:26)
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.a(Unknown Source)
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(Unknown Source)
    at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2421)
    at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)
    at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)
    at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)
    at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)
    at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)
    at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)
    at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501)

-- Affected screen --
Details:
    Screen name: net.minecraft.client.gui.GuiScreenWorking
Stacktrace:
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.a.m.main(Unknown Source)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_191, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 173375024 bytes (165 MB) / 1073741824 bytes (1024 MB) up to 1073741824 bytes (1024 MB)
    JVM Flags: 9 total; -Xmx1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:+IgnoreUnrecognizedVMOptions -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
    IntCache: cache: 0, tcache: 11, allocated: 27, tallocated: 73
    FML: MCP 9.42 Powered by Forge 14.23.5.2855 34 mods loaded, 34 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State  | ID                  | Version               | Source                                 | Signature                                |
    |:------ |:------------------- |:--------------------- |:-------------------------------------- |:---------------------------------------- |
    | LCHIJA | minecraft           | 1.12.2                | minecraft.jar                          | None                                     |
    | LCHIJA | mcp                 | 9.42                  | minecraft.jar                          | None                                     |
    | LCHIJA | FML                 | 8.0.99.99             | forge-1.12.2-14.23.5.2855.jar          | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | LCHIJA | forge               | 14.23.5.2855          | forge-1.12.2-14.23.5.2855.jar          | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | LCHIJA | creativecoredummy   | 1.0.0                 | minecraft.jar                          | None                                     |
    | LCHIJA | albedocore          | 0.1                   | minecraft.jar                          | None                                     |
    | LCHIJA | techguns_core       | 1.12.2-1.0            | minecraft.jar                          | None                                     |
    | LCHIJA | albedo              | 1.0.0                 | albedo-1.12.2-1.1.0.jar                | None                                     |
    | LCHIJA | architecturecraft   | @VERSION@             | ArchitectureCraft-Mod-1.12.2.jar       | None                                     |
    | LCHIJA | forgelin            | 1.8.3                 | Forgelin-1.8.3.jar                     | None                                     |
    | LCHIJA | betterrecords       | unspecified           | BetterRecords-1.12.2-1.6.2.jar         | None                                     |
    | LCHIJA | bibliocraft         | 2.4.5                 | BiblioCraft[v2.4.5][MC1.12.2].jar      | None                                     |
    | LCHIJA | cdm                 | 0.4.1                 | cdm-0.4.1-mc1.12.2.jar                 | None                                     |
    | LCHIJA | ctm                 | MC1.12.2-1.0.2.31     | CTM-MC1.12.2-1.0.2.31.jar              | None                                     |
    | LCHIJA | chisel              | MC1.12.2-1.0.2.45     | Chisel-MC1.12.2-1.0.2.45.jar           | None                                     |
    | LCHIJA | coloredlights       | ${version}            | Colored-Lights-Mod-1.12.2.jar          | None                                     |
    | LCHIJA | creativecore        | 1.10.0                | CreativeCore_v1.10.61_mc1.12.2 (1).jar | None                                     |
    | LCHIJA | engineersdecor      | 1.1.2                 | Engineers-Decor-Mod-1.12.2.jar         | ed58ed655893ced6280650866985abcae2bf7559 |
    | LCHIJA | flashlight          | 1.0.0                 | flashlight-1.0.0.jar                   | None                                     |
    | LCHIJA | cfm                 | 6.3.1                 | furniture-6.3.1-1.12.2.jar             | None                                     |
    | LCHIJA | immersivedecoration | 1.0.0                 | ImmersiveDecoration(1.12.2).jar        | None                                     |
    | LCHIJA | lightswitch         | 1.1.1                 | Light-Switch-Mod-1.12.2.jar            | None                                     |
    | LCHIJA | malisiscore         | 1.12.2-6.5.1-SNAPSHOT | malisiscore-1.12.2-6.5.1.jar           | None                                     |
    | LCHIJA | malisisdoors        | 1.12.2-7.3.0          | malisisdoors-1.12.2-7.3.0.jar          | None                                     |
    | LCHIJA | mcd                 | 9.0                   | MCDecorationsMod-1.9.0.jar             | None                                     |
    | LCHIJA | mcmultipart         | 2.5.3                 | MCMultiPart-2.5.3.jar                  | None                                     |
    | LCHIJA | mcpaint             | 1.2.4                 | mcpaint-1.2.4.jar                      | 7904c4e13947c8a616c5f39b26bdeba796500722 |
    | LCHIJA | modernlamps         | 1.0.3                 | ModernLights-1.0.3_1.12.jar            | None                                     |
    | LCHIJA | placebo             | 1.6.0                 | Placebo-1.12.2.jar                     | None                                     |
    | LCHIJA | quacklib            | 2.2.5                 | quacklib-2.2.5.jar                     | None                                     |
    | LCHIJA | retrocomputers      | 1.0                   | retrocomputers-3.0.2.jar               | None                                     |
    | LCHIJA | rsgauges            | 1.2.5                 | rsgauges-1.12.2-1.2.5.jar              | ed58ed655893ced6280650866985abcae2bf7559 |
    | LCHIJA | simplylight         | 1.12.2-0.8.7          | Simply-Light-Mod-1.12.2.jar            | None                                     |
    | LCHIJA | techguns            | 2.0.2.0               | techguns-1.12.2-2.0.2.0_pre3.2.jar     | None                                     |

    Loaded coremods (and transformers): 
ForgelinPlugin (Forgelin-1.8.3.jar)
  
CreativePatchingLoader (CreativeCore_v1.10.61_mc1.12.2 (1).jar)
  
FMLPlugin (albedo-1.12.2-1.1.0.jar)
  elucent.albedo.asm.ASMTransformer
Techguns Core (techguns-1.12.2-2.0.2.0_pre3.2.jar)
  techguns.core.TechgunsASMTransformer
MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar)
  
CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)
  team.chisel.ctm.client.asm.CTMTransformer
    Launched Version: 1.12.2-forge-14.23.5.2855
    LWJGL: 2.9.4
    OpenGL: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 496.13, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: No
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

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
  • Topics

×
×
  • Create New...

Important Information

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