mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 12:59:41 +00:00
Work on making flamethrowers work nice. Still need to get first person neutral particles down.
This commit is contained in:
1 parent
6fbfd22583
commit
1a458834a8
3 files changed
+81
-3
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package mekanism.client.render;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -8,6 +9,7 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.item.ItemFlamethrower;
|
||||
import mekanism.common.item.ItemJetpack;
|
||||
import mekanism.common.item.ItemScubaTank;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -163,6 +165,51 @@ public class RenderTickHandler
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
}
|
||||
|
||||
if(world.getWorldTime() % 4 == 0)
|
||||
{
|
||||
for(EntityPlayer p : (List<EntityPlayer>)world.playerEntities)
|
||||
{
|
||||
if(!p.isSwingInProgress && p.getCurrentEquippedItem() != null && p.getCurrentEquippedItem().getItem() instanceof ItemFlamethrower)
|
||||
{
|
||||
if(((ItemFlamethrower)p.getCurrentEquippedItem().getItem()).getGas(p.getCurrentEquippedItem()) != null)
|
||||
{
|
||||
Pos3D playerPos = new Pos3D(p);
|
||||
|
||||
Pos3D flameVec = new Pos3D();
|
||||
|
||||
if(p.isSneaking())
|
||||
{
|
||||
flameVec.yPos -= 0.35F;
|
||||
flameVec.zPos -= 0.15F;
|
||||
}
|
||||
|
||||
Pos3D flameMotion = new Pos3D(p.motionX, p.onGround ? 0 : p.motionY, p.motionZ);
|
||||
|
||||
if(player == p && mc.gameSettings.thirdPersonView == 0)
|
||||
{
|
||||
flameVec.xPos -= 0.25F;
|
||||
flameVec.yPos -= 0.5F;
|
||||
flameVec.zPos += 1.15F;
|
||||
|
||||
flameVec.rotateYaw(p.rotationYaw);
|
||||
flameVec.rotatePitch(p.rotationPitch);
|
||||
}
|
||||
else {
|
||||
flameVec.xPos -= 0.45F;
|
||||
flameVec.yPos -= 0.5F;
|
||||
flameVec.zPos += 1.05F;
|
||||
|
||||
flameVec.rotateYaw(p.renderYawOffset);
|
||||
}
|
||||
|
||||
Pos3D mergedVec = playerPos.clone().translate(flameVec);
|
||||
|
||||
spawnAndSetParticle("flame", world, mergedVec.xPos, mergedVec.yPos, mergedVec.zPos, flameMotion.xPos, flameMotion.yPos, flameMotion.zPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user