Jump to content

OreCruncher

Forge Modder
  • Posts

    165
  • Joined

  • Last visited

Everything posted by OreCruncher

  1. That is interesting. I will have to take a look at that. Unfortunately, though, my nefarious plan hit a snag. I will go the passive route. Main reason is that I introduced an option to disable a feature server side meaning that the Client can't rely on the fact the the mod is installed remotely to behave a certain way. I could do a handshake to transfer necessary bits and what not, but the passive route, at least for my mod, is the least complex and easiest way.
  2. I have a mod that can run on the client independent of whether it is installed on a server. What I want to do is fine tune client side behavior of my mod if it happens to be installed on the remote server. Is there a client side query I can make to ask if my mod is installed remotely, or do I need to do something more passive like assume its not installed until I get evidence that it is installed (like a network packet coming in)? (I could just go the passive route and make it work regardless, but right now this is point of my education. I may learn something. )
  3. Egad! I don't want to scare anyone!
  4. In my case the JPanel is just displaying information - no editing or things like that. Pretty basic. What I did do is create my own JPanel and TableModel for the data I wanted to render. I tell it to repaint() whenever the data underneath updates during the client tick cycle and is safe to access. As you point out if I do something more detailed I would have to put in some infrastructure. (Would be nice to have some sort of basic library where a mod could "plug in" for supplying diagnostics.)
  5. I am wanting to open up a Java window rather than having an in-game GUI. My intention is to display some debug/diagnostic information while I am going through the world doing various tests of my mod. My question whether there is sample code laying around somewhere that demonstrates a good of handling, and failing that whether there is guidance on how to approach. Thanks!
  6. Thank you!
  7. Is there a way to get the build process to use any locally cached information, or do we just have to pray the server comes back up?
  8. Forge version 1.10.2-12.18.3.2185 NetHandlerPlayClient, line 2148 (inside handleEntityProperties()): if (iattributeinstance == null) { iattributeinstance = abstractattributemap.registerAttribute(new RangedAttribute((IAttribute)null, spacketentityproperties$snapshot.getName(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); } Inside the RangedAttribute CTOR an exception is generated because the default value (0.0D) is less than the minimum bound (2.2250738585072014E-308D). Shouldn't the minimum bound be 0.0D, or -Double.MAX_VALUE? I am new to this area of modding so I could be looking at this entirely wrong.
  9. That's what I thought. Because of how the class was implemented it was the only place that I could guarantee it would be flagged. My new sandbox implementation does it differently.
  10. This particular set of classes had a colorful past. They started off reading/writing Json but morphed into what you currently see. * Is it that markDirty is generally pointless? * I was planning on making it per dimension as you indicate - would simplify things. Thanks for the suggestions.
  11. Link to the file in my Github repository. My main concern is that I have a Set<> burried in DimensionEffectData. It is possible that the Set<> would be modified in the main server thread while the IO thread is serializing - assuming serialization takes place in the IO thread.
  12. I have been getting sporadic concurrency exceptions from the chunk IO thread and I suspect it may be related to how I interact with my global WorldSavedData. Currently I do not have concurrency guards in place. I looked at the mcforge docs and I did not see anything on this particular topic. So my question is do I need to synchronize access to my WorldSavedData? EDIT: Additional info - I do have various lists inside the WorldSavedData object.
  13. Found a way to do it: OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, ...); You can find my updated code here. Not sure what the parameters are doing exactly so I need to do more research. Thanks for the help guys/gals!
  14. Normally in full light, such as in a cave standing by a torch, the objects I render look fine color wise. If I were to walk away from the torch into the darkness the objects I render become darker because there is less light "hitting" it. What I want to do is tell the render engine not to worry about the lighting and just render my items without the fancy light effects.
  15. Tried that already and it didn't work. Of course, I could have put it in the wrong place. Here is my current code for the text drawing routine: private static void drawText(final FontRenderer font, final List<String> input, final float x, final float y, final float z, final float viewerYaw, final float viewerPitch, final boolean isThirdPersonFrontal, final boolean isSneaking) { final int numberOfMessages = input.size(); int maxWidth = MIN_TEXT_WIDTH; for (final String s : input) { int strWidth = font.getStringWidth(s); if (strWidth > maxWidth) maxWidth = strWidth; } // Calculate scale and position final float scaleBase = 0.8F; // 1.6F; final float scale = scaleBase * 0.016666668F; final double top = -(numberOfMessages) * 9 - BUBBLE_MARGIN; final double bottom = BUBBLE_MARGIN; final double left = -(maxWidth / 2.0D + BUBBLE_MARGIN); final double right = maxWidth / 2.0D + BUBBLE_MARGIN; final Tessellator tessellator = Tessellator.getInstance(); final VertexBuffer buffer = tessellator.getBuffer(); GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F); GlStateManager.rotate(-viewerYaw, 0.0F, 1.0F, 0.0F); GlStateManager.rotate((float) (isThirdPersonFrontal ? -1 : 1) * viewerPitch, 1.0F, 0.0F, 0.0F); GlStateManager.scale(-scale, -scale, scale); GlStateManager.disableLighting(); GlStateManager.depthMask(false); GlStateManager.disableDepth(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.disableTexture2D(); // Draw the background region final float red = B_COLOR.red; final float green = B_COLOR.green; final float blue = B_COLOR.blue; final float alpha = B_COLOR_ALPHA; buffer.begin(7, DefaultVertexFormats.POSITION_COLOR); buffer.pos(left, top, 0.0D).color(red, green, blue, alpha).endVertex(); buffer.pos(left, bottom, 0.0D).color(red, green, blue, alpha).endVertex(); buffer.pos(right, bottom, 0.0D).color(red, green, blue, alpha).endVertex(); buffer.pos(right, top, 0.0D).color(red, green, blue, alpha).endVertex(); tessellator.draw(); GlStateManager.enableTexture2D(); int lines = numberOfMessages; for (int t = 0; t < numberOfMessages; t++) { final String str = input.get(t); final int offset = -lines * 9; final int margin = -font.getStringWidth(str) / 2; GlStateManager.disableDepth(); font.drawString(str, margin, offset, F_COLOR.rgb()); GlStateManager.enableDepth(); GlStateManager.depthMask(true); font.drawString(str, margin, offset, F_COLOR.rgb()); lines--; } GlStateManager.enableLighting(); GlStateManager.disableBlend(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.popMatrix(); }
  16. My mod logic listens for the RenderLivingEvent.Post event so that it can render text above a player's head. Mechanically everything works fine. However, the text will "dim" when it gets into dark areas, like underground. I was wondering if there is a GlStateManager command that will prevent this dimming from happening - I want the text to stay at a normal brightness. Thanks!
  17. For 1.7.10/1.8.9 about 4000 if I recall correctly.
  18. And for today's "Doh!" moment I present the following.... The GuiScreen instance has "global" settings for flags indicating whether config changes require world or Minecraft restart. In my CTOR for the derived class I passed in true for both these values which will override whatever the individual ConfigCategory/Property objects are set to. I changed those suckers to false and I am good to go.
  19. I have a bunch of options I display for my mod using the GuiConfig system. Some of the options require restart, others do not. What I am finding is that all the tooltips for my options indicate that a restart is required regardless of the MC and world restart being set to false for the config entry. I should point out that altering a settings that requires restart will result in the confirmation dialog that the user has to click "I Understand". Furthermore, if I go in and change settings for config items that do not require restart I get no confirmation dialog as expected. My conclusion from this is that my flags are operating is intended, but for some reason the config framework is needing some other information I am not aware of. My hope is that someone else has tripped over this issue and can provide insight. I can't preclude that I haven't done anything bonehead since this is my first time dealing with this subsystem, but to me it seems to be a pretty straight forward deal.
  20. Sounds like the potion effect is a marker of some sort to say that "critter was whacked by something special".
  21. I was wondering if there is a regex for a block name returned from the block registry. Based on my fairly simple investigation it seems the name is rather open ended. Only specific thing I noticed is that the string is comprised of two tokens pasted together with a ":"(the mod ID and the name of the block within the mod). If there is a regex buried within Minecraft/Forge I could use, great! Otherwise, does someone have an expression they use that has been working? Thanks!
  22. lol - I do have a 1.8.9 version of the mod. It may be that this feature would be restricted to that version. Thanks!
  23. I looked at the Minecraft code and short of ASM I can't see a way to replace the liquid block rendering routine. So my question is whether anyone knows how to replace a vanilla rendering routine (in this case for BlockLiquid) without resorting to ASM? Thanks!
  24. Sorry for replying to my own thread. The problem appears to have resolved itself over the past hour. I guess getting a cup of coffee does help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.