Jump to content

[1.12] java.lang.reflect.Field cannot be cast to java.lang.Byte


Recommended Posts

Posted

While testing one of my mods alongside some others, I got this crash that I can't figure out:

Spoiler

---- Minecraft Crash Report ----

// But it works on my machine.

 

Time: 7/18/17 11:45 PM

Description: Ticking entity

 

java.lang.ClassCastException: java.lang.reflect.Field cannot be cast to java.lang.Byte

at net.minecraft.entity.EntityLivingBase.func_184587_cr(EntityLivingBase.java:2641)

at net.minecraft.entity.EntityLivingBase.func_184608_ct(EntityLivingBase.java:2651)

at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2082)

at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)

at net.minecraft.entity.monster.EntityMob.func_70071_h_(SourceFile:46)

at net.minecraft.entity.monster.EntityCreeper.func_70071_h_(SourceFile:161)

at net.minecraft.world.World.func_72866_a(World.java:1976)

at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:833)

at net.minecraft.world.World.func_72870_g(World.java:1939)

at net.minecraft.world.World.func_72939_s(World.java:1753)

at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:614)

at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:761)

at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:665)

at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:523)

at java.lang.Thread.run(Thread.java:748)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Thread: Client thread

Stacktrace:

at net.minecraft.entity.EntityLivingBase.func_184587_cr(EntityLivingBase.java:2641)

at net.minecraft.entity.EntityLivingBase.func_184608_ct(EntityLivingBase.java:2651)

at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2082)

at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)

at net.minecraft.entity.monster.EntityMob.func_70071_h_(SourceFile:46)

at net.minecraft.entity.monster.EntityCreeper.func_70071_h_(SourceFile:161)

at net.minecraft.world.World.func_72866_a(World.java:1976)

at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:833)

at net.minecraft.world.World.func_72870_g(World.java:1939)

 

-- Entity being ticked --

Details:

Entity Type: minecraft:creeper (net.minecraft.entity.monster.EntityCreeper)

Entity ID: 10719

Entity Name: Creeper

Entity's Exact location: -122.50, 44.00, 317.50

Entity's Block location: World: (-123,44,317), Chunk: (at 5,2,13 in -8,19; contains blocks -128,0,304 to -113,255,319), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Entity's Momentum: 0.00, -0.08, 0.00

Entity's Passengers: []

Entity's Vehicle: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.world.World.func_72939_s(World.java:1753)

at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:614)

 

-- Affected level --

Details:

Level name: New World

All players: 1 total; [EntityPlayerMP['<PROFILE NAME>'/386, l='New World', x=-111.07, y=95.53, z=268.25]]

Chunk stats: ServerChunkCache: 630 Drop: 0

Level seed: 8382629383432640614

Level generator: ID 00 - default, ver 1. Features enabled: true

Level generator options:

Level spawn location: World: (-100,64,256), Chunk: (at 12,4,0 in -7,16; contains blocks -112,0,256 to -97,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 12128 game time, 6064 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 23809 (now: false), thunder time: 71243 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true

Stacktrace:

at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:761)

at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:665)

at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:523)

at java.lang.Thread.run(Thread.java:748)

 

-- System Details --

Details:

Minecraft Version: 1.12

Operating System: Linux (amd64) version 4.12.0-041200-generic

Java Version: 1.8.0_131, Oracle Corporation

Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 2316900848 bytes (2209 MB) / 4064280576 bytes (3876 MB) up to 7635730432 bytes (7282 MB)

JVM Flags: 2 total; -Xms2048m -Xmx8192m

IntCache: cache: 0, tcache: 8, allocated: 20, tallocated: 86

FML: MCP 9.40 Powered by Forge 14.21.1.2413 8 mods loaded, 8 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA minecraft{1.12} [Minecraft] (minecraft.jar)

UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forge-1.12-14.21.1.2413-universal.jar)

UCHIJAAAA forge{14.21.1.2413} [Minecraft Forge] (forge-1.12-14.21.1.2413-universal.jar)

UCHIJAAAA crafttweaker{4.0.1} [CraftTweaker2] (CraftTweaker2-1.12-4.0.1.jar)

UCHIJAAAA ctgui{1.0.0} [CT-GUI] (CraftTweaker2-1.12-4.0.1.jar)

UCHIJAAAA degradeexplodedblocks{1.0.0} [DegradeExplodedBlocks] (degradeexplodedblocks-1.11.2-1.0.0.jar)

UCHIJAAAA infinitefluids{1.1.1} [InfiniteFluids] (infinitefluids-1.11-1.1.1.jar)

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['<PROFILE NAME>'/386, l='New World', x=-111.07, y=95.53, z=268.25]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

Important part:

java.lang.ClassCastException: java.lang.reflect.Field cannot be cast to java.lang.Byte

at net.minecraft.entity.EntityLivingBase.func_184587_cr(EntityLivingBase.java:2641)

 

Here's what I figured out myself:

First, here's net.minecraft.entity.EntityLivingBase.func_184587_cr(EntityLivingBase.java:2641):

public boolean isHandActive()
{
	return (((Byte)this.dataManager.get(HAND_STATES)).byteValue() & 1) > 0;
}

HAND_STATES is declared as a DataParameter<Byte>, so all through this next part, T is Byte. Next, here's this.dataManager.get:

public <T> T get(DataParameter<T> key)
{
	return (T)this.getEntry(key).getValue();
}

And here's getValue:

public T getValue()
{
	return this.value;
}

And finally, here's value:

private T value;

I don't get how a Field could have gotten as far as it did. "value" is declared as type T, as are the return values of getValue() and get(). Even get() itself has an explicit cast to T. Where did the Field come from here, and why didn't it crash anywhere prior to isHandActive where it must have been shoehorned into an inappropriate variable?

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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