particles that are actual particles

This commit is contained in:
Bob 2022-05-31 22:28:12 +02:00
parent f0b211dbff
commit baff99e481
24 changed files with 234 additions and 356 deletions

View File

@ -21,11 +21,11 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockMassStorage extends BlockContainer {
@ -206,4 +206,9 @@ public class BlockMassStorage extends BlockContainer {
super.breakBlock(world, x, y, z, block, meta);
}
@Override
public Item getItemDropped(int i, Random rand, int j) {
return null;
}
}

View File

@ -1,19 +1,23 @@
package com.hbm.blocks.machine;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import java.util.Random;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineAutocrafter;
import com.hbm.tileentity.machine.storage.TileEntityCrateBase;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -62,4 +66,49 @@ public class MachineAutocrafter extends BlockContainer {
return false;
}
}
private final Random field_149933_a = new Random();
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
ISidedInventory tileentityfurnace = (ISidedInventory) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
if(tileentityfurnace != null) {
for(int i1 = 10; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
if(itemstack != null) {
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
while(itemstack.stackSize > 0) {
int j1 = this.field_149933_a.nextInt(21) + 10;
if(j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if(itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (float) this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}
}
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
}
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
}
}

View File

@ -3,7 +3,6 @@ package com.hbm.blocks.turret;
import java.util.List;
import com.hbm.config.WeaponConfig;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.lib.ModDamageSource;
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
@ -51,22 +50,6 @@ public class TurretCIWS extends TurretBase {
vector.normalize();
if(!world.isRemote) {
rayShot(world, vector, x + vector.xCoord * 2.5 + 0.5, y + vector.yCoord * 2.5 + 0.5, z + vector.zCoord * 2.5 + 0.5, 100, 10.0F, WeaponConfig.ciwsHitrate);
EntityGasFlameFX smoke = new EntityGasFlameFX(world);
smoke.posX = x + vector.xCoord * 2.5 + 0.5;
smoke.posY = y + vector.yCoord * 2.5 + 1.5;
smoke.posZ = z + vector.zCoord * 2.5 + 0.5;
smoke.motionX = vector.xCoord * 0.25;
smoke.motionY = vector.yCoord * 0.25;
smoke.motionZ = vector.zCoord * 0.25;
world.spawnEntityInWorld(smoke);
}
world.playSoundEffect(x, y, z, "hbm:weapon.ciwsFiringLoop", 1.0F, 1.25F);
flag = true;

View File

@ -1,6 +1,5 @@
package com.hbm.blocks.turret;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.tileentity.turret.TileEntityTurretHeavy;
@ -51,12 +50,6 @@ public class TurretHeavy extends TurretBase {
bullet.damage = rand.nextInt(26) + 15;
world.spawnEntityInWorld(bullet);
EntityGasFlameFX fx = new EntityGasFlameFX(world);
fx.posX = x + vector.xCoord * 2.2 + 0.5;
fx.posY = y + vector.yCoord * 2.2 + 1;
fx.posZ = z + vector.zCoord * 2.2 + 0.5;
world.spawnEntityInWorld(fx);
}
world.playSoundEffect(x, y, z, "hbm:weapon.defabShoot", 1.0F, 0.75F);

View File

@ -1,6 +1,5 @@
package com.hbm.blocks.turret;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.projectile.EntityRocket;
import com.hbm.tileentity.turret.TileEntityTurretRocket;
@ -49,12 +48,6 @@ public class TurretRocket extends TurretBase {
bullet.motionZ = vector.zCoord * 3;
world.spawnEntityInWorld(bullet);
EntityGasFlameFX fx = new EntityGasFlameFX(world);
fx.posX = x + vector.xCoord * 1 + 0.5;
fx.posY = y + vector.yCoord * 1 + 1;
fx.posZ = z + vector.zCoord * 1 + 0.5;
world.spawnEntityInWorld(fx);
}
world.playSoundEffect(x, y, z, "hbm:weapon.rpgShoot", 1.0F, 0.75F);

View File

@ -1,6 +1,5 @@
package com.hbm.blocks.turret;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.projectile.EntityAAShell;
import com.hbm.tileentity.turret.TileEntityTurretSpitfire;
@ -51,17 +50,6 @@ public class TurretSpitfire extends TurretBase {
bullet.speedOverride = 3;
world.spawnEntityInWorld(bullet);
EntityGasFlameFX smoke = new EntityGasFlameFX(world);
smoke.posX = x + vector.xCoord * 4 + 0.5;
smoke.posY = y + vector.yCoord * 4 + 1;
smoke.posZ = z + vector.zCoord * 4 + 0.5;
smoke.motionX = vector.xCoord * 0.25;
smoke.motionY = vector.yCoord * 0.25;
smoke.motionZ = vector.zCoord * 0.25;
world.spawnEntityInWorld(smoke);
}
world.playSoundEffect(x, y, z, "hbm:entity.oldExplosion", 1.0F, 0.5F);

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.projectile.EntityBombletZeta;
import com.hbm.entity.projectile.EntityBoxcar;
import com.hbm.entity.projectile.EntityRocketHoming;
@ -14,6 +13,7 @@ import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.LoopedEntitySoundPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ParticleUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
@ -107,7 +107,7 @@ public class EntityBomber extends Entity implements IChunkLoader {
motionY -= 0.025;
for(int i = 0; i < 10; i++)
this.worldObj.spawnEntityInWorld(new EntityGasFlameFX(this.worldObj, this.posX + rand.nextGaussian() * 0.5 - motionX * 2, this.posY + rand.nextGaussian() * 0.5 - motionY * 2, this.posZ + rand.nextGaussian() * 0.5 - motionZ * 2, 0.0, 0.1, 0.0));
ParticleUtil.spawnGasFlame(this.worldObj, this.posX + rand.nextGaussian() * 0.5 - motionX * 2, this.posY + rand.nextGaussian() * 0.5 - motionY * 2, this.posZ + rand.nextGaussian() * 0.5 - motionZ * 2, 0.0, 0.1, 0.0);
if(worldObj.getBlock((int)posX, (int)posY, (int)posZ).isNormalCube() && !worldObj.isRemote) {
this.setDead();

View File

@ -1,17 +1,20 @@
package com.hbm.entity.missile;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemSatChip;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.saveddata.satellites.Satellite;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -41,48 +44,33 @@ public class EntityCarrier extends EntityThrowable {
if(!worldObj.isRemote) {
for(int i = 0; i < 10; i++) {
EntityGasFlameFX fx = new EntityGasFlameFX(worldObj);
fx.posY = posY - 0.25D;
fx.posX = posX + rand.nextGaussian() * 0.75D;
fx.posZ = posZ + rand.nextGaussian() * 0.75D;
fx.motionY = -0.2D;
worldObj.spawnEntityInWorld(fx);
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "gasfire");
data.setDouble("mY", -0.2D);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX + rand.nextGaussian() * 0.75D, posY - 0.25D, posZ + rand.nextGaussian() * 0.75D), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 200));
}
if(this.dataWatcher.getWatchableObjectInt(8) == 1)
for(int i = 0; i < 2; i++) {
EntityGasFlameFX fx1 = new EntityGasFlameFX(worldObj);
fx1.posY = posY - 0.25D;
fx1.posX = posX + rand.nextGaussian() * 0.15D + 2.5D;
fx1.posZ = posZ + rand.nextGaussian() * 0.15D;
fx1.motionY = -0.2D;
NBTTagCompound d1 = new NBTTagCompound();
d1.setString("type", "gasfire");
d1.setDouble("mY", -0.2D);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(d1, posX + rand.nextGaussian() * 0.75D + 2.5, posY - 0.25D, posZ + rand.nextGaussian() * 0.75D), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 200));
worldObj.spawnEntityInWorld(fx1);
NBTTagCompound d2 = new NBTTagCompound();
d2.setString("type", "gasfire");
d2.setDouble("mY", -0.2D);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(d2, posX + rand.nextGaussian() * 0.75D - 2.5, posY - 0.25D, posZ + rand.nextGaussian() * 0.75D), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 200));
EntityGasFlameFX fx2 = new EntityGasFlameFX(worldObj);
fx2.posY = posY - 0.25D;
fx2.posX = posX + rand.nextGaussian() * 0.15D - 2.5D;
fx2.posZ = posZ + rand.nextGaussian() * 0.15D;
fx2.motionY = -0.2D;
NBTTagCompound d3 = new NBTTagCompound();
d3.setString("type", "gasfire");
d3.setDouble("mY", -0.2D);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(d3, posX + rand.nextGaussian() * 0.75D, posY - 0.25D, posZ + rand.nextGaussian() * 0.75D + 2.5), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 200));
worldObj.spawnEntityInWorld(fx2);
EntityGasFlameFX fx3 = new EntityGasFlameFX(worldObj);
fx3.posY = posY - 0.25D;
fx3.posX = posX + rand.nextGaussian() * 0.15D;
fx3.posZ = posZ + rand.nextGaussian() * 0.15D + 2.5D;
fx3.motionY = -0.2D;
worldObj.spawnEntityInWorld(fx3);
EntityGasFlameFX fx4 = new EntityGasFlameFX(worldObj);
fx4.posY = posY - 0.25D;
fx4.posX = posX + rand.nextGaussian() * 0.15D;
fx4.posZ = posZ + rand.nextGaussian() * 0.15D - 2.5D;
fx4.motionY = -0.2D;
worldObj.spawnEntityInWorld(fx4);
NBTTagCompound d4 = new NBTTagCompound();
d4.setString("type", "gasfire");
d4.setDouble("mY", -0.2D);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(d4, posX + rand.nextGaussian() * 0.75D, posY - 0.25D, posZ + rand.nextGaussian() * 0.75D - 2.5), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 200));
}

View File

@ -1,8 +1,8 @@
package com.hbm.entity.missile;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.util.ParticleUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@ -69,13 +69,7 @@ public class EntityMinerRocket extends Entity {
if(dataWatcher.getWatchableObjectInt(16) != 1) {
if(ticksExisted % 2 == 0) {
EntityGasFlameFX fx = new EntityGasFlameFX(worldObj);
fx.posY = posY - 0.5D;
fx.posX = posX;
fx.posZ = posZ;
fx.motionY = -1D;
worldObj.spawnEntityInWorld(fx);
ParticleUtil.spawnGasFlame(worldObj, posX, posY - 0.5, posZ, 0.0, -1.0, 0.0);
}
}

View File

@ -1,83 +0,0 @@
package com.hbm.entity.particle;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.World;
public class EntityGasFlameFX extends EntityModFX
{
float smokeParticleScale;
public int particleAge;
public int maxAge;
private static final String __OBFID = "CL_00000924";
public EntityGasFlameFX(World world) {
super(world, 0, 0, 0);
}
public EntityGasFlameFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_)
{
this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F);
}
public EntityGasFlameFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_)
{
super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += p_i1226_8_;
this.motionY += p_i1226_10_;
this.motionZ += p_i1226_12_;
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D);
this.particleScale *= 0.75F;
this.particleScale *= p_i1226_14_;
this.smokeParticleScale = this.particleScale;
//this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
//this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_);
this.noClip = true;
}
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if(maxAge < 30)
{
maxAge = rand.nextInt(13) + 30;
}
this.particleAge++;
if (this.particleAge >= maxAge)
{
this.setDead();
}
this.motionX *= 0.7599999785423279D;
this.motionY += 0.0075D;
this.motionZ *= 0.7599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
this.moveEntity(motionX, motionY, motionZ);
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_)
{
return 15728880;
}
}

View File

@ -3,12 +3,12 @@ package com.hbm.explosion;
import java.util.List;
import java.util.Random;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.projectile.EntityOilSpill;
import com.hbm.entity.projectile.EntityRubble;
import com.hbm.entity.projectile.EntityShrapnel;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ParticleUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity;
@ -57,11 +57,7 @@ public class ExplosionLarge {
vec.rotateAroundY(rand.nextInt(360));
for(int i = 0; i < count; i++) {
EntityGasFlameFX fx = new EntityGasFlameFX(world, x, y, z, 0.0, 0.0, 0.0);
fx.motionY = 0;
fx.motionX = vec.xCoord;
fx.motionZ = vec.zCoord;
world.spawnEntityInWorld(fx);
ParticleUtil.spawnGasFlame(world, x, y, z, vec.xCoord, 0.0, vec.zCoord);
vec.rotateAroundY(360 / count);
}

View File

@ -2501,14 +2501,14 @@ public class ModItems {
public static Item orange6;
public static Item orange7;
public static Item orange8;
public static Item gasflame1;
/*public static Item gasflame1;
public static Item gasflame2;
public static Item gasflame3;
public static Item gasflame4;
public static Item gasflame5;
public static Item gasflame6;
public static Item gasflame7;
public static Item gasflame8;
public static Item gasflame8;*/
public static Item energy_ball;
public static Item discharge;
public static Item empblast;
@ -5642,14 +5642,6 @@ public class ModItems {
orange6 = new Item().setUnlocalizedName("orange6").setTextureName(RefStrings.MODID + ":orange6");
orange7 = new Item().setUnlocalizedName("orange7").setTextureName(RefStrings.MODID + ":orange7");
orange8 = new Item().setUnlocalizedName("orange8").setTextureName(RefStrings.MODID + ":orange8");
gasflame1 = new Item().setUnlocalizedName("gasflame1").setTextureName(RefStrings.MODID + ":gasflame1");
gasflame2 = new Item().setUnlocalizedName("gasflame2").setTextureName(RefStrings.MODID + ":gasflame2");
gasflame3 = new Item().setUnlocalizedName("gasflame3").setTextureName(RefStrings.MODID + ":gasflame3");
gasflame4 = new Item().setUnlocalizedName("gasflame4").setTextureName(RefStrings.MODID + ":gasflame4");
gasflame5 = new Item().setUnlocalizedName("gasflame5").setTextureName(RefStrings.MODID + ":gasflame5");
gasflame6 = new Item().setUnlocalizedName("gasflame6").setTextureName(RefStrings.MODID + ":gasflame6");
gasflame7 = new Item().setUnlocalizedName("gasflame7").setTextureName(RefStrings.MODID + ":gasflame7");
gasflame8 = new Item().setUnlocalizedName("gasflame8").setTextureName(RefStrings.MODID + ":gasflame8");
energy_ball = new Item().setUnlocalizedName("energy_ball").setTextureName(RefStrings.MODID + ":energy_ball");
discharge = new Item().setUnlocalizedName("discharge").setTextureName(RefStrings.MODID + ":discharge");
empblast = new Item().setUnlocalizedName("empblast").setTextureName(RefStrings.MODID + ":empblast");
@ -8194,14 +8186,6 @@ public class ModItems {
GameRegistry.registerItem(orange6, orange6.getUnlocalizedName());
GameRegistry.registerItem(orange7, orange7.getUnlocalizedName());
GameRegistry.registerItem(orange8, orange8.getUnlocalizedName());
GameRegistry.registerItem(gasflame1, gasflame1.getUnlocalizedName());
GameRegistry.registerItem(gasflame2, gasflame2.getUnlocalizedName());
GameRegistry.registerItem(gasflame3, gasflame3.getUnlocalizedName());
GameRegistry.registerItem(gasflame4, gasflame4.getUnlocalizedName());
GameRegistry.registerItem(gasflame5, gasflame5.getUnlocalizedName());
GameRegistry.registerItem(gasflame6, gasflame6.getUnlocalizedName());
GameRegistry.registerItem(gasflame7, gasflame7.getUnlocalizedName());
GameRegistry.registerItem(gasflame8, gasflame8.getUnlocalizedName());
GameRegistry.registerItem(energy_ball, energy_ball.getUnlocalizedName());
GameRegistry.registerItem(discharge, discharge.getUnlocalizedName());
GameRegistry.registerItem(empblast, empblast.getUnlocalizedName());

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4242)";
public static final String VERSION = "1.0.27 BETA (4251)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -666,7 +666,6 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntitySSmokeFX.class, new SSmokeRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityOilSpillFX.class, new SpillRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityGasFX.class, new GasRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityGasFlameFX.class, new GasFlameRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityCombineBall.class, new RenderSnowball(ModItems.energy_ball));
RenderingRegistry.registerEntityRenderingHandler(EntityDischarge.class, new ElectricityRenderer(ModItems.discharge));
RenderingRegistry.registerEntityRenderingHandler(EntityEMPBlast.class, new RenderEMPBlast());
@ -1675,6 +1674,14 @@ public class ClientProxy extends ServerProxy {
}
Minecraft.getMinecraft().effectRenderer.addEffect(debug);
}
if("gasfire".equals(type)) {
double mX = data.getDouble("mX");
double mY = data.getDouble("mY");
double mZ = data.getDouble("mZ");
ParticleGasFlame text = new ParticleGasFlame(world, x, y, z, mX, mY, mZ, 6.5F);
Minecraft.getMinecraft().effectRenderer.addEffect(text);
}
}
private HashMap<Integer, Long> vanished = new HashMap();

View File

@ -30,6 +30,7 @@ import cpw.mods.fml.common.Mod.Metadata;
import cpw.mods.fml.common.ModMetadata;
import java.io.File;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
@ -81,8 +82,10 @@ import com.hbm.world.generator.CellularDungeonFactory;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
@ -396,7 +399,7 @@ public class MainRegistry {
EntityRegistry.registerModEntity(EntityOilSpillFX.class, "entity_spill_fx", 72, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityOilSpill.class, "entity_oil_spill", 73, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGasFX.class, "entity_spill_fx", 74, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityGasFlameFX.class, "entity_gasflame_fx", 75, this, 1000, 1, true);
//EntityRegistry.registerModEntity(EntityGasFlameFX.class, "entity_gasflame_fx", 75, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityMinecartTest.class, "entity_minecart_test", 76, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntitySparkBeam.class, "entity_spark_beam", 77, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 78, this, 1000, 1, true);
@ -1064,4 +1067,23 @@ public class MainRegistry {
config.save();
}
private static HashSet<String> ignoreMappings = new HashSet();
static {
for(int i = 1; i <= 8; i++)
ignoreMappings.add("hbm:item.gasflame" + i);
}
@EventHandler
public void handleMissingMappings(FMLMissingMappingsEvent event) {
for(MissingMapping mapping : event.get()) {
if(mapping.type == GameRegistry.Type.ITEM) {
if(ignoreMappings.contains(mapping.name)) {
mapping.ignore();
}
}
}
}
}

View File

@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -62,6 +63,8 @@ import com.hbm.util.EntityDamageUtil;
import com.hbm.world.WorldProviderNTM;
import com.hbm.world.generator.TimedGenerator;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@ -70,6 +73,7 @@ import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;

View File

@ -0,0 +1,56 @@
package com.hbm.particle;
import java.awt.Color;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntitySmokeFX;
import net.minecraft.world.World;
public class ParticleGasFlame extends EntitySmokeFX {
float colorMod = 1.0F;
public ParticleGasFlame(World world, double x, double y, double z, double mX, double mY, double mZ, float scale) {
super(world, x, y, z, mX, mY * 1.5, mZ, scale);
updateColor();
this.particleScale = scale;
this.colorMod = 0.8F + rand.nextFloat() * 0.2F;
this.noClip = true;
this.particleMaxAge = 30 + rand.nextInt(13);
}
@Override
public void onUpdate() {
double prevMo = this.motionY;
super.onUpdate();
updateColor();
//this.motionX *= 0.75;
//this.motionZ *= 0.75;
this.motionY = prevMo;
this.motionX *= 0.75D;
this.motionY += 0.005D;
this.motionZ *= 0.75D;
}
protected void updateColor() {
float time = (float) this.particleAge / (float) this.particleMaxAge;
Color color = Color.getHSBColor(Math.max((60 - time * 100) / 360F, 0.0F), 1 - time * 0.25F, 1 - time * 0.5F);
this.particleRed = color.getRed() / 255F;
this.particleGreen = color.getGreen() / 255F;
this.particleBlue = color.getBlue() / 255F;
this.particleRed *= colorMod;
this.particleGreen *= colorMod;
this.particleBlue *= colorMod;
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 15728880;
}
}

View File

@ -1,125 +0,0 @@
package com.hbm.render.entity.effect;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.items.ModItems;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public class GasFlameRenderer extends Render {
private Item field_94151_a;
private int field_94150_f;
private static final String __OBFID = "CL_00001008";
public GasFlameRenderer(Item p_i1259_1_, int p_i1259_2_) {
this.field_94151_a = p_i1259_1_;
this.field_94150_f = p_i1259_2_;
}
public GasFlameRenderer(Item p_i1260_1_) {
this(p_i1260_1_, 0);
}
/**
* Actually renders the given argument. This is a synthetic bridge method,
* always casting down its argument and then handing it off to a worker
* function which does the actual work. In all probabilty, the class Render
* is generic (Render<T extends Entity) and this method has signature public
* void func_76986_a(T entity, double d, double d1, double d2, float f,
* float f1). But JAD is pre 1.5 so doesn't do that.
*/
@Override
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
float p_76986_9_) {
if (p_76986_1_ instanceof EntityGasFlameFX) {
EntityGasFlameFX fx = (EntityGasFlameFX) p_76986_1_;
if (fx.particleAge <= fx.maxAge && fx.particleAge >= fx.maxAge / 8 * 7) {
field_94151_a = ModItems.gasflame8;
}
if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) {
field_94151_a = ModItems.gasflame7;
}
if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) {
field_94151_a = ModItems.gasflame6;
}
if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) {
field_94151_a = ModItems.gasflame5;
}
if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) {
field_94151_a = ModItems.gasflame4;
}
if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) {
field_94151_a = ModItems.gasflame3;
}
if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) {
field_94151_a = ModItems.gasflame2;
}
if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) {
field_94151_a = ModItems.gasflame1;
}
IIcon iicon = field_94151_a.getIconFromDamage(0);
if (iicon != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glScalef(7.5F, 7.5F, 7.5F);
//
GL11.glScalef(0.35F, 0.35F, 0.35F);
//
this.bindEntityTexture(p_76986_1_);
Tessellator tessellator = Tessellator.instance;
this.func_77026_a(tessellator, iicon);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called
* unless you call Render.bindEntityTexture.
*/
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return TextureMap.locationItemsTexture;
}
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
float f = p_77026_2_.getMinU();
float f1 = p_77026_2_.getMaxU();
float f2 = p_77026_2_.getMinV();
float f3 = p_77026_2_.getMaxV();
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
p_77026_1_.startDrawingQuads();
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
p_77026_1_.draw();
}
}

View File

@ -4,16 +4,19 @@ import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.entity.particle.EntityOrangeFX;
import com.hbm.entity.projectile.EntityShrapnel;
import com.hbm.entity.projectile.EntityWaterSplash;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
@ -102,9 +105,14 @@ public class TileEntityGeysir extends TileEntity {
worldObj.spawnEntityInWorld(fx);
}
if(timer % 2 == 0) //TODO: replace with actual particle
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, this.xCoord + 0.5F, this.yCoord + 1.1F, this.zCoord + 0.5F, worldObj.rand.nextGaussian() * 0.05, 0.2, worldObj.rand.nextGaussian() * 0.05));
if(timer % 2 == 0) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "gasfire");
data.setDouble("mX", worldObj.rand.nextGaussian() * 0.05);
data.setDouble("mY", 0.2);
data.setDouble("mZ", worldObj.rand.nextGaussian() * 0.05);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, this.xCoord + 0.5F, this.yCoord + 1.1F, this.zCoord + 0.5F), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 75));
}
}
private int getDelay() {

View File

@ -1,10 +1,7 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
@ -16,6 +13,7 @@ import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.ParticleUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
@ -331,14 +329,10 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
double pos = rand.nextDouble() * 2.5;
double off = 0.25;
if(meta == 2)
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, xCoord + 0.5 + off, yCoord + 5.5, zCoord + 0.5 - pos, 0.0, 0.0, 0.0));
if(meta == 3)
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, xCoord + 0.5 - off, yCoord + 5.5, zCoord + 0.5 + pos, 0.0, 0.0, 0.0));
if(meta == 4)
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, xCoord + 0.5 - pos, yCoord + 5.5, zCoord + 0.5 - off, 0.0, 0.0, 0.0));
if(meta == 5)
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, xCoord + 0.5 + pos, yCoord + 5.5, zCoord + 0.5 + off, 0.0, 0.0, 0.0));
if(meta == 2) ParticleUtil.spawnGasFlame(worldObj, xCoord + 0.5 + off, yCoord + 5.5, zCoord + 0.5 - pos, 0.0, 0.0, 0.0);
if(meta == 3) ParticleUtil.spawnGasFlame(worldObj, xCoord + 0.5 - off, yCoord + 5.5, zCoord + 0.5 + pos, 0.0, 0.0, 0.0);
if(meta == 4) ParticleUtil.spawnGasFlame(worldObj, xCoord + 0.5 - pos, yCoord + 5.5, zCoord + 0.5 - off, 0.0, 0.0, 0.0);
if(meta == 5) ParticleUtil.spawnGasFlame(worldObj, xCoord + 0.5 + pos, yCoord + 5.5, zCoord + 0.5 + off, 0.0, 0.0, 0.0);
efficiency = 0;
power = 0;

View File

@ -2,7 +2,6 @@ package com.hbm.tileentity.machine.oil;
import java.util.List;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
@ -16,6 +15,7 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.ParticleUtil;
import api.hbm.energy.IEnergyGenerator;
import api.hbm.fluid.IFluidStandardReceiver;
@ -140,8 +140,7 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
if(power > maxPower)
power = maxPower;
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, this.xCoord + 0.5F, this.yCoord + 11.75F, this.zCoord + 0.5F,
worldObj.rand.nextGaussian() * 0.15, 0.2, worldObj.rand.nextGaussian() * 0.15));
ParticleUtil.spawnGasFlame(worldObj, this.xCoord + 0.5F, this.yCoord + 11.75F, this.zCoord + 0.5F, worldObj.rand.nextGaussian() * 0.15, 0.2, worldObj.rand.nextGaussian() * 0.15);
List<Entity> list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord + 12, zCoord - 2, xCoord + 2, yCoord + 17, zCoord + 2));
for(Entity e : list) {

View File

@ -52,6 +52,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
int amount = Math.min(getStockpile(), getType().getMaxStackSize());
if(amount > 0) {
if(slots[2] == null) {
slots[2] = slots[1].copy();
slots[2].stackSize = amount;
@ -62,6 +63,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
this.stack -= amount;
}
}
}
NBTTagCompound data = new NBTTagCompound();
data.setInteger("stack", getStockpile());

View File

@ -0,0 +1,21 @@
package com.hbm.util;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ParticleUtil {
public static void spawnGasFlame(World world, double x, double y, double z, double mX, double mY, double mZ) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "gasfire");
data.setDouble("mX", mX);
data.setDouble("mY", mY);
data.setDouble("mZ", mZ);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(world.provider.dimensionId, x, y, z, 150));
}
}

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X4242",
"version":"1.0.27_X4251",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",