Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • xoombie

xoombie

Members
 View Profile  See their activity
  • Content Count

    4
  • Joined

    August 16, 2020
  • Last visited

    Monday at 05:46 PM

Community Reputation

1 Neutral

About xoombie

  • Rank
    Tree Puncher
  1. xoombie

    Error loading mod outside dev environment

    xoombie replied to xoombie's topic in Modder Support

    Got it working. Thanks for clearing up some confusion for this noob. In case anyone else finds it useful, the SRG names are the cryptic kind, eg func_189810_i The dev environment will also accept human-friendly MCP names as ObfuscationReflectionHelper arguments, eg updateAutoJump The runtime-only environment (ie, during normal use) only works if ObfuscationReflectionHelper has SRG name arguments. My working code now looks like: this.updateAutoJump = ObfuscationReflectionHelper.findMethod(ClientPlayerEntity.class, "func_189810_i", // func_189810_i = updateAutoJump float.class, float.class); this.mouseButtonSimulate = ObfuscationReflectionHelper.findMethod(MouseHelper.class, "func_198023_a", // func_198023_a = mouseButtonCallback long.class, int.class, int.class, int.class); Useful links: MCP, environments and naming Tool for looking up SRG names
    • December 17, 2020
    • 2 replies
  2. xoombie started following Simulate Mouse Click in GUI and Error loading mod outside dev environment December 16, 2020
  3. xoombie

    Error loading mod outside dev environment

    xoombie posted a topic in Modder Support

    On 1.15.2 - 31.2.0 mod runs fine in dev environment, but fails at the first of the following lines during common_setup event phase. If the first line is omitted, it fails on the second, indicating a general problem with symbol lookup in the runtime only environment: this.updateAutoJump = ObfuscationReflectionHelper.findMethod(ClientPlayerEntity.class, "updateAutoJump", float.class, float.class); this.mouseButtonSimulate = ObfuscationReflectionHelper.findMethod(MouseHelper.class, "mouseButtonCallback", long.class, int.class, int.class, int.class); The relevant part of build.gradle: minecraft { [...] mappings channel: 'snapshot', version: '20201216-1.15.1' //mappings channel: 'snapshot', version: '20200514-1.15.1' // also doesn't work [...] } Has anyone else encountered this problem? Have researched for a day now, and just cannot see why the SRG names are not being consistently handled by ObfuscationReflectionHelper Any help greatly appreciated
    • December 16, 2020
    • 2 replies
  4. xoombie

    Simulate Mouse Click in GUI

    xoombie replied to xoombie's topic in Modder Support

    Was a noob mistake. The coordinates used by GLFW for cursor positioning are display pixels, whereas mc renders to a multiple. What worked was: double s = mc.getMainWindow().getGuiScaleFactor(); mc.currentScreen.mouseClicked(x/s, y/s, 0); // 0 is code for left button MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.MouseClickedEvent.Pre(mc.currentScreen, x/s, y/s, 0)); // share event with any mouse handlers (optional) Hope this helps anyone doing something similar
    • August 16, 2020
    • 2 replies
      • 1
      • Like
  5. xoombie

    Simulate Mouse Click in GUI

    xoombie posted a topic in Modder Support

    On 1.15.2, trying to simulate mouse clicks for a mod for a custom hardware input device. Mouse pointer movement works fine, using GLFW.glfwSetCursorPos() However, none of extensive attempts to simulate a mouse click has worked so far. One way is to use java.awt.Robot, but the mod sees itself in a headless environment, where Robot cannot function. (it appears others have successfully used this, but perhaps on old mc versions? is 1.15.2 fundamentally different in this respect?). Other attempts include: MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.MouseClickedEvent.Pre(screen, x, y, GLFW.GLFW_MOUSE_BUTTON_1)); Because these mouse clicks are for GUIs, not the main game (click events in the game itself can be simulated by activating a keybinding). Many many hours lost through this so far, any ideas greatly appreciated. Am new to Minecraft modding, although very familiar with java.
    • August 16, 2020
    • 2 replies
  • All Activity
  • Home
  • xoombie
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community