Refractored Code

+added Solar Factory
-removed unnessecary solar and essentia generator classes
+started gtnh researches
+added tooltip clearance on solars (maximal output)

Signed-off-by: bartimaeusnek <[email protected]>
This commit is contained in:
bartimaeusnek committed 2019-03-18 18:39:23 +01:00
1 parent 980df8516a
commit 0fecf28b65
397 files changed
+8693 -9288

No files matched your search

+74 -74
View File
@@ -24,95 +24,95 @@ import net.minecraftforge.common.IExtendedEntityProperties;
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
public EntityArcher(World world) {
super(world);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
public EntityArcher(World world) {
super(world);
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
}
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
@Override
public void onDeath(DamageSource damageSource) {
super.onDeath(damageSource);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
this.setDead();
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
@Override
protected Item getDropItem() {
return Items.arrow;
}
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
}
@Override
protected void dropFewItems(boolean hitByPlayer, int levelOfLooting) {
int j;
int k;
@Override
public void onDeath(DamageSource damageSource) {
super.onDeath(damageSource);
j = this.rand.nextInt(3 + levelOfLooting);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
this.setDead();
}
for (k = 0; k < j; ++k) {
this.dropItem(Items.arrow, 1);
}
j = this.rand.nextInt(3 + levelOfLooting);
@Override
protected Item getDropItem() {
return Items.arrow;
}
for (k = 0; k < j; ++k) {
this.dropItem(Items.bone, 1);
}
}
@Override
protected void dropFewItems(boolean hitByPlayer, int levelOfLooting) {
int j;
int k;
@Override
protected void dropRareDrop(int ch) {
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
}
j = this.rand.nextInt(3 + levelOfLooting);
protected void addRandomArmor() {
super.addRandomArmor();
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
}
for (k = 0; k < j; ++k) {
this.dropItem(Items.arrow, 1);
}
j = this.rand.nextInt(3 + levelOfLooting);
@Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
for (k = 0; k < j; ++k) {
this.dropItem(Items.bone, 1);
}
}
if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
}
@Override
protected void dropRareDrop(int ch) {
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
}
if (punchLevel > 0) {
entityarrow.setKnockbackStrength(punchLevel);
}
protected void addRandomArmor() {
super.addRandomArmor();
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
entityarrow.setFire(100);
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
this.worldObj.spawnEntityInWorld(entityarrow);
}
if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
}
@Override
public void saveNBTData(NBTTagCompound compound) {
}
if (punchLevel > 0) {
entityarrow.setKnockbackStrength(punchLevel);
}
@Override
public void loadNBTData(NBTTagCompound compound) {
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
entityarrow.setFire(100);
}
@Override
public void init(Entity entity, World world) {
}
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
this.worldObj.spawnEntityInWorld(entityarrow);
}
@Override
public void saveNBTData(NBTTagCompound compound) {
}
@Override
public void loadNBTData(NBTTagCompound compound) {
}
@Override
public void init(Entity entity, World world) {
}
}