Revert "Entity Localisation and a couple derpfixes"

This reverts commit 62cff77c85.
dev
TheDoctorSoda 2015-10-25 13:56:49 -07:00
parent 62cff77c85
commit ce8eefe3ea
4 changed files with 46 additions and 41 deletions

View File

@ -14,57 +14,71 @@ package steamcraft.common.entities.projectile;
import java.util.List;
import boilerplate.common.baseclasses.BaseThrowableEntity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import boilerplate.common.baseclasses.BaseThrowableEntity;
import steamcraft.common.lib.DamageSourceHandler;
public class EntitySplashLightningBottle extends BaseThrowableEntity {
public EntitySplashLightningBottle(World world, EntityLivingBase entityLiving) {
public class EntitySplashLightningBottle extends BaseThrowableEntity
{
public EntitySplashLightningBottle(World world, EntityLivingBase entityLiving)
{
super(world, entityLiving);
}
public EntitySplashLightningBottle(World world) {
public EntitySplashLightningBottle(World world)
{
super(world);
this.setSize(0.5F, 0.5F);
}
@Override
protected float getGravityVelocity() {
protected float getGravityVelocity()
{
return 0.03F;
}
@SuppressWarnings({ "rawtypes", "unused" })
@Override
protected void onImpact(MovingObjectPosition mop) {
if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
if (!this.worldObj.isRemote) {
protected void onImpact(MovingObjectPosition mop)
{
if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
if (!this.worldObj.isRemote)
{
AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D);
List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
if ((list1 != null) && !list1.isEmpty()) {
for (Object obj : list1) {
if ((list1 != null) && !list1.isEmpty())
{
for (Object obj : list1)
{
EntityLivingBase entitylivingbase = (EntityLivingBase) obj;
double d0 = this.getDistanceSqToEntity(entitylivingbase);
if (d0 < 16.0D) {
if (d0 < 16.0D)
{
double d1 = 1.0D - (Math.sqrt(d0) / 4.0D);
if (entitylivingbase == mop.entityHit) {
if (entitylivingbase == mop.entityHit)
{
d1 = 1.0D;
}
entitylivingbase.attackEntityFrom(DamageSourceHandler.electrocution, 4);
if (entitylivingbase instanceof EntityCreeper) {
if (entitylivingbase instanceof EntityCreeper)
{
EntityCreeper creeper = (EntityCreeper) entitylivingbase;
creeper.getDataWatcher().updateObject(17, Byte.valueOf((byte) (1)));
}
}
}
}
this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 0);
this.setDead();
}

View File

@ -12,9 +12,12 @@
*/
package steamcraft.common.init;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.entity.EnumCreatureType;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraftforge.common.BiomeDictionary;
import steamcraft.common.Steamcraft;
import steamcraft.common.entities.EntityFallingBoulder;
import steamcraft.common.entities.EntityTimeBomb;
@ -39,8 +42,10 @@ import steamcraft.common.entities.projectile.EntitySplashLightningBottle;
* @author Surseance
*
*/
public class InitEntities {
public static void init() {
public class InitEntities
{
public static void init()
{
int entID = 0;
// Mobs
@ -54,15 +59,16 @@ public class InitEntities {
EntityRegistry.registerModEntity(EntitySpiderQueen.class, "SpiderQueen", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.registerModEntity(EntityShroomZombie.class, "ShroomZombie", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.registerModEntity(EntityShroomSkeleton.class, "ShroomSkeleton", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.registerModEntity(EntityAbandonedGolem.class, "AbandonedGolem", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.registerModEntity(EntityAbandonedGolem.class, "AbdandonedGolem", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.registerModEntity(EntityWhale.class, "Whale", entID++, Steamcraft.instance, 64, 1, true);
EntityRegistry.addSpawn(EntityWhale.class, 1, 1, 1, EnumCreatureType.waterCreature, BiomeDictionary.getBiomesForType(BiomeDictionary.Type.OCEAN));
EntityRegistry.addSpawn(EntityWhale.class, 1, 1, 1, EnumCreatureType.waterCreature,
BiomeDictionary.getBiomesForType(BiomeDictionary.Type.OCEAN));
// Non-Living
// Projectile
EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", entID++, Steamcraft.instance, 40, 1, true);
EntityRegistry.registerModEntity(EntityRocket.class, "Rocket", entID++, Steamcraft.instance, 40, 1, true);
EntityRegistry.registerModEntity(EntitySplashLightningBottle.class, "SplashLightningBottle", entID++, Steamcraft.instance, 40, 1, true);
EntityRegistry.registerModEntity(EntityFieldManipulator.class, "FieldManipulator", entID++, Steamcraft.instance, 40, 1, true);
EntityRegistry.registerModEntity(EntityFieldManipulator.class, "SplashLightningBottle", entID++, Steamcraft.instance, 40, 1, true);
// Block
EntityRegistry.registerModEntity(EntityTimeBomb.class, "TimeBomb", entID++, Steamcraft.instance, 40, 1, true);
EntityRegistry.registerModEntity(EntityFallingBoulder.class, "FallingBoulder", entID++, Steamcraft.instance, 40, 1, true);

View File

@ -12,4 +12,3 @@ item.itemNugget.0.name=Aluminium Nugget
item.itemClockworkRocket.2.desc=Armour-Piercing Shell
item.itemSteamcraftcluster.0.name=Native Aluminium Cluster

View File

@ -625,6 +625,13 @@ biome.steamcraft2.innerearth.jungle.name=Dense Jungle
biome.steamcraft2.innerearth.swamp.name=Swampy Forest
biome.steamcraft2.innerearth.scorched.name=Scorched Lands
#Entities
entity.steamcraft2.grub.name=Grub
entity.steamcraft2.lostminer.name=Lost Miner
entity.steamcraft2.ghostspider.name=Ghost Spider
entity.steamcraft2.vampirebat.name=Vampire Bat
entity.steamcraft2.boar.name=Boar
#Keys
key.steamcraft.category=
key.vanity.desc=Open Vanity Inventory
@ -662,24 +669,3 @@ item.itemDrillSteam.documentation=This is a drill that runs on Steam provided by
item.itemSwordSteam.documentation=A powerful sword that runs on Steam Canisters.
item.itemShovelSteam.documentation=A quick shovel that runs on Steam Canisters.
#Entities
entity.steamcraft2.FleshGolem.name=Flesh Golem
entity.steamcraft2.Grub.name=Grub
entity.steamcraft2.LostMiner.name=Lost Miner
entity.steamcraft2.Boar.name=Boar
entity.steamcraft2.VampireBat.name=Vampire Bat
entity.steamcraft2.GhostSpider.name=Ghost Spider
entity.steamcraft2.GiantSpider.name=Giant Spider
entity.steamcraft2.SpiderQueen.name=Spider Queen
entity.steamcraft2.ShroomZombie.name=Zombishroom
entity.steamcraft2.ShroomSkeleton.name=Skeleshroom
entity.steamcraft2.AbandonedGolem.name=Abandoned Golem
entity.steamcraft2.Whale.name=Whale
entity.steamcraft2.Bullet.name=Bullet
entity.steamcraft2.Rocket.name=Rocket
entity.steamcraft2.SplashLightningBottle.name=Lightning Bottle
entity.steamcraft2.FieldManipulator.name=Field Manipulator
entity.steamcraft2.TimeBomb.name=Time Bomb
entity.steamcraft2.FallingBoulder.name=Falling Boulder