• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I resolved it after a good nights of sleep! Turns out there's two EntityBuilder create methods: EntityType.Builder<? extends Entity>#create(Entity, EntityClassification) EntityType.Builder<? extends Entity>#create(EntityClassification) and I was using the one without the entity class, thanks for the help!
    • That's work! but idk why it's only work for an IDE runClient, the fps is showing. But when do I export the mod jar, run the game, and then the fps doesn't show.
    • You need to use ObfuscationReflectionHelper with SRG names, otherwise your reflection code will not work outside of the development environment.
    • You call NetworkHooks.openGUI, like with any other GUI. Assuming you want this to happen on right click, the client will know which item to look at, so no special handling is necessary here.
    • I need to get debugFPS but it has private-access in class Mnecraft (net.minecraft.client.Minecraft), I'm try to using Reflection for that and It's give me an error:   java.lang.RuntimeException: No such field exception!     at com.thmc.mod.events.ItemDelayEventHandler.onPreInfoRender(ItemDelayEventHandler.java:130) ~[?:1.0] {re:classloading}     at net.minecraftforge.eventbus.ASMEventHandler_34_ItemDelayEventHandler_onPreInfoRender_Pre.invoke(.dynamic) ~[?:?] {}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.5-service.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.5-service.jar:?] {}     at net.minecraftforge.client.gui.ForgeIngameGui.pre(ForgeIngameGui.java:828) ~[?:?] {re:classloading}     at net.minecraftforge.client.gui.ForgeIngameGui.func_238445_a_(ForgeIngameGui.java:121) ~[?:?] {re:classloading}     at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:765) ~[?:?] {re:classloading,pl:accesstransformer:B,xf:OptiFine:default}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:976) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.4-35.0.17.jar:35.0] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$431/324579982.call(Unknown Source) [forge-1.16.4-35.0.17.jar:35.0] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.6.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.6.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.6.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.6.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.6.jar:?] {}   then I'm try to try-catch Reflection and it's give me that error again? Can anyone help me for that?   Here is my code // throws NoSuchFieldException, IllegalAccessException try { Field fps = Minecraft.class.getDeclaredField("debugFPS"); if (Modifier.isPrivate(fps.getModifiers())) { fps.setAccessible(true); String text = ChatColor.WHITE + "FPS: " + RenderScreenGui.INSTANCE.translateFPSColor(fps.getInt(fps)); this.mc.fontRenderer.drawString(matrixStack, text, ((float)(event.getWindow().getScaledWidth() / 2) + 1.0625F - (float)(this.mc.fontRenderer.getStringWidth(text) / 2)) - ((float)((event.getWindow().getScaledWidth() / 2) - (this.mc.fontRenderer.getStringWidth(text) / 2 + 5) - 1.0625F)), ((float)(event.getWindow().getScaledHeight() / 2 - 24) + (float)(9 + 1)) - ((float)(event.getWindow().getScaledHeight() / 2 - 22)), 16777215); } } catch (NoSuchFieldException e) { throw new RuntimeException("No such field"); }  
  • Topics

  • Who's Online (See full list)