Jump to content

Silly511

Members
  • Posts

    176
  • Joined

Converted

  • Gender
    Male

Recent Profile Visitors

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

Silly511's Achievements

Creeper Killer

Creeper Killer (4/8)

9

Reputation

  1. Minecraft#isSingleplayer will return false if the player is connected to a server, and true if the player is in singleplayer or hosting a LAN world. Minecraft#getIntegratedServer().getPublic() will return true if the player is hosting a LAN world but will throw a NullPointerException if the player is connected to a server. So you could use !mc.isSingleplayer() || mc.getIntegratedServer().getPublic() which will be true if the player is connected to a server or hosting a LAN world and false if the player is in a singleplayer world.
  2. Your BlockRegistry class is never registered as an event handler. Change all the registry methods to static and annotate the class with @EventBusSubscriber.
  3. TileEntitySpecialRenderer has a method called setLightmapDisabled that allows you to disable and enable lighting. The lighting in GlStateManager causes your polygons to be shaded slightly darker on the sides and bottom.
  4. You can use RenderWorldLastEvent#getPartialTicks instead of that horribly hacky thing.
  5. I was about to edit my post when you replied, I should have been more specific. You can't use the code you posted because you can't read the string afterwards. You need to know how long the string is so you know how many bytes to read. ByteBufUtils.writeString will write the length so that ByteBufUtils.readString knows how many bytes to read.
  6. You should use ByteBufUtils.writeString and ByteBufUtils.readString instead.
  7. I'm rendering some things in RenderWorldLastEvent and would like to have fog applied to them. However when I enable fog, it originates from vertex position instead of player position. Here's my code: Tessellator tess = Tessellator.getInstance(); BufferBuilder buffer = tess.getBuffer(); GlStateManager.pushMatrix(); RenderHelper.translateToZero(); GlStateManager.disableTexture2D(); GlStateManager.color(1, 0, 0); GlStateManager.disableCull(); GlStateManager.enableFog(); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); buffer.pos(0, 100, 0).endVertex(); buffer.pos(-1.1, 100, 0).endVertex(); buffer.pos(-100, 100, 0).endVertex(); buffer.pos(-101.1, 100, 0).endVertex(); tess.draw(); GlStateManager.disableFog(); GlStateManager.enableCull(); GlStateManager.enableTexture2D(); GlStateManager.popMatrix(); And this is the translateToZero() method: public static void translateToZero() { Entity entity = mc.getRenderViewEntity(); float partialTicks = mc.getRenderPartialTicks(); GlStateManager.translate( -(entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks), -(entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks), -(entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks) ); } Do I need to draw my quads in a different way? I've never done anything with OpenGL fog.
  8. I have a capability that I'm attaching to all items. There are a couple of values that I would like to sync to the client, however since I am attaching this capability to all items I can't override onUpdate or getNBTShareTag to do the syncing. How can I do this, or is it even possible?
  9. Just make a daemon thread. public class StatDownloadThread extends Thread { public StatDownloadThread() { this.setDaemon(true); this.start(); } public void run() { //Fetch stats. } }
×
×
  • Create New...

Important Information

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