Jump to content

Jwosty

Forge Modder
  • Posts

    128
  • Joined

  • Last visited

Everything posted by Jwosty

  1. Before you call drawTextureModalRect, call glColor. Example for 50% transparency: @ForgeSubscribe public void TestRender(RenderGameOverlayEvent.Post event){ //========Resolution======== res = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); int width = res.getScaledWidth(); int height = res.getScaledHeight(); //========Resolution========+ this.mc.renderEngine.func_110577_a(new ResourceLocation("/Num/Chintzy/" + "Preview" + ".png")); [b]GL11.glColor4f(1, 1, 1, 0.5f);[/b] drawTexturedModalRect(100, 100, 0, 0, 500, 500); mc.func_110434_K().func_110577_a(Gui.field_110324_m); }
  2. Because you have to send it (very bottom of the tutorial page) -- makePacket() just creates the packet and nothing more. When I remove the queue stuff, it doesn't do anything at all. Also, the side variable in OutgoingWormholePacket.execute is being set to SERVER, but it's still executing on the client, which is definitely very strange...
  3. Relevant code: PacketHandler.java (code is pretty much copy-paste from the tutorial here), SDPacket.java (once again, no changes other than the name), OutgoingWormholePacket.java (the same as TestPacket but with different data), and finally BlockStargateController.java line 129 (sends the custom packet from the client side with some test data) If it matters, I'm using 1.6.2 but I assumed that's what you assumed
  4. Ok, just finished implementing their packet handler, but the exact same thing happens. See my GitHub repo for the code... PS: I feel like I'm taking over OP's thread... I have my own I created recently. But then again, this _is_ relevant (at least, I _think_ OP and I are having the same problem here...). Should we discuss there or here?
  5. Are you sure it's not making it to the server? Its quite hard ( for me anyway ) to determine wether or not the packet has gone through... I'm also finding it quite difficult to do so I've tried a few ways: Unless I comment out the @SideOnly annotation, the game crashes with a NoMethodFound error, indicating that the packet is being handled client-side. side and isClient get set to Side.CLIENT and true respectively, which would mean that the code is server-side, while effectiveSide is Side.SERVER , indicating that the code is being handled client-side. I'm most inclined to believe the SideOnly annotation and the value of world.isRemote , especially since the latter should have failed if it were running server side (well, the Minecraft.getMinecraft() part)
  6. @Mew: I've been having the same issue with the packet handlers where if I try to send a custom packet from the client, it comes back to the client and not to the server... Any idea on why it's doing this and how to fix it? It's so very frustrating!
  7. You could probably use player.onGround somehow.
  8. Oh and to put it another way, my current solution on the block placement is to send a custom packet client -> server but for some reason it's seems to be going client -> client
  9. I'm not trying to write the open GUI code: I already have that. Essentially I'm trying to place some blocks from the GUI, usin a packet. The recieving end of the packet handler is only executing on the client server instead of the server side when I send the packet to the server... And thanks for pointing out that Minecraft.getMinecraft() doesn't work on server side, which means that that part, ironically, should cause a crash when the packet sends correctly and the server receives it instead of the client... I guess that's how I'll know when it works!
  10. Ok, I've been trying to do work on the packet for a few days now using the Forge packet handling page, but for some reason the packet handler always excecutes on the client side (I've confirmed this by getting the side in the debugger and also using @SideOnly(Side.SERVER) ). And the code for the packet calls are written exactly following the tutorial... here are the files in question: BlockStargateController.java, line 127, PacketHandler.java, line 18 Does this have something to do with me only testing this on SP? I though Minecraft ran a server even for that gamemode anyway... PS: I also did use [url=https://github.com/jwosty/Minecraft-SpaceDistortionMod/blob/develop/common/SpaceDistortion.java#L15]serverSide=true[/url] in the mod class @NetworkMod annotation EDIT: I'm using this for a similar effect to the Nether portal stuff, but to called from a GUI instead of a block tick or whatever.
  11. DISCLAIMER: I'm not really sure this kind of post is okay in this board, but anyway, I feel like this needs to be here. I've recently had much trouble using MCP for MC 1.6.2 on OSX; it stopped decompiling with this error: ... == ERRORS FOUND in JAVA CODE == src/minecraft/net/minecraft/src/ChatMessageComponent.java:256: warning: non-varargs call of varargs method with inexact argument type for last parameter; cast to java.lang.Object for a varargs call cast to java.lang.Object[] for a non-varargs call and to suppress this warning var7.append(StatCollector.translateToLocalFormatted(this.field_111090_h, var13)); ^ src/minecraft/net/minecraft/src/RenderBlocks.java:4972: missing return statement } ^ 1 error 1 warning ================== Initial client recompile failed, correct source then run updatemd5 But lucky for you if you're running into this to; I've found the solution! Change the following line in conf/mcp.cfg : CmdFernflower = %s -jar %s -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir} to: CmdFernflower = %s -Xmx512M -jar %s -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir} Problem solved! This was in commit 4762d4d, so if you're using the latest source, this shouldn't happen anyway. Hope this helped someone.
  12. I've used reflection in MC before; it works. Just don't remember what though... I think it was actually an Enum as well
  13. If this is simply a Java question, this would be a much better fit for StackOverflow. In fact, I'll bet you anything it's already been answered there!
  14. Here's an idea: if you want to make things easier for some people to help out, you could use GitHub. That way people could just drop in from this post, checkout some code, optimize it, and submit a pull request all in a day's work. Sounds like fun.
  15. You can't just dump code into a class declaration; it has to be inside a method or part of a field assignment (core Java concept I guess you could say). Your mistakes are when you try to register the crafting recipes in the middle of your mod class. Try working through the tutorials like PlatonCraft said... Also might want to work on your Java
  16. When the "light" blocks are placed, you could just skip any normal blocks. But there are still many things that wouldnt quite work... Or maybe an approach using an entity that renders differently depending on the blocks around it; just speculation... Well in any case, it's probably fine as it is
  17. Oh hey, look what I tripped on while browsing the forums: http://www.minecraftforge.net/forum/index.php/topic,11624.0.html What the coincidence I'll say.
  18. True... I'm slightly surprised though that's the case since I would _think_ it would just be some OpenGL calls since that's how GUIs work. Well, I guess you learn something new every day!
  19. Here's a forum topic on setting the block light levels
  20. Wow, nice video and intro. This seems pretty good! One suggestion though: it would be awesome if the lighting color matched the color of the lamp... Not sure if this is trivial though, as I haven't poked around with the lighting API (raw OpenGl or abstracted?). But this can still definitely make your homes less dull.
×
×
  • Create New...

Important Information

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