Jump to content

TominoCZ

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by TominoCZ

  1. this is what I edited in EntityDiggingFX.class(yes, I'm doing this in MCP): public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; float var9 = var8 + 0.015609375F; float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; float var11 = var10 + 0.015609375F; float var12 = 0.1F * this.particleScale; if (this.particleIcon != null) { var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); } float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY) - var12 / 2; float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); p_70539_1_.setColorOpaque_F(1F, 1F, 1F); //TODO //var8, var9 - X U //var 10, var 11 - Y V //front p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var9, (double)var10); //back p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var9, (double)var10); //left p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var9, (double)var10); //right p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10); //top p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var10); //bottom p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10); } now how do I make the cube rotate randomly while falling? By adding some code to the onUpdate method in EntityFX perhabs?
  2. Well the code will be almost the same for newer versions right?
  3. I tried to do this many times.. searched on google, even followed this tutorial: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editing but still I have no damn idea how it works and how to do it. I basically what to do this: https://www.youtube.com/watch?v=6osH9bUVpsU work with forge (I made this in MCP 1.7.10) Is there any easier way to do this? if not, let's say I want to replace a method using Class.getClass().getMethod() maybe? Also the class' name after reobfuscating (using MCP) is bld.class...
  4. Ok.. I did a little bit of research and learned how the vertexes with UV work nad played with it in MCP for a while(not forge, an internal mod - modified base class). This is the result: https://www.youtube.com/watch?v=6osH9bUVpsU Now all I need is to make this work with forge. And that is by making this a core mod. Just like the NotEnoughItems mod.. But I just couldn't figure out how. thanks to this method I changed in EntityDiggingFX.class[MCP]: public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; float var9 = var8 + 0.015609375F; float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; float var11 = var10 + 0.015609375F; float var12 = 0.1F * this.particleScale; if (this.particleIcon != null) { var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); } float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY) - var12 / 2; float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); p_70539_1_.setColorOpaque_F(1F, 1F, 1F); //TODO //var8, var9 - X U //var 10, var 11 - Y V //front face p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var9, (double)var10); //back face p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var9, (double)var10); //left face p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var9, (double)var10); //right face p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10); //top face p_70539_1_.addVertexWithUV(var13, var14 + var12, var15, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var10); //bottom face p_70539_1_.addVertexWithUV(var13, var14, var15 + var12, (double)var8, (double)var10); p_70539_1_.addVertexWithUV(var13, var14, var15, (double)var8, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15, (double)var9, (double)var11); p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10); } For forge, you add this piece of code to a new class extending EntityFX or EntityDiggingFX... Spawn it with Minecraft.getMinecraft().addEffect.effectRenderer(new [your Particle Class]([params]))
  5. Well. He said it's too complicated with the OpenGL.. here: you can see our conversation in the comments.. also.. if as you say, 1.7.10 is not suported anymore... am I able to make it work for 1.8 then?
  6. well since I don't really play any modpacks, I think it'll be ok with just block particles(breaking, and sprinting particles of the block you sprint on) And another thing is that I don't know how to register the class with the effects and make it a core mod...... Also about that video.. that modpack runs on a minecraft client, that is customized including it'd LWJGL libraries.... I looked into the source code of the minecraft.jar file (the menu says it's MC1.8 though) and they use Vector3 and such.. which I don't know how to use here.... one of my friends actually did make 3D particles but not using a core mod(they didn't replace the original ones..). I asked him for the code so I'm still waiting for response..
  7. Ok.. one more question.. Is it possible to override the original minecraft's block breaking particle class using a core mod or something? I'd actually like to render every particle 3D instead of 2D..
  8. I want to make my block spawn 3D little cube particles that look similar to this: (craftland.org custom minecraft client with custom aether mod, multiplayer only). I use a tessellator to draw. here's my FX class: package com.fancyparticles.mod; import static org.lwjgl.opengl.GL11.GL_BLEND; import static org.lwjgl.opengl.GL11.GL_GREATER; import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; import static org.lwjgl.opengl.GL11.glAlphaFunc; import static org.lwjgl.opengl.GL11.glBlendFunc; import static org.lwjgl.opengl.GL11.glDepthMask; import static org.lwjgl.opengl.GL11.glDisable; import java.util.Random; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class EntityBreakFX extends EntityFX{ Random r = new Random(); static final ResourceLocation texture = new ResourceLocation(Main.MODID, "textures/particle/texture.png"); protected EntityBreakFX(World world, double x, double y, double z) { super(world, x, y, z); setGravity(1); setScale(1); setMaxAge(100); } @Override public void renderParticle(Tessellator tess, float partialTicks, float par3, float par4, float par5, float par6, float par7) { Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glDepthMask(false); GL11.glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glAlphaFunc(GL_GREATER, 0.003921569F); tess.startDrawingQuads(); tess.setBrightness(getBrightnessForRender(partialTicks)); float scale = 0.0125F * particleScale; float x = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX); float y = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY); float z = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ); //here used to be the part where it was drawing vertexes with UVs. that's 2D. How can I make it 3D? //here's my first attempt to render a cube (I was too lazy to keep trying to invert the inverted normal maps...... so they're not translucent...): /* //Front tess.addVertex(x + 1, y + 1, z + 1); tess.addVertex(x, y + 1, z + 1); tess.addVertex(x, y, z + 1); tess.addVertex(x + 1, y, z + 1); //Back tess.addVertex(x + 1, y + 1, z + 1); tess.addVertex(x, y + 1, z + 1); tess.addVertex(x, y, z + 1); tess.addVertex(x + 1, y, z + 1); //Bottom tess.addVertex(x + 1, y, z); tess.addVertex(x, y, z); tess.addVertex(x, y, z + 1); tess.addVertex(x + 1, y, z + 1); //Top tess.addVertex(x, y + 1, z); tess.addVertex(x, y + 1, z + 1); tess.addVertex(x + 1, y + 1, z + 1); tess.addVertex(x + 1, y + 1, z); //Left tess.addVertex(x, y + 1, z + 1); tess.addVertex(x, y, z + 1); tess.addVertex(x, y, z); tess.addVertex(x, y + 1, z); //Right tess.addVertex(x + 1, y + 1, z + 1); tess.addVertex(x + 1, y + 1, z); tess.addVertex(x + 1, y, z); tess.addVertex(x + 1, y, z + 1); */ tess.draw(); glDisable(GL_BLEND); glDepthMask(true); glAlphaFunc(GL_GREATER, 0.1F); } public int getFXLayer() { return 3; } public EntityBreakFX setMaxAge (int maxAge) { particleMaxAge = maxAge; return this; } public EntityBreakFX setGravity (int gravity) { particleGravity = gravity; return this; } public EntityBreakFX setScale (int scale) { particleScale = scale; return this; } } Is it possible?
  9. I know what I'm doing but you just don't understand my code
  10. You just don't understand the code
  11. I did what Failander(or whatever his name is) told me to do and I'm having the exact same problem as I was having before. My IMessageHandler class: My Block class: And when you click the block, a gui opens, the Gui class: As I already mentioned, the block is visible only for the client on the server, until you activate(right-click) it. What I need to do is set a block in the server's world not in the client's one.. Because the Gui class is clientside only, it places the block clientside(on a server) aswell. EDIT: Uploaded a video: https://youtu.be/QwC14FKs0AM
  12. guys.. havin' tha same problem
  13. So I have to make a public variable in the messagehandler/packethandler?
  14. the number of players joined in a lobby
  15. BUT You can't read the variable.. cuz this is in my Packet right now: So how can I store a world variable?
  16. I already have a packet handler. But how can I place block through it?
  17. Well the you can see the block on the server, but when you click it, its not there anymore.. That's because the block is only placed on the Client side world.. but how do I set the block Server Side from a client? My Gui class: My Block class: So how can I do this?
  18. Ok so I used the packets from this guide: http://www.minecraftforge.net/forum/index.php/topic,20138.0.html and it works now.
  19. That's exactly what I need to do - send data from client to server and the opposite.. But how can I make such a packet? ://// From what I've found, the packet handling was separated in more than 5 classes... so how do I create/send one?
  20. I knew I need those.. but I don't know how to send and receive data from them... it seems complicated as hell(from what I've seen so far..)
  21. My Block class: My Gui class: My Main class: My GuiHandler class: And the class I register blocks with: What I want is to change the blockPosX, blockPosY, blockPosZ, player and world variables that are in the GuiLobby class from the LobbyBlock class ON THE SERVER. Here you have the crash log:
  22. I kinda tried to code that from the page you told me about agian.. and I seem to understand how that works. Well, no I have it all working
  23. I've already seen that page before -.-
  24. I could only downgrade the BlockTileEntityData.java but have no damn idea how to downgrade the TileEntityData.java
  25. I didn't mean java or forge dummie, I meant the code for tileentities and the code you sent me a link for isn't working anyway. I get errors in eclipse everywhere
×
×
  • Create New...

Important Information

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