Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Reflxction

Members
  • Posts

    26
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Reflxction's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks! It now renders much better. Here's the code in case anyone ran into the same problem: float imgRatio = (720F / 1280F); float containerRatio = ((float) sr.getScaledHeight() / (float) sr.getScaledWidth()); float finalWidth; float finalHeight; if (containerRatio > imgRatio) { finalHeight = sr.getScaledHeight(); finalWidth = (sr.getScaledHeight() * imgRatio); } else { finalHeight = (sr.getScaledWidth() * imgRatio); finalWidth = sr.getScaledWidth(); } Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); finalWidth += 400F; // Extend the image display by 400 pixels Gui.drawModalRectWithCustomSizedTexture(0, 0, finalWidth, finalHeight, (int) finalWidth, (int) finalHeight, finalWidth, finalHeight);
  2. Hello. In the process of creating a GUI, I went on trying to give it a custom background. It works well except that, the image stretches itself to fit on the screen, which makes it look weird and impractical. I wonder if there was a way to make it fill the screen without being stretched. Pretty similar to how it appears here: . I'm mainly using Gui#drawModalRectWithCustomSizedTexture() to draw the resource (I tried using the BufferBuilder which roughly brought the same exact result). The image I would like to render has dimensions of 1280x720. I don't know if any other dimension would look better, so if you are aware of any more appropriate size then I'd love to know. Which looks on screen like that: (Blacked out parts are just hidden, however they are a part of the screen. The gradients are extra effects.). Here's the code I'm using: Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); Gui.drawModalRectWithCustomSizedTexture(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight()); I tried replacing all references to scaledResolution with the image's dimensions, which did not really change anything. Any idea on how to make it display normally without being stretched?
  3. Update: Apparently it was much simpler than I thought. @SubscribeEvent public void onRenderPlayer(RenderPlayerEvent.Pre event) { GlStateManager.enableBlendProfile(GlStateManager.Profile.TRANSPARENT_MODEL); } (Result below) Thanks for the help!
  4. Thanks for the help! I'll try when I get on my computer and report back.
  5. Hello. Over the past days I've been trying to find a way to render players to look transparent, just like when they're invisible with the see invisible friends scoreboard tag. I looked around the game code a lot and really couldn't find anything that seemed to be what I want. I probably didn't search enough, so can you possibly help me in my process or tell me where the best place to look at is? Regards ~Reflxction
  6. I was calling it in EntityJoinWorldEvent, where I assume the player wouldn't be null. Anyway, I did a few more googling and found out that what I was looking for is Minecraft.getSession().getProfile()#getId(), as this is what worked for me
  7. Hello. In the process of making a mod I have come across some weird behavior of the game. Anytime I attempt to call Minecraft.getMinecraft().player#getUUID() in singleplayer the game crashes with a NPE. The same thing happened with #getPersistentID(). Is there any reliable way to check if an entity is the player without causing crashes or something. I'm afraid comparing names may not 100% work, and since retrieving the UUID crashed the game, is there any better way to do so?
  8. Hm I see. Mainly trying to modify the client chat packet that is being sent when sending a chat message. I'm aware that this was added in future versions (I became after making the thread), the thing is I'm using 1.8.9 for my current mod (I know I should be on latest, but currently it's the most commonly used in pvp servers and such). I'll just stick with what I currently have, thanks
  9. That sounds rather useful, but my question was about events not packets themselves
  10. Hello, in my mod I have come to the need of using packet events. The only events I found were the CustomPacketEvent and its subclasses. I don't get the meaning of "custom" packet, does it mean that the packet was made by an external mod and not Forge, or made by Forge and not from Minecraft itself, or does it involve ANY packet? If not, are there any handy ways to modify a packet or cancel it? Thanks in advance.
  11. I think this was a mistake when I copied it, but it was closed with the quotations. I sometimes get those: Etag download for http://export.mcpbot.bspk.rs/versions.json failed with code 40 3 FAILURE: Build failed with an exception. * Where: Build file 'my workspace\build.gradle ' line: 39 * What went wrong: A problem occurred evaluating root project 'Impurity Capes'. > java.lang.NullPointerException (no error message) "failed with code 403" means forbidden access, but I could access this from my browser and even tried a VPN.
  12. Hello. Over the past days, I've been encountering issues with Gradle that Forge uses. Every Gradle command I execute seems to fail with the same error. I haven't modified my build.gradle or any Gradle file that the workspace contains. I'm getting the following errors (this one was on gradlew build): * Where: Build file 'my mod workspace\build.gradle ' line: 39 * What went wrong: A problem occurred evaluating root project 'my mod name'. > java.lang.NullPointerException (no error message) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 37.669 secs It says line 39 in build.gradle, which is mappings = "stable_20 I'm using Forge 1.8.9 Before, everything was running completely fine and I didn't encounter any problems. One of the things I have done was update Java and IntelliJ IDEA. Could that be the cause? If so do I need to update other things like Gradle or will I have to downgrade Java? If not, got any idea or any way to fix that issue? Thanks in advanced.
  13. Yeah but doesn't the server modify the display name using a packet, and when the client receives it it renders based on it?
  14. Hello. Recently I've been working on a mod that formats player names. Everything is fine expect that the display name is done in the client then the server formats it. I was wondering if there was a way for the event#displayname in PlayerEvent.NameFormat to be the name after the server modifies it, or any other way to get the format name after being modified by the server. (by server I mean in multiplayer) Thanks in advance.
  15. No it's not, just like running a normal version from the official launcher (sorry for the bump, I forgot to check my forge account)
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.