Jump to content

Recommended Posts

Posted

After attempting to set my block obsidianore to drop obsidianingot instead, when I was testing, destroying the block resulted in missing textures spawning, which would crash the game if I picked them up. After repeating this with the block dropping sticks, an Item already in minecraft, It worked perfectly. I think this means that the Item copperingot is not being registered before copperore, but I am not sure.

 

Here is the CopperOre Class: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/blocks/CopperOre.java

Here is CommonProxy: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java

Here is modItems: https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/ModItems.java

 

and here is the crash report:

 

---- Minecraft Crash Report ----
// Don't be sad. I'll do better next time, I promise!

Time: 10/30/17 9:23 PM
Description: Ticking player

java.lang.ArrayIndexOutOfBoundsException: -1
    at net.minecraft.stats.StatList.getObjectsPickedUpStats(StatList.java:123)
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:449)
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:662)
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:633)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2392)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:270)
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423)
    at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185)
    at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307)
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:196)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:863)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590)
    at java.lang.Thread.run(Unknown Source)


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

-- Head --
Thread: Server thread
Stacktrace:
    at net.minecraft.stats.StatList.getObjectsPickedUpStats(StatList.java:123)
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:449)
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:662)
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:633)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2392)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:270)

-- Player being ticked --
Details:
    Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
    Entity ID: 194
    Entity Name: Player750
    Entity's Exact location: 180.51, 47.00, 57.51
    Entity's Block location: World: (180,47,57), Chunk: (at 4,2,9 in 11,3; contains blocks 176,0,48 to 191,255,63), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Entity's Momentum: 0.00, -0.08, 0.00
    Entity's Passengers: []
    Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:423)
    at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:185)
    at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:212)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307)

-- Ticking connection --
Details:
    Connection: net.minecraft.network.NetworkManager@6fbe3b33
Stacktrace:
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:196)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:863)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590)
    at java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_151, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 732016696 bytes (698 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
    FML: MCP 9.42 Powered by Forge 14.23.0.2515 5 mods loaded, 5 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 |
    |:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
    | UCHIJAAAA | minecraft | 1.12.2       | minecraft.jar                    | None      |
    | UCHIJAAAA | mcp       | 9.42         | minecraft.jar                    | None      |
    | UCHIJAAAA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.0.2515.jar | None      |
    | UCHIJAAAA | forge     | 14.23.0.2515 | forgeSrc-1.12.2-14.23.0.2515.jar | None      |
    | UCHIJAAAA | btm       | 0.0.1        | bin                              | None      |

    Loaded coremods (and transformers):
    GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
    Profiler Position: N/A (disabled)
    Player Count: 1 / 8; [EntityPlayerMP['Player750'/194, l='New World', x=180.51, y=47.00, z=57.51]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

Posted

Block are registered before items. Therefor this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java#L87

Runs before this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java#L70

Which means that this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/blocks/CopperOre.java#L32

Assigns the CURRENT VALUE of the field (which has not yet had the ObjectHolder annotation run to inject a value) to the block's field.

 

Also:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/ModItems.java#L36

Seriously?

NO, BAD MODDER. DO NOT ASSIGN THESE FIELDS MANUALLY. ESPECIALLY NOT WITH A SEPARATE INSTANCE

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
16 hours ago, Draco18s said:

Block are registered before items. Therefor this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java#L87

Runs before this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/proxy/CommonProxy.java#L70

Which means that this line:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/blocks/CopperOre.java#L32

Assigns the CURRENT VALUE of the field (which has not yet had the ObjectHolder annotation run to inject a value) to the block's field.

 

Also:

https://github.com/InterdimensionalCat/ModTest/blob/master/java/com/benthom123/test/ModItems.java#L36

Seriously?

NO, BAD MODDER. DO NOT ASSIGN THESE FIELDS MANUALLY. ESPECIALLY NOT WITH A SEPARATE INSTANCE

 

Thanks for the info, I found a fix that is working and allows me to assign more than 1 drop to the item.

 

As for the @ObjectHolder stuff, I am not sure what way I should do it that is better, I tried putting everything under the same @ObjectHolder annotation but that crashed all of my textures and I didn't know how to fix that. Could you show me an example of what you mean?

Posted

You see where it says = new Thing()?

Remove = new Thing()

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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

    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
    • The simple answer is there is not an easy way. You would need to know how to program in Java, as well as at least some familiarity with how Forge works so you could port the differences. You would also need the sourcecode for the original mod, and permission from the author to modify it, if they did not use some sort of open source license. So it's not impossible, but it would take some effort, but doing so would open up a whole new world of possibilities for you!
    • Does it still crash if you remove holdmyitems? Looks like that mod doesn't work on a server as far as I can tell from the error.  
    • Crashes the server when trying to start. Error code -1. Log  
  • Topics

×
×
  • Create New...

Important Information

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