black hole sun, won't you come

This commit is contained in:
Bob 2021-06-22 23:14:23 +02:00
parent c4ecb20cf8
commit c664293781
19 changed files with 1597 additions and 125 deletions

View File

@ -1,16 +1,26 @@
package com.hbm.entity.effect; package com.hbm.entity.effect;
import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.entity.projectile.EntityRubble; import com.hbm.entity.projectile.EntityRubble;
import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -31,27 +41,27 @@ public class EntityBlackHole extends Entity {
@Override @Override
public void onUpdate() { public void onUpdate() {
super.onUpdate();
float size = this.dataWatcher.getWatchableObjectFloat(16); float size = this.dataWatcher.getWatchableObjectFloat(16);
for(int k = 0; k < size * 5; k++) { if(!worldObj.isRemote) {
double phi = rand.nextDouble() * (Math.PI * 2); for(int k = 0; k < size * 2; k++) {
double costheta = rand.nextDouble() * 2 - 1; double phi = rand.nextDouble() * (Math.PI * 2);
double theta = Math.acos(costheta); double costheta = rand.nextDouble() * 2 - 1;
double x = Math.sin( theta) * Math.cos( phi ); double theta = Math.acos(costheta);
double y = Math.sin( theta) * Math.sin( phi ); double x = Math.sin( theta) * Math.cos( phi );
double z = Math.cos( theta ); double y = Math.sin( theta) * Math.sin( phi );
double z = Math.cos( theta );
Vec3 vec = Vec3.createVectorHelper(x, y, z);
int length = (int)Math.ceil(size * 15);
for(int i = 0; i < length; i ++) {
int x0 = (int)(this.posX + (vec.xCoord * i));
int y0 = (int)(this.posY + (vec.yCoord * i));
int z0 = (int)(this.posZ + (vec.zCoord * i));
if(!worldObj.isRemote) { Vec3 vec = Vec3.createVectorHelper(x, y, z);
int length = (int)Math.ceil(size * 15);
for(int i = 0; i < length; i ++) {
int x0 = (int)(this.posX + (vec.xCoord * i));
int y0 = (int)(this.posY + (vec.yCoord * i));
int z0 = (int)(this.posZ + (vec.zCoord * i));
if(worldObj.getBlock(x0, y0, z0).getMaterial().isLiquid()) { if(worldObj.getBlock(x0, y0, z0).getMaterial().isLiquid()) {
worldObj.setBlock(x0, y0, z0, Blocks.air); worldObj.setBlock(x0, y0, z0, Blocks.air);
} }
@ -71,32 +81,80 @@ public class EntityBlackHole extends Entity {
} }
} }
} }
ExplosionNukeGeneric.succ(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, (int)Math.ceil(size * 15));
if(!worldObj.isRemote && ExplosionNukeGeneric.dedify(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, (int)Math.ceil(size * 2))) { double range = size * 15;
this.setDead();
int r = (int)Math.ceil(size); List<Entity> entities = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(
int r2 = r * r; posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) { for(Entity e : entities) {
int X = xx + (int)this.posX;
int XX = xx * xx; if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
for (int yy = -r; yy < r; yy++) { continue;
int Y = yy + (int)this.posY;
int YY = XX + yy * yy; if(e instanceof EntityFallingBlock && !worldObj.isRemote && e.ticksExisted > 1) {
for (int zz = -r; zz < r; zz++) {
int Z = zz + (int)this.posZ; double x = e.posX;
int ZZ = YY + zz * zz; double y = e.posY;
if (ZZ < r22) { double z = e.posZ;
worldObj.setBlock(X, Y, Z, ModBlocks.gravel_obsidian); Block b = ((EntityFallingBlock)e).func_145805_f();
} int meta = ((EntityFallingBlock)e).field_145814_a;
e.setDead();
EntityRubble rubble = new EntityRubble(worldObj);
rubble.setMetaBasedOnBlock(b, meta);
rubble.setPositionAndRotation(x, y, z, 0, 0);
rubble.motionX = e.motionX;
rubble.motionY = e.motionY;
rubble.motionZ = e.motionZ;
worldObj.spawnEntityInWorld(rubble);
}
Vec3 vec = Vec3.createVectorHelper(posX - e.posX, posY - e.posY, posZ - e.posZ);
double dist = vec.lengthVector();
if(dist > range)
continue;
vec = vec.normalize();
if(!(e instanceof EntityItem))
vec.rotateAroundY((float)Math.toRadians(15));
double speed = 0.1D;
e.motionX += vec.xCoord * speed;
e.motionY += vec.yCoord * speed * 2;
e.motionZ += vec.zCoord * speed;
if(e instanceof EntityBlackHole)
continue;
if(dist < size * 1.5) {
e.attackEntityFrom(ModDamageSource.blackhole, 1000);
if(!(e instanceof EntityLivingBase))
e.setDead();
if(!worldObj.isRemote && e instanceof EntityItem) {
EntityItem item = (EntityItem) e;
ItemStack stack = item.getEntityItem();
if(stack.getItem() == ModItems.pellet_antimatter || stack.getItem() == ModItems.flame_pony) {
this.setDead();
worldObj.createExplosion(null, this.posX, this.posY, this.posZ, 5.0F, true);
return;
} }
} }
} }
worldObj.createExplosion(null, this.posX, this.posY, this.posZ, 5.0F, true);
} }
this.setPosition(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
this.motionX *= 0.99D;
this.motionY *= 0.99D;
this.motionZ *= 0.99D;
} }
@Override @Override
@ -114,24 +172,20 @@ public class EntityBlackHole extends Entity {
nbt.setFloat("size", this.dataWatcher.getWatchableObjectFloat(16)); nbt.setFloat("size", this.dataWatcher.getWatchableObjectFloat(16));
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) public boolean isInRangeToRenderDist(double distance) {
{ return distance < 25000;
return distance < 25000; }
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) public int getBrightnessForRender(float p_70070_1_) {
{ return 15728880;
return 15728880; }
}
@Override
public float getBrightness(float p_70013_1_)
{
return 1.0F;
}
@Override
public float getBrightness(float p_70013_1_) {
return 1.0F;
}
} }

View File

@ -0,0 +1,22 @@
package com.hbm.entity.effect;
import net.minecraft.world.World;
public class EntityQuasar extends EntityBlackHole {
public EntityQuasar(World world) {
super(world);
this.ignoreFrustumCheck = true;
this.isImmuneToFire = true;
}
public EntityQuasar(World world, float size) {
super(world);
this.dataWatcher.updateObject(16, size);
}
@Override
public void onUpdate() {
super.onUpdate();
}
}

View File

@ -0,0 +1,101 @@
package com.hbm.entity.effect;
import com.hbm.explosion.ExplosionNT;
import com.hbm.explosion.ExplosionNT.ExAttrib;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntitySpear extends Entity {
public EntitySpear(World p_i1582_1_) {
super(p_i1582_1_);
this.setSize(2F, 10F);
this.isImmuneToFire = true;
this.ignoreFrustumCheck = true;
}
@Override
protected void entityInit() { }
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionX = 0;
this.motionY = -0.2;
this.motionZ = 0;
int x = (int) Math.floor(posX);
int y = (int) Math.floor(posY);
int z = (int) Math.floor(posZ);
if(worldObj.getBlock(x, y - 1, z).getMaterial() == Material.air) {
this.setPositionAndRotation(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ, 0, 0);
if(!worldObj.isRemote) {
double ix = posX + rand.nextGaussian() * 25;
double iz = posZ + rand.nextGaussian() * 25;
double iy = worldObj.getHeightValue((int)Math.floor(ix), (int)Math.floor(iz)) + 2;
ExAttrib at = Vec3.createVectorHelper(ix - posX, 0, iz - posZ).lengthVector() < 20 ? ExAttrib.DIGAMMA_CIRCUIT : ExAttrib.DIGAMMA;
new ExplosionNT(worldObj, this, ix, iy, iz, 7.5F)
.addAttrib(ExAttrib.NOHURT)
.addAttrib(ExAttrib.NOPARTICLE)
.addAttrib(ExAttrib.NODROP)
.addAttrib(ExAttrib.NOSOUND)
.addAttrib(at).explode();
}
if(worldObj.isRemote) {
double dy = worldObj.getHeightValue((int)Math.floor(posX), (int)Math.floor(posZ)) + 2;
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "smoke");
data.setString("mode", "radialDigamma");
data.setInteger("count", 3);
data.setDouble("posX", posX);
data.setDouble("posY", dy);
data.setDouble("posZ", posZ);
MainRegistry.proxy.effectNT(data);
}
} else if(!worldObj.isRemote) {
this.setDead();
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { }
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { }
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) {
return distance < 25000;
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 15728880;
}
@Override
public float getBrightness(float p_70013_1_) {
return 1.0F;
}
}

View File

@ -51,7 +51,7 @@ public class EntityRubble extends EntityThrowable {
//worldObj.playAuxSFX(2001, (int)posX, (int)posY, (int)posZ, this.dataWatcher.getWatchableObjectInt(16) + (this.dataWatcher.getWatchableObjectInt(17) << 12)); //worldObj.playAuxSFX(2001, (int)posX, (int)posY, (int)posZ, this.dataWatcher.getWatchableObjectInt(16) + (this.dataWatcher.getWatchableObjectInt(17) << 12));
if(!worldObj.isRemote) if(!worldObj.isRemote)
PacketDispatcher.wrapper.sendToAllAround(new ParticleBurstPacket((int)posX - 1, (int)posY, (int)posZ - 1, this.dataWatcher.getWatchableObjectInt(16), this.dataWatcher.getWatchableObjectInt(17)), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 50)); PacketDispatcher.wrapper.sendToAllAround(new ParticleBurstPacket((int)Math.floor(posX), (int)posY, (int)Math.floor(posZ), this.dataWatcher.getWatchableObjectInt(16), this.dataWatcher.getWatchableObjectInt(17)), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 50));
} }
} }

View File

@ -2,9 +2,8 @@ package com.hbm.handler.guncfg;
import java.util.ArrayList; import java.util.ArrayList;
import com.hbm.entity.effect.EntitySpear;
import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.explosion.ExplosionNT;
import com.hbm.explosion.ExplosionNT.ExAttrib;
import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration; import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration; import com.hbm.handler.GunConfiguration;
@ -418,7 +417,14 @@ public class GunRocketFactory {
if(bullet.worldObj.isRemote) if(bullet.worldObj.isRemote)
return; return;
for(int i = 0; i < 250; i++) { EntitySpear spear = new EntitySpear(bullet.worldObj);
spear.posX = bullet.posX;
spear.posZ = bullet.posZ;
spear.posY = bullet.posY + 100;
bullet.worldObj.spawnEntityInWorld(spear);
/*for(int i = 0; i < 250; i++) {
double ix = bullet.posX + bullet.worldObj.rand.nextGaussian() * 15; double ix = bullet.posX + bullet.worldObj.rand.nextGaussian() * 15;
double iy = bullet.posY + bullet.worldObj.rand.nextGaussian() * 2; double iy = bullet.posY + bullet.worldObj.rand.nextGaussian() * 2;
@ -432,7 +438,7 @@ public class GunRocketFactory {
.addAttrib(ExAttrib.NODROP) .addAttrib(ExAttrib.NODROP)
.addAttrib(ExAttrib.NOSOUND) .addAttrib(ExAttrib.NOSOUND)
.addAttrib(at).explode(); .addAttrib(at).explode();
} }*/
} }
}; };

View File

@ -3,7 +3,7 @@ package com.hbm.items.special;
import java.util.List; import java.util.List;
import com.hbm.config.WeaponConfig; import com.hbm.config.WeaponConfig;
import com.hbm.entity.effect.EntityRagingVortex; import com.hbm.entity.effect.EntityQuasar;
import com.hbm.util.ContaminationUtil; import com.hbm.util.ContaminationUtil;
import com.hbm.util.I18nUtil; import com.hbm.util.I18nUtil;
@ -59,7 +59,7 @@ public class ItemDigamma extends ItemHazard {
if(entityItem.onGround) { if(entityItem.onGround) {
if(WeaponConfig.dropSing) { if(WeaponConfig.dropSing) {
EntityRagingVortex bl = new EntityRagingVortex(entityItem.worldObj, 10F); EntityQuasar bl = new EntityQuasar(entityItem.worldObj, 5F);
bl.posX = entityItem.posX; bl.posX = entityItem.posX;
bl.posY = entityItem.posY; bl.posY = entityItem.posY;
bl.posZ = entityItem.posZ; bl.posZ = entityItem.posZ;

View File

@ -495,8 +495,10 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityBlackHole.class, new RenderBlackHole()); RenderingRegistry.registerEntityRenderingHandler(EntityBlackHole.class, new RenderBlackHole());
RenderingRegistry.registerEntityRenderingHandler(EntityVortex.class, new RenderBlackHole()); RenderingRegistry.registerEntityRenderingHandler(EntityVortex.class, new RenderBlackHole());
RenderingRegistry.registerEntityRenderingHandler(EntityRagingVortex.class, new RenderBlackHole()); RenderingRegistry.registerEntityRenderingHandler(EntityRagingVortex.class, new RenderBlackHole());
RenderingRegistry.registerEntityRenderingHandler(EntityQuasar.class, new RenderQuasar());
RenderingRegistry.registerEntityRenderingHandler(EntityDeathBlast.class, new RenderDeathBlast()); RenderingRegistry.registerEntityRenderingHandler(EntityDeathBlast.class, new RenderDeathBlast());
RenderingRegistry.registerEntityRenderingHandler(EntityNukeExplosionAdvanced.class, new RenderSnowball(ModItems.energy_ball)); RenderingRegistry.registerEntityRenderingHandler(EntityNukeExplosionAdvanced.class, new RenderSnowball(ModItems.energy_ball));
RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear());
//minecarts //minecarts
RenderingRegistry.registerEntityRenderingHandler(EntityMinecartTest.class, new RenderMinecartTest()); RenderingRegistry.registerEntityRenderingHandler(EntityMinecartTest.class, new RenderMinecartTest());
//items //items
@ -717,6 +719,22 @@ public class ClientProxy extends ServerProxy {
Minecraft.getMinecraft().effectRenderer.addEffect(fx); Minecraft.getMinecraft().effectRenderer.addEffect(fx);
} }
} }
if("radialDigamma".equals(mode)) {
Vec3 vec = Vec3.createVectorHelper(2, 0, 0);
vec.rotateAroundY(rand.nextFloat() * (float)Math.PI * 2F);
for(int i = 0; i < count; i++) {
ParticleDigammaSmoke fx = new ParticleDigammaSmoke(man, world, x, y, z);
fx.motionY = 0;
fx.motionX = vec.xCoord;
fx.motionZ = vec.zCoord;
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
vec.rotateAroundY((float)Math.PI * 2F / (float)count);
}
}
if("shock".equals(mode)) { if("shock".equals(mode)) {
@ -731,8 +749,8 @@ public class ClientProxy extends ServerProxy {
fx.motionX = vec.xCoord; fx.motionX = vec.xCoord;
fx.motionZ = vec.zCoord; fx.motionZ = vec.zCoord;
Minecraft.getMinecraft().effectRenderer.addEffect(fx); Minecraft.getMinecraft().effectRenderer.addEffect(fx);
vec.rotateAroundY(360 / count); vec.rotateAroundY((float)Math.PI * 2F / (float)count);
} }
} }

View File

@ -642,6 +642,8 @@ public class MainRegistry {
EntityRegistry.registerModEntity(EntityRBMKDebris.class, "entity_rbmk_debris", 154, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityRBMKDebris.class, "entity_rbmk_debris", 154, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityUFO.class, "entity_ntm_ufo", 155, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityUFO.class, "entity_ntm_ufo", 155, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosionNT.class, "entity_ntm_explosion_nt", 156, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosionNT.class, "entity_ntm_explosion_nt", 156, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityQuasar.class, "entity_digamma_quasar", 157, this, 250, 1, true);
EntityRegistry.registerModEntity(EntitySpear.class, "entity_digamma_spear", 158, this, 1000, 1, true);
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd); EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);

View File

@ -538,6 +538,8 @@ public class ResourceManager {
public static final IModelCustom ff_python = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/python.obj")); public static final IModelCustom ff_python = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/python.obj"));
public static final IModelCustom ff_maresleg = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/maresleg.obj")); public static final IModelCustom ff_maresleg = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/maresleg.obj"));
public static final IModelCustom fireext = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/fireext.obj")); public static final IModelCustom fireext = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/fireext.obj"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
public static final IModelCustom grenade_frag = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_frag.obj")); public static final IModelCustom grenade_frag = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_frag.obj"));
public static final IModelCustom grenade_aschrab = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_aschrab.obj")); public static final IModelCustom grenade_aschrab = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_aschrab.obj"));
@ -594,6 +596,8 @@ public class ResourceManager {
public static final ResourceLocation fireext_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_normal.png"); public static final ResourceLocation fireext_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_normal.png");
public static final ResourceLocation fireext_foam_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_foam.png"); public static final ResourceLocation fireext_foam_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_foam.png");
public static final ResourceLocation fireext_sand_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_sand.png"); public static final ResourceLocation fireext_sand_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_sand.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
public static final ResourceLocation ff_gold = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/gold.png"); public static final ResourceLocation ff_gold = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/gold.png");
public static final ResourceLocation ff_gun_bright = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/gun_bright.png"); public static final ResourceLocation ff_gun_bright = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/gun_bright.png");

View File

@ -0,0 +1,78 @@
package com.hbm.particle;
import com.hbm.main.ModEventHandlerClient;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleDigammaSmoke extends EntityFX {
private int age;
public int maxAge;
public ParticleDigammaSmoke(TextureManager p_i1213_1_, World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_) {
super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_);
particleIcon = ModEventHandlerClient.particleBase;
maxAge = 100 + rand.nextInt(40);
this.noClip = true;
this.particleScale = 5;
this.particleRed = 0.5F + rand.nextFloat() * 0.2F;
this.particleGreen = 0.0F;
this.particleBlue = 0.0F;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
particleAlpha = 1 - ((float) age / (float) maxAge);
++this.age;
if(this.age == this.maxAge) {
this.setDead();
}
this.motionX *= 0.99D;
this.motionY *= 0.99D;
this.motionZ *= 0.99D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
}
@Override
public int getFXLayer() {
return 1;
}
@Override
public void renderParticle(Tessellator tess, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tess.setNormal(0.0F, 1.0F, 0.0F);
float scale = this.particleScale;
float pX = (float) ((this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX));
float pY = (float) ((this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY));
float pZ = (float) ((this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ));
tess.addVertexWithUV((double) (pX - p_70539_3_ * scale - p_70539_6_ * scale), (double) (pY - p_70539_4_ * scale), (double) (pZ - p_70539_5_ * scale - p_70539_7_ * scale), particleIcon.getMaxU(), particleIcon.getMaxV());
tess.addVertexWithUV((double) (pX - p_70539_3_ * scale + p_70539_6_ * scale), (double) (pY + p_70539_4_ * scale), (double) (pZ - p_70539_5_ * scale + p_70539_7_ * scale), particleIcon.getMaxU(), particleIcon.getMinV());
tess.addVertexWithUV((double) (pX + p_70539_3_ * scale + p_70539_6_ * scale), (double) (pY + p_70539_4_ * scale), (double) (pZ + p_70539_5_ * scale + p_70539_7_ * scale), particleIcon.getMinU(), particleIcon.getMinV());
tess.addVertexWithUV((double) (pX + p_70539_3_ * scale - p_70539_6_ * scale), (double) (pY - p_70539_4_ * scale), (double) (pZ + p_70539_5_ * scale - p_70539_7_ * scale), particleIcon.getMinU(), particleIcon.getMaxV());
}
@Override
public int getBrightnessForRender(float p_70070_1_) {
return 240;
}
}

View File

@ -35,27 +35,26 @@ public class ParticleSmokePlume extends EntityFX {
this.prevPosX = this.posX; this.prevPosX = this.posX;
this.prevPosY = this.posY; this.prevPosY = this.posY;
this.prevPosZ = this.posZ; this.prevPosZ = this.posZ;
particleAlpha = 1 - ((float) age / (float) maxAge); particleAlpha = 1 - ((float) age / (float) maxAge);
++this.age; ++this.age;
if (this.age == this.maxAge) { if(this.age == this.maxAge) {
this.setDead(); this.setDead();
} }
double bak = Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector();
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (Math.abs(motionX) < 0.025 && Math.abs(motionZ) < 0.025)
{
motionY = bak;
}
motionX *= 0.925; double bak = Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector();
motionY *= 0.925;
motionZ *= 0.925; this.moveEntity(this.motionX, this.motionY, this.motionZ);
if(Math.abs(motionX) < 0.025 && Math.abs(motionZ) < 0.025) {
motionY = bak;
}
motionX *= 0.925;
motionY *= 0.925;
motionZ *= 0.925;
} }
public int getFXLayer() { public int getFXLayer() {
@ -63,40 +62,40 @@ public class ParticleSmokePlume extends EntityFX {
} }
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_) { 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_) {
this.theRenderEngine.bindTexture(texture); this.theRenderEngine.bindTexture(texture);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glDepthMask(false); GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
Random urandom = new Random(this.getEntityId()); Random urandom = new Random(this.getEntityId());
for(int i = 0; i < 6; i++) { for(int i = 0; i < 6; i++) {
p_70539_1_.startDrawingQuads(); p_70539_1_.startDrawingQuads();
this.particleRed = this.particleGreen = this.particleBlue = urandom.nextFloat() * 0.7F + 0.2F; this.particleRed = this.particleGreen = this.particleBlue = urandom.nextFloat() * 0.7F + 0.2F;
p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
p_70539_1_.setNormal(0.0F, 1.0F, 0.0F); p_70539_1_.setNormal(0.0F, 1.0F, 0.0F);
p_70539_1_.setBrightness(240); p_70539_1_.setBrightness(240);
float scale = 0.5F; float scale = 0.5F;
float pX = (float) ((this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX) + urandom.nextGaussian() * 0.5); float pX = (float) ((this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX) + urandom.nextGaussian() * 0.5);
float pY = (float) ((this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY) + urandom.nextGaussian() * 0.5); float pY = (float) ((this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY) + urandom.nextGaussian() * 0.5);
float pZ = (float) ((this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ) + urandom.nextGaussian() * 0.5); float pZ = (float) ((this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ) + urandom.nextGaussian() * 0.5);
p_70539_1_.addVertexWithUV((double)(pX - p_70539_3_ * scale - p_70539_6_ * scale), (double)(pY - p_70539_4_ * scale), (double)(pZ - p_70539_5_ * scale - p_70539_7_ * scale), 1, 1); p_70539_1_.addVertexWithUV((double) (pX - p_70539_3_ * scale - p_70539_6_ * scale), (double) (pY - p_70539_4_ * scale), (double) (pZ - p_70539_5_ * scale - p_70539_7_ * scale), 1, 1);
p_70539_1_.addVertexWithUV((double)(pX - p_70539_3_ * scale + p_70539_6_ * scale), (double)(pY + p_70539_4_ * scale), (double)(pZ - p_70539_5_ * scale + p_70539_7_ * scale), 1, 0); p_70539_1_.addVertexWithUV((double) (pX - p_70539_3_ * scale + p_70539_6_ * scale), (double) (pY + p_70539_4_ * scale), (double) (pZ - p_70539_5_ * scale + p_70539_7_ * scale), 1, 0);
p_70539_1_.addVertexWithUV((double)(pX + p_70539_3_ * scale + p_70539_6_ * scale), (double)(pY + p_70539_4_ * scale), (double)(pZ + p_70539_5_ * scale + p_70539_7_ * scale), 0, 0); p_70539_1_.addVertexWithUV((double) (pX + p_70539_3_ * scale + p_70539_6_ * scale), (double) (pY + p_70539_4_ * scale), (double) (pZ + p_70539_5_ * scale + p_70539_7_ * scale), 0, 0);
p_70539_1_.addVertexWithUV((double)(pX + p_70539_3_ * scale - p_70539_6_ * scale), (double)(pY - p_70539_4_ * scale), (double)(pZ + p_70539_5_ * scale - p_70539_7_ * scale), 0, 1); p_70539_1_.addVertexWithUV((double) (pX + p_70539_3_ * scale - p_70539_6_ * scale), (double) (pY - p_70539_4_ * scale), (double) (pZ + p_70539_5_ * scale - p_70539_7_ * scale), 0, 1);
p_70539_1_.draw(); p_70539_1_.draw();
} }
GL11.glPolygonOffset(0.0F, 0.0F); GL11.glPolygonOffset(0.0F, 0.0F);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
} }

View File

@ -4,7 +4,6 @@ import java.util.Random;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.entity.effect.EntityBlackHole;
import com.hbm.entity.effect.EntityRagingVortex; import com.hbm.entity.effect.EntityRagingVortex;
import com.hbm.entity.effect.EntityVortex; import com.hbm.entity.effect.EntityVortex;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
@ -21,11 +20,11 @@ import net.minecraftforge.client.model.IModelCustom;
public class RenderBlackHole extends Render { public class RenderBlackHole extends Render {
private static final ResourceLocation objTesterModelRL = new ResourceLocation(RefStrings.MODID, "models/Sphere.obj"); protected static final ResourceLocation objTesterModelRL = new ResourceLocation(RefStrings.MODID, "models/Sphere.obj");
private IModelCustom blastModel; protected IModelCustom blastModel;
private ResourceLocation hole = new ResourceLocation(RefStrings.MODID, "textures/models/BlackHole.png"); protected ResourceLocation hole = new ResourceLocation(RefStrings.MODID, "textures/models/BlackHole.png");
private ResourceLocation swirl = new ResourceLocation(RefStrings.MODID, "textures/entity/bhole.png"); protected ResourceLocation swirl = new ResourceLocation(RefStrings.MODID, "textures/entity/bhole.png");
private ResourceLocation disc = new ResourceLocation(RefStrings.MODID, "textures/entity/bholeDisc.png"); protected ResourceLocation disc = new ResourceLocation(RefStrings.MODID, "textures/entity/bholeDisc.png");
public RenderBlackHole() { public RenderBlackHole() {
blastModel = AdvancedModelLoader.loadModel(objTesterModelRL); blastModel = AdvancedModelLoader.loadModel(objTesterModelRL);
@ -64,11 +63,15 @@ public class RenderBlackHole extends Render {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void renderDisc(Entity entity, float interp) { protected ResourceLocation discTex() {
return this.disc;
}
protected void renderDisc(Entity entity, float interp) {
float glow = 0.75F; float glow = 0.75F;
bindTexture(disc); bindTexture(discTex());
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef(entity.getEntityId() % 90 - 45, 1, 0, 0); GL11.glRotatef(entity.getEntityId() % 90 - 45, 1, 0, 0);
@ -86,7 +89,7 @@ public class RenderBlackHole extends Render {
Vec3 vec = Vec3.createVectorHelper(1, 0, 0); Vec3 vec = Vec3.createVectorHelper(1, 0, 0);
for(int k = 0; k < 15; k++) { for(int k = 0; k < steps(); k++) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glRotatef((entity.ticksExisted + interp % 360) * -((float)Math.pow(k + 1, 1.25)), 0, 1, 0); GL11.glRotatef((entity.ticksExisted + interp % 360) * -((float)Math.pow(k + 1, 1.25)), 0, 1, 0);
@ -135,7 +138,11 @@ public class RenderBlackHole extends Render {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void setColorFromIteration(Tessellator tess, int iteration, float alpha) { protected int steps() {
return 15;
}
protected void setColorFromIteration(Tessellator tess, int iteration, float alpha) {
if(iteration < 5) { if(iteration < 5) {
float g = 0.125F + iteration * (1F / 10F); float g = 0.125F + iteration * (1F / 10F);
@ -155,18 +162,10 @@ public class RenderBlackHole extends Render {
float g = 1F - i * (1F / 9F); float g = 1F - i * (1F / 9F);
float b = i * (1F / 5F); float b = i * (1F / 5F);
tess.setColorRGBA_F(r, g, b, alpha); tess.setColorRGBA_F(r, g, b, alpha);
return;
}
switch(iteration) {
case 0: tess.setColorRGBA_F(1.0F, 0.0F, 0.0F, alpha); break;
case 1: tess.setColorRGBA_F(1.0F, 0.5F, 0.0F, alpha); break;
case 2: tess.setColorRGBA_F(1.0F, 1.0F, 0.0F, alpha); break;
case 3: tess.setColorRGBA_F(0.5F, 1.0F, 1.0F, alpha); break;
} }
} }
private void renderSwirl(Entity entity, float interp) { protected void renderSwirl(Entity entity, float interp) {
float glow = 0.75F; float glow = 0.75F;
@ -267,7 +266,7 @@ public class RenderBlackHole extends Render {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void renderJets(Entity entity, float interp) { protected void renderJets(Entity entity, float interp) {
Tessellator tess = Tessellator.instance; Tessellator tess = Tessellator.instance;
@ -309,7 +308,7 @@ public class RenderBlackHole extends Render {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void renderFlare(Entity entity) { protected void renderFlare(Entity entity) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(0.2F, 0.2F, 0.2F); GL11.glScalef(0.2F, 0.2F, 0.2F);
@ -367,7 +366,7 @@ public class RenderBlackHole extends Render {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void setColorFull(Entity e, Tessellator tessellator) { protected void setColorFull(Entity e, Tessellator tessellator) {
if(e instanceof EntityVortex) if(e instanceof EntityVortex)
tessellator.setColorRGBA_I(0x3898b3, (int) (255.0F * (1.0F))); tessellator.setColorRGBA_I(0x3898b3, (int) (255.0F * (1.0F)));
@ -379,7 +378,7 @@ public class RenderBlackHole extends Render {
tessellator.setColorRGBA_I(0xFFB900, (int) (255.0F * (1.0F))); tessellator.setColorRGBA_I(0xFFB900, (int) (255.0F * (1.0F)));
} }
private void setColorNone(Entity e, Tessellator tessellator) { protected void setColorNone(Entity e, Tessellator tessellator) {
if(e instanceof EntityVortex) if(e instanceof EntityVortex)
tessellator.setColorRGBA_I(0x3898b3, 0); tessellator.setColorRGBA_I(0x3898b3, 0);

View File

@ -0,0 +1,62 @@
package com.hbm.render.entity.effect;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderQuasar extends RenderBlackHole {
protected ResourceLocation quasar = new ResourceLocation(RefStrings.MODID, "textures/entity/bholeD.png");
@Override
public void doRender(Entity entity, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float interp) {
GL11.glPushMatrix();
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
float size = entity.getDataWatcher().getWatchableObjectFloat(16);
GL11.glScalef(size, size, size);
bindTexture(hole);
blastModel.renderAll();
renderDisc(entity, interp);
renderJets(entity, interp);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation discTex() {
return this.quasar;
}
@Override
protected void setColorFromIteration(Tessellator tess, int iteration, float alpha) {
float r = 1.0F;
float g = (float) Math.pow(iteration / 15F, 2);
float b = (float) Math.pow(iteration / 15F, 2);
tess.setColorRGBA_F(r, g, b, alpha);
}
@Override
protected int steps() {
return 15;
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return super.getEntityTexture(entity);
}
}

View File

@ -0,0 +1,36 @@
package com.hbm.render.entity.effect;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderSpear extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f, float interp) {
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y + 15, (float) z);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glRotated(180, 1, 0, 0);
GL11.glScaled(2, 2, 2);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.lance_tex);
ResourceManager.lance.renderPart("Spear");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return ResourceManager.lance_tex;
}
}

View File

@ -20,13 +20,12 @@ public class RenderRubble extends Render {
} }
@Override @Override
public void doRender(Entity rocket, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, public void doRender(Entity rocket, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
float p_76986_9_) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glScalef(1.0F, 1.0F, 1.0F);
GL11.glRotatef(180, 1, 0, 0); GL11.glRotatef(180, 1, 0, 0);
GL11.glRotatef((rocket.ticksExisted % 360) * 10, 1, 1, 1); GL11.glRotatef(((rocket.ticksExisted + p_76986_9_) % 360) * 10, 1, 1, 1);
try { try {
int block = rocket.getDataWatcher().getWatchableObjectInt(16); int block = rocket.getDataWatcher().getWatchableObjectInt(16);

View File

@ -26,7 +26,7 @@ achievement.digammaKnow.desc=what this world is about.
achievement.digammaKnow=The Terror of Knowing achievement.digammaKnow=The Terror of Knowing
achievement.digammaSee.desc=into the abyss. achievement.digammaSee.desc=into the abyss.
achievement.digammaSee=The Terror of Seeing achievement.digammaSee=The Terror of Seeing
achievement.digammaUpOnTop.desc=Ich tu was ich will, verantwortungslos. achievement.digammaUpOnTop.desc=Bewundere meinen Sohn, er ist mein Klon.
achievement.digammaUpOnTop=Bewundere mich, bewundere mein Heim achievement.digammaUpOnTop=Bewundere mich, bewundere mein Heim
achievement.fiend.desc=Sei gemein. achievement.fiend.desc=Sei gemein.
achievement.fiend2.desc=Sei gemeiner. achievement.fiend2.desc=Sei gemeiner.

View File

@ -26,7 +26,7 @@ achievement.digammaKnow.desc=what this world is about.
achievement.digammaKnow=The Terror of Knowing achievement.digammaKnow=The Terror of Knowing
achievement.digammaSee.desc=into the abyss. achievement.digammaSee.desc=into the abyss.
achievement.digammaSee=The Terror of Seeing achievement.digammaSee=The Terror of Seeing
achievement.digammaUpOnTop.desc=I do what I want, but irresponsibly. achievement.digammaUpOnTop.desc=Admire my son, he's my clone.
achievement.digammaUpOnTop=Admire Me, Admire my Home achievement.digammaUpOnTop=Admire Me, Admire my Home
achievement.fiend.desc=Be mean. achievement.fiend.desc=Be mean.
achievement.fiend2.desc=Be meaner. achievement.fiend2.desc=Be meaner.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB