Jump to content

Lucius Q. User

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Lucius Q. User

  1. Is there a way to create a DamageSource that bypasses Draconic-style armor? (I have a "cast from hitpoints" mechanic in my mod and draconic style armor blocks the hp drain from that mechanic)
  2. You create a subclass of EntityOcelot with an overridden processInteract and replace all ocelots in the world with your ones.
  3. I am trying to use a particle to draw a beam from the player to the target. Instead the particle a good distance from both the player and the target: The code: @Override public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { Vec3d lookVec = Helpers.getEntityLook(Minecraft.getMinecraft().player, 1).eyePosition; drawBeam(buffer, origin, target, lookVec, 2); } public static void drawBeam(BufferBuilder buffer, Vec3d S, Vec3d E, Vec3d P, float width) { Vec3d PS = S.subtract(P); Vec3d SE = E.subtract(S); Vec3d normal = PS.crossProduct(SE).normalize(); Vec3d half = normal.scale(width); Vec3d p1 = S.add(half); Vec3d p2 = S.subtract(half); Vec3d p3 = E.add(half); Vec3d p4 = E.subtract(half); int brightness = 240; int b1 = brightness >> 16 & 65535; int b2 = brightness & 65535; buffer.pos(p1.x, p1.y, p1.z).tex(0.0D, 0.0D).lightmap(b1, b2).color(255, 255, 255, 128).endVertex(); buffer.pos(p2.x, p2.y, p2.z).tex(1.0D, 0.0D).lightmap(b1, b2).color(255, 255, 255, 128).endVertex(); buffer.pos(p3.x, p3.y, p3.z).tex(1.0D, 1.0D).lightmap(b1, b2).color(255, 255, 255, 128).endVertex(); buffer.pos(p4.x, p4.y, p4.z).tex(0.0D, 1.0D).lightmap(b1, b2).color(255, 255, 255, 128).endVertex(); }
  4. So if a situation is impossible save for bugs, kick.
  5. Sigh. 1. I know about sides, thanks. 2. The question is: If a certain kind of packet is recieved on a server, then either the mod has a bug, or the client is hacking. What should i do in such situation. I edited the OP to make it more concise.
  6. If a certain kind of packet is recieved on a server, then either the mod has a bug, or the client is hacking. What should the server do in such situation? Kick the player from server? Tell the player in chat that a error occured? Something entirely different?
  7. Entities have a "motionY" field. I believe that that is what you're looking for.
  8. You would need to check for your structure in the world and place portal blocks inside of it. That's why vanilla portal needs to be "ignited", so the game won't need to check every block, only the one that was iginted.
  9. Just use access transformers and unprivate the methods.
  10. Please show your item code. Overriding "getUnlocalizedName" is the correct way to change the name, so your code must be doing something wrong.
  11. I find your lack of Google-fu disturbing: https://wiki.mcjty.eu/modding/index.php/GUI-1.12
  12. I did enable it. The problem is not that it is not cutting anything, but rather that it cuts too much. EDIT: The problem is as follows: drawRect(...)// <- gets drawn setUpStencil(...) drawRect(...) // <- gets cut entirely (should get cut only partially) disableStencil() drawRect(...) // <- gets drawn
  13. Sorry, what? I have just set it up and it cuts everything drawn while it is active.
  14. Unfortunately i was not able to see your image, (It is corrupted or something), but the simple answer is: You don't intercept the packet, but create a new one and run your code in it's handler. Here is a tutorial to how to make your own packets: https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
  15. EDIT: I switched to using scissor test. I am trying to set up stencil buffer to cut everything that gets drawn outside of a specific rectangle in the gui. Instead, everything that is drawn after the stencil buffer is set up gets cut; Here is the stencil set up code: public static void setUpStencil(int left, int top, int right, int bottom) { if (left < right) { int i = left; left = right; right = i; } if (top < bottom) { int j = top; top = bottom; bottom = j; } Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexbuffer = tessellator.getBuffer(); GL11.glEnable(GL11.GL_STENCIL_TEST); GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF); GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE); GL11.glStencilMask(0xFF); GL11.glDepthMask(false); GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT); vertexbuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); vertexbuffer.pos(left, bottom, 0.0D).endVertex(); vertexbuffer.pos(right, bottom, 0.0D).endVertex(); vertexbuffer.pos(right, top, 0.0D).endVertex(); vertexbuffer.pos(left, top, 0.0D).endVertex(); tessellator.draw(); GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF); GL11.glStencilMask(0x00); GL11.glDepthMask(true); } Here is the actual drawing code: drawDefaultBackground(); setUpStencil(20, 20, width - 20, height - 20); drawRect(0, 0, 50, 65); //Some drawRect calls here
  16. Subscribe to LivingEquipmentChangeEvent, check for full armor and apply/remove the effects there.
  17. It appears that the versions of Optifine and replaymod, that you are trying to use, are designed for Minecraft 1.10.2. So you should either upgrade Minecraft or find 1.8.9 versions of those mods.
  18. https://www.spongepowered.org <- you should ask here for assistance
  19. Is it ok to have a somthing like 60 blocks long EntityFX? All the ones i seen in vanilla are usually very small.
  20. You are trying to send the message from the server. isRemote being true means that code runs on the client.
  21. You can do that, but it is not a good idea. Just do all the calculations on the server and send a packet with allow/deny.
  22. You need to have something like this: 1. On block activation the client sends a packet to the server. 2. The server checks what it needs to check, and sends a reply packet with the results. 3. The client receives the packet and either opens the gui, or tells the player that the permission was denied.
  23. Hi, everyone! I am currently writing a mod that has a "Laser gun", that when right clicked shoots a (potentially very long) beam. I have two questions about how to draw said beam. 1. Where should i put the beam drawing code? Create an EntityFX for it, somehow do it in the Item renderer itself (if so, than how?) or do arcane magicks with TESRs? 2. I want the beam to originate in a specific place of the gun's model. How do i convert the the "muzzle's" coordinates from model's coordinate system to world coordinates?
×
×
  • Create New...

Important Information

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