Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Izzy Axel

Forge Modder
  • Joined

  • Last visited

Everything posted by Izzy Axel

  1. That ends up being transparent with my code, whatever's going on in the renderParticle section is linking the color values to the transparency I would guess: EntityFX Class
  2. No no no, like this:
  3. What should go in where ISound is for background music?
  4. Well, is your texture grayscale? AFAIK, particle textures have to be an oldschool alpha map, black being transparent and white being completely opaque, and then you color them in the code. I may be wrong about that, though, someone else can comment on that. I also haven't figured out how to make black particles yet, which is either me not understanding fully how the particle textures and GL code work together, or having to find a needle-in-a-haystack combination of blendfuncs and alphafuncs to invert the color its looking for to subtract as alpha and leave a full black particle. For some reason the opacity and color are inextricably linked, too? When I try to color my particles a darker shade of a color, it just decreases the opacity. I need to learn OGL and rewrite the vanilla code, it seems really...bad.
  5. The alpha, you're not using the same alpha or blend func combinations as me, so try: GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); You're also specifying GL11.glColor4F's alpha as 1.0, that may also be it. You also don't disable GL11.GL_LIGHTING for the particle render, but I doubt that would cause this. As for the particle moving with the player, do you think setting canBePushed to true is causing it to collide with the player and move with them? Otherwise, I'm not sure about that.
  6. This is why I was saying I don't care to go through the math, I don't know what interpPosX is, but it's likely not the same as posX/prevPosX. It works, no point in arguing about it.
  7. I had this problem with tile entities too, every instance shared the values I was writing to NBT and I couldn't figure out why, so I worked on something else. I'd be interested in the solution to this too.
  8. Well, I went in and tinkered with the flash FX, the reason it's not showing up is because of the addVertexWithUV calls, I don't care to go through the math too much but I suspect it's because all the verticies are being created in the exact same coordinates since you set f11-13 to the posX/Y/Z instead of the calculations the vanilla code uses: float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * particleTicks - interpPosX); float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * particleTicks - interpPosY); float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * particleTicks - interpPosZ); Replacing them with the vanilla calculations makes it show up fine.
  9. Hm yeah I thought you were talking about the server/client positioning mismatch. Might be an precision error with floats/doubles if it's that small? I kind of doubt it though, otherwise I'm not sure what's causing the offset. As for the first part of 3, it sounds like you somehow got the particles' motionX/Y/Z entangled with the player's position, that's odd. Posting code will probably be necessary for further troubleshooting. (always best to post code anyway, there's only so much we can do without it) As for 4, you could try making a new AABB, setting it up with the particle's positioning and whatever dimensions you want, and returning it in setBoundingBox(). What class are you extending that has setBoundingBox() though?
  10. Isn't it because you gave your generator a weighting of 0 when you registered it?
  11. 3: The client position is at the player's feet from what I've seen, I added 1.6 to the y position to account for this when I spawned particles, personally. 4: Sounds like you haven't specified this.noClip = false in your EntityFX derived class's constructor, or particlevar.noclip = false after making the instance.
  12. Ok, thanks, now everything is working how it should, and I've learned a lot.
  13. It was a leftover !world.isRemote check for spawning the entity. Strangely, the particles in onImpact still aren't spawning, do I need packets for those? @Override protected void onImpact(MovingObjectPosition mop) { if(mop.entityHit != null) { if(mop.entityHit != this.getThrower() && this.getThrower() instanceof EntityPlayer && mop.entityHit instanceof EntityLiving) { EntityLiving mob = (EntityLiving)mop.entityHit; double x, y, z; Random rand = new Random(); for(int i = 0; i < 20; i++) { x = mob.posX + (rand.nextInt(2) - 1 * rand.nextFloat()); y = mob.posY; z = mob.posZ + (rand.nextInt(2) - 1 * rand.nextFloat()); if(worldObj.isRemote) { ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamHitFX, x, y + 1, z, (x - mob.posX) * 0.01, 0, (z - mob.posZ) * 0.01, 10, 300); ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamHitFX, x, y + 1, z, (x - mob.posX) / 2, (y - mob.posY) / 2, (z - mob.posZ) / 2, 10, 5); } } mob.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 300, 10)); } return; } }
  14. Description: Exception in server tick loop java.lang.NoSuchMethodError: izzyaxel.arcaneartificing.entity.LightBeam.setVelocity(DDD)V at izzyaxel.arcaneartificing.entity.LightBeam.<init>(LightBeam.java:36) at izzyaxel.arcaneartificing.items.staves.ItemLightStaff.onPlayerStoppedUsing(ItemLightStaff.java:94) at net.minecraft.item.ItemStack.onPlayerStoppedUsing(ItemStack.java:500) at net.minecraft.entity.player.EntityPlayer.stopUsingItem(EntityPlayer.java:232) at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:473) at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61) at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:349) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) So, it didn't like this.setVelocity, which I didn't know was client sided until this prompted me to read the comments on that function, so changed it to this.motionX /= 10 etc and the entites spawn fine now. I changed it to check for client and then directly spawn particles in the entity classes, but the particles on the beam still aren't spawning on SMP, and don't spawn on SSP anymore. public class LightBeam extends EntityThrowable { Vector3 movVec; final int maxTicks = 150; public LightBeam(World world, EntityLivingBase elb) { super(world, elb); this.motionX /= 10; this.motionY /= 10; this.motionZ /= 10; movVec = new Vector3(this.motionX, this.motionY, this.motionZ); } @Override protected void onImpact(MovingObjectPosition mop) { if(mop.entityHit != null) { if(mop.entityHit != this.getThrower() && this.getThrower() instanceof EntityPlayer && mop.entityHit instanceof EntityLiving) { EntityLiving mob = (EntityLiving)mop.entityHit; double x, y, z; Random rand = new Random(); for(int i = 0; i < 20; i++) { x = mob.posX + (rand.nextInt(2) - 1 * rand.nextFloat()); y = mob.posY; z = mob.posZ + (rand.nextInt(2) - 1 * rand.nextFloat()); if(worldObj.isRemote) { ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamHitFX, x, y + 1, z, (x - mob.posX) * 0.01, 0, (z - mob.posZ) * 0.01, 10, 300); ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamHitFX, x, y + 1, z, (x - mob.posX) / 2, (y - mob.posY) / 2, (z - mob.posZ) / 2, 10, 5); } } mob.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 300, 10)); } return; } } @Override public void onUpdate() { motionX = movVec.x; motionY = movVec.y; motionZ = movVec.z; super.onUpdate(); Random rand = new Random(); double x, y, z, x2, y2, z2; for(int i = 0; i < 2; i++) { x = posX + rand.nextInt(2) - 1 * rand.nextFloat(); y = posY + rand.nextInt(2) - 1 * rand.nextFloat(); z = posZ + rand.nextInt(2) - 1 * rand.nextFloat(); x2 = (x - posX) / 15; y2 = (y - posY) / 15; z2 = (z - posZ) / 15; if(worldObj.isRemote) { ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamFX, x, y, z, x2, y2, z2, 20, 12); } } if(worldObj.isRemote) { ArcaneArtificing.proxy.doParticles(worldObj, Reference.LightBeamCoreFX, posX, posY, posZ, 0, 0, 0, 10, 5); } ++ticksExisted; if(ticksExisted >= maxTicks) { setDead(); } } @Override public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { super.setThrowableHeading(par1, par3, par5, par7, par8); float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); par1 /= (double)f2; par3 /= (double)f2; par5 /= (double)f2; par1 += 0.007499999832361937D * (double)par8; par3 += 0.007499999832361937D * (double)par8; par5 += 0.007499999832361937D * (double)par8; par1 *= (double)par7; par3 *= (double)par7; par5 *= (double)par7; this.motionX = par1; this.motionY = par3; this.motionZ = par5; } public void updateUntilDead() { while(!isDead) { onUpdate(); } } @Override protected float getGravityVelocity() { return 0F; }}
  15. I did a bit of experimenting, and discovered I have to use sendToAll when the packet sending is inside an entity, so now everything works on SSP, albeit the particles spawned within an item class are offset down at the player's feet, but in SMP, all 3 entities created by these staves crash the server on creation. PS sendToAll works everywhere, so using that instead.
  16. The entity doesn't have a texture, I'm using its position to spawn particles, though giving the entity a texture sounds like it'd be useful to replace the core FXs, I didn't know you could do that.
  17. That gets rid of most of the crashes, but the particles still aren't showing up on SSP or SMP, the light beam entity crashes the server when spawned in SMP because I had no isRemote check around it which I go into later, it works fine in SSP, and none of the other entities are getting spawned at all. I then realized I had limited the entity spawning to the client side on everything except the light beam, which I forgot to put an isRemote around, which was the cause for the crash, and for the rest, of course was doing nothing because you dont spawn entities client side, but I can't change that to server side, or it'll crash because of the client sided stuff I'm now doing inside the entity class. What do?
  18. Is the comment wrong then? It says sendToAll is client side, and if I cant use that, then should I use sendToAllAround to get the other players too? And how am I getting the player instance inside onUpdate in the entity classes?
  19. Nevermind, I was being a derp. But now this brings up a bigger issue, the release/firing of the beam from the light staff crashes the server in SMP, all particles crash SSP with java.lang.NullPointerException: Unexpected error at net.minecraft.entity.Entity.getBrightnessForRender(Entity.java:1214) at net.minecraft.client.particle.EffectRenderer.renderLitParticles(EffectRenderer.java:215) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1347) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1057) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) And everything besides the light staff firing (it has a charge period, which spawns particles, then release like a bow to fire) gives continual errors on SMP: java.lang.NullPointerException at cpw.mods.fml.common.network.FMLOutboundHandler$OutboundTarget$5.selectNetworks(FMLOutboundHandler.java:129) at cpw.mods.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:273) at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637) at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:115) at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:688) at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:717) at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:893) at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:239) at cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendToAll(SimpleNetworkWrapper.java:182) at izzyaxel.arcaneartificing.entity.BlazeBeam.onUpdate(BlazeBeam.java:68) at izzyaxel.arcaneartificing.entity.BlazeBeam.updateUntilDead(BlazeBeam.java:101) at izzyaxel.arcaneartificing.items.staves.ItemBlazeStaff.onUsingTick(ItemBlazeStaff.java:36) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:273) at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:96) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) at net.minecraft.world.World.updateEntity(World.java:2258) at net.minecraft.world.World.updateEntities(World.java:2108) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2087) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1029) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) Misc: Main Client Proxy Message/Handler Items: Blaze Staff Healing Staff Light Staff Magnet Entities: Blaze Beam Healing Beam Light Beam Particles: Blaze Beam FX Healing Beam Core FX Healing Beam FX Light Beam Core FX Light Beam FX Light Charge Ball FX Light Charge FX Light Charge Full FX Warp FX
  20. So, what should I be doing for the particles made inside onUpdate() in the entity an item fires? I need to give the particle constructor a world object, which I'm going to have to get by getting the player via their entity ID then getting the worldObj from that afaik, but I don't have access to the player to be able to get their ID in onUpdate, so what should I do about that? Also, the particles made in clientProxy from the item right click don't show up in SMP, but they show up in SSP.
  21. Yeah I was suspecting I needed to do that, but had to go to bed after posting that message
  22. So, I added EntityFX derived particles, and the dedicated server crashes on startup, because: Attempted to load class net/minecraft/client/particle/EntityFX for invalid side SERVER The issue is, I surrounded all creation of instances of the EntityFX derived classes with world.isRemote checks, and the error hasn't gone away, so I'm not sure what's wrong here. Example
  23. Since it's been so long without any replies, anything may be useful, so, I don't know if it changed in 1.8, but particle textures are masks, white is fully visible, black is fully transparent, and you apply color via the RGB values in the EntityFX derived class. I don't know about the other stuff though, in 1.7.10 you could just put a ResourceLocation in the constructor arguments. Maybe this will help? 1.7.10 EntityFX
  24. Maybe I would if you actually tried to help people learn instead of vomiting abstract concepts the person you're talking to probably won't understand by virtue of having to ask the question in the first place...and then insulting them when they don't understand it. Modding for Minecraft is absurdly confusing, there's 20 completely different ways to do any particular thing and everyone has a different idea of how they should be done. Tutorials tend to be horribly written and difficult to follow, with no real explanation, or an explanation written entirely in abstractions that might as well read "Look at how smart I am!" that has no content someone at the skill level the tutorial is aimed at would understand. When you're still learning, the "correct way" to do something is completely nebulous thanks to this, unless you ask someone who already knows it...which is where we are now. We ask because we DON'T KNOW. I thought I understood what proxies do, but I guess I don't, and I guess I never will, because nobody is explaining them, and all the tutorials I've read about proxies aren't telling me why what I did is wrong, and what proxies are "really for" in this situation, if not for sided functions with packets. All I know is what I just did worked. It's not crashing, it's not interfering with other mods, it's not making the game lag. There has to be a real reason why whatever it is you want me to do is right and should replace what I did. That's what you should be telling me, why it's wrong and how to fix it so I can learn from it, not "I don't think you understand what you're doing here". That's not helping anyone, that's being a dick, it's discouraging people from learning, it's pushing people away, it's hurting the community.
  25. Well this is just a test, if I make the button do something that doesn't exist on the client or server, then I will need to use proxies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.