this doesn't compile yet, but have something to peek at

This commit is contained in:
Nicholas Ignoffo 2017-08-14 20:53:42 -07:00
parent 973f1019a5
commit 5fcdd978d7
329 changed files with 3247 additions and 2953 deletions

View file

@ -6,7 +6,6 @@ import java.util.Random;
import javax.annotation.Nullable;
import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
@ -53,7 +52,6 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
*/
private int sheepTimer;
@Getter
private int castTimer = 0;
private EntityAIEatAndCorruptBlock entityAIEatGrass;
private EntityAIProtectAlly entityAIProtectAlly;
@ -66,7 +64,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
public static float[] getDyeRgb(EnumDyeColor dyeColor)
{
return (float[]) DYE_TO_RGB.get(dyeColor);
return DYE_TO_RGB.get(dyeColor);
}
public EntityCorruptedSheep(World world)
@ -289,7 +287,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
*/
public EnumDyeColor getFleeceColor()
{
return EnumDyeColor.byMetadata(((Byte) this.dataManager.get(DYE_COLOR)).byteValue() & 15);
return EnumDyeColor.byMetadata(this.dataManager.get(DYE_COLOR).byteValue() & 15);
}
/**
@ -297,7 +295,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
*/
public void setFleeceColor(EnumDyeColor color)
{
byte b0 = ((Byte) this.dataManager.get(DYE_COLOR)).byteValue();
byte b0 = this.dataManager.get(DYE_COLOR).byteValue();
this.dataManager.set(DYE_COLOR, Byte.valueOf((byte) (b0 & 240 | color.getMetadata() & 15)));
}
@ -306,7 +304,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
*/
public boolean getSheared()
{
return (((Byte) this.dataManager.get(DYE_COLOR)).byteValue() & 16) != 0;
return (this.dataManager.get(DYE_COLOR).byteValue() & 16) != 0;
}
/**
@ -314,7 +312,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
*/
public void setSheared(boolean sheared)
{
byte b0 = ((Byte) this.dataManager.get(DYE_COLOR)).byteValue();
byte b0 = this.dataManager.get(DYE_COLOR).byteValue();
if (sheared)
{
@ -408,4 +406,8 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
this.playSound(SoundEvents.ENTITY_SHEEP_SHEAR, 1.0F, 1.0F);
return ret;
}
public int getCastTimer() {
return castTimer;
}
}

View file

@ -207,9 +207,9 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
public boolean shouldContinueExecuting()
{
float f = this.attacker.getBrightness(1.0F);
float f = this.attacker.getBrightness();
if (f >= 0.5F && this.attacker.getRNG().nextInt(100) == 0)
{
@ -217,7 +217,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
return false;
} else
{
return super.continueExecuting();
return super.shouldContinueExecuting();
}
}
@ -239,7 +239,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
*/
public boolean shouldExecute()
{
float f = this.taskOwner.getBrightness(1.0F);
float f = this.taskOwner.getBrightness();
return !(f >= 0.5F) && super.shouldExecute();
}
}

View file

@ -50,10 +50,10 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
this.tasks.addTask(8, new EntityAILookIdle(this));
this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] { EntityPigZombie.class }));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityVillager>(this, EntityVillager.class, false));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>(this, EntityIronGolem.class, true));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, EntityPigZombie.class));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityVillager.class, false));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityIronGolem.class, true));
this.setCombatTask();
// this.targetTasks.addTask(8, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, true, false, new TargetPredicate(this)));

View file

@ -37,6 +37,8 @@ import net.minecraft.world.WorldServer;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import javax.annotation.Nullable;
public class EntityDemonBase extends EntityCreature implements IEntityOwnable
{
protected static final DataParameter<Byte> TAMED = EntityDataManager.createKey(EntityDemonBase.class, DataSerializers.BYTE);
@ -286,7 +288,12 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
return SoundEvents.ENTITY_COW_AMBIENT;
}
@Nullable
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
return getHurtSound();
}
protected SoundEvent getHurtSound()
{
return SoundEvents.ENTITY_COW_HURT;

View file

@ -35,7 +35,7 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import WayofTime.bloodmagic.block.BlockMimic;
import WayofTime.bloodmagic.entity.ai.EntityAIMimicReform;
import WayofTime.bloodmagic.registry.ModBlocks;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.tile.TileMimic;
public class EntityMimic extends EntityDemonBase
@ -110,7 +110,7 @@ public class EntityMimic extends EntityDemonBase
{
if (world.isAirBlock(pos))
{
IBlockState mimicState = ModBlocks.MIMIC.getStateFromMeta(BlockMimic.sentientMimicMeta);
IBlockState mimicState = RegistrarBloodMagicBlocks.MIMIC.getStateFromMeta(BlockMimic.sentientMimicMeta);
world.setBlockState(pos, mimicState, 3);
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileMimic)
@ -367,15 +367,6 @@ public class EntityMimic extends EntityDemonBase
super(spider, 1.0D, true);
}
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
@Override
public boolean continueExecuting()
{
return super.continueExecuting();
}
@Override
protected double getAttackReachSqr(EntityLivingBase attackTarget)
{
@ -389,13 +380,5 @@ public class EntityMimic extends EntityDemonBase
{
super(spider, classTarget, true);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
return super.shouldExecute();
}
}
}

View file

@ -4,10 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
@ -54,16 +50,11 @@ import WayofTime.bloodmagic.entity.ai.EntityAIOwnerHurtByTarget;
import WayofTime.bloodmagic.entity.ai.EntityAIOwnerHurtTarget;
import WayofTime.bloodmagic.entity.ai.EntityAIRetreatToHeal;
import WayofTime.bloodmagic.item.soul.ItemSentientBow;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
public class EntitySentientSpecter extends EntityDemonBase
{
@Getter
@Setter
protected EnumDemonWillType type = EnumDemonWillType.DESTRUCTIVE;
@Getter
@Setter
protected boolean wasGivenSentientArmour = false;
private final EntityAIAttackRangedBow aiArrowAttack = new EntityAIAttackRangedBow(this, 1.0D, 20, 15.0F);
@ -355,7 +346,7 @@ public class EntitySentientSpecter extends EntityDemonBase
if (wasGivenSentientArmour)
{
this.entityDropItem(new ItemStack(ModItems.SENTIENT_ARMOUR_GEM), 0);
this.entityDropItem(new ItemStack(RegistrarBloodMagicItems.SENTIENT_ARMOUR_GEM), 0);
}
this.setDead();
@ -479,7 +470,7 @@ public class EntitySentientSpecter extends EntityDemonBase
public void attackEntityWithRangedAttack(EntityLivingBase target, float velocity)
{
ItemStack heldStack = this.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND);
if (!heldStack.isEmpty() && heldStack.getItem() == ModItems.SENTIENT_BOW)
if (!heldStack.isEmpty() && heldStack.getItem() == RegistrarBloodMagicItems.SENTIENT_BOW)
{
EntityTippedArrow arrowEntity = ((ItemSentientBow) heldStack.getItem()).getArrowEntity(getEntityWorld(), heldStack, target, this, velocity);
if (arrowEntity != null)
@ -565,4 +556,20 @@ public class EntitySentientSpecter extends EntityDemonBase
{
return 0.4F;
}
public EnumDemonWillType getType() {
return type;
}
public void setType(EnumDemonWillType type) {
this.type = type;
}
public boolean isWasGivenSentientArmour() {
return wasGivenSentientArmour;
}
public void setWasGivenSentientArmour(boolean wasGivenSentientArmour) {
this.wasGivenSentientArmour = wasGivenSentientArmour;
}
}