crap cleanup

This commit is contained in:
Boblet 2026-04-27 11:05:49 +02:00
parent 300be53a3a
commit 90e345937a
30 changed files with 63 additions and 1938 deletions

View File

@ -12,6 +12,11 @@
* If two pipe anchors are connected, one having a type set and one still being "none", instead of erroring, the "none" pipe will assume the other one's type
* Self-chargers in battery sockets now produce unreliable power output which constantly fluctuates
* Self-chargers in battery sockets now cause static discharges in regular intervals
* Added more RoR functionality to the boilers, industrial combustion engine, CCGT and ZIRNOX
* The industrial steam turbine now has OpenComputers integration
* Crates now open when right-clicked by default, holding shift is required to place them down
* The automatic buzzsaw can now burn coal tar creosote
* The old cluster type effect used by MPBs and cluster missiles now use the new generic projectile system with actual bomblet models
## Fixed
* Fixed uncrafting of the nickel RTG pellet not respecting item metadata

View File

@ -1135,8 +1135,6 @@ public class ModBlocks {
public static Block statue_elb_f;
public static Block cheater_virus;
public static Block cheater_virus_seed;
public static Block crystal_virus;
public static Block crystal_hardened;
public static Block crystal_pulsar;
@ -2273,8 +2271,6 @@ public class ModBlocks {
machine_forcefield = new MachineForceField(Material.iron).setBlockName("machine_forcefield").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_forcefield");
cheater_virus = new CheaterVirus(Material.iron).setBlockName("cheater_virus").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus");
cheater_virus_seed = new CheaterVirusSeed(Material.iron).setBlockName("cheater_virus_seed").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus_seed");
crystal_virus = new CrystalVirus(Material.iron).setBlockName("crystal_virus").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_virus");
crystal_hardened = new BlockGeneric(Material.iron).setBlockName("crystal_hardened").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_hardened");
crystal_pulsar = new CrystalPulsar(Material.iron).setBlockName("crystal_pulsar").setHardness(15.0F).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crystal_pulsar");
@ -3496,8 +3492,6 @@ public class ModBlocks {
GameRegistry.registerBlock(crystal_hardened, crystal_hardened.getUnlocalizedName());
GameRegistry.registerBlock(crystal_pulsar, crystal_pulsar.getUnlocalizedName());
register(taint);
GameRegistry.registerBlock(cheater_virus, cheater_virus.getUnlocalizedName());
GameRegistry.registerBlock(cheater_virus_seed, cheater_virus_seed.getUnlocalizedName());
GameRegistry.registerBlock(ntm_dirt, ntm_dirt.getUnlocalizedName());
GameRegistry.registerBlock(pink_log, pink_log.getUnlocalizedName());
GameRegistry.registerBlock(pink_planks, pink_planks.getUnlocalizedName());

View File

@ -159,11 +159,11 @@ public class BombMulti extends BlockContainer implements IBomb {
explosionValue = 0;
if(clusterCount > 0) {
ExplosionChaos.cluster(world, x, y, z, clusterCount, 1);
ExplosionChaos.cluster(world, x + 0.5, y + 0.5, z + 0.5, clusterCount, 0, 0, (float) Math.PI * 2F, (float) Math.PI * 0.5F, 0.5F);
}
if(fireRadius > 0) {
ExplosionChaos.burn(world, x, y, z, fireRadius);
ExplosionChaos.igniteAllBlocks(world, x, y, z, fireRadius);
}
if(poisonRadius > 0) {

View File

@ -1,94 +0,0 @@
package com.hbm.blocks.bomb;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.explosion.ExplosionChaos;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class CheaterVirus extends Block {
static boolean protect = true;
public CheaterVirus(Material p_i45394_1_) {
super(p_i45394_1_);
this.setTickRandomly(true);
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int i)
{
super.breakBlock(world, x, y, z, block, i);
if(CheaterVirus.protect)
world.setBlock(x, y, z, this, i, 2);
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(GeneralConfig.enableVirus){
if(world.getBlock(x + 1, y, z) != ModBlocks.cheater_virus && world.getBlock(x + 1, y, z) != Blocks.air && world.getBlock(x + 1, y, z) != ModBlocks.cheater_virus) {
world.setBlock(x + 1, y, z, ModBlocks.cheater_virus);
}
if(world.getBlock(x, y + 1, z) != ModBlocks.cheater_virus && world.getBlock(x, y + 1, z) != Blocks.air && world.getBlock(x, y + 1, z) != ModBlocks.cheater_virus) {
world.setBlock(x, y + 1, z, ModBlocks.cheater_virus);
}
if(world.getBlock(x, y, z + 1) != ModBlocks.cheater_virus && world.getBlock(x, y, z + 1) != Blocks.air && world.getBlock(x, y, z + 1) != ModBlocks.cheater_virus) {
world.setBlock(x, y, z + 1, ModBlocks.cheater_virus);
}
if(world.getBlock(x - 1, y, z) != ModBlocks.cheater_virus && world.getBlock(x - 1, y, z) != Blocks.air && world.getBlock(x - 1, y, z) != ModBlocks.cheater_virus) {
world.setBlock(x - 1, y, z, ModBlocks.cheater_virus);
}
if(world.getBlock(x, y - 1, z) != ModBlocks.cheater_virus && world.getBlock(x, y - 1, z) != Blocks.air && world.getBlock(x, y - 1, z) != ModBlocks.cheater_virus) {
world.setBlock(x, y - 1, z, ModBlocks.cheater_virus);
}
if(world.getBlock(x, y, z - 1) != ModBlocks.cheater_virus && world.getBlock(x, y, z - 1) != Blocks.air && world.getBlock(x, y, z - 1) != ModBlocks.cheater_virus) {
world.setBlock(x, y, z - 1, ModBlocks.cheater_virus);
}
protect = false;
world.setBlock(x, y, z, Blocks.air);
protect = true;
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x - 1, y, z) == Blocks.air || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y + 1, z) == Blocks.air || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y - 1, z) == Blocks.air || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z + 1) == Blocks.air || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z - 1) == Blocks.air || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus_seed) &&
!world.isRemote) {
protect = false;
world.setBlock(x, y, z, Blocks.air);
ExplosionChaos.spreadVirus(world, x, y, z, 5);
protect = true;
}
}
@Override
public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity)
{
if(entity instanceof EntityLivingBase) {
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.wither.id, 60 * 60 * 60, 9));
}
}
}

View File

@ -1,73 +0,0 @@
package com.hbm.blocks.bomb;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class CheaterVirusSeed extends Block {
public CheaterVirusSeed(Material p_i45394_1_) {
super(p_i45394_1_);
this.setTickRandomly(true);
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
super.breakBlock(world, x, y, z, block, i);
if(!GeneralConfig.enableVirus)
return;
if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x - 1, y, z) == Blocks.air || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y + 1, z) == Blocks.air || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y - 1, z) == Blocks.air || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z + 1) == Blocks.air || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z - 1) == Blocks.air || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus_seed) &&
!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
} else {
world.setBlock(x, y, z, ModBlocks.cheater_virus);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(!GeneralConfig.enableVirus)
return;
if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x - 1, y, z) == Blocks.air || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y + 1, z) == Blocks.air || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y - 1, z) == Blocks.air || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z + 1) == Blocks.air || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z - 1) == Blocks.air || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus_seed) &&
!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
} else {
world.setBlock(x, y, z, ModBlocks.cheater_virus);
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if((world.getBlock(x + 1, y, z) == Blocks.air || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x + 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x - 1, y, z) == Blocks.air || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus || world.getBlock(x - 1, y, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y + 1, z) == Blocks.air || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y + 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y - 1, z) == Blocks.air || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus || world.getBlock(x, y - 1, z) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z + 1) == Blocks.air || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z + 1) == ModBlocks.cheater_virus_seed) &&
(world.getBlock(x, y, z - 1) == Blocks.air || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus || world.getBlock(x, y, z - 1) == ModBlocks.cheater_virus_seed) &&
!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
}
}
}

View File

@ -41,9 +41,7 @@ public class EntityMappings {
public static void writeMappings() {
addEntity(EntityRocket.class, "entity_rocket", 250);
addEntity(EntityBullet.class, "entity_bullet", 250);
addEntity(EntitySchrab.class, "entity_schrabnel", 500);
addEntity(EntityMissileGeneric.class, "entity_missile_generic", 1000);
addEntity(EntityMissileDecoy.class, "entity_missile_decoy", 1000);
addEntity(EntityMissileStrong.class, "entity_missile_strong", 1000);
@ -121,7 +119,6 @@ public class EntityMappings {
addEntity(EntityDeliveryDrone.class, "entity_delivery_drone", 250, false);
addEntity(EntityRequestDrone.class, "entity_request_drone", 250, false);
addEntity(EntityCloudTom.class, "entity_moonstone_blast", 1000);
addEntity(EntityBeamVortex.class, "entity_vortex_beam", 1000);
addEntity(EntityFireworks.class, "entity_firework_ball", 1000);
addEntity(EntityWastePearl.class, "entity_waste_pearl", 1000);
addEntity(EntityBOTPrimeHead.class, "entity_balls_o_tron", 1000);

View File

@ -62,7 +62,7 @@ public abstract class EntityMissileTier1 extends EntityMissileBaseNT {
public EntityMissileCluster(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
@Override public void onMissileImpact(MovingObjectPosition mop) {
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5F, true);
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, 100);
ExplosionChaos.cluster(this.worldObj, this.posX, this.posY, this.posZ, 25, this.rotationYaw, this.rotationPitch, (float) Math.PI * 0.25F, (float) Math.PI * 0.25F, 1F);
}
@Override public void cluster() { this.onMissileImpact(null); }
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_small); }

View File

@ -54,7 +54,7 @@ public abstract class EntityMissileTier2 extends EntityMissileBaseNT {
@Override public void onMissileImpact(MovingObjectPosition mop) {
this.explodeStandard(30F, 32, true);
ExplosionCreator.composeEffectStandard(worldObj, posX, posY, posZ);
ExplosionChaos.flameDeath(this.worldObj, (int)((float)this.posX + 0.5F), (int)((float)this.posY + 0.5F), (int)((float)this.posZ + 0.5F), 25);
ExplosionChaos.igniteFlammableBlocks(this.worldObj, (int)((float)this.posX + 0.5F), (int)((float)this.posY + 0.5F), (int)((float)this.posZ + 0.5F), 25);
}
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_incendiary_medium); }
@Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_incendiary_strong); }
@ -65,7 +65,7 @@ public abstract class EntityMissileTier2 extends EntityMissileBaseNT {
public EntityMissileClusterStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
@Override public void onMissileImpact(MovingObjectPosition mop) {
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 15F, true);
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 50, 100);
ExplosionChaos.cluster(this.worldObj, this.posX, this.posY, this.posZ, 50, this.rotationYaw, this.rotationPitch, (float) Math.PI * 0.25F, (float) Math.PI * 0.25F, 1F);
}
@Override public void cluster() { this.onMissileImpact(null); }
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_medium); }

View File

@ -73,8 +73,8 @@ public abstract class EntityMissileTier3 extends EntityMissileBaseNT {
@Override public void onMissileImpact(MovingObjectPosition mop) {
this.explodeStandard(50F, 48, true);
ExplosionCreator.composeEffectLarge(worldObj, posX, posY, posZ);
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10);
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25);
ExplosionChaos.igniteAllBlocks(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10);
ExplosionChaos.igniteFlammableBlocks(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25);
}
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_incendiary_large); }
@Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_inferno); }
@ -85,7 +85,7 @@ public abstract class EntityMissileTier3 extends EntityMissileBaseNT {
public EntityMissileRain(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
@Override public void onMissileImpact(MovingObjectPosition mop) {
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 25F, true);
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, 100);
ExplosionChaos.cluster(this.worldObj, this.posX, this.posY, this.posZ, 100, this.rotationYaw, this.rotationPitch, (float) Math.PI * 0.25F, (float) Math.PI * 0.25F, 1F);
}
@Override public void cluster() { this.onMissileImpact(null); }
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_large); }

View File

@ -1,54 +0,0 @@
package com.hbm.entity.projectile;
import java.util.List;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityBeamVortex extends EntityBeamBase {
public EntityBeamVortex(World world) {
super(world);
}
public EntityBeamVortex(World world, EntityPlayer player) {
super(world, player);
}
@Override
public void onUpdate() {
if(this.ticksExisted > 10)
this.setDead();
if(this.ticksExisted > 1)
return;
int range = 100;
EntityPlayer player = worldObj.getPlayerEntityByName(this.dataWatcher.getWatchableObjectString(20));
if(player != null) {
MovingObjectPosition pos = Library.rayTrace(player, range, 1, false, true, false);
if(pos == null)
return;
worldObj.spawnParticle("cloud", pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 0, 0, 0);
worldObj.playSound(pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, "random.fizz", 1, 1, true);
List<Entity> list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(pos.hitVec.xCoord - 1, pos.hitVec.yCoord - 1, pos.hitVec.zCoord - 1, pos.hitVec.xCoord + 1, pos.hitVec.yCoord + 1, pos.hitVec.zCoord + 1));
for(Entity e : list)
e.attackEntityFrom(ModDamageSource.radiation, 5);
}
}
}

View File

@ -1,634 +0,0 @@
package com.hbm.entity.projectile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import com.hbm.explosion.ExplosionLarge;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.play.server.S2BPacketChangeGameState;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
// still in use for cluster munitions - somehow! let this fucking class die already
public class EntityRocket extends Entity implements IProjectile
{
private int field_145791_d = -1;
private int field_145792_e = -1;
private int field_145789_f = -1;
public double gravity = 0.0D;
private Block field_145790_g;
private int inData;
private boolean inGround;
/** 1 if the player can pick up the arrow */
public int canBePickedUp;
/** Seems to be some sort of timer for animating an arrow. */
public int arrowShake;
/** The owner of this arrow. */
public Entity shootingEntity;
private int ticksInGround;
private int ticksInAir;
private double damage = 2.0D;
/** The amount of knockback an arrow applies when it hits a mob. */
private int knockbackStrength;
public EntityRocket(World p_i1753_1_)
{
super(p_i1753_1_);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
}
public EntityRocket(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
{
super(p_i1754_1_);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_);
this.yOffset = 0.0F;
}
public EntityRocket(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
{
super(p_i1755_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1755_2_;
if (p_i1755_2_ instanceof EntityPlayer)
{
this.canBePickedUp = 1;
}
this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
if (d3 >= 1.0E-7D)
{
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
double d4 = d0 / d3;
double d5 = d2 / d3;
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
this.yOffset = 0.0F;
float f4 = (float)d3 * 0.2F;
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
}
}
public EntityRocket(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
{
super(p_i1756_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1756_2_;
if (p_i1756_2_ instanceof EntityPlayer)
{
this.canBePickedUp = 1;
}
this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.posY -= 0.10000000149011612D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
}
public EntityRocket(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
super(world);
this.posX = x + 0.5F;
this.posY = y + 0.5F;
this.posZ = z + 0.5F;
this.motionX = mx;
this.motionY = my;
this.motionZ = mz;
this.gravity = grav;
}
@Override
protected void entityInit()
{
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
}
/**
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
*/
@Override
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
{
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
p_70186_1_ /= f2;
p_70186_3_ /= f2;
p_70186_5_ /= f2;
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_1_ *= p_70186_7_;
p_70186_3_ *= p_70186_7_;
p_70186_5_ *= p_70186_7_;
this.motionX = p_70186_1_;
this.motionY = p_70186_3_;
this.motionZ = p_70186_5_;
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
this.ticksInGround = 0;
}
/**
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
* posY, posZ, yaw, pitch
*/
@Override
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
{
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
this.setRotation(p_70056_7_, p_70056_8_);
}
/**
* Sets the velocity to the args. Args: x, y, z
*/
@Override
@SideOnly(Side.CLIENT)
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
{
this.motionX = p_70016_1_;
this.motionY = p_70016_3_;
this.motionZ = p_70016_5_;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw;
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
this.ticksInGround = 0;
}
}
/**
* Called to update the entity's position/logic.
*/
//@Override
@Override
public void onUpdate()
{
super.onUpdate();
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
//this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
}
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (block.getMaterial() != Material.air)
{
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
{
this.inGround = true;
}
}
if (this.arrowShake > 0)
{
--this.arrowShake;
}
if (this.inGround)
{
/*int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (block == this.field_145790_g && j == this.inData)
{
++this.ticksInGround;
if (this.ticksInGround == 1200)
{
this.setDead();
}
}
else
{
this.inGround = false;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}*/
if (!this.worldObj.isRemote)
{
//this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
/*EntityNukeExplosionAdvanced explosion = new EntityNukeExplosionAdvanced(this.worldObj);
explosion.speed = 25;
explosion.coefficient = 5.0F;
explosion.destructionRange = 20;
explosion.posX = this.posX;
explosion.posY = this.posY;
explosion.posZ = this.posZ;
this.worldObj.spawnEntityInWorld(explosion);*/
}
this.setDead();
}
else
{
++this.ticksInAir;
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int i;
float f1;
for (i = 0; i < list.size(); ++i)
{
Entity entity1 = (Entity)list.get(i);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{
f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
if (movingobjectposition1 != null)
{
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
{
movingobjectposition = null;
}
}
float f2;
float f4;
if (movingobjectposition != null)
{
if (movingobjectposition.entityHit != null)
{
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int k = MathHelper.ceiling_double_int(f2 * this.damage);
if (this.getIsCritical())
{
k += this.rand.nextInt(k / 2 + 2);
}
DamageSource damagesource = null;
if (this.shootingEntity == null)
{
damagesource = DamageSource.causeIndirectMagicDamage(this, this);
}
else
{
damagesource = DamageSource.causeIndirectMagicDamage(this, this);
}
if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
{
movingobjectposition.entityHit.setFire(5);
}
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k))
{
if (movingobjectposition.entityHit instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
if (this.knockbackStrength > 0)
{
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f4 > 0.0F)
{
movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
}
}
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase)
{
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
}
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
}
}
if (!(movingobjectposition.entityHit instanceof EntityEnderman))
{
if (!this.worldObj.isRemote)
{
//this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
}
this.setDead();
}
}
else
{
if (!this.worldObj.isRemote)
{
//this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true);
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
}
this.setDead();
}
}
else
{
this.field_145791_d = movingobjectposition.blockX;
this.field_145792_e = movingobjectposition.blockY;
this.field_145789_f = movingobjectposition.blockZ;
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / f2 * 0.05000000074505806D;
this.posY -= this.motionY / f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
this.inGround = true;
this.arrowShake = 7;
this.setIsCritical(false);
if (this.field_145790_g.getMaterial() != Material.air)
{
this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
}
}
}
if (true)
{
for (i = 0; i < 4; ++i)
{
this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, /*0, 0, 0 this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D,*/ -this.motionX/4, -this.motionY/4, -this.motionZ/4);
//this.worldObj.spawnEntityInWorld(new EntityGasFX(worldObj, this.posX - motionX/4*i, this.posY - motionY/4*i, this.posZ - motionZ/4*i, 0, 0, 0));
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
//for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
/*while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}*/
//this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
//this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float f3 = 0.99F;
f1 = 0.05F;
if (this.isInWater())
{
for (int l = 0; l < 4; ++l)
{
f4 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ);
}
f3 = 0.8F;
}
if (this.isWet())
{
this.extinguish();
}
this.motionX *= f3;
this.motionY *= f3;
this.motionZ *= f3;
this.motionY -= gravity;
this.setPosition(this.posX, this.posY, this.posZ);
this.func_145775_I();
}
if (this.ticksExisted > 250)
this.setDead();
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
p_70014_1_.setShort("zTile", (short)this.field_145789_f);
p_70014_1_.setShort("life", (short)this.ticksInGround);
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
p_70014_1_.setByte("inData", (byte)this.inData);
p_70014_1_.setByte("shake", (byte)this.arrowShake);
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
p_70014_1_.setByte("pickup", (byte)this.canBePickedUp);
p_70014_1_.setDouble("damage", this.damage);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
this.field_145791_d = p_70037_1_.getShort("xTile");
this.field_145792_e = p_70037_1_.getShort("yTile");
this.field_145789_f = p_70037_1_.getShort("zTile");
this.ticksInGround = p_70037_1_.getShort("life");
this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
this.inData = p_70037_1_.getByte("inData") & 255;
this.arrowShake = p_70037_1_.getByte("shake") & 255;
this.inGround = p_70037_1_.getByte("inGround") == 1;
if (p_70037_1_.hasKey("damage", 99))
{
this.damage = p_70037_1_.getDouble("damage");
}
if (p_70037_1_.hasKey("pickup", 99))
{
this.canBePickedUp = p_70037_1_.getByte("pickup");
}
else if (p_70037_1_.hasKey("player", 99))
{
this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0;
}
}
/**
* Called by a player entity when they collide with an entity
*/
@Override
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
{
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
{
boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode;
if (flag)
{
p_70100_1_.onItemPickup(this, 1);
this.setDead();
}
}
}
/**
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
@Override
protected boolean canTriggerWalking()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public void setDamage(double p_70239_1_)
{
this.damage = p_70239_1_;
}
public double getDamage()
{
return this.damage;
}
/**
* Sets the amount of knockback the arrow applies when it hits a mob.
*/
public void setKnockbackStrength(int p_70240_1_)
{
this.knockbackStrength = p_70240_1_;
}
/**
* If returns false, the item will not inflict any damage against entities.
*/
@Override
public boolean canAttackWithItem()
{
return false;
}
/**
* Whether the arrow has a stream of critical hit particles flying behind it.
*/
public void setIsCritical(boolean p_70243_1_)
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (p_70243_1_)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
}
else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
}
}
/**
* Whether the arrow has a stream of critical hit particles flying behind it.
*/
public boolean getIsCritical()
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
return (b0 & 1) != 0;
}
}

View File

@ -1,632 +0,0 @@
package com.hbm.entity.projectile;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.play.server.S2BPacketChangeGameState;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionNukeGeneric;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntitySchrab extends Entity implements IProjectile
{
private int field_145791_d = -1;
private int field_145792_e = -1;
private int field_145789_f = -1;
public double gravity = 0.0D;
private Block field_145790_g;
private int inData;
private boolean inGround;
/** 1 if the player can pick up the arrow */
public int canBePickedUp;
/** Seems to be some sort of timer for animating an arrow. */
public int arrowShake;
/** The owner of this arrow. */
public Entity shootingEntity;
private int ticksInGround;
private int ticksInAir;
private double damage = 2.0D;
/** The amount of knockback an arrow applies when it hits a mob. */
private int knockbackStrength;
public EntitySchrab(World p_i1753_1_)
{
super(p_i1753_1_);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
}
public EntitySchrab(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
{
super(p_i1754_1_);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_);
this.yOffset = 0.0F;
}
public EntitySchrab(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
{
super(p_i1755_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1755_2_;
if (p_i1755_2_ instanceof EntityPlayer)
{
this.canBePickedUp = 1;
}
this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
if (d3 >= 1.0E-7D)
{
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
double d4 = d0 / d3;
double d5 = d2 / d3;
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
this.yOffset = 0.0F;
float f4 = (float)d3 * 0.2F;
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
}
}
public EntitySchrab(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
{
super(p_i1756_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1756_2_;
if (p_i1756_2_ instanceof EntityPlayer)
{
this.canBePickedUp = 1;
}
this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.posY -= 0.10000000149011612D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
}
public EntitySchrab(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
super(world);
this.posX = x + 0.5F;
this.posY = y + 0.5F;
this.posZ = z + 0.5F;
this.motionX = mx;
this.motionY = my;
this.motionZ = mz;
this.gravity = grav;
}
@Override
protected void entityInit()
{
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
}
/**
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
*/
@Override
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
{
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
p_70186_1_ /= f2;
p_70186_3_ /= f2;
p_70186_5_ /= f2;
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
p_70186_1_ *= p_70186_7_;
p_70186_3_ *= p_70186_7_;
p_70186_5_ *= p_70186_7_;
this.motionX = p_70186_1_;
this.motionY = p_70186_3_;
this.motionZ = p_70186_5_;
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
this.ticksInGround = 0;
}
/**
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
* posY, posZ, yaw, pitch
*/
@Override
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
{
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
this.setRotation(p_70056_7_, p_70056_8_);
}
/**
* Sets the velocity to the args. Args: x, y, z
*/
@Override
@SideOnly(Side.CLIENT)
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
{
this.motionX = p_70016_1_;
this.motionY = p_70016_3_;
this.motionZ = p_70016_5_;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw;
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
this.ticksInGround = 0;
}
}
/**
* Called to update the entity's position/logic.
*/
//@Override
@Override
public void onUpdate()
{
super.onUpdate();
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
//this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
}
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (block.getMaterial() != Material.air)
{
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
{
this.inGround = true;
}
}
if (this.arrowShake > 0)
{
--this.arrowShake;
}
if (this.inGround)
{
/*int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
if (block == this.field_145790_g && j == this.inData)
{
++this.ticksInGround;
if (this.ticksInGround == 1200)
{
this.setDead();
}
}
else
{
this.inGround = false;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}*/
if (!this.worldObj.isRemote)
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true);
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10);
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 20);
ExplosionNukeGeneric.wasteNoSchrab(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 20);
ExplosionChaos.poison(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 20);
}
this.worldObj.spawnEntityInWorld(new EntityLightningBolt(this.worldObj, this.posX, this.posY, this.posZ));
this.setDead();
}
else
{
++this.ticksInAir;
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int i;
float f1;
for (i = 0; i < list.size(); ++i)
{
Entity entity1 = (Entity)list.get(i);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{
f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
if (movingobjectposition1 != null)
{
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null)
{
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
{
movingobjectposition = null;
}
}
float f2;
float f4;
if (movingobjectposition != null)
{
if (movingobjectposition.entityHit != null)
{
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int k = MathHelper.ceiling_double_int(f2 * this.damage);
if (this.getIsCritical())
{
k += this.rand.nextInt(k / 2 + 2);
}
DamageSource damagesource = null;
if (this.shootingEntity == null)
{
damagesource = DamageSource.causeIndirectMagicDamage(this, this);
}
else
{
damagesource = DamageSource.causeIndirectMagicDamage(this, this);
}
if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman))
{
movingobjectposition.entityHit.setFire(5);
}
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k))
{
if (movingobjectposition.entityHit instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
if (this.knockbackStrength > 0)
{
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (f4 > 0.0F)
{
movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
}
}
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase)
{
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
}
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
{
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
}
}
if (!(movingobjectposition.entityHit instanceof EntityEnderman))
{
if (!this.worldObj.isRemote)
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.5F, true);
}
this.setDead();
}
}
else
{
this.motionX *= -0.10000000149011612D;
this.motionY *= -0.10000000149011612D;
this.motionZ *= -0.10000000149011612D;
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
this.ticksInAir = 0;
}
}
else
{
this.field_145791_d = movingobjectposition.blockX;
this.field_145792_e = movingobjectposition.blockY;
this.field_145789_f = movingobjectposition.blockZ;
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / f2 * 0.05000000074505806D;
this.posY -= this.motionY / f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.inGround = true;
this.arrowShake = 7;
this.setIsCritical(false);
if (this.field_145790_g.getMaterial() != Material.air)
{
this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
}
}
}
if (true)
{
for (i = 0; i < 4; ++i)
{
this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, 0, 0, 0 /*this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ*/);
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
//for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
/*while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}*/
//this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
//this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float f3 = 0.99F;
f1 = 0.05F;
if (this.isInWater())
{
for (int l = 0; l < 4; ++l)
{
f4 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f4, this.posY - this.motionY * f4, this.posZ - this.motionZ * f4, this.motionX, this.motionY, this.motionZ);
}
f3 = 0.8F;
}
if (this.isWet())
{
this.extinguish();
}
this.motionX *= f3;
this.motionY *= f3;
this.motionZ *= f3;
this.motionY -= gravity;
this.setPosition(this.posX, this.posY, this.posZ);
this.func_145775_I();
}
if (this.ticksExisted > 250)
this.setDead();
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
@Override
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
p_70014_1_.setShort("zTile", (short)this.field_145789_f);
p_70014_1_.setShort("life", (short)this.ticksInGround);
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
p_70014_1_.setByte("inData", (byte)this.inData);
p_70014_1_.setByte("shake", (byte)this.arrowShake);
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
p_70014_1_.setByte("pickup", (byte)this.canBePickedUp);
p_70014_1_.setDouble("damage", this.damage);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
this.field_145791_d = p_70037_1_.getShort("xTile");
this.field_145792_e = p_70037_1_.getShort("yTile");
this.field_145789_f = p_70037_1_.getShort("zTile");
this.ticksInGround = p_70037_1_.getShort("life");
this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
this.inData = p_70037_1_.getByte("inData") & 255;
this.arrowShake = p_70037_1_.getByte("shake") & 255;
this.inGround = p_70037_1_.getByte("inGround") == 1;
if (p_70037_1_.hasKey("damage", 99))
{
this.damage = p_70037_1_.getDouble("damage");
}
if (p_70037_1_.hasKey("pickup", 99))
{
this.canBePickedUp = p_70037_1_.getByte("pickup");
}
else if (p_70037_1_.hasKey("player", 99))
{
this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0;
}
}
/**
* Called by a player entity when they collide with an entity
*/
@Override
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
{
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
{
boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode;
if (flag)
{
this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
p_70100_1_.onItemPickup(this, 1);
this.setDead();
}
}
}
/**
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
@Override
protected boolean canTriggerWalking()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
return 0.0F;
}
public void setDamage(double p_70239_1_)
{
this.damage = p_70239_1_;
}
public double getDamage()
{
return this.damage;
}
/**
* Sets the amount of knockback the arrow applies when it hits a mob.
*/
public void setKnockbackStrength(int p_70240_1_)
{
this.knockbackStrength = p_70240_1_;
}
/**
* If returns false, the item will not inflict any damage against entities.
*/
@Override
public boolean canAttackWithItem()
{
return false;
}
/**
* Whether the arrow has a stream of critical hit particles flying behind it.
*/
public void setIsCritical(boolean p_70243_1_)
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (p_70243_1_)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
}
else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
}
}
/**
* Whether the arrow has a stream of critical hit particles flying behind it.
*/
public boolean getIsCritical()
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
return (b0 & 1) != 0;
}
}

View File

@ -4,15 +4,13 @@ import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.item.EntityFallingBlockNT;
import com.hbm.entity.particle.EntityCloudFX;
import com.hbm.entity.particle.EntityModFX;
import com.hbm.entity.particle.EntityOrangeFX;
import com.hbm.entity.particle.EntityPinkCloudFX;
import com.hbm.entity.projectile.EntityRocket;
import com.hbm.entity.projectile.EntityRubble;
import com.hbm.entity.projectile.EntitySchrab;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.interfaces.Spaghetti;
import com.hbm.items.weapon.sedna.factory.XFactoryCatapult;
import com.hbm.lib.ModDamageSource;
import com.hbm.potion.HbmPotion;
import com.hbm.util.ArmorRegistry;
@ -24,7 +22,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -63,110 +60,7 @@ public class ExplosionChaos { //TODO: destroy this entire class
}
}
public static void spreadVirus(World world, int x, int y, int z, int bombStartStrength) {
int r = bombStartStrength;
int r2 = r * r;
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) {
int X = xx + x;
int XX = xx * xx;
for (int yy = -r; yy < r; yy++) {
int Y = yy + y;
int YY = XX + yy * yy;
for (int zz = -r; zz < r; zz++) {
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
if (rand.nextInt(15) == 0 && world.getBlock(X, Y, Z) != Blocks.air)
world.setBlock(X, Y, Z, ModBlocks.cheater_virus_seed);
}
}
}
}
}
public static void pulse(World world, int x, int y, int z, int bombStartStrength) {
int r = bombStartStrength;
int r2 = r * r;
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) {
int X = xx + x;
int XX = xx * xx;
for (int yy = -r; yy < r; yy++) {
int Y = yy + y;
int YY = XX + yy * yy;
for (int zz = -r; zz < r; zz++) {
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
if(world.getBlock(X, Y, Z).getExplosionResistance(null) <= 70) {
EntityFallingBlockNT entityfallingblock = new EntityFallingBlockNT(world, X + 0.5, Y + 0.5, Z + 0.5, world.getBlock(X, Y, Z), world.getBlockMetadata(X, Y, Z));
world.spawnEntityInWorld(entityfallingblock);
}
}
}
}
}
}
public static void explodeZOMG(World world, int x, int y, int z, int bombStartStrength) {
int r = bombStartStrength;
int r2 = r * r;
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) {
int X = xx + x;
int XX = xx * xx;
for (int yy = -r; yy < r; yy++) {
int Y = yy + y;
int YY = XX + yy * yy;
for (int zz = -r; zz < r; zz++) {
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
if (!(world.getBlock(X, Y, Z) == Blocks.bedrock && Y <= 0))
world.setBlock(X, Y, Z, Blocks.air);
}
}
}
}
}
public static void decon(World world, int x, int y, int z, int radius) {
int r = radius;
int r2 = r * r;
int r22 = r2 / 2;
for (int xx = -r; xx < r; xx++) {
int X = xx + x;
int XX = xx * xx;
for (int yy = -r; yy < r; yy++) {
int Y = yy + y;
int YY = XX + yy * yy;
for (int zz = -r; zz < r; zz++) {
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
decontaminate(world, X, Y, Z);
}
}
}
}
}
/**
* Sets all flammable blocks on fire
*
* @param world
* @param x
* @param y
* @param z
* @param bound
*/
public static void flameDeath(World world, int x, int y, int z, int bound) {
public static void igniteFlammableBlocks(World world, int x, int y, int z, int bound) {
int r = bound;
int r2 = r * r;
@ -181,8 +75,7 @@ public class ExplosionChaos { //TODO: destroy this entire class
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
if (world.getBlock(X, Y, Z).isFlammable(world, XX, YY, ZZ, ForgeDirection.UP)
&& world.getBlock(X, Y + 1, Z) == Blocks.air) {
if (world.getBlock(X, Y, Z).isFlammable(world, XX, YY, ZZ, ForgeDirection.UP) && world.getBlock(X, Y + 1, Z) == Blocks.air) {
world.setBlock(X, Y + 1, Z, Blocks.fire);
}
}
@ -192,16 +85,7 @@ public class ExplosionChaos { //TODO: destroy this entire class
}
/**
* Sets all blocks on fire
*
* @param world
* @param x
* @param y
* @param z
* @param bound
*/
public static void burn(World world, int x, int y, int z, int bound) {
public static void igniteAllBlocks(World world, int x, int y, int z, int bound) {
int r = bound;
int r2 = r * r;
@ -216,16 +100,13 @@ public class ExplosionChaos { //TODO: destroy this entire class
int Z = zz + z;
int ZZ = YY + zz * zz;
if (ZZ < r22) {
if ((world.getBlock(X, Y + 1, Z) == Blocks.air
|| world.getBlock(X, Y + 1, Z) == Blocks.snow_layer)
&& world.getBlock(X, Y, Z) != Blocks.air) {
if ((world.getBlock(X, Y + 1, Z) == Blocks.air || world.getBlock(X, Y + 1, Z) == Blocks.snow_layer) && world.getBlock(X, Y, Z) != Blocks.air) {
world.setBlock(X, Y + 1, Z, Blocks.fire);
}
}
}
}
}
}
@Deprecated public static void spawnPoisonCloud(World world, double x, double y, double z, int count, double speed, int type) {
@ -264,93 +145,15 @@ public class ExplosionChaos { //TODO: destroy this entire class
}
}
public static void cluster(World world, int x, int y, int z, int count, int gravity) {
double d1 = 0;
double d2 = 0;
double d3 = 0;
EntityRocket fragment;
public static void cluster(World world, double x, double y, double z, int count, float yaw, float pitch, float yawRand, float pitchRand, float speed) {
for (int i = 0; i < count; i++) {
d1 = rand.nextDouble();
d2 = rand.nextDouble();
d3 = rand.nextDouble();
if (rand.nextInt(2) == 0) {
d1 *= -1;
}
if (rand.nextInt(2) == 0) {
d3 *= -1;
}
fragment = new EntityRocket(world, x, y, z, d1, d2, d3, 0.0125D);
world.spawnEntityInWorld(fragment);
}
}
public static void schrab(World world, int x, int y, int z, int count, int gravity) {
double d1 = 0;
double d2 = 0;
double d3 = 0;
EntitySchrab fragment;
for (int i = 0; i < count; i++) {
d1 = rand.nextDouble();
d2 = rand.nextDouble();
d3 = rand.nextDouble();
if (rand.nextInt(2) == 0) {
d1 *= -1;
}
if (rand.nextInt(2) == 0) {
d3 *= -1;
}
fragment = new EntitySchrab(world, x, y, z, d1, d2, d3, 0.0125D);
world.spawnEntityInWorld(fragment);
}
}
public static void frag(World world, int x, int y, int z, int count, boolean flame, Entity shooter) {
double d1 = 0;
double d2 = 0;
double d3 = 0;
EntityArrow fragment;
for (int i = 0; i < count; i++) {
d1 = rand.nextDouble();
d2 = rand.nextDouble();
d3 = rand.nextDouble();
if (rand.nextInt(2) == 0) {
d1 *= -1;
}
if (rand.nextInt(2) == 0) {
d3 *= -1;
}
fragment = new EntityArrow(world, x, y, z);
fragment.motionX = d1;
fragment.motionY = d2;
fragment.motionZ = d3;
fragment.shootingEntity = shooter;
fragment.setIsCritical(true);
if (flame) {
fragment.setFire(1000);
}
fragment.setDamage(2.5);
world.spawnEntityInWorld(fragment);
EntityBulletBaseMK4 bullet = new EntityBulletBaseMK4(world, XFactoryCatapult.cluster_submunition, 50F, 0F, yaw + (float) (yawRand * world.rand.nextGaussian()), pitch + (float) (pitchRand * world.rand.nextGaussian()));
bullet.setPosition(x, y, z);
bullet.motionX *= speed;
bullet.motionY *= speed;
bullet.motionZ *= speed;
world.spawnEntityInWorld(bullet);
}
}
@ -500,80 +303,4 @@ public class ExplosionChaos { //TODO: destroy this entire class
radius = (int) f;
}
public static void levelDown(World world, int x, int y, int z, int radius) {
if(!world.isRemote)
for (int i = x - radius; i <= x + radius; i++)
for (int j = z - radius; j <= z + radius; j++) {
Block b = world.getBlock(i, y, j);
float k = b.getExplosionResistance(null);
if(k < 6000 && b != Blocks.air) {
EntityRubble rubble = new EntityRubble(world);
rubble.posX = i + 0.5F;
rubble.posY = y;
rubble.posZ = j + 0.5F;
rubble.motionY = 0.025F * 10 + 0.15F;
rubble.setMetaBasedOnBlock(b, world.getBlockMetadata(i, y, j));
world.spawnEntityInWorld(rubble);
world.setBlock(i, y, j, Blocks.air);
}
}
}
public static void decontaminate(World world, int x, int y, int z) {
Random random = new Random();
if (world.getBlock(x, y, z) == ModBlocks.waste_earth && random.nextInt(3) != 0) {
world.setBlock(x, y, z, Blocks.grass);
}
else if (world.getBlock(x, y, z) == ModBlocks.waste_mycelium && random.nextInt(5) == 0) {
world.setBlock(x, y, z, Blocks.mycelium);
}
else if (world.getBlock(x, y, z) == ModBlocks.waste_trinitite && random.nextInt(3) == 0) {
world.setBlock(x, y, z, Blocks.sand);
}
else if (world.getBlock(x, y, z) == ModBlocks.waste_trinitite_red && random.nextInt(3) == 0) {
world.setBlock(x, y, z, Blocks.sand, 1, 2);
}
else if (world.getBlock(x, y, z) == ModBlocks.waste_log && random.nextInt(3) != 0) {
world.setBlock(x, y, z, Blocks.log);
}
else if (world.getBlock(x, y, z) == ModBlocks.waste_planks && random.nextInt(3) != 0) {
world.setBlock(x, y, z, Blocks.planks);
}
else if (world.getBlock(x, y, z) == ModBlocks.block_trinitite && random.nextInt(10) == 0) {
world.setBlock(x, y, z, ModBlocks.block_lead);
}
else if (world.getBlock(x, y, z) == ModBlocks.block_waste && random.nextInt(10) == 0) {
world.setBlock(x, y, z, ModBlocks.block_lead);
}
else if(world.getBlock(x, y, z) == ModBlocks.sellafield) {
int meta = world.getBlockMetadata(x, y, z);
if(meta > 0) {
if(meta == 5 && random.nextInt(10) == 0)
world.setBlockMetadataWithNotify(x, y, z, 4, 3);
else if(random.nextInt(5) == 0)
world.setBlockMetadataWithNotify(meta, x, y, z, meta - 1);
} else if(random.nextInt(5) == 0)
world.setBlock(y, z, meta, ModBlocks.sellafield_slaked);
}
}
}

View File

@ -99,7 +99,7 @@ public class ItemGlitch extends Item implements IBatteryItem {
break;
case 14:
player.inventory.dropAllItems();
ExplosionChaos.burn(world, (int)player.posX, (int)player.posY, (int)player.posZ, 5);
ExplosionChaos.igniteAllBlocks(world, (int)player.posX, (int)player.posY, (int)player.posZ, 5);
break;
case 15:
for(int i = 0; i < 36; i++)

View File

@ -274,7 +274,7 @@ public class ItemAmmoArty extends Item {
standardExplosion(shell, mop, 10F, 3F, false);
//shell.worldObj.playSoundEffect(shell.posX, shell.posY, shell.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + shell.worldObj.rand.nextFloat() * 0.2F);
ExplosionLarge.spawnShrapnels(shell.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 15);
ExplosionChaos.burn(shell.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 12);
ExplosionChaos.igniteAllBlocks(shell.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 12);
int radius = 15;
List<Entity> hit = shell.worldObj.getEntitiesWithinAABBExcludingEntity(shell, AxisAlignedBB.getBoundingBox(shell.posX - radius, shell.posY - radius, shell.posZ - radius, shell.posX + radius, shell.posY + radius, shell.posZ + radius));
for(Entity e : hit) {

View File

@ -187,7 +187,7 @@ public class ItemAmmoHIMARS extends Item {
rocket.worldObj.playSoundEffect(rocket.posX, rocket.posY, rocket.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + rocket.worldObj.rand.nextFloat() * 0.2F);
standardExplosion(rocket, mop, 20F, 3F, false, ModBlocks.block_slag, 1);
ExplosionLarge.spawnShrapnels(rocket.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 30);
ExplosionChaos.burn(rocket.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 20);
ExplosionChaos.igniteAllBlocks(rocket.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 20);
int radius = 30;
List<Entity> hit = rocket.worldObj.getEntitiesWithinAABBExcludingEntity(rocket, AxisAlignedBB.getBoundingBox(rocket.posX - radius, rocket.posY - radius, rocket.posZ - radius, rocket.posX + radius, rocket.posY + radius, rocket.posZ + radius));
for(Entity e : hit) {

View File

@ -220,6 +220,7 @@ public class GunFactoryClient {
nuke_tots.setRenderer(LegoClient.RENDER_GRENADE);
nuke_hive.setRenderer(LegoClient.RENDER_HIVE);
nuke_balefire.setRenderer(LegoClient.RENDER_NUKE_BALEFIRE);
cluster_submunition.setRenderer(LegoClient.RENDER_BOMB);
setRendererBulkBeam(LegoClient.RENDER_LIGHTNING, energy_tesla, energy_tesla_overcharge, energy_tesla_ir);
setRendererBulkBeam(LegoClient.RENDER_LIGHTNING_SUB, energy_tesla_ir_sub, TileEntityBatterySocket.discharge);

View File

@ -493,6 +493,19 @@ public class LegoClient {
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_BOMB = (bullet, interp) -> {
GL11.glPushMatrix();
GL11.glScalef(0.03125F, 0.03125F, 0.03125F);
GL11.glRotated(-90, 0, 1, 0);
GL11.glTranslatef(0, -1, 1F);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.cluster_submunition_tex);
ResourceManager.fatman.renderPart("MiniNuke");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_NUKE_BALEFIRE = (bullet, interp) -> {
GL11.glPushMatrix();

View File

@ -48,6 +48,8 @@ public class XFactoryCatapult {
public static BulletConfig nuke_tots;
public static BulletConfig nuke_hive;
public static BulletConfig nuke_balefire;
public static BulletConfig cluster_submunition;
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_STANDARD = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
@ -153,6 +155,17 @@ public class XFactoryCatapult {
vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F));
vnt.explode();
};
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_SUBMUNITION = (bullet, mop) -> {
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 7.5F, bullet.getThrower());
vnt.setBlockAllocator(new BlockAllocatorStandard());
vnt.setBlockProcessor(new BlockProcessorStandard());
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, bullet.damage));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F));
vnt.explode();
bullet.setDead();
};
public static void init() {
@ -163,6 +176,8 @@ public class XFactoryCatapult {
nuke_hive = new BulletConfig().setItem(EnumAmmo.NUKE_HIVE).setProjectiles(12).setLife(300).setVel(1F).setGrav(0.025F).setSpread(0.15F).setDamage(0.25F).setOnImpact(LAMBDA_NUKE_HIVE);
nuke_balefire = new BulletConfig().setItem(EnumAmmo.NUKE_BALEFIRE).setDamage(2.5F).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_BALEFIRE);
cluster_submunition = new BulletConfig().setLife(1_200).setGrav(0.025F).setOnImpact(LAMBDA_SUBMUNITION);
ModItems.gun_fatman = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(300).draw(20).inspect(30).reloadChangeType(true).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
.rec(new Receiver(0)

View File

@ -593,8 +593,6 @@ public class ClientProxy extends ServerProxy {
@Override
public void registerEntityRenderer() {
//projectiles
RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderSnowball(ModItems.man_core));
RenderingRegistry.registerEntityRenderingHandler(EntitySchrab.class, new RenderFlare());
RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderRocket());
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBaseNT.class, new RenderBullet());
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBaseMK4.class, new RenderBulletMK4());
@ -621,7 +619,6 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityFireworks.class, new RenderShrapnel());
RenderingRegistry.registerEntityRenderingHandler(EntityWaterSplash.class, new RenderEmpty());
RenderingRegistry.registerEntityRenderingHandler(EntityEMP.class, new RenderEmpty());
RenderingRegistry.registerEntityRenderingHandler(EntityBeamVortex.class, new RenderVortexBeam());
RenderingRegistry.registerEntityRenderingHandler(EntityRBMKDebris.class, new RenderRBMKDebris());
RenderingRegistry.registerEntityRenderingHandler(EntityZirnoxDebris.class, new RenderZirnoxDebris());
RenderingRegistry.registerEntityRenderingHandler(EntityArtilleryShell.class, new RenderArtilleryShell());

View File

@ -1570,6 +1570,8 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.grenade_kit");
ignoreMappings.add("hbm:item.nuclear_waste_pearl");
ignoreMappings.add("hbm:tile.plasma");
ignoreMappings.add("hbm:tile.cheater_virus");
ignoreMappings.add("hbm:tile.cheater_virus_seed");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -58,8 +58,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModBlocks.machine_rtg_furnace_on));
API.hideItem(new ItemStack(ModBlocks.reinforced_lamp_on));
API.hideItem(new ItemStack(ModBlocks.statue_elb_f));
API.hideItem(new ItemStack(ModBlocks.cheater_virus));
API.hideItem(new ItemStack(ModBlocks.cheater_virus_seed));
API.hideItem(new ItemStack(ModItems.euphemium_kit));
API.hideItem(new ItemStack(ModItems.bobmazon_hidden));
API.hideItem(new ItemStack(ModItems.book_lore)); //the broken nbt-less one shouldn't show up in normal play anyway

View File

@ -1075,6 +1075,7 @@ public class ResourceManager {
public static final ResourceLocation fatman_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fatman.png");
public static final ResourceLocation fatman_mininuke_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fatman_mininuke.png");
public static final ResourceLocation fatman_balefire_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fatman_balefire.png");
public static final ResourceLocation cluster_submunition_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fatman_submunition.png");
public static final ResourceLocation lasrifle_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lasrifle.png");
public static final ResourceLocation lasrifle_mods_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lasrifle_mods.png");
public static final ResourceLocation hangman_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/hangman.png");

View File

@ -1,88 +0,0 @@
package com.hbm.render.entity.effect;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderFlare extends Render {
@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_) {
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
float f1 = (p_76986_1_.ticksExisted + 2.0F) / 200.0F;
float f2 = 0.0F;
int count = 250;
if(p_76986_1_.ticksExisted < 250)
{
count = p_76986_1_.ticksExisted * 3;
}
if (f1 > 0.8F)
{
f2 = (f1 - 0.8F) / 0.2F;
}
Random random = new Random(432L);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);
GL11.glPushMatrix();
//GL11.glTranslatef(0.0F, -1.0F, -2.0F);
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
//for (int i = 0; (float)i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i)
for(int i = 0; i < count; i++)
{
GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F);
tessellator.startDrawing(6);
float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F;
float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F;
//tessellator.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - f2)));
tessellator.setColorRGBA_I(59345715, (int)(255.0F * (1.0F - f2)));
tessellator.addVertex(0.0D, 0.0D, 0.0D);
//tessellator.setColorRGBA_I(16711935, 0);
tessellator.setColorRGBA_I(59345735, 0);
tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
tessellator.addVertex(0.866D * f4, f3, -0.5F * f4);
tessellator.addVertex(0.0D, f3, 1.0F * f4);
tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
GL11.glScalef(0.99F, 0.99F, 0.99F);
tessellator.draw();
}
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_ALPHA_TEST);
RenderHelper.enableStandardItemLighting();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -1,51 +0,0 @@
package com.hbm.render.entity.projectile;
import org.lwjgl.opengl.GL11;
import com.hbm.entity.projectile.EntityBeamBase;
import com.hbm.lib.Library;
import com.hbm.render.util.BeamPronter;
import com.hbm.render.util.BeamPronter.EnumBeamType;
import com.hbm.render.util.BeamPronter.EnumWaveType;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class RenderVortexBeam extends Render {
@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_) {
this.doRender((EntityBeamBase)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
public void doRender(EntityBeamBase laser, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
GL11.glPushMatrix();
EntityPlayer player = laser.worldObj.getPlayerEntityByName(laser.getDataWatcher().getWatchableObjectString(20));
if(player != null) {
GL11.glTranslated(x, y, z);
MovingObjectPosition pos = Library.rayTrace(player, 100, 1);
Vec3 skeleton = Vec3.createVectorHelper(pos.hitVec.xCoord - player.posX, pos.hitVec.yCoord - player.posY - player.getEyeHeight(), pos.hitVec.zCoord - player.posZ);
int init = (int) -(System.currentTimeMillis() % 360);
BeamPronter.prontBeam(skeleton, EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x000040, 0x2020d0, init, 1, 0F, 4, 0.005F);
BeamPronter.prontBeam(skeleton, EnumWaveType.RANDOM, EnumBeamType.LINE, 0x8080ff, 0x8080ff, init, (int)skeleton.lengthVector() * 3 + 1, 0.01F, 1, 0.01F);
}
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -66,6 +66,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
acceptedFuels.add(Fluids.ETHANOL);
acceptedFuels.add(Fluids.FISHOIL);
acceptedFuels.add(Fluids.HEAVYOIL);
acceptedFuels.add(Fluids.COALCREOSOTE);
}
public FluidTank tank;

View File

@ -5757,7 +5757,7 @@ tile.machine_assembly_factory.desc=Quadruple assembly machine.$Recipes process t
tile.machine_assembly_machine.name=Assembly Machine
tile.machine_autocrafter.name=Automatic Crafting Table
tile.machine_autosaw.name=Automatic Buzz Saw
tile.machine_autosaw.desc=Cuts down nearby plants, re-plants trees$Accepts:$-Wood oil$-Ethanol$-Fish oil$-Heavy oil
tile.machine_autosaw.desc=Cuts down nearby plants, re-plants trees$Accepts:$-Wood oil$-Ethanol$-Fish oil$-Heavy oil$-Coal Tar Creosote
tile.machine_autosaw.suspended=Suspended
tile.machine_bat9000.name=Big-Ass Tank 9000
tile.machine_battery.name=Energy Storage Block (LEGACY)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B