BedrockIfy - Bedrock Features on Java!

BedrockIfy - Bedrock Features on Java!

967k Downloads

Bedrockify assumes that every BundleItem uses the default BundleTooltipData

DaFuqs opened this issue ยท 0 comments

commented

While that is a fair assumption, it is not always be true in case of modded bundles and will cause a crash if that piece of code is triggered, causing a crash.
Suggestions: Either check for Items.BUNDLE directly, or query the tooltip component of that item.

Example:
The Spectrum Bottomless Bundle (holts only 1 item, albeit an unlimited count of it) is a bundle with a custom tooltip, to better match it's functionality.
https://github.com/DaFuqs/Spectrum/blob/1.18.2/src/main/java/de/dafuqs/spectrum/items/magic_items/BottomlessBundleItem.java

Line:

return getTooltipsFromContainer(((BundleTooltipData)currentStack.getTooltipData().get()).getInventory());

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

Time: 6/1/22, 8:58 AM
Description: Unexpected error

java.lang.ClassCastException: class de.dafuqs.spectrum.items.tooltip.VoidBundleTooltipData cannot be cast to class net.minecraft.class_5631 (de.dafuqs.spectrum.items.tooltip.VoidBundleTooltipData and net.minecraft.class_5631 are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @50c87b21)
at Not Enough Crashes deobfuscated stack trace.(1.18.2+build.3)
at me.juancarloscp52.bedrockify.client.features.heldItemTooltips.HeldItemTooltips.getTooltips(HeldItemTooltips.java:110)
at me.juancarloscp52.bedrockify.client.features.heldItemTooltips.HeldItemTooltips.equals(HeldItemTooltips.java:121)
at net.minecraft.client.gui.hud.InGameHud.redirect$bfg000$interceptItemStack(InGameHud:5040)
at net.minecraft.client.gui.hud.InGameHud.tick(InGameHud:1318)
at net.minecraft.client.gui.hud.InGameHud.tick(InGameHud:1291)
at net.minecraft.client.MinecraftClient.tick(MinecraftClient:1702)
at net.minecraft.client.MinecraftClient.render(MinecraftClient:1091)
at net.minecraft.client.MinecraftClient.run(MinecraftClient:737)
at net.minecraft.client.main.Main.main(Main:236)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:460)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:568)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)

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

-- Head --
Thread: Render thread
Stacktrace:
at me.juancarloscp52.bedrockify.client.features.heldItemTooltips.HeldItemTooltips.getTooltips(HeldItemTooltips.java:110)
at me.juancarloscp52.bedrockify.client.features.heldItemTooltips.HeldItemTooltips.equals(HeldItemTooltips.java:121)
at net.minecraft.class_329.redirect$bfg000$interceptItemStack(class_329.java:5040)
at net.minecraft.class_329.method_1748(class_329.java:1318)
at net.minecraft.class_329.method_39191(class_329.java:1291)

-- Affected level --
Details:
All players: 2 total; [class_746['Oakelope'/1266580, l='ClientLevel', x=2677.38, y=72.00, z=2820.11], class_745['DRACOMITE'/2143383, l='ClientLevel', x=2661.92, y=72.00, z=2815.33]]
Chunk stats: 1024, 628
Level dimension: minecraft:overworld
Level spawn location: World: (0,74,0), Section: (at 0,10,0 in 0,4,0; chunk contains blocks 0,-64,0 to 15,319,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
Level time: 533857 game time, 784884 day time
Server brand: fabric
Server type: Non-integrated multiplayer server
Stacktrace:
at net.minecraft.class_638.method_8538(class_638.java:407)
at net.minecraft.class_310.method_1587(class_310.java:2376)
at net.minecraft.class_310.method_1514(class_310.java:761)
at net.minecraft.client.main.Main.main(Main.java:236)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:460)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)

-- Last reload --
Details:
Reload number: 1
Reload reason: initial
Finished: Yes
Packs: Default, Fabric Mods

-- System Details --
Details:
Minecraft Version: 1.18.2
Minecraft Version ID: 1.18.2
Operating System: Windows 11 (amd64) version 10.0
Java Version: 17.0.2, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
Memory: 2152528504 bytes (2052 MiB) / 8388608000 bytes (8000 MiB) up to 8388608000 bytes (8000 MiB)
CPUs: 16
Processor Vendor: AuthenticAMD
Processor Name: AMD Ryzen 7 5800X 8-Core Processor
Identifier: AuthenticAMD Family 25 Model 33 Stepping 0
Microarchitecture: unknown
Frequency (GHz): 3.79
Number of physical packages: 1
Number of physical CPUs: 8
Number of logical CPUs: 16
Graphics card #0 name: NVIDIA GeForce RTX 3080 Ti
Graphics card #0 vendor: NVIDIA (0x10de)
Graphics card #0 VRAM (MB): 4095.00
Graphics card #0 deviceId: 0x2208
Graphics card #0 versionInfo: DriverVersion=30.0.15.1215
Memory slot #0 capacity (MB): 8192.00
Memory slot #0 clockSpeed (GHz): 3.60
Memory slot #0 type: DDR4