我试图使用ModCoderPack为1.8.8创建一个客户机,但是当我试图调用任何在同一个类中不存在的函数时,比如MC.DisplayGuisCreen,游戏就崩溃了。我有等待按键的代码
public void onKeyPressed(GameSettings gs) {
if(gs.jbClientToggleMenu.isKeyDown()) {
this.mc.displayGuiScreen(new ModManager());
}
}
该函数在Minecraft.java中调用
else
{
jbclient.onKeyPressed(this.gameSettings); // <-=
if (k == 1)
{
this.displayInGameMenu();
}
以下是客户端类的全部代码
代码:
public class Client {
private final Minecraft mc = Minecraft.getMinecraft();
private GameSettings gameSettings = new GameSettings();
public static String clientName = "jbClient";
public static String clientVersion = "0.01";
public static final ModManager modManager = new ModManager();
public static final Logger logger = LogManager.getLogger();
public void onKeyPressed(GameSettings gs) {
if(gs.jbClientToggleMenu.isKeyDown()) {
this.mc.displayGuiScreen(new ModManager());
}
}
}
崩溃日志
---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.
Time: 6/18/20 5:53 PM
Description: Unexpected error
java.lang.NullPointerException: Unexpected error
at jordanbaron.jbclient.Client.onKeyPressed(Client.java:23)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1950)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1123)
at net.minecraft.client.Minecraft.run(Minecraft.java:429)
at net.minecraft.client.main.Main.main(Main.java:113)
at Start.main(Start.java:11)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at jordanbaron.jbclient.Client.onKeyPressed(Client.java:23)
-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player824'/288, l='MpServer', x=87.13, y=81.00, z=-381.85]]
Chunk stats: MultiplayerChunkCache: 583, 583
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: -52.00,64.00,132.00 - World: (-52,64,132), Chunk: (at 12,4,4 in -4,8; contains blocks -64,0,128 to -49,255,143), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 5569 game time, 5569 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 84 total; [EntityCreeper['Creeper'/4096, l='MpServer', x=163.50, y=18.00, z=-365.50], EntityCreeper['Creeper'/4097, l='MpServer', x=159.50, y=18.00, z=-362.50], EntitySkeleton['Skeleton'/4099, l='MpServer', x=166.19, y=18.00, z=-366.66], EntitySkeleton['Skeleton'/2820, l='MpServer', x=156.50, y=27.00, z=-360.50], EntityBat['Bat'/3889, l='MpServer', x=99.47, y=12.53, z=-440.25], EntityZombie['Zombie'/4659, l='MpServer', x=35.50, y=55.00, z=-427.50], EntityBat['Bat'/2612, l='MpServer', x=51.44, y=49.59, z=-424.41], EntityZombie['Zombie'/4660, l='MpServer', x=34.50, y=55.00, z=-428.50], EntityRabbit['Rabbit'/826, l='MpServer', x=141.50, y=71.00, z=-426.50], EntityRabbit['Rabbit'/827, l='MpServer', x=138.34, y=72.00, z=-427.66], EntityRabbit['Rabbit'/828, l='MpServer', x=136.34, y=72.00, z=-427.66], EntityZombie['Zombie'/3139, l='MpServer', x=154.50, y=20.00, z=-324.50], EntityZombie['Zombie'/3140, l='MpServer', x=154.50, y=20.00, z=-325.50], EntityZombie['Zombie'/3141, l='MpServer', x=150.50, y=20.00, z=-322.50], EntityZombie['Zombie'/3142, l='MpServer', x=156.44, y=20.00, z=-324.06], EntityZombie['Zombie'/2376, l='MpServer', x=128.47, y=37.00, z=-366.81], EntityCreeper['Creeper'/2377, l='MpServer', x=129.06, y=38.00, z=-367.66], EntitySkeleton['Skeleton'/4426, l='MpServer', x=149.53, y=12.00, z=-461.66], EntitySpider['Spider'/2891, l='MpServer', x=160.69, y=40.09, z=-417.31], EntitySquid['Squid'/2898, l='MpServer', x=97.00, y=61.41, z=-403.77], EntitySquid['Squid'/2900, l='MpServer', x=100.53, y=58.30, z=-399.57], EntitySquid['Squid'/2901, l='MpServer', x=101.89, y=60.17, z=-386.47], EntitySquid['Squid'/2902, l='MpServer', x=102.47, y=57.00, z=-391.50], EntityBat['Bat'/4955, l='MpServer', x=153.43, y=17.07, z=-438.28], EntityCreeper['Creeper'/3932, l='MpServer', x=147.56, y=26.00, z=-459.94], EntityCreeper['Creeper'/3938, l='MpServer', x=97.50, y=18.00, z=-354.50], EntityCreeper['Creeper'/2147, l='MpServer', x=49.50, y=51.00, z=-342.50], EntitySkeleton['Skeleton'/3939, l='MpServer', x=95.50, y=18.00, z=-355.50], EntitySkeleton['Skeleton'/4966, l='MpServer', x=159.50, y=18.00, z=-363.50], EntitySkeleton['Skeleton'/4967, l='MpServer', x=157.50, y=18.00, z=-364.50], EntityBat['Bat'/3433, l='MpServer', x=147.27, y=11.30, z=-340.73], EntityBat['Bat'/3434, l='MpServer', x=144.89, y=12.05, z=-343.34], EntityPlayerSP['Player824'/288, l='MpServer', x=87.13, y=81.00, z=-381.85], EntityZombie['Zombie'/4208, l='MpServer', x=34.50, y=40.00, z=-334.50], EntityZombie['Zombie'/2673, l='MpServer', x=50.50, y=34.00, z=-424.50], EntitySkeleton['Skeleton'/3953, l='MpServer', x=21.94, y=25.00, z=-306.06], EntityWitch['Witch'/3186, l='MpServer', x=56.50, y=44.00, z=-421.50], EntitySpider['Spider'/3954, l='MpServer', x=19.91, y=25.00, z=-308.09], EntitySpider['Spider'/2674, l='MpServer', x=13.50, y=11.00, z=-376.50], EntityCreeper['Creeper'/3187, l='MpServer', x=47.50, y=44.00, z=-421.50], EntityZombie['Zombie'/2936, l='MpServer', x=112.50, y=17.00, z=-352.50], EntityZombie['Zombie'/2937, l='MpServer', x=113.81, y=16.00, z=-351.25], EntityZombie['Zombie'/3196, l='MpServer', x=33.50, y=35.00, z=-428.50], EntityItem['item.item.seeds'/386, l='MpServer', x=43.13, y=63.00, z=-357.88], EntityRabbit['Rabbit'/387, l='MpServer', x=34.50, y=68.00, z=-334.50], EntityRabbit['Rabbit'/388, l='MpServer', x=32.13, y=66.00, z=-330.88], EntityRabbit['Rabbit'/389, l='MpServer', x=32.75, y=66.00, z=-330.25], EntityCow['Cow'/1929, l='MpServer', x=111.50, y=65.00, z=-448.50], EntityCow['Cow'/1930, l='MpServer', x=113.50, y=66.00, z=-449.50], EntityCow['Cow'/1931, l='MpServer', x=115.50, y=66.00, z=-450.50], EntityCow['Cow'/1932, l='MpServer', x=115.50, y=66.00, z=-446.50], EntityChicken['Chicken'/1933, l='MpServer', x=100.47, y=64.00, z=-452.53], EntityChicken['Chicken'/1934, l='MpServer', x=104.50, y=65.00, z=-442.50], EntityChicken['Chicken'/1935, l='MpServer', x=108.50, y=65.00, z=-449.50], EntityChicken['Chicken'/1936, l='MpServer', x=109.50, y=65.00, z=-449.50], EntityCow['Cow'/406, l='MpServer', x=49.13, y=86.00, z=-402.06], EntityCow['Cow'/407, l='MpServer', x=43.88, y=83.00, z=-397.59], EntityCow['Cow'/408, l='MpServer', x=44.50, y=83.00, z=-394.50], EntityCow['Cow'/409, l='MpServer', x=44.50, y=88.00, z=-392.50], EntityZombie['Zombie'/3737, l='MpServer', x=91.28, y=11.06, z=-455.56], EntityBat['Bat'/5793, l='MpServer', x=66.75, y=35.10, z=-397.75], EntityCreeper['Creeper'/3509, l='MpServer', x=39.50, y=82.00, z=-373.50], EntityItem['item.item.seeds'/5064, l='MpServer', x=65.28, y=64.00, z=-362.81], EntitySquid['Squid'/5070, l='MpServer', x=39.81, y=60.75, z=-353.53], EntitySquid['Squid'/5071, l='MpServer', x=46.47, y=60.19, z=-347.03], EntityCreeper['Creeper'/3024, l='MpServer', x=153.50, y=24.00, z=-375.50], EntitySquid['Squid'/5072, l='MpServer', x=36.47, y=61.00, z=-350.34], EntityCreeper['Creeper'/3025, l='MpServer', x=156.50, y=24.00, z=-377.50], EntityEnderman['Enderman'/3795, l='MpServer', x=41.50, y=55.00, z=-432.50], EntityZombie['Zombie'/4315, l='MpServer', x=142.50, y=13.00, z=-443.50], EntitySkeleton['Skeleton'/3550, l='MpServer', x=91.50, y=23.00, z=-455.50], EntitySkeleton['Skeleton'/3552, l='MpServer', x=78.50, y=23.00, z=-458.16], EntitySkeleton['Skeleton'/3297, l='MpServer', x=28.16, y=25.00, z=-309.75], EntityZombie['Zombie'/744, l='MpServer', x=70.50, y=34.00, z=-312.50], EntitySkeleton['Skeleton'/745, l='MpServer', x=67.50, y=34.00, z=-316.50], EntityZombie['Zombie'/746, l='MpServer', x=70.50, y=34.00, z=-309.50], EntityBat['Bat'/3821, l='MpServer', x=162.75, y=15.66, z=-452.50], EntityRabbit['Rabbit'/494, l='MpServer', x=105.50, y=63.00, z=-398.50], EntitySkeleton['Skeleton'/2287, l='MpServer', x=109.50, y=18.00, z=-351.50], EntityRabbit['Rabbit'/495, l='MpServer', x=103.94, y=64.00, z=-401.88], EntityRabbit['Rabbit'/496, l='MpServer', x=109.53, y=66.00, z=-399.81], EntityRabbit['Rabbit'/2037, l='MpServer', x=109.78, y=65.00, z=-457.59], EntityCreeper['Creeper'/3574, l='MpServer', x=89.50, y=17.00, z=-459.50], EntityCreeper['Creeper'/3582, l='MpServer', x=48.50, y=55.00, z=-427.50]]
Retry entities: 0 total; []
Server brand: vanilla
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:390)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2782)
at net.minecraft.client.Minecraft.run(Minecraft.java:458)
at net.minecraft.client.main.Main.main(Main.java:113)
at Start.main(Start.java:11)
-- System Details --
Details:
Minecraft Version: 1.8.9
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_251, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 837748936 bytes (798 MB) / 1532493824 bytes (1461 MB) up to 3806855168 bytes (3630 MB)
JVM Flags: 0 total;
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
Launched Version: mcp
LWJGL: 2.9.4
OpenGL: GeForce GTX 1660/PCIe/SSE2 GL version 4.6.0 NVIDIA 445.75, 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: Very likely; Jar signature invalidated
Type: Client (map_client.txt)
Resource Packs:
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 4x Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
编辑:它在将Minecraft实例传递给函数时工作
这很简单:您正面临一个NullPointerException,这意味着您试图使用没有赋值的东西。我猜
this.gameSettings
要么不存在,要么尚未赋值,这意味着它为空。这将导致NullPointerExcepting导致崩溃。你可能需要写
this.gameSettings = gs;
或者如果可能的话只使用gs。两者都应该管用。好运:)
当我运行应用程序时,它工作得很好,但是当我想调试一个变量值时,应用程序就崩溃了。下面是完整的调试日志。我不知道是什么错误来纠正它。你们能帮帮我吗?我读到了一些关于并且我禁用和启用了ADB集成,但没有帮助我。我试图清洁,重建和运行的项目再次和没有帮助我。每次我尝试开始调试时,应用程序都会崩溃。 提前谢谢!!
当我尝试连接Android Studio调试器时,我的一些应用程序崩溃,然后我收到以下错误: 我试着重启Windows 我正在使用最新版本的Android SDK,构建工具,。。。 此崩溃后的部分日志:
我正在开发一个Android应用程序,它必须从文件中解析文本。 我的解析器中有以下方法。java类: 每当调用缓冲区时,我都会遇到问题。while循环中的readLine()方法。 我传递以下路径信息File对象是: 现在我已经看了堆栈和在线上的许多帖子,以便尝试解决这个问题,并尝试使用一些解决方案,但没有运气。这是我从错误堆栈跟踪中获得的一个片段。 我确信文件的路径是正确的,因为我在调试时检查了
我试图将一个向量元组转换成一个向量元组(反之亦然)。调用函数时遇到问题。当我用一个参数调用它时,我得到一个错误: prog。cpp:在函数“int main()”中: prog。cpp:44:24:错误:调用“tuple_transpose(std::tuple)”时没有匹配函数 这是一个演示,其中包含错误:http://ideone.com/7AWiQQ#view_edit_box 我做错了什么
希望你做得很好。 我有一个C语言的JNI实现,其中一个C函数连接到当前JVM线程并回调一个Java方法,这实际上是在attachCurrentThread()函数调用时使JVM崩溃。我的实现基于链接中给出的答案,保持对JNIEnv环境的全局引用 线程创建部分,它将侦听套接字连接以接受事件并注入GetEvent函数。 回调函数 在接收到事件时执行GetEvent()后,我的JVM在AttachMon
本文向大家介绍WordPress中调试缩略图的相关PHP函数使用解析,包括了WordPress中调试缩略图的相关PHP函数使用解析的使用技巧和注意事项,需要的朋友参考一下 the_post_thumbnail the_post_thumbnail 在 WordPress 中主要用来打印文章中设定的缩略图,而 get_the_post_thumbnail 函数可以将你需要的 HTML 代码以字符串的