Everything posted by N247S
-
[1.7.10]Particle render problems
Wel I figured out that when you set your brightness at 0. Your particles will be pitch black! And my particles are not greyscaled. I made them with paint.net, just a basic editor. If you look at the colour tab, there are 7 different scales. I only use 4 (3 colours and alpha) but what you want to do is set one of the other 3 scales? Im pretty sure you'll be able to do that with gl11..
-
[1.7.10]Particle render problems
Hey, I swapped the codes out and it works kinda better? I can change the alpha to a verry low number, while it just wouldn't show up when I did that with my code. But sadly, no matter what value I set the alpha to, it doesn't seem to affect the texture verry much. so am I doing something wrong here? secondly, the particle movement problem is unfortunatly still not solved. btw, sorry that I wasn't answering. I had to do some stuff this weekend.
-
InventoryPlayer not working :/
First of all, what is it used for? Why do you want to duplicate the players inventory if there are already methodes to call and modify it?
-
[1.7.10]Multi-block?
Hey, there is a guy on youtube under the name scratchforfun. He made an easy to use program and a tutorial for creating multiblocks. You might want to check it out!
-
[1.7.10] [UNSOLVED] Problems with rendering item inside an Item???
Hey, I don't know all the answers, but Ill try my verry best. Fisrt of all, in the methode "renderItem()", you should specify the coördinates relative to the player. if the item is showing up far away from the player, you should change the values in the "GL11.glTranslated()". If you want to change the scale you can use the "GL11.glScalef()" methode. these first to can be different for each renderType. and about your second point: "items with multiple render passes, are rendered with only one", what exactualy do you mean? Hope this helps a bit, other wise let us know ! GL
-
[1.7.10] How to make a mob walk without moving
Wow, thats the last thing I would think of. It might be interesting to make a tutorial of that, since I'm sure you're not the only one with this problem!
-
[1.7.10]Particle render problems
I guese, anyway Thanks for the tip! Continuing on, do you have an idea on how to fix the other prolems? The two major problems are the alpha wich isn't working as it should and the movement linked with the players movement.
-
[1.8]Split a mod in multiplex packages.jar
Maybe make the different parts like several Mods, where you have a main mod wich require several ChildMods. and all the Child mods require the main mod? just like you implement an API etc.
-
[1.7.10]Particle render problems
Yes, copy-pasting the codes brought it back. but there is one thing I'm concerned about. The part "(this.posX - this.prevPosX)" (and same for Y and Z) should return 0 since there is no motion. But when I leave that part out, the particle is gone! So it might explain the texture offset(maybe?), but right now I'm clueless of where the motion is comming from (or at least the difference between 'this' and 'prev' position). The only thing I can think of right now is that the paritcles (because they are all rendered in FXLayer 3) might share some values? just like the colour and Aplha? this is realy confusing.
-
[1.7.10] How to make a mob walk without moving
woops, Derp! yea, I haven't messed with that allot yet. Anyway, its getting way off topic here, I suggest posting a new thread, maybe there is someone who can explain it a bit more!
-
[1.7.10] How to make a mob walk without moving
Yea, I've heard some problems with that ealier. One thing I know is that the player headposition is difderent in singleplayer and multiplayer. As it works fine in SP, in MP the game thinks that the players head is at the position of a players feat. So if you were about to do an raytrace or something with the players head for MP, you need some serious package updating to counter this bug. it should be fixed in MC1.8 I believe
-
[1.7.10] How to make a mob walk without moving
Wow, are you thinking I'm an developer of MCAnimator? I apreciate your suspecion, but I am not. Its indeed sad that you can't message him that easily. but since we're on this topic anyway, I tried to use it for an block animation, but sadly that function doesnt work since his mod is specialy made for Entities, not TileEntities. So I worked around it by looking closly on how he managed to work it out on Entities, and transfer it over to a TileEntity. It has never been an god idea to copy paste codes without taking a close look at it anyway.
-
[1.7.10]Particle render problems
yea, its propably better to post the codes. right now everything works except the FlashFX. it doesn't show somehow. I spawn these particles with above an TileEntity. so it shouldn't have any motion nor offset. EffectWelling, this is the Entity I spawn in with "EffectRenderer.addEffect()". this will spawn in the other 3. package mechanical_crafting_table.client.particles; import mechanical_crafting_table.client.particles.entityfx.EntityWellFlashFX; import mechanical_crafting_table.client.particles.entityfx.EntityWellGlowFX; import mechanical_crafting_table.client.particles.entityfx.EntityWellSparkFX; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class EffectWelling extends EntityFX { private boolean canSpawn = true; private int WellAge; private int count; public EffectWelling(World world, double x, double y, double z, double mX,double mY, double mZ) { super(world, x, y, z, 0.0D, 0.0D, 0.0D); this.motionX = mX; this.motionY = mY; this.motionZ = mZ; this.particleMaxAge = 1; } public void renderParticle(Tessellator tess, float x, float y, float z, float mX, float mY, float mZ) {} public void onUpdate() { if(this.particleAge < this.particleMaxAge && count == 0) { this.createBurst(); count++; } ++this.WellAge; if (this.WellAge > this.particleMaxAge) { this.setDead(); count = 0; } } private void createBurst() { double d0 = this.rand.nextGaussian() * 0.05D; double d1 = this.rand.nextGaussian() * 0.05D; this.createParticle(this.posX + 0.095D, this.posY - 0.095D, this.posZ, 0.0D, 0.0D, 0.0D, 3); for (int i = 0; i < 2; ++i) { double d2 = this.rand.nextGaussian() * 0.15D + d0; double d3 = this.rand.nextGaussian() * 0.15D + d1; double d4 = this.rand.nextDouble() * 0.5D; this.createParticle(this.posX, this.posY, this.posZ, d2, d4, d3, 1); } this.createParticle(this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, 2); } private void createParticle(double x, double y, double z, double mX, double mY, double mZ, int id) { switch(id){ case 1: EntityWellSparkFX WellingSpark = new EntityWellSparkFX(this.worldObj, x, y, z, mX, mY, mZ); Minecraft.getMinecraft().effectRenderer.addEffect(WellingSpark); break; case 2: EntityWellGlowFX WellingGlow = new EntityWellGlowFX(this.worldObj, x, y, z); WellingGlow.setRBGColorF((float)244/255, (float)255/255, (float)130/255); WellingGlow.setFadeColour((float)160/255, (float)33/255, (float)46/255); Minecraft.getMinecraft().effectRenderer.addEffect(WellingGlow); break; case 3: EntityWellFlashFX WellingFlash = new EntityWellFlashFX(this.worldObj, x, y, z); Minecraft.getMinecraft().effectRenderer.addEffect(WellingFlash); break; } } } EntityWellingSparkFX. package mechanical_crafting_table.client.particles.entityfx; import static org.lwjgl.opengl.GL11.*; import mechanical_crafting_table.Main; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class EntityWellSparkFX extends EntityFX { private static final ResourceLocation WellingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingSpark.png"); public EntityWellSparkFX(World world, double x, double y, double z, double mX, double mY, double mZ) { super(world, x, y, z, mX, mY, mZ); this.motionX = mX; this.motionY = mY; this.motionZ = mZ; this.particleScale *= 0.4F; this.particleAlpha = 1.0F; this.particleMaxAge = 5 + this.rand.nextInt(5); this.particleGravity = 1F; this.noClip = false; } public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v) { if(this.particleAge < this.particleMaxAge) { Minecraft.getMinecraft().renderEngine.bindTexture(WellingFXTexture); glDepthMask(false); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glAlphaFunc(GL_GREATER, 0.003921569F); tess.startDrawingQuads(); tess.setBrightness(getBrightnessForRender(particleTicks)); glAlphaFunc(GL_GREATER, 0.6F - ((float)this.particleAge + particleTicks - 1.0F) * 0.25F * 0.5F); float f10 = 0.1F * this.particleScale; float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)particleTicks - interpPosX); float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)particleTicks - interpPosY); float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)particleTicks - interpPosZ); tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);//WithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);// (double)f7, (double)f9); tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1);//WithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 1, 0);// (double)f7, (double)f8); tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);//WithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);// (double)f6, (double)f8); tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0);//WithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 0, 1);// (double)f6, (double)f9); tess.draw(); glDisable(GL_BLEND); glDepthMask(true); glAlphaFunc(GL_GREATER, 0.1F); } } public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; if (this.particleAge++ >= this.particleMaxAge) { this.setDead(); } if (this.particleAge > this.particleMaxAge / 2) { this.setAlphaF(1.0F - ((float) this.particleAge - (float) (this.particleMaxAge / 2)) / (float) this.particleMaxAge); } this.motionY -= 0.004D * (double)this.particleGravity;; this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.2D;//0.9100000262260437D; this.motionY *= 0.05D;//0.9100000262260437D; this.motionZ *= 0.2D;//0.9100000262260437D; this.setRBGColorF(this.particleRed, this.particleBlue, this.particleGreen); if (this.onGround) { this.motionX *= 0.699999988079071D; this.motionZ *= 0.699999988079071D; } if (this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { EntityWellSparkFX EntityWell = new EntityWellSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); EntityWell.particleAge = EntityWell.particleMaxAge / 2; Minecraft.getMinecraft().effectRenderer.addEffect(EntityWell); } } public int getBrightnessForRender(float brightnessFR) { return 15728880; } public float getBrightness(float brightness) { return 1.0F; } public boolean canBePushed() { return true; } public int getFXLayer() { return 3; } } EntityWellingGlowFX. package mechanical_crafting_table.client.particles.entityfx; import static org.lwjgl.opengl.GL11.*; import mechanical_crafting_table.Main; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class EntityWellGlowFX extends EntityFX { private static final ResourceLocation GlowingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingGlow.png"); private float fadeColourR; private float fadeColourG; private float fadeColourB; private boolean hasFade; public EntityWellGlowFX(World world, double x, double y, double z) { super(world, x, y, z, 0, 0, 0); this.particleScale *= 0.75F; this.particleMaxAge = 72;// + this.rand.nextInt(12); this.noClip = false; this.particleGravity = 0F; this.particleAlpha = 1.0F; this.motionX = this.motionX * 0.00; this.motionY = this.motionY * 0.00; this.motionZ = this.motionZ * 0.00; } public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v) { if (this.particleAge < this.particleMaxAge) { Minecraft.getMinecraft().renderEngine.bindTexture(GlowingFXTexture); glDepthMask(false); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); tess.startDrawingQuads(); tess.setBrightness(getBrightnessForRender(particleTicks)); float f10 = 0.1F * this.particleScale; float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)particleTicks - interpPosX); float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)particleTicks - interpPosY); float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)particleTicks - interpPosZ); float CR = this.particleRed; float CG = this.particleGreen; float CB = this.particleBlue; tess.setColorRGBA_F(CR, CG, CB, this.particleAlpha); tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);//WithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0);// (double)f7, (double)f9); tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1);//WithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 1, 0);// (double)f7, (double)f8); tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);//WithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1);// (double)f6, (double)f8); tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0);//WithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 0, 1);// (double)f6, (double)f9); tess.draw(); glDisable(GL_BLEND); glDepthMask(true); glAlphaFunc(GL_GREATER, 0.1F); } } public void setFadeColour(float CR, float CG, float CB) { this.fadeColourR = CR; this.fadeColourG = CG; this.fadeColourB = CB; this.hasFade = true; } public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; if (this.particleAge++ > this.particleMaxAge) { this.setDead(); } if(this.particleAge > (this.particleMaxAge / 4)*3) { this.setAlphaF(this.particleAlpha / 2); } else { this.setAlphaF(1.0F); } if (this.hasFade && this.particleAge > this.particleMaxAge / 2) { this.particleRed -= ((this.particleRed - this.fadeColourR) / this.particleMaxAge) * this.particleAge; this.particleGreen -= ((this.particleGreen - this.fadeColourG) / this.particleMaxAge) * this.particleAge; this.particleBlue -= ((this.particleBlue - this.fadeColourB) / this.particleMaxAge) * this.particleAge; } this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.0; this.motionY *= 0.0; this.motionZ *= 0.0; } public int getBrightnessForRender(float brightnessFR) { return 15728880; } public float getBrightness(float brightness) { return 0.654F; } public int getFXLayer() { return 3; } } EntityWellingFlashFX. Right now this is not visible, eventhough it gets spawned in.(I debugged it) package mechanical_crafting_table.client.particles.entityfx; import static org.lwjgl.opengl.GL11.*; import mechanical_crafting_table.Main; 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; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class EntityWellFlashFX extends EntityFX { private static final ResourceLocation WellingFXTexture = new ResourceLocation(Main.MODID, "textures/particles/WellingFlash.png"); public EntityWellFlashFX(World world, double x, double y, double z) { super(world, x, y, z); this.particleScale = 8.0F; this.particleMaxAge = 2; this.particleGravity = 1F; this.particleAlpha = 0.4F; this.noClip = false; } @Override public void renderParticle(Tessellator tess, float particleTicks, float x, float y, float z, float u, float v) { if(this.particleAge < this.particleMaxAge) { Minecraft.getMinecraft().renderEngine.bindTexture(WellingFXTexture); glColor4f(1.0F, 1.0F, 1.0F, 1.0F); glDepthMask(false); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glAlphaFunc(GL_GREATER, 0.003921569F); tess.startDrawingQuads(); tess.setBrightness(this.getBrightnessForRender(particleTicks)); float f10 = 0.1F * this.particleScale; float f11 = (float) this.posX; float f12 = (float) this.posY; float f13 = (float) this.posZ; tess.addVertexWithUV((double)(f11 - x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 - z * f10 - v * f10), 0, 0); tess.addVertexWithUV((double)(f11 - x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 - z * f10 + v * f10), 0, 1); tess.addVertexWithUV((double)(f11 + x * f10 + u * f10), (double)(f12 + y * f10), (double)(f13 + z * f10 + v * f10), 1, 1); tess.addVertexWithUV((double)(f11 + x * f10 - u * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - v * f10), 1, 0); tess.draw(); glDisable(GL_BLEND); glDepthMask(true); glAlphaFunc(GL_GREATER, 1.0F); } } public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; if (this.particleAge++ >= this.particleMaxAge) { this.setDead(); } if (this.particleAge > this.particleMaxAge / 5) { this.setAlphaF(this.particleAlpha / 2); } this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.0D; this.motionY *= 0.0D; this.motionZ *= 0.0D; } public int getBrightnessForRender(float brightnessFR) { return 15728880; } public float getBrightness(float brightness) { return 1.0F; } public int getFXLayer() { return 3; } } About point 4, I tried to set the boundingbox earlier, but doesnt seem to work somehow. Anyway, I looked at the XPOrb, cause they get picked up when they collide with the player. And it seems that MC. is using an actual Entity. so I might have to create one for this purpose.(but it will get pretty laggy if I spawn a bunch of them in. (wich Im planning on doing)
-
[1.7.10] How to make a mob walk without moving
Hey, I think the easiest option here is spawning an custom made entity(so it doesnt have any animation or ai) and from there on add your own animations etc. to it. If you dont set any movement values to it, it will stay in place. If you're new to animation and custom entity rendering I recommend to use MCAnimator. it is specialy made for entity's and it should have an zombie model already preconfiged in it.
-
[1.7.10] [SOLVED!] Need to send a packet to update the client on the client.
Hey, are you still using a TileEntity? or just a guiscreen like a vanilla WorkBench? And if you have tried something already, could you post some code of it?
-
[1.7.10]Particle render problems
Thanks for your reply! about point 4, I actualy did set "this.noClip" to false. so what else could it be? about point 3, either I miss your point, or I didn't describe it clearly enough. in point 3 I tried to describe that even if I set the movement to 0, that there is still movement wich is linked to the player's movement. the second thing I tried to explain is, that particles do have an offset when they are spawned in (not at the player, but at a block). its on offset of 0.01 or lower I think. but still pretty annoying if you want it to be in an exact location you tell him to spawn at. The first thing is possible to fix (if I look at the vanilla particles), the second one, I'm not sure.
-
How to change the height of the bed?
that shouldn't solve the problem indeed. if you take a look at "sleepInBedAt()" in the "EntityPlayer.class", it sets the player size, offset and position. so one of these three (or all of them) are skipped during the event 'sleeping'. try to set it manualy for the player. also a quick question, your are calling a function "func_149979_a". I might be blind, but where exactualy is it from, and what is the function of it?
-
How to change the height of the bed?
Hey, I saw that you block height was 1.3F. Looking at the (somewhat dark) picture, it seems like the player is laying at that height. So might it fix this if you would lower that number. Let me know if this helped. Good luck!
-
[1.8] Container Problems
Hey, I have a hard time understanding what exactualy is happening with your mod, so correct me if I'm wrong. So if you'r clicking in your playerInventory, you are accesing for example the armorslot? That means that your inventory id's are not correct. The id's 0-8 are the hotbar slots. the id's 9-35 are the other inventory slot id's. Currently you are calculating the nonhotbar slot id's with this formula "j + (i + 1) * 9". try to change it to "j + i * 9 + 9". (no brackets are needed). try it out and let me know if it worked. Good luck!
-
[1.7.10]Particle render problems
Hey, Im currently tying to get some particles in a mod I'm currently working on. But there are some things I dont understand about it. 1. the particle alpha acts pretty wierd. I tried to use "this.setAlphaF()", with some calculations between the brackets. but wether I put it in the "renderParticle" section or the "onUpdate", nothing will happen. 2. something wich maybe a partial answer of number 1 is the "getFXLayer()". right now Im using Layer 3 cause it doesnt have a renderer behind it. But when I render several particles at the same time (at the same place) some will not be visible until the particles in front of it are gone. I could arange them with the number below 3, but that would influence the vanilla particles as well. so my question is, how can I adjust things like colour and alpha for every single particle? (cause when you change colour on one particle, other will join the party) 3. something I noticed is that the particles I made are moving along with the player. when you move towards the left, they will go left with you, till your not moving anymore. than they will return to their original position. something wich vanilla paritcles dont do. also, when I spawn particles at a given position(for example right above a block) they will always have an certain offset. how can I work around both problems? 4. currently non of the entityfx has an hitbox I discovered. but I would like to do some eventhandling when players look at a particle. besides I set "canBePushed()" to true, but they wont collide since they dont have an hitbox. I tried to use "getBoundingBox()" and "setBoundingBox()", but both gave me an error if I returned something else than "this.boudingBox" or "null". so if this can be done, how? One big note on these questions is, that I looked verry closly at the vanilla codes for firework. (something wich come closely to what I want to add) I use the same setup (and GL functions) except that I changed a lot of the calculations and values and that I made my own texture for it (with multiple colours, so thats why I want to dupe the code rather than use it). I hope I made my point(s)/questions pretty clear, if not (or you need more information) feel free to ask. Thanks for your time!
IPS spam blocked by CleanTalk.