mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
no more rainbows. we homophobic now.
This commit is contained in:
parent
f91718111d
commit
7afd9901d3
93
changelog
93
changelog
@ -1,93 +1,2 @@
|
||||
## Added
|
||||
* New fusion reactor
|
||||
* More dynamic system with more components to choose from
|
||||
* Models and GUIs that are less eye-bleeding
|
||||
* Plasmas are now represented as a recipe selector instead of dedicated fluids, making the entire thing fully configurable
|
||||
* Despite being recipe based, fusion reactors will still burn fuel at a steady rate
|
||||
* Comes with load-balancing, if the solenoid power or fuel supply drops, the reaction will slow down
|
||||
* This ensures that supply below maximum demand doesn't cause "flickering" due to constantly running out of fuel
|
||||
* Comes with many juicy parts
|
||||
* The plasma vessel is where the magic happens, has four connectors for other parts
|
||||
* Klystron is used to ignite the plasma
|
||||
* Breeding chamber uses the plasma's outout flux to do irradiation recipes
|
||||
* Collector increases byproduct yield
|
||||
* Boiler turns water into SDS
|
||||
* MHD turbine makes power out of the plasma directly at greater efficiency
|
||||
* Coupler turns plasma output energy into usable klystron energy, allowing one reactor to be powered by another, creating a multi-torus setup
|
||||
* Also has full QMAW documentation, if the tooltips aren't enough
|
||||
* Boxcables
|
||||
* Like boxducts, but for power
|
||||
|
||||
## Changed
|
||||
* Updated chinese localization
|
||||
* Updated meteors
|
||||
* Meteors will now punch through weak blocks like leaves instead of getting stuck on trees
|
||||
* Meteor impacts now have new visuals
|
||||
* Falling meteors will produce a sound instead of stealthily blowing people up
|
||||
* Fallen meteors will now be placed deeper into the actual crater instead of hovering awkwardly over the hole
|
||||
* Added QMAW pages for the particle accelerator parts along with a PA overview page and a simple step by step construction tutorial
|
||||
* Increased the acidizer partitioner's input limit from 9 to 45 slots
|
||||
* Ammo containers are now functional again
|
||||
* Each gun has a fixed "default ammo" that will be given
|
||||
* Grants ammo for up to three held guns, selected randomly
|
||||
* Ammo given does not respect caliber conversion mods
|
||||
* Amount of ammo given depends on the mag size and type of ammo
|
||||
* Most pistols and low capacity rifles will get two reloads worth of ammo
|
||||
* High capacity rifles will typically get only one magazine
|
||||
* Rocket launchers typically only get a small amount of rockets
|
||||
* The fat man only gets a single nuke
|
||||
* Certain legendaries do not give ammo at all, they are omitted when three randomly held guns are selected
|
||||
* Ammo containers are now found in more itempools
|
||||
* The arc furnace input queue can now be moved into the recipe grid if the lid is at least slightly open instead of requiring a fully opened lid
|
||||
* This means that in system with slow input, the time window when items can be added to the arc furance is now more forgiving
|
||||
* Pipe anchors now have a look overlay showing the currently configured fluid type
|
||||
* Removed ammo duping using nitra, instead, four large piles can now be combined into an ammo container
|
||||
* Ammo containers crafted from nitra cannot give "expensive" ammo types
|
||||
* This mainly excludes mini nukes and .35
|
||||
* Comes in a distinct blue color instead of military green
|
||||
* Makeshift containers also yield only half as much ammo as regular ones
|
||||
* Using a defuser, creepers can now be rendered harmless manually
|
||||
* Defusing creepers now also works if the creeper hasn't lit its fuse yet
|
||||
* Defused creepers are now permanently harmless, they can no longer be manually re-ignited at all
|
||||
* Manual defusers now also affect big man johnson
|
||||
* Defusing only works if the timer is active
|
||||
* The glpyhid will explode instantly, but only about as powerful as a conventional rocket, not destroying blocks
|
||||
* Doing so will also drop one usable demolition mini nuke
|
||||
* The painsaw ability no longer plays the blood splash particle effect
|
||||
* Instead, it will outright gib the target
|
||||
* Pile plutonium rods can now be reprocessed in the PUREX in addition to the old anvil recipes
|
||||
* The recipes require 100mB of sulfuric acid and 100HE/t, the lowest requirement for all reprocessing recipes
|
||||
* The recipes are part of a shared auto switch group, meaning that even if different rod types are produced, only one PUREX is necessary
|
||||
* Grass is no longer a valid paint block for paintable cables and ducts
|
||||
* Multiblocks are no longer affected by collapses caused by nuclear explosions
|
||||
* The old NITAN powder chests have been removed
|
||||
* In their place, there's now a different, more useful structure with similar but not identical spawn rules
|
||||
* ROR controller torches can now set the threshold of particle accelerator dipoles
|
||||
* Removed the legacy recipes from the terra drills
|
||||
* Slag can now be cast into ingots
|
||||
* Re-solidifcation of bedrock ore crumbs now requires ore slop instead of nitric acid
|
||||
* Due to ore slop being only obtainable from processing raw bedrock ore, this places a hard cap on how many times a single ore can be re-solidified out of crumbs
|
||||
* This approach means that crumb yields don't have to be nerfed, and prevents that issue from popping up again should there ever be a new, more efficient processing path
|
||||
* Rewrote the ore layer generator (hematite, bauxite) to be way more performant during worldgen
|
||||
* The mining laser can now be stopped by applying a redstone signal to one of the ports
|
||||
* Ionized particles can no longer be liquefacted into helium-4, helium is now a direct liquid byproduct of several fusion reactor recipes
|
||||
* Adjusted schrabidic acid recipe to account for higher ionized particle yield
|
||||
* Increases the ICF's stellar flux output by a factor of four
|
||||
|
||||
## Fixed
|
||||
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
||||
* Fixed issue where the `amounts` tracker wasn't being used correctly when using a custom acidizer config, preventing the acidizer partitioner from working
|
||||
* Fixed multi fluid ID search potentially not working on systems with a non-latin locale
|
||||
* Fixed particle accelerator source working even if not cooled
|
||||
* Fixed foundry channels being overly laggy in certain setups
|
||||
* Fixed potential mod incompatibilities with world generation mods that use outdated forge hooks
|
||||
* Fixed the buzzsaw not properly replanting trees using the `leaves2` block type
|
||||
* Fixed creepers regaining their exploding AI task upon relog, if defused
|
||||
* Fixed assembly and chemical factories not properly saving their recipe fluid buffers
|
||||
* Fixed light blue and light gray dyes not working when dyeing cables
|
||||
* Fixed bismuth armor not having a valid repair material
|
||||
* Fixed compressors needing at least one mB of fluid more to process a recipe than necessary
|
||||
* Fixed many NTM structure spawn conditions being hardcoded (again) preventing them from spawning in modded biomes that would otherwise be a fit
|
||||
* Fixed spawn offset for some structures which caused them to float in the air
|
||||
* Fixed icons in the QMAW title bar often times being too dark when rendered with a 3D model
|
||||
* Fixed rocket artillery modes having incorrect tooltips
|
||||
* Fixed ore acidizer recipe config just straight up not working with ore dictionary keys
|
||||
@ -3,16 +3,18 @@ package com.hbm.blocks.bomb;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleija;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.effect.EntityNukeTorex;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.logic.EntityBalefire;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.projectile.EntityFallingNuke;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
|
||||
@ -30,10 +32,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// this entire class sucks ass
|
||||
@NotableComments
|
||||
public class NukeCustom extends BlockContainer implements IBomb {
|
||||
|
||||
public TileEntityNukeCustom tetn = new TileEntityNukeCustom();
|
||||
|
||||
private static boolean keepInventory = false;
|
||||
private final static Random field_149933_a = new Random();
|
||||
|
||||
@ -134,6 +136,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
public static final int maxAmat = 350;
|
||||
public static final int maxSchrab = 250;
|
||||
|
||||
// genuinely some of the worst fucking code i've ever written
|
||||
public static void explodeCustom(World worldObj, double xCoord, double yCoord, double zCoord, float tnt, float nuke, float hydro, float amat, float dirty, float schrab, float euph) {
|
||||
|
||||
dirty = Math.min(dirty, 100);
|
||||
@ -142,7 +145,24 @@ public class NukeCustom extends BlockContainer implements IBomb {
|
||||
if(euph > 0) {
|
||||
|
||||
EntityGrenadeZOMG zomg = new EntityGrenadeZOMG(worldObj, xCoord, yCoord, zCoord);
|
||||
ExplosionChaos.zomgMeSinPi(worldObj, xCoord, yCoord, zCoord, 1000, null, zomg);
|
||||
|
||||
EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj);
|
||||
ex.posX = xCoord;
|
||||
ex.posY = yCoord;
|
||||
ex.posZ = zCoord;
|
||||
ex.destructionRange = 150;
|
||||
ex.speed = BombConfig.blastSpeed;
|
||||
ex.coefficient = 1.0F;
|
||||
ex.waste = false;
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, 50);
|
||||
cloud.posX = xCoord;
|
||||
cloud.posY = yCoord;
|
||||
cloud.posZ = zCoord;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
|
||||
// SCHRABIDIUM ///
|
||||
} else if(schrab > 0) {
|
||||
|
||||
@ -75,7 +75,6 @@ public class EntityMappings {
|
||||
addEntity(EntityGrenadePlasma.class, "entity_grenade_plasma", 500);
|
||||
addEntity(EntityGrenadeTau.class, "entity_grenade_tau", 500);
|
||||
addEntity(EntityChopperMine.class, "entity_chopper_mine", 1000);
|
||||
addEntity(EntityRainbow.class, "entity_rainbow", 1000);
|
||||
addEntity(EntityGrenadeLemon.class, "entity_grenade_lemon", 500);
|
||||
addEntity(EntityCloudFleija.class, "entity_cloud_fleija", 500);
|
||||
addEntity(EntityGrenadeMk2.class, "entity_grenade_mk2", 500);
|
||||
@ -84,15 +83,12 @@ public class EntityMappings {
|
||||
addEntity(EntityFalloutRain.class, "entity_fallout", 1000);
|
||||
addEntity(EntityEMPBlast.class, "entity_emp_blast", 1000);
|
||||
addEntity(EntityGrenadePulse.class, "entity_grenade_pulse", 1000);
|
||||
addEntity(EntityLaserBeam.class, "entity_laser_beam", 1000);
|
||||
addEntity(EntityMinerBeam.class, "entity_miner_beam", 1000);
|
||||
addEntity(EntityRubble.class, "entity_rubble", 1000);
|
||||
addEntity(EntityShrapnel.class, "entity_shrapnel", 1000);
|
||||
addEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 250);
|
||||
addEntity(EntityBlackHole.class, "entity_black_hole", 250);
|
||||
addEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 250);
|
||||
addEntity(EntityMinecartTest.class, "entity_minecart_test", 1000);
|
||||
addEntity(EntitySparkBeam.class, "entity_spark_beam", 1000);
|
||||
addEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 1000);
|
||||
addEntity(EntityMissileDoomsdayRusted.class, "entity_missile_doomsday_rusted", 1000);
|
||||
addEntity(EntityNukeExplosionMK3.class, "entity_nuke_mk3", 1000);
|
||||
@ -109,7 +105,6 @@ public class EntityMappings {
|
||||
addEntity(EntityMissileMicro.class, "entity_missile_micronuclear", 1000);
|
||||
addEntity(EntityCloudSolinium.class, "entity_cloud_rainbow", 1000);
|
||||
addEntity(EntityRagingVortex.class, "entity_raging_vortex", 250);
|
||||
addEntity(EntityModBeam.class, "entity_beam_bang", 1000);
|
||||
addEntity(EntityMissileBHole.class, "entity_missile_blackhole", 1000);
|
||||
addEntity(EntityMissileSchrabidium.class, "entity_missile_schrabidium", 1000);
|
||||
addEntity(EntityMissileEMP.class, "entity_missile_emp", 1000);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
@ -26,7 +28,24 @@ public class EntityGrenadeZOMG extends EntityGrenadeBouncyBase {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
ExplosionChaos.zomgMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 20, this.getThrower(), this);
|
||||
|
||||
EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj);
|
||||
ex.posX = posX;
|
||||
ex.posY = posY;
|
||||
ex.posZ = posZ;
|
||||
ex.destructionRange = 50;
|
||||
ex.speed = BombConfig.blastSpeed;
|
||||
ex.coefficient = 1.0F;
|
||||
ex.waste = false;
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100000.0F, 1.0F);
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, 50);
|
||||
cloud.posX = posX;
|
||||
cloud.posY = posY;
|
||||
cloud.posZ = posZ;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,531 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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;
|
||||
|
||||
public class EntityLaserBeam 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 EntityLaserBeam(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityLaserBeam(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 EntityLaserBeam(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 EntityLaserBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.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 EntityLaserBeam(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_;
|
||||
|
||||
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 EntityLaserBeam(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.002499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * 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.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
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);
|
||||
block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
if(!worldObj.isRemote) {
|
||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 2);
|
||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
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.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeLaserDamage(this, this.shootingEntity);
|
||||
}
|
||||
|
||||
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 && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 25 + rand.nextInt(20));
|
||||
if(!worldObj.isRemote) {
|
||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 2);
|
||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
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.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);
|
||||
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@ -1,558 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
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;
|
||||
|
||||
public class EntityMinerBeam 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 EntityMinerBeam(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityMinerBeam(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 EntityMinerBeam(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 EntityMinerBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.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 EntityMinerBeam(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_;
|
||||
|
||||
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 EntityMinerBeam(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.002499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * 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.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
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);
|
||||
block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
if(!worldObj.isRemote) {
|
||||
this.dropMinedItem(this.worldObj, field_145791_d, field_145792_e, field_145789_f);
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
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.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeLaserDamage(this, this.shootingEntity);
|
||||
}
|
||||
|
||||
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 && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 25 + rand.nextInt(20));
|
||||
movingobjectposition.entityHit.setFire(5);
|
||||
if(!worldObj.isRemote) {
|
||||
this.dropMinedItem(this.worldObj, field_145791_d, field_145792_e, field_145789_f);
|
||||
}
|
||||
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.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);
|
||||
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
public void dropMinedItem(World world, int x, int y, int z) {
|
||||
Block b = world.getBlock(x, y, z);
|
||||
ItemStack s = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(Item.getItemFromBlock(b), 1, world.getBlockMetadata(x, y, z)));
|
||||
if(s != null) {
|
||||
ItemStack t = s.copy();
|
||||
if(!world.isRemote)
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
|
||||
float f = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, t);
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)rand.nextGaussian() * f3;
|
||||
|
||||
if(!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,497 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityBlackHole;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.effect.EntityNukeTorex;
|
||||
import com.hbm.entity.effect.EntityRagingVortex;
|
||||
import com.hbm.entity.effect.EntityVortex;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityModBeam 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;
|
||||
public int canBePickedUp;
|
||||
public int arrowShake;
|
||||
public Entity shootingEntity;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
private double damage = 2.0D;
|
||||
public int mode = 0;
|
||||
|
||||
public EntityModBeam(World p_i1753_1_) {
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityModBeam(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 EntityModBeam(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 EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ, grenade.rotationYaw, grenade.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 EntityModBeam(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_;
|
||||
|
||||
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 EntityModBeam(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.002499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * 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.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
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);
|
||||
this.setDead();
|
||||
explode();
|
||||
}
|
||||
|
||||
if(this.arrowShake > 0) {
|
||||
--this.arrowShake;
|
||||
} 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;
|
||||
if(movingobjectposition != null) {
|
||||
if(movingobjectposition.entityHit != null && movingobjectposition.entityHit != this.shootingEntity) {
|
||||
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);
|
||||
}
|
||||
|
||||
if(movingobjectposition.entityHit instanceof EntityLivingBase) {
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
((EntityLivingBase) movingobjectposition.entityHit).addPotionEffect(new PotionEffect(HbmPotion.bang.id, 60, 0));
|
||||
} else {
|
||||
explode();
|
||||
}
|
||||
|
||||
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.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);
|
||||
|
||||
f1 = 0.05F;
|
||||
|
||||
if(this.isInWater()) {
|
||||
this.setDead();
|
||||
explode();
|
||||
}
|
||||
|
||||
if(this.isWet()) {
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (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);
|
||||
p_70014_1_.setInteger("mode", this.mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* (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;
|
||||
this.mode = p_70037_1_.getInteger("mode");
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(mode == 0) {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, false);
|
||||
} else if(mode == 1) {
|
||||
ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 10, true, false, false);
|
||||
} else if(mode == 2) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, 10));
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10);
|
||||
cloud.posX = this.posX;
|
||||
cloud.posY = this.posY;
|
||||
cloud.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(cloud);
|
||||
} else if(mode == 3) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, 20));
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 20);
|
||||
cloud.posX = this.posX;
|
||||
cloud.posY = this.posY;
|
||||
cloud.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(cloud);
|
||||
} else if(mode == 4) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityVortex vortex = new EntityVortex(this.worldObj, 1F);
|
||||
vortex.posX = this.posX;
|
||||
vortex.posY = this.posY;
|
||||
vortex.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(vortex);
|
||||
} else if(mode == 5) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityVortex vortex = new EntityVortex(this.worldObj, 2.5F);
|
||||
vortex.posX = this.posX;
|
||||
vortex.posY = this.posY;
|
||||
vortex.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(vortex);
|
||||
} else if(mode == 6) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 2.5F);
|
||||
vortex.posX = this.posX;
|
||||
vortex.posY = this.posY;
|
||||
vortex.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(vortex);
|
||||
} else if(mode == 7) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 5F);
|
||||
vortex.posX = this.posX;
|
||||
vortex.posY = this.posY;
|
||||
vortex.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(vortex);
|
||||
} else if(mode == 8) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
EntityBlackHole vortex = new EntityBlackHole(this.worldObj, 2F);
|
||||
vortex.posX = this.posX;
|
||||
vortex.posY = this.posY;
|
||||
vortex.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(vortex);
|
||||
} else {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.gadgetRadius, posX, posY, posZ));
|
||||
EntityNukeTorex.statFacStandard(worldObj, posX, posY, posZ, BombConfig.gadgetRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,541 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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;
|
||||
|
||||
public class EntityRainbow 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 EntityRainbow(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityRainbow(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 EntityRainbow(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 EntityRainbow(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.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 EntityRainbow(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_;
|
||||
|
||||
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 EntityRainbow(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));
|
||||
this.dataWatcher.addObject(20, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(21, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(22, 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.054499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.054499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.054499999832361937D * 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;
|
||||
this.randomizeColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
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);
|
||||
block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
if(!worldObj.isRemote)
|
||||
ExplosionChaos.explodeZOMG(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
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.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeSubatomicDamage(this, this.shootingEntity);
|
||||
}
|
||||
|
||||
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 && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 100000F);
|
||||
if(!worldObj.isRemote)
|
||||
ExplosionChaos.explodeZOMG(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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.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);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (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;
|
||||
}
|
||||
|
||||
this.randomizeColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
public void randomizeColor() {
|
||||
this.dataWatcher.updateObject(20, (byte)rand.nextInt(2));
|
||||
this.dataWatcher.updateObject(21, (byte)rand.nextInt(2));
|
||||
this.dataWatcher.updateObject(22, (byte)rand.nextInt(2));
|
||||
}
|
||||
}
|
||||
@ -1,527 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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;
|
||||
|
||||
public class EntitySparkBeam 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 EntitySparkBeam(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntitySparkBeam(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 EntitySparkBeam(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 EntitySparkBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.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 EntitySparkBeam(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_;
|
||||
|
||||
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 EntitySparkBeam(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.002499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * 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.ticksExisted > 100)
|
||||
this.setDead();
|
||||
|
||||
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);
|
||||
block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
if(!worldObj.isRemote) {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 50, true, true, true);
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
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.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = DamageSource.generic;
|
||||
}
|
||||
|
||||
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 && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 25 + rand.nextInt(20));
|
||||
if(!worldObj.isRemote) {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 50, true, true, 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.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);
|
||||
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@ -5,14 +5,12 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
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.EntityBullet;
|
||||
import com.hbm.entity.projectile.EntityRainbow;
|
||||
import com.hbm.entity.projectile.EntityRocket;
|
||||
import com.hbm.entity.projectile.EntityRubble;
|
||||
import com.hbm.entity.projectile.EntitySchrab;
|
||||
@ -573,43 +571,6 @@ public class ExplosionChaos { //TODO: destroy this entire class
|
||||
}
|
||||
}
|
||||
|
||||
public static void zomgMeSinPi(World world, double x, double y, double z, int count, Entity shooter,
|
||||
EntityGrenadeZOMG zomg) {
|
||||
|
||||
double d1 = 0;
|
||||
double d2 = 0;
|
||||
double d3 = 0;
|
||||
|
||||
// if (shooter != null && shooter instanceof EntityPlayer)
|
||||
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) {
|
||||
d2 *= -1;
|
||||
}
|
||||
|
||||
if (rand.nextInt(2) == 0) {
|
||||
d3 *= -1;
|
||||
}
|
||||
|
||||
EntityRainbow entityZomg = new EntityRainbow(world, (EntityPlayer) shooter, 1F, 10000, 100000, zomg);
|
||||
|
||||
entityZomg.motionX = d1;// * 5;
|
||||
entityZomg.motionY = d2;// * 5;
|
||||
entityZomg.motionZ = d3;// * 5;
|
||||
entityZomg.shootingEntity = shooter;
|
||||
|
||||
world.spawnEntityInWorld(entityZomg);
|
||||
world.playSoundAtEntity(zomg, "hbm:weapon.zomgShoot", 10.0F, 0.8F + (rand.nextFloat() * 0.4F));
|
||||
}
|
||||
}
|
||||
|
||||
public static void levelDown(World world, int x, int y, int z, int radius) {
|
||||
|
||||
if(!world.isRemote)
|
||||
|
||||
@ -785,14 +785,6 @@ import net.minecraft.item.ItemStack;
|
||||
new ComparableStack(ModItems.plate_polymer, 4)
|
||||
}, 100);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.multitool_hit, 1), new AStack[] {
|
||||
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4),
|
||||
new OreDictStack(STEEL.plate(), 4),
|
||||
new OreDictStack(GOLD.wireFine(), 12),
|
||||
new ComparableStack(ModItems.motor, 4),
|
||||
new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD)
|
||||
}, 100);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.missile_shuttle, 1), new AStack[] {
|
||||
new ComparableStack(ModItems.missile_generic, 2),
|
||||
new ComparableStack(ModItems.missile_strong, 1),
|
||||
|
||||
@ -943,10 +943,6 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
.inputItems(new ComparableStack(ModItems.ammo_arty, 1, 0), new OreDictStack(ANY_PLASTIC.ingot(), 1))
|
||||
.inputFluids(new FluidStack(Fluids.MUSTARDGAS, 4_000)));
|
||||
|
||||
// tools
|
||||
this.register(new GenericRecipe("ass.multitool").setup(100, 100).outputItems(new ItemStack(ModItems.multitool_hit, 1))
|
||||
.inputItems(new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4), new OreDictStack(STEEL.plate(), 4), new OreDictStack(GOLD.wireFine(), 12), new ComparableStack(ModItems.motor, 4), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD)));
|
||||
|
||||
// space
|
||||
this.register(new GenericRecipe("ass.soyuz").setup(6_000, 100).outputItems(new ItemStack(ModItems.missile_soyuz, 1))
|
||||
.inputItems(new OreDictStack(TI.shell(), 32),
|
||||
|
||||
@ -12,7 +12,6 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockNTMSand.EnumSandType;
|
||||
import com.hbm.handler.imc.IMCCrystallizer;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
@ -37,7 +36,6 @@ import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
import com.hbm.items.special.ItemPlasticScrap.ScrapType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@ -47,13 +45,10 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
//This time we're doing this right
|
||||
//...right?
|
||||
public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
//'Object' is either a ComparableStack or the key for the ore dict
|
||||
private static HashMap<Pair<Object, FluidType>, CrystallizerRecipe> recipes = new HashMap();
|
||||
private static HashMap<Object, Integer> amounts = new HashMap(); // for use in the partitioner
|
||||
private static HashMap<Pair<AStack, FluidType>, CrystallizerRecipe> recipes = new HashMap();
|
||||
private static HashMap<AStack, Integer> amounts = new HashMap(); // for use in the partitioner
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
@ -63,45 +58,45 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
final int mixingTime = 20;
|
||||
FluidStack sulfur = new FluidStack(Fluids.SULFURIC_ACID, 500);
|
||||
|
||||
registerRecipe(COAL.ore(), new CrystallizerRecipe(ModItems.crystal_coal, baseTime).prod(0.05F));
|
||||
registerRecipe(IRON.ore(), new CrystallizerRecipe(ModItems.crystal_iron, baseTime).prod(0.05F));
|
||||
registerRecipe(GOLD.ore(), new CrystallizerRecipe(ModItems.crystal_gold, baseTime).prod(0.05F));
|
||||
registerRecipe(REDSTONE.ore(), new CrystallizerRecipe(ModItems.crystal_redstone, baseTime).prod(0.05F));
|
||||
registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime).prod(0.05F));
|
||||
registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime).prod(0.05F));
|
||||
registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime).prod(0.05F), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime).prod(0.05F));
|
||||
registerRecipe(KNO.ore(), new CrystallizerRecipe(ModItems.crystal_niter, baseTime).prod(0.05F));
|
||||
registerRecipe(CU.ore(), new CrystallizerRecipe(ModItems.crystal_copper, baseTime).prod(0.05F));
|
||||
registerRecipe(W.ore(), new CrystallizerRecipe(ModItems.crystal_tungsten, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(AL.ore(), new CrystallizerRecipe(ModItems.crystal_aluminium, baseTime).prod(0.05F));
|
||||
registerRecipe(F.ore(), new CrystallizerRecipe(ModItems.crystal_fluorite, baseTime).prod(0.05F));
|
||||
registerRecipe(BE.ore(), new CrystallizerRecipe(ModItems.crystal_beryllium, baseTime).prod(0.05F));
|
||||
registerRecipe(PB.ore(), new CrystallizerRecipe(ModItems.crystal_lead, baseTime).prod(0.05F));
|
||||
registerRecipe(SA326.ore(), new CrystallizerRecipe(ModItems.crystal_schrabidium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(LI.ore(), new CrystallizerRecipe(ModItems.crystal_lithium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(CO.ore(), new CrystallizerRecipe(ModItems.crystal_cobalt, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(COAL.ore()), new CrystallizerRecipe(ModItems.crystal_coal, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(IRON.ore()), new CrystallizerRecipe(ModItems.crystal_iron, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(GOLD.ore()), new CrystallizerRecipe(ModItems.crystal_gold, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(REDSTONE.ore()), new CrystallizerRecipe(ModItems.crystal_redstone, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(LAPIS.ore()), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(DIAMOND.ore()), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(U.ore()), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime).prod(0.05F), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerRecipe(new OreDictStack(ore), new CrystallizerRecipe(ModItems.crystal_thorium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(PU.ore()), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(TI.ore()), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(S.ore()), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(KNO.ore()), new CrystallizerRecipe(ModItems.crystal_niter, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(CU.ore()), new CrystallizerRecipe(ModItems.crystal_copper, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(W.ore()), new CrystallizerRecipe(ModItems.crystal_tungsten, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(AL.ore()), new CrystallizerRecipe(ModItems.crystal_aluminium, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(F.ore()), new CrystallizerRecipe(ModItems.crystal_fluorite, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(BE.ore()), new CrystallizerRecipe(ModItems.crystal_beryllium, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(PB.ore()), new CrystallizerRecipe(ModItems.crystal_lead, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(SA326.ore()), new CrystallizerRecipe(ModItems.crystal_schrabidium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(LI.ore()), new CrystallizerRecipe(ModItems.crystal_lithium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack(CO.ore()), new CrystallizerRecipe(ModItems.crystal_cobalt, baseTime).prod(0.05F), sulfur);
|
||||
|
||||
registerRecipe(new ComparableStack(ModItems.powder_calcium), new CrystallizerRecipe(new ItemStack(ModItems.powder_cement, 8), utilityTime).prod(0.1F), new FluidStack(Fluids.REDMUD, 75));
|
||||
registerRecipe(MALACHITE.ingot(), new CrystallizerRecipe(ItemScraps.create(new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(1))), 300).prod(0.1F), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
registerRecipe(new OreDictStack(MALACHITE.ingot()), new CrystallizerRecipe(ItemScraps.create(new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(1))), 300).prod(0.1F), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
|
||||
registerRecipe("oreRareEarth", new CrystallizerRecipe(ModItems.crystal_rare, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack("oreRareEarth"), new CrystallizerRecipe(ModItems.crystal_rare, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new OreDictStack("oreCinnabar"), new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime).prod(0.05F));
|
||||
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_nether_fire), new CrystallizerRecipe(ModItems.crystal_phosphorus, baseTime).prod(0.05F));
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_tikite), new CrystallizerRecipe(ModItems.crystal_trixite, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_diamond), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime).prod(0.05F));
|
||||
registerRecipe(SRN.ingot(), new CrystallizerRecipe(ModItems.crystal_schraranium, baseTime).prod(0.05F));
|
||||
registerRecipe(new OreDictStack(SRN.ingot()), new CrystallizerRecipe(ModItems.crystal_schraranium, baseTime).prod(0.05F));
|
||||
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(ModItems.ingot_fiberglass, utilityTime).prod(0.15F));
|
||||
registerRecipe(SI.ingot(), new CrystallizerRecipe(new ItemStack(Items.quartz, 2), utilityTime).prod(0.1F), new FluidStack(Fluids.OXYGEN, 250));
|
||||
registerRecipe(REDSTONE.block(), new CrystallizerRecipe(ModItems.ingot_mercury, baseTime).prod(0.25F));
|
||||
registerRecipe(CINNABAR.crystal(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_mercury, 3), baseTime).prod(0.25F));
|
||||
registerRecipe(BORAX.dust(), new CrystallizerRecipe(new ItemStack(ModItems.powder_boron_tiny, 3), baseTime).prod(0.25F), sulfur);
|
||||
registerRecipe(COAL.block(), new CrystallizerRecipe(ModBlocks.block_graphite, baseTime));
|
||||
registerRecipe(new OreDictStack(KEY_SAND), new CrystallizerRecipe(ModItems.ingot_fiberglass, utilityTime).prod(0.15F));
|
||||
registerRecipe(new OreDictStack(SI.ingot()), new CrystallizerRecipe(new ItemStack(Items.quartz, 2), utilityTime).prod(0.1F), new FluidStack(Fluids.OXYGEN, 250));
|
||||
registerRecipe(new OreDictStack(REDSTONE.block()), new CrystallizerRecipe(ModItems.ingot_mercury, baseTime).prod(0.25F));
|
||||
registerRecipe(new OreDictStack(CINNABAR.crystal()), new CrystallizerRecipe(new ItemStack(ModItems.ingot_mercury, 3), baseTime).prod(0.25F));
|
||||
registerRecipe(new OreDictStack(BORAX.dust()), new CrystallizerRecipe(new ItemStack(ModItems.powder_boron_tiny, 3), baseTime).prod(0.25F), sulfur);
|
||||
registerRecipe(new OreDictStack(COAL.block()), new CrystallizerRecipe(ModBlocks.block_graphite, baseTime));
|
||||
|
||||
registerRecipe(new ComparableStack(Blocks.cobblestone), new CrystallizerRecipe(ModBlocks.reinforced_stone, utilityTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_obsidian), new CrystallizerRecipe(ModBlocks.brick_obsidian, utilityTime));
|
||||
@ -114,14 +109,14 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(ModItems.scrap_oil), new CrystallizerRecipe(new ItemStack(ModItems.nugget_arsenic), 100).prod(0.3F).setReq(16), new FluidStack(Fluids.RADIOSOLVENT, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.FULLERENE)), new CrystallizerRecipe(new ItemStack(ModItems.ingot_cft), baseTime).prod(0.1F).setReq(4), new FluidStack(Fluids.XYLENE, 1_000));
|
||||
|
||||
registerRecipe(DIAMOND.dust(), new CrystallizerRecipe(Items.diamond, utilityTime));
|
||||
registerRecipe(EMERALD.dust(), new CrystallizerRecipe(Items.emerald, utilityTime));
|
||||
registerRecipe(LAPIS.dust(), new CrystallizerRecipe(new ItemStack(Items.dye, 1, 4), utilityTime));
|
||||
registerRecipe(new OreDictStack(DIAMOND.dust()), new CrystallizerRecipe(Items.diamond, utilityTime));
|
||||
registerRecipe(new OreDictStack(EMERALD.dust()), new CrystallizerRecipe(Items.emerald, utilityTime));
|
||||
registerRecipe(new OreDictStack(LAPIS.dust()), new CrystallizerRecipe(new ItemStack(Items.dye, 1, 4), utilityTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_semtex_mix), new CrystallizerRecipe(ModItems.ingot_semtex, baseTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_desh_ready), new CrystallizerRecipe(ModItems.ingot_desh, baseTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_meteorite), new CrystallizerRecipe(ModItems.fragment_meteorite, utilityTime));
|
||||
registerRecipe(CD.dust(), new CrystallizerRecipe(ModItems.ingot_rubber, utilityTime), new FluidStack(Fluids.FISHOIL, 250));
|
||||
registerRecipe(LATEX.ingot(), new CrystallizerRecipe(ModItems.ingot_rubber, mixingTime).prod(0.15F), new FluidStack(Fluids.SOURGAS, 25));
|
||||
registerRecipe(new OreDictStack(CD.dust()), new CrystallizerRecipe(ModItems.ingot_rubber, utilityTime), new FluidStack(Fluids.FISHOIL, 250));
|
||||
registerRecipe(new OreDictStack(LATEX.ingot()), new CrystallizerRecipe(ModItems.ingot_rubber, mixingTime).prod(0.15F), new FluidStack(Fluids.SOURGAS, 25));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_sawdust), new CrystallizerRecipe(ModItems.cordite, mixingTime).prod(0.25F), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
registerRecipe(new ComparableStack(ModBlocks.rebar), new CrystallizerRecipe(ModBlocks.concrete_rebar, 10), new FluidStack(Fluids.CONCRETE, 1_000));
|
||||
|
||||
@ -206,12 +201,12 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
FluidStack[] dyes = new FluidStack[] {new FluidStack(Fluids.WOODOIL, 100), new FluidStack(Fluids.FISHOIL, 100), new FluidStack(Fluids.LIGHTOIL, 100)};
|
||||
for(FluidStack dye : dyes) {
|
||||
registerRecipe(COAL.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLACK, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(TI.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.WHITE, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(IRON.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.RED, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(W.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.YELLOW, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(CU.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(CO.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(COAL.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLACK, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(TI.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.WHITE, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(IRON.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.RED, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(W.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.YELLOW, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(CU.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(new OreDictStack(CO.dust()), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), mixingTime).prod(0.15F), dye);
|
||||
}
|
||||
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
|
||||
@ -220,37 +215,31 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new CrystallizerRecipe(new ItemStack(ModItems.pellet_charged), 200), new FluidStack(Fluids.IONGEL, 500));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)), new CrystallizerRecipe(new ItemStack(ModItems.pill_red), 200), new FluidStack(Fluids.ESTRADIOL, 250));
|
||||
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
|
||||
registerRecipe(new OreDictStack(KEY_SAND), new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
|
||||
registerRecipe(new ComparableStack(ModBlocks.sand_mix, 1, EnumSandType.QUARTZ), new CrystallizerRecipe(new ItemStack(ModItems.ball_dynamite, 16), 20), new FluidStack(Fluids.NITROGLYCERIN, 1_000));
|
||||
registerRecipe(NETHERQUARTZ.dust(), new CrystallizerRecipe(new ItemStack(ModItems.ball_dynamite, 4), 20), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
registerRecipe(new OreDictStack(NETHERQUARTZ.dust()), new CrystallizerRecipe(new ItemStack(ModItems.ball_dynamite, 4), 20), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
|
||||
/// COMPAT CERTUS QUARTZ ///
|
||||
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
|
||||
if(quartz != null && !quartz.isEmpty()) {
|
||||
ItemStack qItem = quartz.get(0).copy();
|
||||
qItem.stackSize = 12;
|
||||
registerRecipe("oreCertusQuartz", new CrystallizerRecipe(qItem, baseTime));
|
||||
registerRecipe(new OreDictStack("oreCertusQuartz"), new CrystallizerRecipe(qItem, baseTime));
|
||||
}
|
||||
|
||||
/// COMPAT WHITE PHOSPHORUS DUST ///
|
||||
List<ItemStack> dustWhitePhosphorus = OreDictionary.getOres(P_WHITE.dust());
|
||||
if(dustWhitePhosphorus != null && !dustWhitePhosphorus.isEmpty()) {
|
||||
registerRecipe(P_WHITE.dust(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_phosphorus), utilityTime), new FluidStack(Fluids.AROMATICS, 50));
|
||||
registerRecipe(new OreDictStack(P_WHITE.dust()), new CrystallizerRecipe(new ItemStack(ModItems.ingot_phosphorus), utilityTime), new FluidStack(Fluids.AROMATICS, 50));
|
||||
}
|
||||
|
||||
/// COMPAT CINNABAR DUST ///
|
||||
List<ItemStack> dustCinnabar = OreDictionary.getOres(CINNABAR.dust());
|
||||
if(dustCinnabar != null && !dustCinnabar.isEmpty()) {
|
||||
registerRecipe(CINNABAR.dust(), new CrystallizerRecipe(new ItemStack(ModItems.cinnebar), utilityTime), new FluidStack(Fluids.PEROXIDE, 50));
|
||||
registerRecipe(new OreDictStack(CINNABAR.dust()), new CrystallizerRecipe(new ItemStack(ModItems.cinnebar), utilityTime), new FluidStack(Fluids.PEROXIDE, 50));
|
||||
}
|
||||
|
||||
registerRecipe(new ComparableStack(ModBlocks.moon_turf), new CrystallizerRecipe(new ItemStack(ModItems.chunk_ore, 1, EnumChunkType.MOONSTONE.ordinal()), 1200).setReq(16));
|
||||
|
||||
if(!IMCCrystallizer.buffer.isEmpty()) {
|
||||
recipes.putAll(IMCCrystallizer.buffer);
|
||||
MainRegistry.logger.info("Fetched " + IMCCrystallizer.buffer.size() + " IMC crystallizer recipes!");
|
||||
IMCCrystallizer.buffer.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static CrystallizerRecipe getOutput(ItemStack stack, FluidType type) {
|
||||
@ -266,7 +255,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
for(String key : dictKeys) {
|
||||
Pair dictKey = new Pair(key, type);
|
||||
Pair dictKey = new Pair(new OreDictStack(key), type);
|
||||
if(recipes.containsKey(dictKey)) return recipes.get(dictKey);
|
||||
}
|
||||
|
||||
@ -278,8 +267,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
public static int getAmount(ItemStack stack) {
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return 0;
|
||||
if(stack == null || stack.getItem() == null) return 0;
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
if(amounts.containsKey(comp)) return amounts.get(comp);
|
||||
@ -287,7 +275,8 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
for(String key : dictKeys) {
|
||||
if(amounts.containsKey(key)) return amounts.get(key);
|
||||
OreDictStack od = new OreDictStack(key);
|
||||
if(amounts.containsKey(od)) return amounts.get(od);
|
||||
}
|
||||
|
||||
comp.meta = OreDictionary.WILDCARD_VALUE;
|
||||
@ -300,21 +289,20 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
for(Entry<Pair<Object, FluidType>, CrystallizerRecipe> entry : CrystallizerRecipes.recipes.entrySet()) {
|
||||
for(Entry<Pair<AStack, FluidType>, CrystallizerRecipe> entry : CrystallizerRecipes.recipes.entrySet()) {
|
||||
|
||||
CrystallizerRecipe recipe = entry.getValue();
|
||||
|
||||
Pair<Object, FluidType> key = entry.getKey();
|
||||
Pair<AStack, FluidType> key = entry.getKey();
|
||||
Object input = key.getKey();
|
||||
FluidType acid = key.getValue();
|
||||
|
||||
if(input instanceof String) {
|
||||
OreDictStack stack = new OreDictStack((String) input, recipe.itemAmount);
|
||||
if(input instanceof OreDictStack) {
|
||||
OreDictStack stack = ((OreDictStack) input).copy(recipe.itemAmount);
|
||||
recipes.put(new Object[] {ItemFluidIcon.make(acid, recipe.acidAmount), stack}, recipe.output);
|
||||
} else {
|
||||
ComparableStack stack = ((ComparableStack) input);
|
||||
stack = (ComparableStack) stack.copy();
|
||||
stack.stacksize = recipe.itemAmount;
|
||||
stack = (ComparableStack) stack.copy(recipe.itemAmount);
|
||||
if(stack.item == ModItems.scrap_plastic) continue;
|
||||
recipes.put(new Object[] {ItemFluidIcon.make(acid, recipe.acidAmount), stack}, recipe.output);
|
||||
}
|
||||
@ -323,11 +311,11 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static void registerRecipe(Object input, CrystallizerRecipe recipe) {
|
||||
public static void registerRecipe(AStack input, CrystallizerRecipe recipe) {
|
||||
registerRecipe(input, recipe, new FluidStack(Fluids.PEROXIDE, 500));
|
||||
}
|
||||
|
||||
public static void registerRecipe(Object input, CrystallizerRecipe recipe, FluidStack stack) {
|
||||
public static void registerRecipe(AStack input, CrystallizerRecipe recipe, FluidStack stack) {
|
||||
recipe.acidAmount = stack.fill;
|
||||
recipes.put(new Pair(input, stack.type), recipe);
|
||||
amounts.put(input, recipe.itemAmount);
|
||||
@ -382,11 +370,8 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
CrystallizerRecipe cRecipe = new CrystallizerRecipe(output, duration).setReq(input.stacksize);
|
||||
input.stacksize = 1;
|
||||
cRecipe.acidAmount = fluid.fill;
|
||||
if(input instanceof ComparableStack) {
|
||||
this.registerRecipe(input, cRecipe, fluid);
|
||||
} else if(input instanceof OreDictStack) {
|
||||
this.registerRecipe(input, cRecipe, fluid);
|
||||
}
|
||||
this.registerRecipe(input, cRecipe, fluid);
|
||||
|
||||
if(obj.has("productivity")) cRecipe.prod(obj.get("productivity").getAsFloat());
|
||||
}
|
||||
|
||||
@ -394,8 +379,8 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<Pair, CrystallizerRecipe> rec = (Entry<Pair, CrystallizerRecipe>) recipe;
|
||||
CrystallizerRecipe cRecipe = rec.getValue();
|
||||
Pair<Object, FluidType> pair = rec.getKey();
|
||||
AStack input = pair.getKey() instanceof String ? new OreDictStack((String )pair.getKey()) : ((ComparableStack) pair.getKey()).copy();
|
||||
Pair<AStack, FluidType> pair = rec.getKey();
|
||||
AStack input = pair.getKey().copy();
|
||||
input.stacksize = cRecipe.itemAmount;
|
||||
FluidStack fluid = new FluidStack(pair.value, cRecipe.acidAmount);
|
||||
|
||||
|
||||
@ -1964,17 +1964,6 @@ public class ModItems {
|
||||
public static Item wrench_flipped;
|
||||
public static Item memespoon;
|
||||
|
||||
public static Item multitool_hit;
|
||||
public static Item multitool_dig;
|
||||
public static Item multitool_silk;
|
||||
public static Item multitool_ext;
|
||||
public static Item multitool_miner;
|
||||
public static Item multitool_beam;
|
||||
public static Item multitool_sky;
|
||||
public static Item multitool_mega;
|
||||
public static Item multitool_joule;
|
||||
public static Item multitool_decon;
|
||||
|
||||
public static Item saw;
|
||||
public static Item bat;
|
||||
public static Item bat_nail;
|
||||
@ -4871,17 +4860,6 @@ public class ModItems {
|
||||
.addAbility(IWeaponAbility.VAMPIRE, 4)
|
||||
.addAbility(IWeaponAbility.BEHEADER, 0).setUnlocalizedName("mese_gavel").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mese_gavel");
|
||||
|
||||
multitool_hit = new ItemMultitoolPassive().setUnlocalizedName("multitool_hit").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
|
||||
multitool_dig = new ItemMultitoolTool(4.0F, MainRegistry.enumToolMaterialMultitool, ItemMultitoolTool.getAllBlocks()).setFull3D().setUnlocalizedName("multitool_dig").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":multitool_claw");
|
||||
multitool_silk = new ItemMultitoolTool(4.0F, MainRegistry.enumToolMaterialMultitool, ItemMultitoolTool.getAllBlocks()).setFull3D().setUnlocalizedName("multitool_silk").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_claw");
|
||||
multitool_ext = new ItemMultitoolPassive().setUnlocalizedName("multitool_ext").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_open");
|
||||
multitool_miner = new ItemMultitoolPassive().setUnlocalizedName("multitool_miner").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_pointer");
|
||||
multitool_beam = new ItemMultitoolPassive().setUnlocalizedName("multitool_beam").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_pointer");
|
||||
multitool_sky= new ItemMultitoolPassive().setUnlocalizedName("multitool_sky").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_open");
|
||||
multitool_mega = new ItemMultitoolPassive().setUnlocalizedName("multitool_mega").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
|
||||
multitool_joule = new ItemMultitoolPassive().setUnlocalizedName("multitool_joule").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
|
||||
multitool_decon = new ItemMultitoolPassive().setUnlocalizedName("multitool_decon").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
|
||||
|
||||
saw = new ModSword(MainRegistry.enumToolMaterialSaw).setUnlocalizedName("weapon_saw").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":saw");
|
||||
bat = new ModSword(MainRegistry.enumToolMaterialBat).setUnlocalizedName("weapon_bat").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":bat");
|
||||
bat_nail = new ModSword(MainRegistry.enumToolMaterialBatNail).setUnlocalizedName("weapon_bat_nail").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":bat_nail");
|
||||
@ -6600,18 +6578,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(meteorite_sword_fused, meteorite_sword_fused.getUnlocalizedName());
|
||||
GameRegistry.registerItem(meteorite_sword_baleful, meteorite_sword_baleful.getUnlocalizedName());
|
||||
|
||||
//Multitool
|
||||
GameRegistry.registerItem(multitool_hit, multitool_hit.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_dig, multitool_dig.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_silk, multitool_silk.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_ext, multitool_ext.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_miner, multitool_miner.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_beam, multitool_beam.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_sky, multitool_sky.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_mega, multitool_mega.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_joule, multitool_joule.getUnlocalizedName());
|
||||
GameRegistry.registerItem(multitool_decon, multitool_decon.getUnlocalizedName());
|
||||
|
||||
//Syringes & Pills
|
||||
GameRegistry.registerItem(syringe_empty, syringe_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(syringe_antidote, syringe_antidote.getUnlocalizedName());
|
||||
|
||||
@ -1,277 +0,0 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.entity.projectile.EntityLaserBeam;
|
||||
import com.hbm.entity.projectile.EntityMinerBeam;
|
||||
import com.hbm.entity.projectile.EntityRubble;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemMultitoolPassive extends Item {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public ItemMultitoolPassive() {
|
||||
this.setMaxDamage(5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if(player.isSneaking()) {
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:item.techBoop", 2.0F, 1.0F);
|
||||
|
||||
if (this == ModItems.multitool_ext) {
|
||||
return new ItemStack(ModItems.multitool_miner, 1, stack.getItemDamage());
|
||||
} else if(this == ModItems.multitool_miner) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_hit, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.looting, 3);
|
||||
item.addEnchantment(Enchantment.knockback, 3);
|
||||
return item;
|
||||
} else if (this == ModItems.multitool_hit) {
|
||||
return new ItemStack(ModItems.multitool_beam, 1, stack.getItemDamage());
|
||||
} else if (this == ModItems.multitool_beam) {
|
||||
return new ItemStack(ModItems.multitool_sky, 1, stack.getItemDamage());
|
||||
} else if (this == ModItems.multitool_sky) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_mega, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.knockback, 5);
|
||||
return item;
|
||||
} else if (this == ModItems.multitool_mega) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_joule, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.knockback, 3);
|
||||
return item;
|
||||
} else if (this == ModItems.multitool_joule) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_decon, 1, stack.getItemDamage());
|
||||
return item;
|
||||
} else if (this == ModItems.multitool_decon) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_dig, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.looting, 3);
|
||||
item.addEnchantment(Enchantment.fortune, 3);
|
||||
return item;
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this == ModItems.multitool_ext) {
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_miner) {
|
||||
|
||||
EntityMinerBeam plasma = new EntityMinerBeam(world, player, 0.75F);
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:weapon.immolatorIgnite", 1.0F, 1F);
|
||||
//world.playSoundAtEntity(player, "hbm:weapon.immolatorShoot", 1.0F, 1F);
|
||||
|
||||
if (!world.isRemote)
|
||||
world.spawnEntityInWorld(plasma);
|
||||
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_hit) {
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_beam) {
|
||||
|
||||
EntityLaserBeam plasma = new EntityLaserBeam(world, player, 1F);
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:weapon.immolatorIgnite", 1.0F, 1F);
|
||||
//world.playSoundAtEntity(player, "hbm:weapon.immolatorShoot", 1.0F, 1F);
|
||||
|
||||
if (!world.isRemote)
|
||||
world.spawnEntityInWorld(plasma);
|
||||
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_sky) {
|
||||
for(int i = 0; i < 15; i++) {
|
||||
int a = (int)player.posX - 15 + rand.nextInt(31);
|
||||
int b = (int)player.posZ - 15 + rand.nextInt(31);
|
||||
//if(!world.isRemote) {
|
||||
EntityLightningBolt blitz = new EntityLightningBolt(world, a, world.getHeightValue(a, b), b);
|
||||
world.spawnEntityInWorld(blitz);
|
||||
//}
|
||||
}
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_mega) {
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_joule) {
|
||||
return stack;
|
||||
} else if (this == ModItems.multitool_decon) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f1, float f2, float f3)
|
||||
{
|
||||
if(this == ModItems.multitool_ext) {
|
||||
Block b = world.getBlock(x, y, z);
|
||||
ItemStack s = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(Item.getItemFromBlock(b), 1, world.getBlockMetadata(x, y, z)));
|
||||
if(s != null) {
|
||||
ItemStack t = s.copy();
|
||||
if(!world.isRemote)
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 3);
|
||||
|
||||
if(!player.inventory.addItemStackToInventory(t))
|
||||
player.dropPlayerItemWithRandomChoice(t, false);
|
||||
player.swingItem();
|
||||
}
|
||||
} else if (this == ModItems.multitool_miner) {
|
||||
} else if (this == ModItems.multitool_hit) {
|
||||
} else if (this == ModItems.multitool_beam) {
|
||||
} else if (this == ModItems.multitool_sky) {
|
||||
} else if (this == ModItems.multitool_mega) {
|
||||
|
||||
ExplosionChaos.levelDown(world, x, y, z, 2);
|
||||
return true;
|
||||
|
||||
} else if (this == ModItems.multitool_joule) {
|
||||
|
||||
int l = 25;
|
||||
float part = -1F/16F;
|
||||
|
||||
Vec3 vec0 = player.getLookVec();
|
||||
vec0.rotateAroundY(.25F);
|
||||
List<int[]> list = Library.getBlockPosInPath(x, y, z, l, vec0);
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
vec0.rotateAroundY(part);
|
||||
list.addAll(Library.getBlockPosInPath(x, y, z, l, vec0));
|
||||
|
||||
if(!world.isRemote)
|
||||
for(int j = 0; j < list.size(); j++) {
|
||||
|
||||
int x1 = list.get(j)[0];
|
||||
int y1 = list.get(j)[1];
|
||||
int z1 = list.get(j)[2];
|
||||
int w1 = list.get(j)[3];
|
||||
|
||||
Block b = world.getBlock(x1, y1, z1);
|
||||
float k = b.getExplosionResistance(null);
|
||||
|
||||
if(k < 6000 && b != Blocks.air) {
|
||||
|
||||
EntityRubble rubble = new EntityRubble(world);
|
||||
rubble.posX = x1 + 0.5F;
|
||||
rubble.posY = y1;
|
||||
rubble.posZ = z1 + 0.5F;
|
||||
|
||||
rubble.motionY = 0.025F * w1 + 0.15F;
|
||||
rubble.setMetaBasedOnBlock(b, world.getBlockMetadata(x1, y1, z1));
|
||||
|
||||
world.spawnEntityInWorld(rubble);
|
||||
|
||||
world.setBlock(x1, y1, z1, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} else if (this == ModItems.multitool_decon) {
|
||||
|
||||
if(!world.isRemote)
|
||||
ExplosionChaos.decontaminate(world, x, y, z);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
if(this == ModItems.multitool_ext) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 7, 0));
|
||||
} else if (this == ModItems.multitool_miner) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 8, 0));
|
||||
} else if (this == ModItems.multitool_hit) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 16, 0));
|
||||
} else if (this == ModItems.multitool_beam) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 8, 0));
|
||||
} else if (this == ModItems.multitool_sky) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 5, 0));
|
||||
} else if (this == ModItems.multitool_mega) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 12, 0));
|
||||
} else if (this == ModItems.multitool_joule) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 12, 0));
|
||||
} else if (this == ModItems.multitool_decon) {
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 5, 0));
|
||||
}
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(this == ModItems.multitool_ext) {
|
||||
list.add("Right click instantly destroys smeltable blocks");
|
||||
list.add("Mined blocks will be smelted and put in the player's inventory");
|
||||
}
|
||||
if(this == ModItems.multitool_miner) {
|
||||
list.add("Shoots lasers which destroy smeltable blocks");
|
||||
list.add("These blocks will drop the smelted item");
|
||||
}
|
||||
if(this == ModItems.multitool_hit) {
|
||||
list.add("Very high damage against mobs");
|
||||
list.add("Strong knock back");
|
||||
}
|
||||
if(this == ModItems.multitool_beam) {
|
||||
list.add("Shoots lasers which ignite blocks and mobs");
|
||||
list.add("Lasers are destroyed by water");
|
||||
}
|
||||
if(this == ModItems.multitool_sky) {
|
||||
list.add("Right click summons a lightning storm around the player");
|
||||
list.add("Lightning can also hit the player using the fist");
|
||||
}
|
||||
if(this == ModItems.multitool_mega) {
|
||||
list.add("Right click will level down blocks with a powerful punch");
|
||||
list.add("Immense knockback against mobs");
|
||||
}
|
||||
if(this == ModItems.multitool_joule) {
|
||||
list.add("Right click will break blocks in the line of sight");
|
||||
list.add("These blocks will be flung up as rubble");
|
||||
}
|
||||
if(this == ModItems.multitool_decon) {
|
||||
list.add("Right click will remove radiation effect from blocks");
|
||||
list.add("Blocks like nuclear waste turn into lead");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,83 +0,0 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemMultitoolTool extends ItemTool {
|
||||
|
||||
|
||||
public ItemMultitoolTool(float f, ToolMaterial mat, Set set) {
|
||||
super(f, mat, set);
|
||||
}
|
||||
|
||||
public static Set getAllBlocks() {
|
||||
|
||||
Set all = new HashSet();
|
||||
|
||||
for(Object b : GameData.getBlockRegistry()) {
|
||||
all.add(b);
|
||||
}
|
||||
|
||||
return all;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if(player.isSneaking()) {
|
||||
|
||||
world.playSoundAtEntity(player, "hbm:item.techBoop", 2.0F, 1.0F);
|
||||
|
||||
if(this == ModItems.multitool_dig) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_silk, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.silkTouch, 3);
|
||||
return item;
|
||||
} else if (this == ModItems.multitool_silk) {
|
||||
ItemStack item = new ItemStack(ModItems.multitool_ext, 1, stack.getItemDamage());
|
||||
item.addEnchantment(Enchantment.fireAspect, 3);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_150897_b(Block p_150897_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(this == ModItems.multitool_dig) {
|
||||
list.add("Breaks blocks extremely fast");
|
||||
list.add("Extra drops for ores");
|
||||
}
|
||||
if(this == ModItems.multitool_silk) {
|
||||
list.add("Breaks blocks extremely fast");
|
||||
list.add("Ores will drop themselves via silk touch");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +1,6 @@
|
||||
package com.hbm.lib;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.entity.projectile.EntityLaserBeam;
|
||||
import com.hbm.entity.projectile.EntityMinerBeam;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
@ -96,14 +94,6 @@ public class ModDamageSource extends DamageSource {
|
||||
return (new EntityDamageSourceIndirect(s_euthanized, ent, hit)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static DamageSource causeLaserDamage(EntityLaserBeam ent, Entity hit) {
|
||||
return (new EntityDamageSourceIndirect(s_laser, ent, hit)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static DamageSource causeLaserDamage(EntityMinerBeam ent, Entity hit) {
|
||||
return (new EntityDamageSourceIndirect("s_laser", ent, hit)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static boolean getIsBullet(DamageSource source) {
|
||||
if(source instanceof EntityDamageSourceIndirect) {
|
||||
return ((EntityDamageSourceIndirect) source).damageType.equals("revolverBullet");
|
||||
|
||||
@ -580,17 +580,6 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_b92, new ItemRenderGunAnim());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fireext, new ItemRenderFireExt());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.detonator_laser, new ItemRenderDetonatorLaser());
|
||||
//multitool
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_ext, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_miner, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_hit, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_beam, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_sky, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_mega, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_joule, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_decon, new ItemRenderMultitool());
|
||||
//blocks
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_roof), new ItemRenderDecoBlock());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.conveyor_wand, new ItemRenderBlock(ModBlocks.conveyor, ModBlocks.conveyor_express, ModBlocks.conveyor_double, ModBlocks.conveyor_triple));
|
||||
@ -606,12 +595,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBaseMK4.class, new RenderBulletMK4());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBaseMK4CL.class, new RenderBulletMK4());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBeamBase.class, new RenderBeam());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRainbow.class, new RenderRainbow());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLaserBeam.class, new RenderBeam2());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinerBeam.class, new RenderBeam3());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySparkBeam.class, new RenderBeam4());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityExplosiveBeam.class, new RenderBeam5());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityModBeam.class, new RenderBeam6());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeLaser.class, new RenderSiegeLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBombletZeta.class, new RenderBombletTheta());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMeteor.class, new RenderMeteor());
|
||||
|
||||
@ -1447,6 +1447,16 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.bob_chemistry");
|
||||
ignoreMappings.add("hbm:item.bob_oil");
|
||||
ignoreMappings.add("hbm:item.bob_nuclear");
|
||||
ignoreMappings.add("hbm:item.multitool_hit");
|
||||
ignoreMappings.add("hbm:item.multitool_dig");
|
||||
ignoreMappings.add("hbm:item.multitool_silk");
|
||||
ignoreMappings.add("hbm:item.multitool_ext");
|
||||
ignoreMappings.add("hbm:item.multitool_miner");
|
||||
ignoreMappings.add("hbm:item.multitool_beam");
|
||||
ignoreMappings.add("hbm:item.multitool_sky");
|
||||
ignoreMappings.add("hbm:item.multitool_mega");
|
||||
ignoreMappings.add("hbm:item.multitool_joule");
|
||||
ignoreMappings.add("hbm:item.multitool_decon");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
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 RenderBeam2 extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
float radius = 0.12F;
|
||||
//float radius = 0.06F;
|
||||
int distance = 4;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = true;
|
||||
boolean green = true;
|
||||
boolean blue = true;
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/PlasmaBeam.png");
|
||||
}
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
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 RenderBeam3 extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
float radius = 0.12F;
|
||||
//float radius = 0.06F;
|
||||
int distance = 4;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = true;
|
||||
boolean green = false;
|
||||
boolean blue = true;
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/PlasmaBeam.png");
|
||||
}
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
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 RenderBeam4 extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
//float radius = 0.12F;
|
||||
//float radius = 0.06F;
|
||||
float radius = 0.45F;
|
||||
int distance = 2;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = true;
|
||||
boolean green = true;
|
||||
boolean blue = false;
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/PlasmaBeam.png");
|
||||
}
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
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 RenderBeam6 extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
//float radius = 0.12F;
|
||||
//float radius = 0.06F;
|
||||
float radius = 0.175F;
|
||||
int distance = 2;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = System.currentTimeMillis() % 250 < 124;
|
||||
boolean green = false;
|
||||
boolean blue = !red;
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/PlasmaBeam.png");
|
||||
}
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.projectile.EntityRainbow;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
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 RenderRainbow extends Render {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
float radius = 0.12F;
|
||||
int distance = 4;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
boolean red = false;
|
||||
boolean green = false;
|
||||
boolean blue = false;
|
||||
|
||||
if(rocket instanceof EntityRainbow && ((EntityRainbow)rocket).getDataWatcher() != null)
|
||||
{
|
||||
red = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(20) == 1;
|
||||
green = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(21) == 1;
|
||||
blue = ((EntityRainbow)rocket).getDataWatcher().getWatchableObjectByte(22) == 1;
|
||||
}
|
||||
|
||||
for (float o = 0; o <= radius; o += radius / 8) {
|
||||
float color = 1f - (o * 8.333f);
|
||||
if (color < 0)
|
||||
color = 0;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0);
|
||||
tessellator.addVertex(0 + o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0);
|
||||
tessellator.addVertex(0 - o, 0 - o, 0 + distance);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0);
|
||||
tessellator.addVertex(0 - o, 0 + o, 0 + distance);
|
||||
tessellator.addVertex(0 + o, 0 + o, 0 + distance);
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/Rainbow.png");
|
||||
}
|
||||
}
|
||||
@ -1,132 +0,0 @@
|
||||
package com.hbm.render.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.model.ModelMultitoolClaw;
|
||||
import com.hbm.render.model.ModelMultitoolFist;
|
||||
import com.hbm.render.model.ModelMultitoolOpen;
|
||||
import com.hbm.render.model.ModelMultitoolPointer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderMultitool implements IItemRenderer {
|
||||
|
||||
protected ModelMultitoolOpen open;
|
||||
protected ModelMultitoolClaw claw;
|
||||
protected ModelMultitoolFist fist;
|
||||
protected ModelMultitoolPointer pointer;
|
||||
public RenderPlayer renderPlayer;
|
||||
|
||||
public ItemRenderMultitool() {
|
||||
open = new ModelMultitoolOpen();
|
||||
claw = new ModelMultitoolClaw();
|
||||
fist = new ModelMultitoolFist();
|
||||
pointer = new ModelMultitoolPointer();
|
||||
renderPlayer = new RenderPlayer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch(type) {
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelMultitool.png"));
|
||||
GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(-0.5F, 0.0F, -0.2F);
|
||||
//GL11.glScalef(2.0F, 2.0F, 2.0F);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
//GL11.glTranslatef(-0.4F, -0.1F, 0.1F);
|
||||
GL11.glTranslatef(-0.2F, -0.1F, -0.1F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_dig)
|
||||
claw.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_silk)
|
||||
claw.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_ext)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_miner)
|
||||
pointer.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_hit)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_beam)
|
||||
pointer.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_sky)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_mega)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_joule)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_decon)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
GL11.glScalef(2.0F, 2.0F, 2.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(6 * 0.0625F, -12 * 0.0625F, 0 * 0.0625F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("textures/entity/steve.png"));
|
||||
renderPlayer.modelBipedMain.bipedRightArm.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
case EQUIPPED:
|
||||
case ENTITY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelMultitool.png"));
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
|
||||
GL11.glRotatef(-200.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(75.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-5.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
GL11.glTranslatef(-4 * 0.0625F, 2 * 0.0625F, -9 * 0.0625F);
|
||||
|
||||
if(item != null && item.getItem() == ModItems.multitool_dig)
|
||||
claw.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_silk)
|
||||
claw.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_ext)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_miner)
|
||||
pointer.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_hit)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_beam)
|
||||
pointer.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_sky)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_mega)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_joule)
|
||||
fist.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
if(item != null && item.getItem() == ModItems.multitool_decon)
|
||||
open.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class CompatRecipeRegistry {
|
||||
|
||||
public static void registerCrystallizer(AStack input, ItemStack output, int time, float productivity, FluidStack fluid) {
|
||||
CrystallizerRecipe recipe = new CrystallizerRecipe(output, time).prod(productivity);
|
||||
CrystallizerRecipes.registerRecipe(input instanceof OreDictStack ? ((OreDictStack) input).name : input, recipe, fluid);
|
||||
CrystallizerRecipes.registerRecipe(input, recipe, fluid);
|
||||
}
|
||||
|
||||
/** Fractions always use 100mB of input fluid per operation. None of the outputs can be null. */
|
||||
@ -220,6 +220,14 @@ public class CompatRecipeRegistry {
|
||||
public static void registerExposureChamber(AStack particle, AStack input, ItemStack output) {
|
||||
ExposureChamberRecipes.recipes.add(new ExposureChamberRecipe(particle, input, output));
|
||||
}
|
||||
|
||||
public static void registerFusionReactor(String name, int time, long power, long klystron, long plasma, double neutrons, FluidStack[] inputs, ItemStack outputItem, FluidStack outputFluid) {
|
||||
FusionRecipe recipe = (FusionRecipe) new FusionRecipe(name).setInputEnergy(klystron).setOutputEnergy(klystron).setup(time, power);
|
||||
if(inputs != null) recipe.inputFluids(copyFirst(inputs, 3));
|
||||
if(outputItem != null) recipe.outputItems(outputItem);
|
||||
if(outputFluid != null) recipe.outputFluids(outputFluid);
|
||||
FusionRecipes.INSTANCE.register(recipe);
|
||||
}
|
||||
|
||||
/** Input needs two AStacks, output can take 1-2 ItemStacks. If the same recipe with different
|
||||
* momentum should yield different results, register the lower momentum recipes first. */
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/misc/player.png
Normal file
BIN
src/main/resources/assets/hbm/textures/misc/player.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user