Working on chaos guardian

This commit is contained in:
brandon3055 committed 2015-08-24 15:01:45 +10:00
1 parent 8158152a66
commit 4e8c2f3673
24 files changed
+1033 -57

No files matched your search

+8 -1
View File
@@ -1,3 +1,10 @@
######## 1.0.2-Snapshot 4 ########
-crystal binder now only rotates blocks when set to the mode change function.
-added config option to switch back to the old 2D armor model.
######## 1.0.2-Snapshot 3 ########
-fixed server crash
######## 1.0.2-Snapshot 2 ########
-fixed energy core crash when placed.
@@ -17,7 +24,7 @@
-fixed game freezing for a few seconds on startup.
-energy core now stores its energy value as a long (fixes potential issues)
-added draconium and awakened draconium blocks to the ore dictionary.
-made some adjustments to the armor.
-added new armor model by @Skele_P.
-implemented ore dictionary in recipes.
-added Flow Gates.
-added Draconic Reactor (WIP)
+1 -1
View File
@@ -1,3 +1,3 @@
Version:1.0.2
Snapshot:2
Snapshot:3
ReleaseNote:The start of the 1.0.2 snapshots!
+1 -1
View File
@@ -1,3 +1,3 @@
Version:1.0.2
Snapshot:2
Snapshot:3
ReleaseNote:The start of the 1.0.2 snapshots!
+1 -1
View File
@@ -1,5 +1,5 @@
minecraft_version=1.7.10
mod_version=1.0.2-Snapshot_2
mod_version=1.0.2-Snapshot_3
forge_version=10.13.3.1403-1.7.10
CCLIB_version=1.1.1.99
NEI_version=1.0.3.74
@@ -10,6 +10,7 @@ import com.brandon3055.draconicevolution.client.keybinding.KeyInputHandler;
import com.brandon3055.draconicevolution.client.render.block.*;
import com.brandon3055.draconicevolution.client.render.entity.RenderDragon;
import com.brandon3055.draconicevolution.client.render.entity.RenderDragonHeart;
import com.brandon3055.draconicevolution.client.render.entity.RenderDragonProjectile;
import com.brandon3055.draconicevolution.client.render.item.RenderArmor;
import com.brandon3055.draconicevolution.client.render.item.RenderBow;
import com.brandon3055.draconicevolution.client.render.item.RenderMobSoul;
@@ -21,8 +22,10 @@ import com.brandon3055.draconicevolution.common.CommonProxy;
import com.brandon3055.draconicevolution.common.ModBlocks;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.draconicevolution.common.blocks.multiblock.IIsSlave;
import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.*;
@@ -140,14 +143,17 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
MinecraftForgeClient.registerItemRenderer(ModItems.mobSoul, new RenderMobSoul());
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernHelm, new RenderArmor(ModItems.wyvernHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernChest, new RenderArmor(ModItems.wyvernChest));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernLeggs, new RenderArmor(ModItems.wyvernLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBoots, new RenderArmor(ModItems.wyvernBoots));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHelm, new RenderArmor(ModItems.draconicHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicChest, new RenderArmor(ModItems.draconicChest));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicLeggs, new RenderArmor(ModItems.draconicLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBoots, new RenderArmor(ModItems.draconicBoots));
if (!ConfigHandler.useOldArmorModel)
{
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernHelm, new RenderArmor(ModItems.wyvernHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernChest, new RenderArmor(ModItems.wyvernChest));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernLeggs, new RenderArmor(ModItems.wyvernLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBoots, new RenderArmor(ModItems.wyvernBoots));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHelm, new RenderArmor(ModItems.draconicHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicChest, new RenderArmor(ModItems.draconicChest));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicLeggs, new RenderArmor(ModItems.draconicLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBoots, new RenderArmor(ModItems.draconicBoots));
}
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
@@ -181,7 +187,9 @@ public class ClientProxy extends CommonProxy {
//Entitys
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityChaosGuardian.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
RenderingRegistry.registerEntityRenderingHandler(EntityDragonProjectile.class, new RenderDragonProjectile());
}
public void registerRenderIDs (){
@@ -100,6 +100,7 @@ public class ModelDraconicArmor extends ModelBiped {
public ModelRenderer WyHelmPieceTop3;
public ModelRenderer WyHelmPieceTop4;
public ModelRenderer WyMainChestPieceMid;
public ModelRenderer WyMainChestPieceTop;
public ModelRenderer WyChestPieceTop1;
public ModelRenderer WyChestPieceTop2;
public ModelRenderer WyChestDecorationPiece3;
@@ -257,6 +258,11 @@ public class ModelDraconicArmor extends ModelBiped {
this.WyChestPieceTop3.addBox(1.0F, 0.0F, 0.0F, 4, 4, 1, 0.0F);
this.setRotateAngle(WyChestPieceTop3, 0.0879645943005142F, 0.08621926504851989F, -0.7890633548266364F);
this.WyMainChestPieceTop = new ModelRenderer(this, 250, 0);
this.WyMainChestPieceTop.setRotationPoint(-5.7F, 0.0F, -2.6F);
this.WyMainChestPieceTop.addBox(1.0F, 0.0F, 0.0F, 2, 4, 1, 0.0F);
this.setRotateAngle(WyMainChestPieceTop, 0.0F, 0.47123889803846897F, 0.0F);
this.MainChestPieceBottom = new ModelRenderer(this, 228, 27);
this.MainChestPieceBottom.setRotationPoint(-4.5F, 7.0F, -2.5F);
this.MainChestPieceBottom.addBox(0.0F, 0.0F, 0.0F, 9, 5, 5, 0.0F);
@@ -617,6 +623,7 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedBody.addChild(this.WyChestPieceTop1);
this.bipedBody.addChild(this.WyChestPieceTop3);
this.bipedBody.addChild(this.WyChestDecorationPiece3);
this.bipedBody.addChild(this.WyMainChestPieceTop);
}
this.bipedLeftArm.addChild(this.ShoulderPadLeft1);
@@ -633,7 +640,7 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedLeftLeg.cubeList.clear();
this.bipedRightLeg.cubeList.clear();
if (isLeggings){
//this.bipedBody.addChild(this.LeggsTop);
this.bipedBody.addChild(this.LeggsTop);
this.bipedLeftLeg.addChild(this.LegPieceLeft1);
this.bipedLeftLeg.addChild(this.MainKneePadLeft);
@@ -678,11 +685,11 @@ public class ModelDraconicArmor extends ModelBiped {
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.bipedRightLeg.render(f5);
this.bipedBody.render(f5);
this.bipedBody.render(f5*1.05F);// * 1.1F);
this.bipedLeftArm.render(f5);
this.bipedRightArm.render(f5);
this.bipedLeftLeg.render(f5);
this.bipedHead.render(f5);
this.bipedHead.render(f5*1.05F);
}
/**
@@ -1,6 +1,6 @@
package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -13,6 +13,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@@ -40,7 +41,7 @@ public class RenderDragon extends RenderLiving
this.setRenderPassModel(this.mainModel);
}
protected void rotateCorpse(EntityCustomDragon p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_)
protected void rotateCorpse(EntityDragon p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_)
{
float f3 = (float)p_77043_1_.getMovementOffsets(7, p_77043_4_)[0];
float f4 = (float)(p_77043_1_.getMovementOffsets(5, p_77043_4_)[1] - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]);
@@ -65,7 +66,7 @@ public class RenderDragon extends RenderLiving
/**
* Renders the model in RenderLiving
*/
protected void renderModel(EntityCustomDragon p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
protected void renderModel(EntityDragon p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
if (p_77036_1_.deathTicks > 0)
{
@@ -102,7 +103,7 @@ public class RenderDragon extends RenderLiving
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityCustomDragon p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
public void doRender(EntityDragon p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
BossStatus.setBossStatus(p_76986_1_, false);
super.doRender((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
@@ -153,12 +154,12 @@ public class RenderDragon extends RenderLiving
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityCustomDragon dragon)
protected ResourceLocation getEntityTexture(EntityDragon dragon)
{
return dragon.getDataWatcher().getWatchableObjectByte(12) == 1 ? enderDragonTextures2 : enderDragonTextures;
return dragon instanceof EntityChaosGuardian ? enderDragonTextures2 : enderDragonTextures;
}
protected void renderEquippedItems(EntityCustomDragon p_77029_1_, float p_77029_2_)
protected void renderEquippedItems(EntityDragon p_77029_1_, float p_77029_2_)
{
super.renderEquippedItems(p_77029_1_, p_77029_2_);
Tessellator tessellator = Tessellator.instance;
@@ -221,7 +222,7 @@ public class RenderDragon extends RenderLiving
/**
* Queries whether should renderBackground the specified pass or not.
*/
protected int shouldRenderPass(EntityCustomDragon p_77032_1_, int p_77032_2_, float p_77032_3_)
protected int shouldRenderPass(EntityDragon p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_2_ == 1)
{
@@ -258,7 +259,7 @@ public class RenderDragon extends RenderLiving
*/
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityCustomDragon)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
this.doRender((EntityDragon)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
@@ -266,17 +267,17 @@ public class RenderDragon extends RenderLiving
*/
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
{
return this.shouldRenderPass((EntityCustomDragon) p_77032_1_, p_77032_2_, p_77032_3_);
return this.shouldRenderPass((EntityDragon) p_77032_1_, p_77032_2_, p_77032_3_);
}
protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_)
{
this.renderEquippedItems((EntityCustomDragon) p_77029_1_, p_77029_2_);
this.renderEquippedItems((EntityDragon) p_77029_1_, p_77029_2_);
}
protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_)
{
this.rotateCorpse((EntityCustomDragon) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
this.rotateCorpse((EntityDragon) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
}
/**
@@ -284,7 +285,7 @@ public class RenderDragon extends RenderLiving
*/
protected void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
this.renderModel((EntityCustomDragon) p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
this.renderModel((EntityDragon) p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
}
/**
@@ -295,7 +296,7 @@ public class RenderDragon extends RenderLiving
*/
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityCustomDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
@@ -303,7 +304,7 @@ public class RenderDragon extends RenderLiving
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityCustomDragon)p_110775_1_);
return this.getEntityTexture((EntityDragon)p_110775_1_);
}
/**
@@ -314,7 +315,7 @@ public class RenderDragon extends RenderLiving
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityCustomDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}
@@ -0,0 +1,60 @@
package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
/**
* Created by brandon3055 on 24/8/2015.
*/
public class RenderDragonProjectile extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
GL11.glPushMatrix();
ResourceHandler.bindResource("textures/entity/projectileEnergy.png");
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
float f2 = 2; //Size?
GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
Tessellator tessellator = Tessellator.instance;
float height = (entity.ticksExisted/2) % 8 * 1F / 8F;
float f3 = 0;
float f4 = 1;
float f5 = height;
float f6 = height + (1F / 8F);
float f7 = 1.0F;
float f8 = 0.5F;
float f9 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
tessellator.draw();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return null;
}
}
@@ -1,7 +1,9 @@
package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
@@ -34,8 +36,12 @@ public class RenderArmor implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {
GL11.glPushMatrix();
if (ConfigHandler.useOldArmorModel){
LogHelper.error("You must restart the game for armor model change to effect the armor items!!!");
return;
}
GL11.glPushMatrix();
ResourceHandler.bindResource(armor.getArmorTexture(stack, null, 0, null).replace(References.RESOURCESPREFIX, ""));
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED)
@@ -96,7 +96,7 @@ public class CommonProxy {
CraftingHandler.init();
registerGuiHandeler();
registerWorldGen();
registerEntitys();
registerEntities();
DETab.initialize();
PotionHandler.init();
@@ -179,13 +179,15 @@ public class CommonProxy {
GameRegistry.registerWorldGenerator(new DraconicWorldGenerator(), 0);
}
public void registerEntitys() {
public void registerEntities() {
EntityRegistry.registerModEntity(EntityCustomDragon.class, "EnderDragon", 0, DraconicEvolution.instance, 500, 3, true);
EntityRegistry.registerModEntity(EntityPersistentItem.class, "Persistent Item", 1, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityDraconicArrow.class, "Arrow", 2, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityEnderArrow.class, "Ender Arrow", 3, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 4, DraconicEvolution.instance, 10, 5, false);
EntityRegistry.registerModEntity(EntityDragonHeart.class, "Dragon Heart Item", 5, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityChaosGuardian.class, "ChaosGuardian", 6, DraconicEvolution.instance, 500, 3, true);
EntityRegistry.registerModEntity(EntityDragonProjectile.class, "DragonProjectile", 7, DraconicEvolution.instance, 32, 5, true);
}
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType)
@@ -70,7 +70,6 @@ public class EnergyStorageCore extends BlockDE implements IHudDisplayBlock{
if (!world.isRemote) {
player.addChatComponentMessage(new ChatComponentText("Tier:" + (tile.getTier() + 1)));
String BN = String.valueOf(tile.getEnergyStored());
if (BN.substring(BN.length() - 2).contentEquals(".0")) BN = BN.substring(0, BN.length() - 2);
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("info.de.charge.txt") + ": " + Utills.formatNumber(tile.getEnergyStored()) + " / " + Utills.formatNumber(tile.getMaxEnergyStored()) + " [" + BN + " RF]")); }
return true;
}
@@ -0,0 +1,799 @@
package com.brandon3055.draconicevolution.common.entity;
import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityDragonPart;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import java.util.Iterator;
import java.util.List;
/**
* Created by Brandon on 4/07/2014.
*/
public class EntityChaosGuardian extends EntityDragon {//summon DraconicEvolution.ChaosGuardian
private Entity target;
/**The spawn coordinates of this dragon*/
public int homeX = 0;
public int homeY = 67;
public int homeZ = 0;
public int timer1 = 0;
public int timer2 = 0;
public float circlePosition = 0;
public float circleDirection = 1;
public EnumBehaviour behaviour = EnumBehaviour.ROAMING;
public EntityChaosGuardian(World par1World) {
super(par1World);
}
// public EntityChaosGuardian(World world, double health, float attack){
// this(world);
// this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(health);
// this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(health);
// }//todo set base health
@Override
protected void entityInit() {
super.entityInit();
//this.dataWatcher.addObject(12, (isUber ? (byte)1 : (byte)0));
}
@Override
public boolean isNoDespawnRequired() {
return true;
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200D);
}
@Override
public void onLivingUpdate() {
//Set home position when spawned
if (ticksExisted == 1) {
homeX = (int) posX;
homeY = (int) posY;
homeZ = (int) posZ;
targetX = homeX;
targetZ = homeZ;
}
float f;
float f1;
float moveSpeedMultiplier = behaviour.dragonSpeed;//getCurrentMovementSpeed();
if (this.worldObj.isRemote) {
f = MathHelper.cos(this.animTime * (float) Math.PI * 2.0F);
f1 = MathHelper.cos(this.prevAnimTime * (float) Math.PI * 2.0F);
if (f1 <= -0.3F && f >= -0.3F) {
this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false);
}
}
this.prevAnimTime = this.animTime;
float f2;
if (!worldObj.isRemote) {
updateTarget();
customAIUpdate();
}
if (this.getHealth() <= 0.0F) {
f = (this.rand.nextFloat() - 0.5F) * 8.0F;
f1 = (this.rand.nextFloat() - 0.5F) * 4.0F;
f2 = (this.rand.nextFloat() - 0.5F) * 8.0F;
this.worldObj.spawnParticle("largeexplode", this.posX + (double) f, this.posY + 2.0D + (double) f1, this.posZ + (double) f2, 0.0D, 0.0D, 0.0D);
} else {
this.updateDragonEnderCrystal();
f = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F);
f *= moveSpeedMultiplier;
f *= (float) Math.pow(2.0D, this.motionY);
if (this.slowed) {
this.animTime += f * 0.5F;
} else {
this.animTime += f;
}
this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw);
if (this.ringBufferIndex < 0) {
for (int i = 0; i < this.ringBuffer.length; ++i) {
this.ringBuffer[i][0] = (double) this.rotationYaw;
this.ringBuffer[i][1] = this.posY;
}
}
if (++this.ringBufferIndex == this.ringBuffer.length) {
this.ringBufferIndex = 0;
}
this.ringBuffer[this.ringBufferIndex][0] = (double) this.rotationYaw;
this.ringBuffer[this.ringBufferIndex][1] = this.posY;
double d0;
double d1;
double d2;
double d10;
float f12;
if (this.worldObj.isRemote) {
if (this.newPosRotationIncrements > 0) {
d10 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements;
d0 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements;
d1 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements;
d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw);
this.rotationYaw = (float) ((double) this.rotationYaw + d2 / (double) this.newPosRotationIncrements);
this.rotationPitch = (float) ((double) this.rotationPitch + (this.newRotationPitch - (double) this.rotationPitch) / (double) this.newPosRotationIncrements);
--this.newPosRotationIncrements;
this.setPosition(d10, d0, d1);
this.setRotation(this.rotationYaw, this.rotationPitch);
}
} else {
d10 = this.targetX - this.posX;
d0 = this.targetY - this.posY;
d1 = this.targetZ - this.posZ;
d2 = d10 * d10 + d0 * d0 + d1 * d1;
if (this.target != null) {
if (behaviour == EnumBehaviour.CIRCLE_PLAYER){
this.targetX = this.target.posX + (int)(Math.cos(circlePosition) * 60);
this.targetZ = this.target.posZ + (int)(Math.sin(circlePosition) * 60);
moveSpeedMultiplier = 1F + Math.min(((float) Utills.getDistanceAtoB(targetX, targetZ, posX, posZ) / 50) * 3F, 3F);
LogHelper.info((int)(Math.sin(circlePosition) * 60) + " " + (int)(Math.cos(circlePosition) * 60)+" "+moveSpeedMultiplier);
}else {
this.targetX = this.target.posX;
this.targetZ = this.target.posZ;
}
double d3 = this.targetX - this.posX;
double d5 = this.targetZ - this.posZ;
double d7 = Math.sqrt(d3 * d3 + d5 * d5);
double d8 = 0.4000000059604645D + d7 / 80.0D - 1.0D;
if (d8 > 10.0D) {
d8 = 10.0D;
}
this.targetY = this.target.boundingBox.minY + d8 + (behaviour == EnumBehaviour.CIRCLE_PLAYER ? 20 : 0);
} else {
this.targetX += this.rand.nextGaussian() * 2.0D;
this.targetZ += this.rand.nextGaussian() * 2.0D;
}
if (this.forceNewTarget || d2 < 100.0D || d2 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) this.setNewTarget();
d0 /= (double) MathHelper.sqrt_double(d10 * d10 + d1 * d1);
//if (isUber) f12 = 1.0F;//Verticle Motion Speed
//else
f12 = 0.6F;
if (d0 < (double) (-f12)) {
d0 = (double) (-f12);
}
if (d0 > (double) f12) {
d0 = (double) f12;
}
this.motionY += d0 * 0.10000000149011612D;
this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw);
double d4 = 180.0D - Math.atan2(d10, d1) * 180.0D / Math.PI;
double d6 = MathHelper.wrapAngleTo180_double(d4 - (double) this.rotationYaw);
if (d6 > 50.0D) {
d6 = 50.0D;
}
if (d6 < -50.0D) {
d6 = -50.0D;
}
Vec3 vec3 = Vec3.createVectorHelper(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize();
Vec3 vec32 = Vec3.createVectorHelper((double) MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F), this.motionY, (double) (-MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F))).normalize();
float f5 = (float) (vec32.dotProduct(vec3) + 0.5D) / 1.5F;
if (f5 < 0.0F) {
f5 = 0.0F;
}
this.randomYawVelocity *= 0.8F;
float f6 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F;
double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D;
if (d9 > 40.0D) {
d9 = 40.0D;
}
this.randomYawVelocity = (float) ((double) this.randomYawVelocity + d6 * (0.699999988079071D / d9 / (double) f6));
this.rotationYaw += this.randomYawVelocity * 0.1F;
float f7 = (float) (2.0D / (d9 + 1.0D));
float f8 = 0.06F;
this.moveFlying(0.0F, -1.0F, f8 * (f5 * f7 + (1.0F - f7)));
if (this.slowed) {
this.moveEntity(this.motionX * 0.800000011920929D * moveSpeedMultiplier, this.motionY * 0.800000011920929D * moveSpeedMultiplier, this.motionZ * 0.800000011920929D * moveSpeedMultiplier);
}
else {
this.moveEntity(this.motionX * moveSpeedMultiplier, this.motionY * moveSpeedMultiplier, this.motionZ * moveSpeedMultiplier);
}
Vec3 vec31 = Vec3.createVectorHelper(this.motionX, this.motionY, this.motionZ).normalize();
float f9 = (float) (vec31.dotProduct(vec32) + 1.0D) / 2.0F;
f9 = 0.8F + 0.15F * f9;
this.motionX *= (double) f9;
this.motionZ *= (double) f9;
this.motionY *= 0.9100000262260437D;
}
this.renderYawOffset = this.rotationYaw;
this.dragonPartHead.width = this.dragonPartHead.height = 3.0F;
this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F;
this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F;
this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F;
this.dragonPartBody.height = 3.0F;
this.dragonPartBody.width = 5.0F;
this.dragonPartWing1.height = 2.0F;
this.dragonPartWing1.width = 4.0F;
this.dragonPartWing2.height = 3.0F;
this.dragonPartWing2.width = 4.0F;
f1 = (float) (this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F / 180.0F * (float) Math.PI;
f2 = MathHelper.cos(f1);
float f10 = -MathHelper.sin(f1);
float f3 = this.rotationYaw * (float) Math.PI / 180.0F;
float f11 = MathHelper.sin(f3);
float f4 = MathHelper.cos(f3);
this.dragonPartBody.onUpdate();
this.dragonPartBody.setLocationAndAngles(this.posX + (double) (f11 * 0.5F), this.posY, this.posZ - (double) (f4 * 0.5F), 0.0F, 0.0F);
this.dragonPartWing1.onUpdate();
this.dragonPartWing1.setLocationAndAngles(this.posX + (double) (f4 * 4.5F), this.posY + 2.0D, this.posZ + (double) (f11 * 4.5F), 0.0F, 0.0F);
this.dragonPartWing2.onUpdate();
this.dragonPartWing2.setLocationAndAngles(this.posX - (double) (f4 * 4.5F), this.posY + 2.0D, this.posZ - (double) (f11 * 4.5F), 0.0F, 0.0F);
if (!this.worldObj.isRemote && this.hurtTime == 0) {
this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D)));
this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D)));
}
double[] adouble1 = this.getMovementOffsets(5, 1.0F);
double[] adouble = this.getMovementOffsets(0, 1.0F);
f12 = MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
float f13 = MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F - this.randomYawVelocity * 0.01F);
this.dragonPartHead.onUpdate();
this.dragonPartHead.setLocationAndAngles(this.posX + (double) (f12 * 5.5F * f2), this.posY + (adouble[1] - adouble1[1]) * 1.0D + (double) (f10 * 5.5F), this.posZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F);
for (int j = 0; j < 3; ++j) {
EntityDragonPart entitydragonpart = null;
if (j == 0) {
entitydragonpart = this.dragonPartTail1;
}
if (j == 1) {
entitydragonpart = this.dragonPartTail2;
}
if (j == 2) {
entitydragonpart = this.dragonPartTail3;
}
double[] adouble2 = this.getMovementOffsets(12 + j * 2, 1.0F);
float f14 = this.rotationYaw * (float) Math.PI / 180.0F + this.simplifyAngle(adouble2[0] - adouble1[0]) * (float) Math.PI / 180.0F * 1.0F;
float f15 = MathHelper.sin(f14);
float f16 = MathHelper.cos(f14);
float f17 = 1.5F;
float f18 = (float) (j + 1) * 2.0F;
entitydragonpart.onUpdate();
entitydragonpart.setLocationAndAngles(this.posX - (double) ((f11 * f17 + f15 * f18) * f2), this.posY + (adouble2[1] - adouble1[1]) * 1.0D - (double) ((f18 + f17) * f10) + 1.5D, this.posZ + (double) ((f4 * f17 + f16 * f18) * f2), 0.0F, 0.0F);
}
if (!this.worldObj.isRemote) {
this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox);
}
}
}
private void customAIUpdate(){
//LogHelper.info(homeX+" "+homeZ);
switch (behaviour){
case ROAMING:
if (worldObj.getClosestPlayer(homeX, homeY, homeZ, 200) != null) behaviour = EnumBehaviour.CIRCLE_PLAYER;
break;
case GO_HOME:
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) < 70 ) behaviour = EnumBehaviour.ROAMING;
break;
case GUARDING:
break;
case CHARGING:
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300) behaviour = EnumBehaviour.GO_HOME;
break;
case CIRCLE_PLAYER:
circlePosition += (0.02F * circleDirection);
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300) behaviour = EnumBehaviour.GO_HOME;
break;
case AVOID_PLAYERS:
break;
case RETREAT:
break;
case DEAD:
break;
}
}
private void updateTarget(){
switch (behaviour){
case ROAMING:
break;
case GO_HOME:
break;
case GUARDING:
break;
case CHARGING:
break;
case CIRCLE_PLAYER:
break;
case AVOID_PLAYERS:
break;
case RETREAT:
break;
case DEAD:
break;
}
}
private void setNewTarget() {
this.forceNewTarget = false;
switch (behaviour){
case ROAMING:
boolean flag = false;
do {
this.targetX = homeX;
this.targetY = (double) (homeY + this.rand.nextFloat() * 50.0F);
this.targetZ = homeZ;
this.targetX += (double) (this.rand.nextFloat() * 120.0F - 60.0F);
this.targetZ += (double) (this.rand.nextFloat() * 120.0F - 60.0F);
double d0 = this.posX - this.targetX;
double d1 = this.posY - this.targetY;
double d2 = this.posZ - this.targetZ;
flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
} while (!flag);
this.target = null;
break;
case GO_HOME:
case GUARDING:
this.targetX = homeX;
this.targetY = (double) (homeY + this.rand.nextFloat() * 50.0F);
this.targetZ = homeZ;
this.target = null;
break;
case CHARGING:
case CIRCLE_PLAYER:
if (worldObj.getClosestPlayer(homeX, homeY, homeZ, 200) != null) this.target = worldObj.getClosestPlayer(homeX, homeY, homeZ, 200);
break;
case AVOID_PLAYERS:
break;
case RETREAT:
break;
case DEAD:
break;
}
}
private static enum EnumBehaviour {
ROAMING(1F),
GO_HOME(1F),
GUARDING(1F),
CHARGING(1F),
CIRCLE_PLAYER(1.2F),
AVOID_PLAYERS(1F),
RETREAT(1F),
DEAD(1F);
public float dragonSpeed;
private EnumBehaviour(float dragonSpeed) {this.dragonSpeed = dragonSpeed;}
}
@Override
protected void onDeathUpdate() {
// if (deathTicks == 0 && !isUber)
// {
// for (int ix = -150; ix < 150; ix++) {
// for (int iz = -150; iz < 150; iz++) {
// if (worldObj.getBlock(ix, homeY, iz) == Blocks.bedrock && worldObj.getBlock(ix, homeY - 1, iz) == Blocks.bedrock) {
// homeX = ix;
// homeZ = iz;
// createPortal = false;
// break;
// }
// }
// }
// if (ConfigHandler.dragonEggSpawnLocation[0] != 0 || ConfigHandler.dragonEggSpawnLocation[1] != 0 || ConfigHandler.dragonEggSpawnLocation[1] != 0) {
// createPortal = false;
// homeX = ConfigHandler.dragonEggSpawnLocation[0];
// homeY = ConfigHandler.dragonEggSpawnLocation[1];
// homeZ = ConfigHandler.dragonEggSpawnLocation[2];
// }
// }
++this.deathTicks;
if (worldObj.rand.nextInt(5) == 2)
{
EntityLightningBolt bolt = new EntityLightningBolt(worldObj, homeX, homeY + 1, homeZ);
bolt.ignoreFrustumCheck = true;
worldObj.addWeatherEffect(bolt);
}
if (this.deathTicks >= 180 && this.deathTicks <= 200) {
float f = (this.rand.nextFloat() - 0.5F) * 8.0F;
float f1 = (this.rand.nextFloat() - 0.5F) * 4.0F;
float f2 = (this.rand.nextFloat() - 0.5F) * 8.0F;
this.worldObj.spawnParticle("hugeexplosion", this.posX + (double) f, this.posY + 2.0D + (double) f1, this.posZ + (double) f2, 0.0D, 0.0D, 0.0D);
}
int i;
int j;
if (!this.worldObj.isRemote) {
if (this.deathTicks > 150 && this.deathTicks % 5 == 0) {
i = 1000;
while (i > 0) {
j = EntityXPOrb.getXPSplit(i);
i -= j;
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j));
}
}
if (this.deathTicks == 1) {
this.worldObj.playBroadcastSound(1018, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
}
}
this.moveEntity(0.0D, 0.10000000149011612D, 0.0D);
this.renderYawOffset = this.rotationYaw += 20.0F;
if (this.deathTicks == 200 && !this.worldObj.isRemote) {
i = 2000;
while (i > 0) {
j = EntityXPOrb.getXPSplit(i);
i -= j;
this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j));
}
spawnEgg();
setDead();
}
}
private void collideWithEntities(List par1List) {
// if (true) return;
//
// double d0 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D;
// double d1 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D;
// Iterator iterator = par1List.iterator();
//
// while (iterator.hasNext()) {
// Entity entity = (Entity) iterator.next();
//
// if (entity instanceof EntityLivingBase) {
// double d2 = entity.posX - d0;
// double d3 = entity.posZ - d1;
// double d4 = d2 * d2 + d3 * d3;
// if (rand.nextInt(isUber ? 3 : 10) == 0) entity.addVelocity(d2 / d4 * 8.0D, 5.20000000298023224D, d3 / d4 * 8.0D);
// entity.velocityChanged = true;
// ((EntityLivingBase)entity).setLastAttacker(this);
// }
// if (entity instanceof EntityLivingBase && isUber){
// ((EntityLivingBase)entity).setLastAttacker(this);
// entity.attackEntityFrom(new DamageSourceChaos(this), 20F);
// }
// }
}
private void attackEntitiesInList(List par1List) {
// for (int i = 0; i < par1List.size(); ++i) {
// Entity entity = (Entity) par1List.get(i);
//
// if (entity instanceof EntityLivingBase && !isUber) {
// ((EntityLivingBase)entity).setLastAttacker(this);
// entity.attackEntityFrom(DamageSource.causeMobDamage(this), attackDamage);
// }
// if (entity instanceof EntityLivingBase && isUber){
// ((EntityLivingBase)entity).setLastAttacker(this);
// entity.attackEntityFrom(new DamageSourceChaos(this), 50F);
// }
// }
}
private void updateDragonEnderCrystal() {
// if (this.healingEnderCrystal != null) {
// if (this.healingEnderCrystal.isDead) {
// if (!this.worldObj.isRemote) {
// this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion) null), 10.0F);
// }
//
// this.healingEnderCrystal = null;
// } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
// if (isUber) this.setHealth(this.getHealth() + 10.0F);
// else this.setHealth(this.getHealth() + 1.0F);
// }
// }
if (this.rand.nextInt(10) == 0) {
float f = 32.0F;
List list = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.boundingBox.expand((double) f, (double) f, (double) f));
EntityEnderCrystal entityendercrystal = null;
double d0 = Double.MAX_VALUE;
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
EntityEnderCrystal entityendercrystal1 = (EntityEnderCrystal) iterator.next();
double d1 = entityendercrystal1.getDistanceSqToEntity(this);
if (d1 < d0) {
d0 = d1;
entityendercrystal = entityendercrystal1;
}
}
this.healingEnderCrystal = entityendercrystal;
}
}
private float simplifyAngle(double par1) {
return (float) MathHelper.wrapAngleTo180_double(par1);
}
private boolean destroyBlocksInAABB(AxisAlignedBB par1AxisAlignedBB) {
if (!ConfigHandler.dragonBreaksBlocks) return false;
int i = MathHelper.floor_double(par1AxisAlignedBB.minX);
int j = MathHelper.floor_double(par1AxisAlignedBB.minY);
int k = MathHelper.floor_double(par1AxisAlignedBB.minZ);
int l = MathHelper.floor_double(par1AxisAlignedBB.maxX);
int i1 = MathHelper.floor_double(par1AxisAlignedBB.maxY);
int j1 = MathHelper.floor_double(par1AxisAlignedBB.maxZ);
boolean flag = false;
boolean flag1 = false;
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
for (int i2 = k; i2 <= j1; ++i2) {
Block block = this.worldObj.getBlock(k1, l1, i2);
if (!block.isAir(worldObj, k1, l1, i2)) {
if (block.canEntityDestroy(worldObj, k1, l1, i2, this) && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
flag1 = this.worldObj.setBlockToAir(k1, l1, i2) || flag1;
} else {
flag = true;
}
}
}
}
}
if (flag1) {
double d1 = par1AxisAlignedBB.minX + (par1AxisAlignedBB.maxX - par1AxisAlignedBB.minX) * (double) this.rand.nextFloat();
double d2 = par1AxisAlignedBB.minY + (par1AxisAlignedBB.maxY - par1AxisAlignedBB.minY) * (double) this.rand.nextFloat();
double d0 = par1AxisAlignedBB.minZ + (par1AxisAlignedBB.maxZ - par1AxisAlignedBB.minZ) * (double) this.rand.nextFloat();
this.worldObj.spawnParticle("largeexplode", d1, d2, d0, 0.0D, 0.0D, 0.0D);
}
return flag;
}
private void spawnEgg() {
// if (ConfigHandler.dragonEggSpawnLocation[0] != 0 || ConfigHandler.dragonEggSpawnLocation[1] != 0 || ConfigHandler.dragonEggSpawnLocation[1] != 0 && !isUber) {
// homeX = ConfigHandler.dragonEggSpawnLocation[0];
// homeY = ConfigHandler.dragonEggSpawnLocation[1];
// homeZ = ConfigHandler.dragonEggSpawnLocation[2];
// }
//
// BlockEndPortal.field_149948_a = true;
//
// if (createPortal || isUber) {
// createEnderPortal(homeX, homeZ);
// }
// LogHelper.info("spawn egg");
// if (worldObj.getBlock(homeX, homeY + 1, homeZ) == Blocks.air) {
// worldObj.setBlock(homeX, homeY + 1, homeZ, Blocks.dragon_egg);
// LogHelper.info("spawn egg2 " + homeX + " " + homeY + " " + homeZ);
// }else {
// for (int i = homeY + 1; i < 250; i++) {
// if (worldObj.getBlock(homeX, i, homeZ) == Blocks.air) {
// worldObj.setBlock(homeX, i, homeZ, Blocks.dragon_egg);
// LogHelper.info("spawn egg3");
// break;
// }
// }
// }
//
// for (int iX = homeX - 2; iX <= homeX + 2; iX++)
// {
// for (int iZ = homeZ - 2; iZ <= homeZ + 2; iZ++)
// {
//
// if (worldObj.getBlock(iX, homeY - 4, iZ) == Blocks.bedrock && !(iX == homeX && iZ == homeZ))
// {
// worldObj.setBlock(iX, homeY - 3, iZ, Blocks.end_portal);
// }
// }
// }
//
//
// worldObj.setBlock(homeX - 1, homeY - 1, homeZ, Blocks.torch);
// worldObj.setBlock(homeX + 1, homeY - 1, homeZ, Blocks.torch);
// worldObj.setBlock(homeX, homeY - 1, homeZ - 1, Blocks.torch);
// worldObj.setBlock(homeX, homeY - 1, homeZ + 1, Blocks.torch);
//
//
// BlockEndPortal.field_149948_a = false;
}
private void createEnderPortal(int par1, int par2) {
int b0 = homeY -3;
byte b1 = 4;
for (int k = b0 - 1; k <= b0 + 32; ++k)
{
for (int l = par1 - b1; l <= par1 + b1; ++l)
{
for (int i1 = par2 - b1; i1 <= par2 + b1; ++i1)
{
double d0 = (double)(l - par1);
double d1 = (double)(i1 - par2);
double d2 = d0 * d0 + d1 * d1;
if (d2 <= ((double)b1 - 0.5D) * ((double)b1 - 0.5D))
{
if (k < b0)
{
if (d2 <= ((double)(b1 - 1) - 0.5D) * ((double)(b1 - 1) - 0.5D))
{
this.worldObj.setBlock(l, k, i1, Blocks.bedrock);
}
}
else if (k > b0)
{
this.worldObj.setBlock(l, k, i1, Blocks.air);
}
else if (d2 > ((double)(b1 - 1) - 0.5D) * ((double)(b1 - 1) - 0.5D))
{
this.worldObj.setBlock(l, k, i1, Blocks.bedrock);
}
}
}
}
}
this.worldObj.setBlock(par1, b0 + 0, par2, Blocks.bedrock);
this.worldObj.setBlock(par1, b0 + 1, par2, Blocks.bedrock);
this.worldObj.setBlock(par1, b0 + 2, par2, Blocks.bedrock);
this.worldObj.setBlock(par1, b0 + 3, par2, Blocks.bedrock);
}
@Override
public void writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
compound.setInteger("HomeX", homeX);
compound.setInteger("HomeY", homeY);
compound.setInteger("HomeZ", homeZ);
compound.setString("Behaviour", behaviour.name());
}
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
homeX = compound.getInteger("HomeX");
homeY = compound.getInteger("HomeY");
homeZ = compound.getInteger("HomeZ");
if (compound.hasKey("Behaviour")) behaviour = EnumBehaviour.valueOf(compound.getString("Behaviour"));
}
@Override
protected boolean canDespawn() {
return false;
}
@Override
protected void despawnEntity() {
}
@Override
public boolean attackEntityFrom(DamageSource damageSource, float dmg) {
// if (damageSource.getEntity() != null && getDistanceToEntity(damageSource.getEntity()) > 100) {
// LogHelper.info("cancel attack");
// return false;
// }
return super.attackEntityFrom(damageSource, dmg);
}
@Override
public boolean attackEntityFromPart(EntityDragonPart p_70965_1_, DamageSource damageSource, float p_70965_3_) {
// if (damageSource.getEntity() != null && Utills.getDistanceAtoB(damageSource.getEntity().posX)getDistanceToEntity(damageSource.getEntity()) > 100) {
// LogHelper.info("cancel attack");
// return false;
// }
return super.attackEntityFromPart(p_70965_1_, damageSource, p_70965_3_);
}
@Override
public void travelToDimension(int p_71027_1_) {}
}
@@ -0,0 +1,63 @@
package com.brandon3055.draconicevolution.common.entity;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
/**
* Created by brandon3055 on 23/8/2015.
*/
public class EntityDragonProjectile extends Entity {
public int type;
public Entity target;
public float power;
public boolean isChaser;
//public static final int FIREBALL = 0; /** Generic fireball a lot more powerful then ghast fireball */
public static final int FIREBOMB = 1; /** Large fireball with a trail and large fiery AOE */
public static final int ENDER_PORT = 2; /** Ender pearl which teleports the player away if it hits. */
public static final int FIRE_CHASER = 3; /** Fireball that chases the player it is fired at (Explodes on impact with blocks) */
public static final int ENERGY_CHASER = 4; /** Energy gall that chases the player. (Can pass through blocks) */
public static final int CHAOS_CHASER = 5; /** Chases player. On impact splits into mini chaos charges which lock on to other or the same player (can pass through blocks) */
public static final int MINI_CHAOS_CHASER = 6; /** ^ */
public static final int IGNITION_CHARGE = 7; /** Reignites Crystals */
public EntityDragonProjectile(World world){
this(world, 1, null, 5);
}
public EntityDragonProjectile(World world, int type, Entity target, float power) {
super(world);
this.type = type;
this.target = target;
this.power = power;
this.isChaser = type == FIRE_CHASER || type == ENERGY_CHASER || type == CHAOS_CHASER || type == MINI_CHAOS_CHASER || type == IGNITION_CHARGE;
this.setSize(0.5F, 0.5F);
}
@Override
protected void entityInit() {
}
@Override
public void onUpdate() {
super.onUpdate();
}
@Override
public void onEntityUpdate() {
super.onEntityUpdate();
}
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
}
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
}
}
@@ -40,6 +40,8 @@ public class ConfigHandler {
public static List<Integer> speedLimitDimList = new ArrayList<Integer>();
public static boolean speedLimitops;
public static boolean rapidlyDespawnMinedItems;
public static boolean useOldArmorModel;
//spawner
public static String[] spawnerList;
public static boolean spawnerListType;
@@ -104,6 +106,7 @@ public class ConfigHandler {
speedDimBlackList = config.get(Configuration.CATEGORY_GENERAL, "Speed limit Dim black lack list", new int[] {1}, "A list of dimensions the speed limit will not effect (speed limit is not so really required in the end)").getIntList();
speedLimitops = config.get(Configuration.CATEGORY_GENERAL, "Speed limit effects ops", false, "Dose the speed limit effect ops").getBoolean(false);
rapidlyDespawnMinedItems = config.get(Configuration.CATEGORY_GENERAL, "Rapidly despawn aoe mined items", false, "If true items dropped by a tool in aoe mode will despawn after 5 seconds").getBoolean(false);
useOldArmorModel = config.get(Configuration.CATEGORY_GENERAL, "Use old armor model", false, "If true the armor will use the original vanilla 2D model instead of the new 3D models").getBoolean(false);
//Spawner
spawnerListType = config.get("spawner", "listType", false, "Sets weather the spawner list is a white list or a black list (true = white list false = black list)").getBoolean(false);
@@ -7,6 +7,7 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.model.ModelDraconicArmor;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
@@ -121,13 +122,12 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return References.RESOURCESPREFIX + "textures/models/armor/armorDraconic.png";
// if (stack.getItem() == ModItems.draconicHelm || stack.getItem() == ModItems.draconicChest || stack.getItem() == ModItems.draconicBoots) {
// return References.RESOURCESPREFIX + "textures/models/armor/draconic_layer_1.png";
// } else {
// return References.RESOURCESPREFIX + "textures/models/armor/draconic_layer_2.png";
// }
if (!ConfigHandler.useOldArmorModel) return References.RESOURCESPREFIX + "textures/models/armor/armorDraconic.png";
if (stack.getItem() == ModItems.draconicHelm || stack.getItem() == ModItems.draconicChest || stack.getItem() == ModItems.draconicBoots) {
return References.RESOURCESPREFIX + "textures/models/armor/draconic_layer_1.png";
} else {
return References.RESOURCESPREFIX + "textures/models/armor/draconic_layer_2.png";
}
}
@Override
@@ -337,16 +337,18 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
}
@SideOnly(Side.CLIENT)
private ModelBiped model = null;
public ModelBiped model;
@SideOnly(Side.CLIENT)
@Override
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (ConfigHandler.useOldArmorModel) return super.getArmorModel(entityLiving, itemStack, armorSlot);
if (model == null) {
if (armorType == 0) model = new ModelDraconicArmor(1F, true, false, false, false, true);
else if (armorType == 1) model = new ModelDraconicArmor(1F, false, true, false, false, true);
else if (armorType == 2) model = new ModelDraconicArmor(1F, false, false, true, false, true);
else model = new ModelDraconicArmor(1F, false, false, false, true, true);
if (armorType == 0) model = new ModelDraconicArmor(1.1F, true, false, false, false, true);
else if (armorType == 1) model = new ModelDraconicArmor(1.1F, false, true, false, false, true);
else if (armorType == 2) model = new ModelDraconicArmor(1.1F, false, false, true, false, true);
else model = new ModelDraconicArmor(1.1F, false, false, false, true, true);
this.model.bipedHead.showModel = (armorType == 0);
this.model.bipedHeadwear.showModel = (armorType == 0);
@@ -7,6 +7,7 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.model.ModelDraconicArmor;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.*;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -103,12 +104,12 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyCont
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return References.RESOURCESPREFIX + "textures/models/armor/armorWyvern.png";
// if (stack.getItem() == ModItems.wyvernHelm || stack.getItem() == ModItems.wyvernChest || stack.getItem() == ModItems.wyvernBoots) {
// return References.RESOURCESPREFIX + "textures/models/armor/wyvern_layer_1.png";
// } else {
// return References.RESOURCESPREFIX + "textures/models/armor/wyvern_layer_2.png";
// }
if (!ConfigHandler.useOldArmorModel) return References.RESOURCESPREFIX + "textures/models/armor/armorWyvern.png";
if (stack.getItem() == ModItems.wyvernHelm || stack.getItem() == ModItems.wyvernChest || stack.getItem() == ModItems.wyvernBoots) {
return References.RESOURCESPREFIX + "textures/models/armor/wyvern_layer_1.png";
} else {
return References.RESOURCESPREFIX + "textures/models/armor/wyvern_layer_2.png";
}
}
@Override
@@ -263,13 +264,15 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyCont
}
@SideOnly(Side.CLIENT)
ModelBiped model = null;
private ModelBiped model;
@SideOnly(Side.CLIENT)
@Override
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (ConfigHandler.useOldArmorModel) return super.getArmorModel(entityLiving, itemStack, armorSlot);
if (model == null) {
if (armorType == 0) model = new ModelDraconicArmor(1F, true, false, false, false, false);
if (armorType == 0) model = new ModelDraconicArmor(1.0F, true, false, false, false, false);
else if (armorType == 1) model = new ModelDraconicArmor(1F, false, true, false, false, false);
else if (armorType == 2) model = new ModelDraconicArmor(1F, false, false, true, false, false);
else model = new ModelDraconicArmor(1F, false, false, false, true, false);
@@ -108,7 +108,7 @@ public class Wrench extends ItemDE implements IHudDisplayItem {
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
Block clicked = world.getBlock(x, y, z);
if (clicked.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side)) && !world.isRemote) return true;
if (getMode(stack).equals(MODE_SWITCH) && clicked.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side)) && !world.isRemote) return true;
if (world.isRemote) return false;
@@ -6,7 +6,7 @@ package com.brandon3055.draconicevolution.common.lib;
public class VersionHandler
{
public static final String VERSION = "1.0.2";
public static final int SNAPSHOT = 2;
public static final int SNAPSHOT = 3;
public static final String MCVERSION = "1.7.10";
public static final String FULL_VERSION = VERSION + (SNAPSHOT > 0 ? "-snapshot_" + SNAPSHOT : "");
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@@ -0,0 +1,16 @@
{
"texture": { "blur": true },
"animation": {
"frametime": 1,
"frames": [
0,
1,
2,
3,
4,
5,
6,
7
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB