-
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 (4/8)
9
Reputation
-
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.
-
Also don't push and pop attribute.
-
In 1.12 item stacks are never null.
-
Your BlockRegistry class is never registered as an event handler. Change all the registry methods to static and annotate the class with @EventBusSubscriber.
-
[Solved][1.12] Ignoring light/lack of light in TESR using Tesselator
Silly511 replied to oldcheese's topic in Modder Support
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. -
[1.12.2] How do you render a shape in the world ?
Silly511 replied to grand_gibus's topic in Modder Support
You can use RenderWorldLastEvent#getPartialTicks instead of that horribly hacky thing. -
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.
-
You should use ByteBufUtils.writeString and ByteBufUtils.readString instead.
-
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.
-
Bump
-
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?
-
Just make a daemon thread. public class StatDownloadThread extends Thread { public StatDownloadThread() { this.setDaemon(true); this.start(); } public void run() { //Fetch stats. } }
-
[1.12.1] [Solved] Model is shading opposite side
Silly511 replied to Silly511's topic in Modder Support
Thank you, that seemed to fix it.