From 575a55e1b37435204ec93709371a3a71464933df Mon Sep 17 00:00:00 2001 From: makeo Date: Sun, 1 Nov 2015 01:58:15 +0100 Subject: [PATCH] Added golem core: bodyguard --- .../makeo/gadomancy/common/CommonProxy.java | 2 + .../common/entities/ai/AIFollowOwner.java | 41 ++++ .../gadomancy/common/entities/ai/AISit.java | 43 ++++ .../ai/AIUncheckedAttackOnCollide.java | 43 ++++ .../entities/ai/AIUncheckedDartAttack.java | 43 ++++ .../entities/golems/cores/BodyguardCore.java | 187 ++++++++++++++++++ .../golems/cores/EntityAITasksWrapper.java | 14 +- .../golems/nbt/ExtendedGolemProperties.java | 46 ++++- .../common/items/ItemGolemCoreBreak.java | 35 +++- .../registration/RegisteredGolemStuff.java | 3 + .../registration/RegisteredPotions.java | 26 +++ src/main/resources/META-INF/gadomancy_at.cfg | 7 +- .../assets/gadomancy/lang/en_US.lang | 1 + 13 files changed, 476 insertions(+), 15 deletions(-) create mode 100644 src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java create mode 100644 src/main/java/makeo/gadomancy/common/entities/ai/AISit.java create mode 100644 src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java create mode 100644 src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java create mode 100644 src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardCore.java create mode 100644 src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java diff --git a/src/main/java/makeo/gadomancy/common/CommonProxy.java b/src/main/java/makeo/gadomancy/common/CommonProxy.java index e8e275c..1b06ddf 100644 --- a/src/main/java/makeo/gadomancy/common/CommonProxy.java +++ b/src/main/java/makeo/gadomancy/common/CommonProxy.java @@ -70,6 +70,8 @@ public class CommonProxy implements IGuiHandler { RegisteredRecipes.init(); ModSubstitutions.init(); + + RegisteredPotions.init(); } public void postInitalize() { diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java new file mode 100644 index 0000000..4aa1f7a --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java @@ -0,0 +1,41 @@ +package makeo.gadomancy.common.entities.ai; + +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.passive.EntityTameable; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 15:55 + */ +public class AIFollowOwner extends EntityAIFollowOwner { + EntityTameable entity; + + public AIFollowOwner(EntityTameable entity, float minDist, float maxDist) { + super(entity, 0, minDist, maxDist); + this.entity = entity; + } + + @Override + public void startExecuting() { + boolean avoidWater = entity.getNavigator().getAvoidsWater(); + super.startExecuting(); + entity.getNavigator().setAvoidsWater(avoidWater); + } + + @Override + public void resetTask() { + boolean avoidWater = entity.getNavigator().getAvoidsWater(); + super.resetTask(); + entity.getNavigator().setAvoidsWater(avoidWater); + } + + @Override + public void updateTask() { + super.field_75336_f = entity.getAIMoveSpeed(); + super.updateTask(); + } +} diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java b/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java new file mode 100644 index 0000000..dc5608a --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java @@ -0,0 +1,43 @@ +package makeo.gadomancy.common.entities.ai; + +import makeo.gadomancy.common.Gadomancy; +import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; +import net.minecraft.entity.ai.EntityAIBase; +import thaumcraft.common.entities.golems.EntityGolemBase; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 20:15 + */ +public class AISit extends EntityAIBase { + private EntityGolemBase golem; + private ExtendedGolemProperties properties; + + public AISit(EntityGolemBase golem) { + this.golem = golem; + this.properties = (ExtendedGolemProperties) golem.getExtendedProperties(Gadomancy.MODID); + setMutexBits(7); + } + + @Override + public boolean shouldExecute() { + return properties.isSitting(); + } + + @Override + public void startExecuting() { + golem.getNavigator().clearPathEntity(); + } + + @Override + public boolean continueExecuting() { + golem.setTarget(null); + + golem.getLookHelper().setLookPosition(0, 0, 0, 0, -45); + return properties.isSitting(); + } +} diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java new file mode 100644 index 0000000..ba35e3c --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java @@ -0,0 +1,43 @@ +package makeo.gadomancy.common.entities.ai; + +import makeo.gadomancy.common.utils.Injector; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.pathfinding.PathEntity; +import thaumcraft.common.entities.ai.combat.AIGolemAttackOnCollide; +import thaumcraft.common.entities.golems.EntityGolemBase; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 19:11 + */ +public class AIUncheckedAttackOnCollide extends AIGolemAttackOnCollide { + private static final Injector INJECTOR = new Injector(AIGolemAttackOnCollide.class); + private EntityGolemBase golem; + + public AIUncheckedAttackOnCollide(EntityGolemBase golem) { + super(golem); + this.golem = golem; + } + + @Override + public boolean shouldExecute() { + EntityLivingBase target = golem.getAttackTarget(); + if (target == null) { + return false; + } + + PathEntity pathEntity = golem.getNavigator().getPathToEntityLiving(target); + if(pathEntity != null) { + INJECTOR.setObject(this); + INJECTOR.setField("entityPathEntity", pathEntity); + INJECTOR.setField("entityTarget", target); + return true; + } + + return false; + } +} diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java new file mode 100644 index 0000000..bf7b237 --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java @@ -0,0 +1,43 @@ +package makeo.gadomancy.common.entities.ai; + +import makeo.gadomancy.common.utils.Injector; +import net.minecraft.entity.EntityLivingBase; +import thaumcraft.common.entities.ai.combat.AIDartAttack; +import thaumcraft.common.entities.golems.EntityGolemBase; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 20:03 + */ +public class AIUncheckedDartAttack extends AIDartAttack { + private static final Injector INJECTOR = new Injector(AIDartAttack.class); + private EntityGolemBase golem; + + public AIUncheckedDartAttack(EntityGolemBase golem) { + super(golem); + this.golem = golem; + } + + @Override + public boolean shouldExecute() { + EntityLivingBase target = golem.getAttackTarget(); + if (target == null) { + return false; + } + + double ra = golem.getDistanceSq(target.posX, target.boundingBox.minY, target.posZ); + if (ra < 9.0D) { + return false; + } + + INJECTOR.setObject(this); + INJECTOR.setField("attackTarget", target); + + return true; + + } +} diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardCore.java b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardCore.java new file mode 100644 index 0000000..b4ad93a --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardCore.java @@ -0,0 +1,187 @@ +package makeo.gadomancy.common.entities.golems.cores; + +import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; +import makeo.gadomancy.common.Gadomancy; +import makeo.gadomancy.common.entities.ai.AIFollowOwner; +import makeo.gadomancy.common.entities.ai.AISit; +import makeo.gadomancy.common.entities.ai.AIUncheckedAttackOnCollide; +import makeo.gadomancy.common.entities.ai.AIUncheckedDartAttack; +import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; +import makeo.gadomancy.common.registration.RegisteredItems; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathNavigate; +import thaumcraft.common.entities.ai.combat.AIDartAttack; +import thaumcraft.common.entities.ai.misc.AIOpenDoor; +import thaumcraft.common.entities.golems.EntityGolemBase; + +import java.util.Random; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 15:35 + */ +public class BodyguardCore extends AdditionalGolemCore { + @Override + public void setupGolem(EntityGolemBase golem) { + WrappedGolem wrapped = new WrappedGolem(golem); + + golem.setHomeArea(0, 300000000, 0, 300000000); + + golem.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(wrapped)); + golem.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(wrapped)); + golem.targetTasks.addTask(3, new EntityAIHurtByTarget(golem, true)); + + golem.tasks.addTask(1, new AISit(golem)); + + if (golem.decoration.contains("R")) { + golem.tasks.addTask(2, new AIUncheckedDartAttack(golem)); + } + golem.tasks.addTask(3, new AIUncheckedAttackOnCollide(golem)); + golem.tasks.addTask(4, new AIFollowOwner(wrapped, 5, 2)); + + golem.tasks.addTask(5, new AIOpenDoor(golem, true)); + golem.tasks.addTask(7, new EntityAIWatchClosest(golem, EntityPlayer.class, 6.0F)); + golem.tasks.addTask(8, new EntityAILookIdle(golem)); + } + + private static class WrappedGolem extends EntityTameable { + private EntityGolemBase golem; + + public WrappedGolem(EntityGolemBase golem) { + super(golem.worldObj); + + this.golem = golem; + } + + @Override + public boolean isWithinHomeDistance(int p_110176_1_, int p_110176_2_, int p_110176_3_) { + return true; + } + + @Override + public float getAIMoveSpeed() { + return golem.getAIMoveSpeed(); + } + + @Override + public Random getRNG() { + return golem.getRNG(); + } + + @Override + public EntityLivingBase getAttackTarget() { + return golem.getAttackTarget(); + } + + @Override + public boolean canAttackClass(Class p_70686_1_) { + return golem.canAttackClass(p_70686_1_); + } + + @Override + public EntitySenses getEntitySenses() { + return golem.getEntitySenses(); + } + + @Override + public IAttributeInstance getEntityAttribute(IAttribute p_110148_1_) { + if(golem != null) { + return golem.getEntityAttribute(p_110148_1_); + } + return super.getEntityAttribute(p_110148_1_); + } + + @Override + public void setAttackTarget(EntityLivingBase p_70624_1_) { + golem.setAttackTarget(p_70624_1_); + } + + @Override + public boolean isTamed() { + return true; + } + + @Override + public PathNavigate getNavigator() { + return golem.getNavigator(); + } + + @Override + public EntityAgeable createChild(EntityAgeable entity) { + return null; + } + + @Override + public EntityLivingBase getOwner() { + return golem.getOwner(); + } + + @Override + public EntityLookHelper getLookHelper() { + return golem.getLookHelper(); + } + + @Override + public double getDistanceSqToEntity(Entity entity) { + return golem.getDistanceSqToEntity(entity); + } + + @Override + public boolean getLeashed() { + return golem.getLeashed(); + } + + @Override + public int getVerticalFaceSpeed() { + return golem.getVerticalFaceSpeed(); + } + + @Override + public void setLocationAndAngles(double x, double y, double z, float rotationYaw, float rotationPitch) { + rotationYaw = golem.rotationYaw; + rotationPitch = golem.rotationPitch; + golem.setLocationAndAngles(x, y, z, rotationYaw, rotationPitch); + this.worldObj.playSoundEffect(x, y, z, "mob.endermen.portal", 0.5F, 1.0F); + } + } + + @Override + public boolean hasGui() { + return true; + } + + @Override + public boolean openGui(EntityPlayer player, EntityGolemBase golem) { + ExtendedGolemProperties props = (ExtendedGolemProperties) golem.getExtendedProperties(Gadomancy.MODID); + props.setSitting(!props.isSitting()); + + return true; + } + + @Override + public byte getBaseCore() { + return 4; + } + + @Override + public String getUnlocalizedName() { + return "gadomancy.golem.bodyguardcore"; + } + + @Override + public ItemStack getItem() { + return new ItemStack(RegisteredItems.itemGolemCoreBreak, 1, 1); + } +} diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java b/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java index 2f1d62a..e74aeea 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java @@ -1,6 +1,8 @@ package makeo.gadomancy.common.entities.golems.cores; import makeo.gadomancy.api.GadomancyApi; +import makeo.gadomancy.common.Gadomancy; +import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAITasks; import thaumcraft.common.entities.golems.EntityGolemBase; @@ -21,14 +23,18 @@ public class EntityAITasksWrapper extends EntityAITasks { private final EntityAITasks original; private boolean locked = true; - public EntityAITasksWrapper(EntityGolemBase golem) { - super(golem.targetTasks.theProfiler); + private boolean scheduleUpdate; + + public EntityAITasksWrapper(EntityGolemBase golem, EntityAITasks tasks, boolean scheduleUpdate) { + super(tasks.theProfiler); this.golem = golem; - this.original = golem.targetTasks; + this.original = tasks; this.taskEntries = new WrapperList(original.taskEntries); this.original.taskEntries = this.taskEntries; + + this.scheduleUpdate = scheduleUpdate; } private class WrapperList extends ArrayList { @@ -40,6 +46,8 @@ public class EntityAITasksWrapper extends EntityAITasks { public void clear() { if(!isLocked()) { super.clear(); + } else if(scheduleUpdate) { + ((ExtendedGolemProperties)golem.getExtendedProperties(Gadomancy.MODID)).updateGolem(); } } } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java index 6598b07..960bf3c 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java @@ -30,7 +30,10 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { private boolean updateHealth = false; private float health; - private EntityAITasksWrapper wrapper = null; + private boolean isSitting = false; + + private EntityAITasksWrapper taskWrapper = null; + private EntityAITasksWrapper targetWrapper = null; public ExtendedGolemProperties(EntityGolemBase golem) { this.golem = golem; @@ -48,6 +51,14 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { return health; } + public boolean isSitting() { + return isSitting; + } + + public void setSitting(boolean isSitting) { + this.isSitting = isSitting; + } + @Override public void saveNBTData(NBTTagCompound compound) { AdditionalGolemType type = GadomancyApi.getAdditionalGolemType(golem.getGolemType()); @@ -63,6 +74,8 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { writeAdvancedGolemType(entityData, type); golem.ridingEntity = new OverrideRidingEntity(golem, compound, golem.ridingEntity); } + + compound.setBoolean(Gadomancy.MODID + ":sitting", isSitting); } private static void writeAdvancedGolemType(NBTTagCompound base, AdditionalGolemType type) { @@ -89,6 +102,8 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { } } + isSitting = compound.getBoolean(Gadomancy.MODID + ":sitting"); + updateGolemCore(); } @@ -109,27 +124,42 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { } public void setWrapperIfNeeded() { - if(wrapper == null) { - wrapper = new EntityAITasksWrapper(golem); - golem.tasks = wrapper; + boolean needsUpdate = false; + if(taskWrapper == null) { + taskWrapper = new EntityAITasksWrapper(golem, golem.tasks, true); + golem.tasks = taskWrapper; + needsUpdate = true; + } + + if(targetWrapper == null) { + targetWrapper = new EntityAITasksWrapper(golem, golem.targetTasks, false); + golem.targetTasks = targetWrapper; + + needsUpdate = true; + } + + if(needsUpdate) { updateGolem(); } } public void updateGolem() { - wrapper.unlock(); + taskWrapper.unlock(); + targetWrapper.unlock(); + golem.setupGolem(); golem.setupGolemInventory(); AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(golem); if(core != null) { - wrapper.taskEntries.clear(); - golem.targetTasks.taskEntries.clear(); + taskWrapper.taskEntries.clear(); + targetWrapper.taskEntries.clear(); core.setupGolem(golem); - wrapper.lock(); + taskWrapper.lock(); + targetWrapper.lock(); } } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java b/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java index 3a63a3b..f5b41fe 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java @@ -2,10 +2,13 @@ package makeo.gadomancy.common.items; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import java.util.List; @@ -23,9 +26,30 @@ public class ItemGolemCoreBreak extends Item { setCreativeTab(RegisteredItems.creativeTab); } + private IIcon breakIcon; + private IIcon bodyguardIcon; + @Override - protected String getIconString() { - return Gadomancy.MODID + ":golem_core_break"; + public void registerIcons(IIconRegister ir) { + breakIcon = ir.registerIcon(Gadomancy.MODID + ":golem_core_break"); + bodyguardIcon = ir.registerIcon("thaumcraft:golem_core_bodyguard"); + } + + @Override + public IIcon getIconFromDamage(int damage) { + if(damage == 0) { + return breakIcon; + } else if(damage == 1) { + return bodyguardIcon; + } + + return super.getIconFromDamage(damage); + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); } @Override @@ -40,7 +64,12 @@ public class ItemGolemCoreBreak extends Item { @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean showAdvanced) { - list.add(StatCollector.translateToLocal("gadomancy.golem.breakcore")); + int damage = stack.getItemDamage(); + if(damage == 0) { + list.add(StatCollector.translateToLocal("gadomancy.golem.breakcore")); + } else if(damage == 1) { + list.add(StatCollector.translateToLocal("gadomancy.golem.bodyguardcore")); + } } @Override diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java index 9ba6de4..713b77d 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java @@ -4,6 +4,7 @@ import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; +import makeo.gadomancy.common.entities.golems.cores.BodyguardCore; import makeo.gadomancy.common.entities.golems.cores.BreakGolemCore; import makeo.gadomancy.common.entities.golems.types.SilverwoodGolemType; import makeo.gadomancy.common.entities.golems.upgrades.GolemUpgrade; @@ -29,11 +30,13 @@ public class RegisteredGolemStuff { public static SilverwoodGolemType typeSilverwood; public static AdditionalGolemCore breakCore; + public static AdditionalGolemCore bodyguardCore; public static void init() { typeSilverwood = registerGolemType("SILVERWOOD", new SilverwoodGolemType()); breakCore = registerGolemCore("breakCore", new BreakGolemCore()); + bodyguardCore = registerGolemCore("bodyguardCore", new BodyguardCore()); upgradeRunicShield = registerGolemUpgrade(new GolemUpgradeRunicShield()); } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java new file mode 100644 index 0000000..844114e --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java @@ -0,0 +1,26 @@ +package makeo.gadomancy.common.registration; + +import makeo.gadomancy.common.utils.Injector; +import net.minecraft.potion.Potion; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by makeo @ 31.10.2015 23:09 + */ +public class RegisteredPotions { + public static void init() { + } + + private static T registerPotion(Class potionClass) { + int id = Potion.potionTypes.length; + Potion[] potions = new Potion[Potion.potionTypes.length + 1]; + System.arraycopy(Potion.potionTypes, 0, potions, 0, Potion.potionTypes.length); + Potion.potionTypes = potions; + + return new Injector(potionClass).invokeConstructor(int.class, id); + } +} diff --git a/src/main/resources/META-INF/gadomancy_at.cfg b/src/main/resources/META-INF/gadomancy_at.cfg index 5b68fd4..2cb646c 100644 --- a/src/main/resources/META-INF/gadomancy_at.cfg +++ b/src/main/resources/META-INF/gadomancy_at.cfg @@ -6,10 +6,15 @@ public net.minecraft.server.management.ItemInWorldManager field_73087_g #partial public net.minecraft.server.management.ItemInWorldManager field_73099_h #partiallyDestroyedBlockZ public net.minecraft.entity.ai.EntityAITasks field_75781_c #theProfiler public-f net.minecraft.entity.EntityLiving field_70714_bg #tasks +public-f net.minecraft.entity.EntityLiving field_70715_bh #targetTasks public net.minecraft.entity.Entity field_70152_a #nextEntityID public net.minecraft.client.renderer.entity.RendererLivingEntity field_77045_g #mainModel public-f net.minecraft.item.ItemBlock field_150939_a #field_150939_a public net.minecraft.util.RegistryNamespaced field_148759_a #underlyingIntegerMap public net.minecraft.util.ObjectIntIdentityMap field_148749_a #field_148749_a public net.minecraft.util.ObjectIntIdentityMap field_148748_b #field_148748_b -public net.minecraft.util.RegistryNamespaced field_148758_b #field_148758_b \ No newline at end of file +public net.minecraft.util.RegistryNamespaced field_148758_b #field_148758_b +public net.minecraft.entity.ai.EntityAIFollowOwner field_75336_f #field_75336_f +public net.minecraft.entity.ai.EntityLookHelper * +public net.minecraft.entity.EntityLiving field_70749_g #lookHelper +public-f net.minecraft.potion.Potion field_76425_a #potionTypes \ No newline at end of file diff --git a/src/main/resources/assets/gadomancy/lang/en_US.lang b/src/main/resources/assets/gadomancy/lang/en_US.lang index c5ce1ad..108ae0f 100644 --- a/src/main/resources/assets/gadomancy/lang/en_US.lang +++ b/src/main/resources/assets/gadomancy/lang/en_US.lang @@ -64,6 +64,7 @@ gadomancy.research_page.GROWING_GROWTHCLUE.2=In contrast to that it seems that i gadomancy.golemblurb.default=?? gadomancy.golemblurb.breakcore=Master, should I break everything, or something specific? gadomancy.golem.breakcore=Break +gadomancy.golem.bodyguardcore=Bodyguard gadomancy.upgrades.runicshield=Runic Shield