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
  • Peyang

Peyang

Members
 View Profile  See their activity
  • Content Count

    8
  • Joined

    January 18
  • Last visited

    January 21

Community Reputation

0 Neutral

About Peyang

  • Rank
    Tree Puncher
  1. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    Apparently my repository is cursed. It worked perfectly in other repositories. Thank you very much.
    • January 18
    • 12 replies
  2. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    When I reproduced it as another mod, it worked fine. I'll port the code to this mod and test it. I would appreciate it if you could tell me why it doesn't work. https://github.com/Yuki-At/RenderMod
    • January 18
    • 12 replies
  3. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    Ah, I'm sorry. I will try to reproduce it in personal project.
    • January 18
    • 12 replies
  4. Peyang Peyang changed their profile photo January 18
  5. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    This is a mod that reproduces the GTA Wanted Star. 1. Build a PaperMC 1.15.2 server. 2. Copy https://github.com/TeamKun/GTAWantedDisplayTestPlugin/releases to plugins and do /reload or /restart. 3. Build https://github.com/TeamKun/GTA5WantedDisplayMod and enter the Bukkit server. 4. From the player, run /wanted <maxWanted> <nowWanted>. Note: maxWanted is the maximum number of stars and nowWanted is the number of stars to change Five stars will wrap to the next line. Test case: Input /wanted 10 4 Expected output: ★★★★☆ ☆☆☆☆☆ Input /wanted 5 3 Expected output: ★★★☆☆ Input /wanted 20 13 Expected output: ★★★★★ ★★★★★ ★★★☆☆ ☆☆☆☆☆ I look forward to working with you. Thank you
    • January 18
    • 12 replies
  6. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    Originally it was created to connect Bukkit and Forge with a Plugin Message. nowWanted is a dedicated plug-in "https://github.com/TeamKun/GTAWantedDisplayTestPlugin" Changed from "/ wanted <max> <now>". The server is Bukkit Server, not Forge Server. Also, nowWanted if passed safely and I was able to get standard output. I look forward to working with you. Also, this mod does not need to send packets, it intercepts packets from the server. I pushed the code for this log. public void draw() { if (nowWanted == 0) return; System.out.println("nowWanted: " + nowWanted);
    • January 18
    • 12 replies
  7. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    I'm sorry, when pasting from IDE, the variable name seems to disappear around the color... It actually compiles and draw () seems to be running. <-Checked with standard output. Also, my code is posted on GitHub, and if you have any questions, please take a look there. Also, I modified the code. https://github.com/TeamKun/GTA5WantedDisplayMod
    • January 18
    • 12 replies
  8. Peyang

    [1.15.2] Display text in the upper right

    Peyang replied to Peyang's topic in Modder Support

    @SubscribeEvent public void onRender(final RenderGameOverlayEvent.Pre event) { if (event.getType() != RenderGameOverlayEvent.ElementType.ALL/*HEALTH*/) return; DrawTest.draw(); } public void draw() { if (nowWanted == 0) return; IngameGui gui = Minecraft.getInstance().ingameGUI; int maxWidth = Minecraft.getInstance().getMainWindow().getWidth(); int maxHeight = Minecraft.getInstance().getMainWindow().getHeight(); int width = Regions.getStringWidth(StringUtils.repeat(/*'\u2606'*/"a", 5)); String nowS= StringUtils.repeat(/*'\u2605'*/"a", 5); String maxS= StringUtils.repeat(/*'\u2606'*/"b", 5); String cS= nowS+ maxS; Matcher matcher = new Pattern("[\\s]{1,5}").matcher(cS); AtomicInteger ip = new AtomicInteger(); FontRenderer fr = Minecraft.getInstance().fontRenderer; while (matcher.find()) { //drawText(matcher.group(), 2, 2); gui.drawCenteredString(fr, "Test123", 20, 20, 0xffFFFFFF); ip.set(ip.get() + 11); } } public static final int FULL_COLOR = Regions.colorFromRGB(255, 255, 255, 255) public static int colorFromRGB(Number red, Number green, Number blue, Number alpha) { return red.intValue() << 16 | green.intValue() << 8 | blue.intValue() | alpha.intValue() << 24; } public static void drawText(String s, int w, int h) { FontRenderer fr = Minecraft.getInstance().fontRenderer; fr.drawStringWithShadow(s, (float) w, (float) h, FULL_COLOR);}
    • January 18
    • 12 replies
  9. Peyang started following [1.15.2] Display text in the upper right January 18
  10. Peyang

    [1.15.2] Display text in the upper right

    Peyang posted a topic in Modder Support

    (Please forgive me for using a translator. I wanted to show strings on the display and created a project in 1.15.2. I ported from the code that worked in 1.8.9, but apparently it doesn't work in 1.15.2. In the code of 1.8.9 I used Minecraft.getInstance().fontRenderer.drawStringWithShadow() from RenderGameOverlayEvent.Pre. Since there was the same method in 1.15.2, I wrote it as it is, but it seems that it does not work. I also tried, but it didn't work. I also tried RenderGameOverlayEvent.Post and so on. Can anyone please teach me how to display the character string in the upper left corner of the screen?
    • January 18
    • 12 replies
  • All Activity
  • Home
  • Peyang
  • Theme

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