diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-24 05:10:32 +1000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-24 05:10:32 +1000 |
| commit | 7a632048aae20cb62470adc6be0700f092f3893f (patch) | |
| tree | fb14c0c37338bc5e9d5387fd59dadc670ffe8ff7 /src/Java | |
| parent | 41e94c991ba39a7a466b67a13f346461b26ce3c1 (diff) | |
| download | GT5-Unofficial-7a632048aae20cb62470adc6be0700f092f3893f.tar.gz GT5-Unofficial-7a632048aae20cb62470adc6be0700f092f3893f.tar.bz2 GT5-Unofficial-7a632048aae20cb62470adc6be0700f092f3893f.zip | |
+ Added Giant Chicken.
+ Added Big Eggs.
- Removed Segment Analytics entirely.
Diffstat (limited to 'src/Java')
14 files changed, 547 insertions, 480 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index d22426246d..5ac47f085f 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -28,8 +28,6 @@ import gtPlusPlus.core.common.CommonProxy; import gtPlusPlus.core.config.ConfigHandler; import gtPlusPlus.core.handler.BookHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; -import gtPlusPlus.core.handler.analytics.SegmentAnalytics; -import gtPlusPlus.core.handler.analytics.SegmentHelper; import gtPlusPlus.core.handler.events.BlockEventHandler; import gtPlusPlus.core.handler.events.LoginEventHandler; import gtPlusPlus.core.handler.events.MissingMappingsEvent; @@ -166,14 +164,6 @@ public class GTplusplus implements ActionListener { @Mod.EventHandler public void serverStopping(final FMLServerStoppingEvent event) { - //Flush all data to Server at the end of the day. - if (SegmentAnalytics.sAnalyticsMasterList.size() > 0){ - for (SegmentAnalytics sa : SegmentAnalytics.sAnalyticsMasterList.values()){ - sa.flushDataFinal(); - SegmentAnalytics.LOG("Cleaned up Analytics Data for player "+sa.mLocalName+"."); - } - } - //Chunkload Handler if (ChunkManager.mChunkLoaderManagerMap.size() > 0) { Logger.INFO("Clearing Chunk Loaders."); @@ -250,15 +240,6 @@ public class GTplusplus implements ActionListener { } } - - private static final void initAnalytics(){ - SegmentAnalytics.isEnabled = CORE.ConfigSwitches.enableUpdateChecker; - if (!Utils.isServer() && PlayerUtils.isPlayerAlkalus()){ - SegmentAnalytics.isEnabled = true; - } - new SegmentHelper(); - } - private static final boolean setupMaterialBlacklist(){ Material.invalidMaterials.put(Materials._NULL); Material.invalidMaterials.put(Materials.Clay); diff --git a/src/Java/gtPlusPlus/core/client/model/ModelGiantChicken.java b/src/Java/gtPlusPlus/core/client/model/ModelGiantChicken.java new file mode 100644 index 0000000000..c0f5f79018 --- /dev/null +++ b/src/Java/gtPlusPlus/core/client/model/ModelGiantChicken.java @@ -0,0 +1,102 @@ +package gtPlusPlus.core.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.client.model.ModelChicken; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelGiantChicken extends ModelChicken{ + + public ModelGiantChicken() + { + byte b0 = 16; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); + this.head.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.bill = new ModelRenderer(this, 14, 0); + this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); + this.bill.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.chin = new ModelRenderer(this, 14, 4); + this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); + this.chin.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.body = new ModelRenderer(this, 0, 9); + this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); + this.body.setRotationPoint(0.0F, (float)b0, 0.0F); + this.rightLeg = new ModelRenderer(this, 26, 0); + this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.rightLeg.setRotationPoint(-2.0F, (float)(3 + b0), 1.0F); + this.leftLeg = new ModelRenderer(this, 26, 0); + this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.leftLeg.setRotationPoint(1.0F, (float)(3 + b0), 1.0F); + this.rightWing = new ModelRenderer(this, 24, 13); + this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); + this.rightWing.setRotationPoint(-4.0F, (float)(-3 + b0), 0.0F); + this.leftWing = new ModelRenderer(this, 24, 13); + this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); + this.leftWing.setRotationPoint(4.0F, (float)(-3 + b0), 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_); + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bill.rotateAngleX = this.head.rotateAngleX; + this.bill.rotateAngleY = this.head.rotateAngleY; + this.chin.rotateAngleX = this.head.rotateAngleX; + this.chin.rotateAngleY = this.head.rotateAngleY; + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.rightWing.rotateAngleZ = p_78087_3_; + this.leftWing.rotateAngleZ = -p_78087_3_; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java b/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java new file mode 100644 index 0000000000..b3d1ce21fc --- /dev/null +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java @@ -0,0 +1,116 @@ +package gtPlusPlus.core.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderChicken; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +import gtPlusPlus.core.util.reflect.ReflectionUtils; + +@SideOnly(Side.CLIENT) +public class RenderGiantChicken extends RenderChicken { + + /** + * Fancy reflective handling of nabbing the original chicken texture object, should save reload the texture to memory. :) + */ + private static final ResourceLocation chickenTexturesEx; + static { + ResourceLocation mChicken; + try { + mChicken = (ResourceLocation) ReflectionUtils.getField(RenderGiantChicken.class, "chickenTextures").get(null); + } + catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) { + mChicken = new ResourceLocation("textures/entity/chicken.png"); + } + chickenTexturesEx = mChicken; + } + + public RenderGiantChicken(ModelBase p_i1252_1_, float p_i1252_2_) + { + super(p_i1252_1_, p_i1252_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (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(EntityChicken p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + super.doRender((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityChicken p_110775_1_) + { + return chickenTexturesEx; + } + + /** + * Defines what float the third param in setRotationAngles of ModelBase is + */ + protected float handleRotationFloat(EntityChicken p_77044_1_, float p_77044_2_) + { + float f1 = p_77044_1_.field_70888_h + (p_77044_1_.field_70886_e - p_77044_1_.field_70888_h) * p_77044_2_; + float f2 = p_77044_1_.field_70884_g + (p_77044_1_.destPos - p_77044_1_.field_70884_g) * p_77044_2_; + return (MathHelper.sin(f1) + 1.0F) * f2; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (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(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((EntityChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } + + /** + * Defines what float the third param in setRotationAngles of ModelBase is + */ + protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) + { + return this.handleRotationFloat((EntityChicken)p_77044_1_, p_77044_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (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(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((EntityChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityChicken)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (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(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((EntityChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java index ca46bca48b..81d8a789c5 100644 --- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -4,11 +4,13 @@ import cpw.mods.fml.common.registry.EntityRegistry; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; +import gtPlusPlus.core.util.Utils; public class InternalEntityRegistry { @@ -17,32 +19,35 @@ public class InternalEntityRegistry { public static void registerEntities(){ Logger.INFO("Registering GT++ Entities."); - EntityRegistry.registerGlobalEntityID(EntityPrimedMiningExplosive.class, "MiningCharge", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityPrimedMiningExplosive.class, "MiningCharge", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(125, 125, 125)); EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(200, 0, 200), Utils.rgbtoHexValue(125, 125, 125)); EntityRegistry.registerModEntity(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 0, 0), Utils.rgbtoHexValue(255, 255, 255)); EntityRegistry.registerModEntity(EntityHydrofluoricAcidPotion.class, "throwablePotionHydrofluoric", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntityToxinballSmall.class, "toxinBall", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityToxinballSmall.class, "toxinBall", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 25, 0), Utils.rgbtoHexValue(0, 125, 0)); EntityRegistry.registerModEntity(EntityToxinballSmall.class, "toxinBall", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntityStaballoyConstruct.class, "constructStaballoy", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityStaballoyConstruct.class, "constructStaballoy", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(50, 220, 50)); EntityRegistry.registerModEntity(EntityStaballoyConstruct.class, "constructStaballoy", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntitySickBlaze.class, "sickBlaze", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(0, 75, 0), Utils.rgbtoHexValue(75, 175, 75)); EntityRegistry.registerModEntity(EntitySickBlaze.class, "sickBlaze", mEntityID++, GTplusplus.instance, 64, 20, true); - EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityTeslaTowerLightning.class, "plasmaBolt", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(125, 125, 125)); EntityRegistry.registerModEntity(EntityTeslaTowerLightning.class, "plasmaBolt", mEntityID++, GTplusplus.instance, 64, 5, true); + + EntityRegistry.registerGlobalEntityID(EntityGiantChickenBase.class, "bigChickenFriendly", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175)); + EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true); } diff --git a/src/Java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java b/src/Java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java new file mode 100644 index 0000000000..071b893527 --- /dev/null +++ b/src/Java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java @@ -0,0 +1,295 @@ +package gtPlusPlus.core.entity.monster; + +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.general.ItemGemShards; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraftforge.common.ForgeHooks; + +public class EntityGiantChickenBase extends EntityChicken { + + /** The time until the next egg is spawned. */ + public int timeUntilNextBigEgg; + + public EntityGiantChickenBase(World aWorld) + { + super(aWorld); + this.setSize(0.6F, 1.4F); //Double + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, ModItems.itemGemShards, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.tasks.addTask(8, new EntityAIEatGrass(this)); + + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.field_70888_h = this.field_70886_e; + this.field_70884_g = this.destPos; + this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); + + if (this.destPos < 0.0F) + { + this.destPos = 0.0F; + } + + if (this.destPos > 1.0F) + { + this.destPos = 1.0F; + } + + if (!this.onGround && this.field_70889_i < 1.0F) + { + this.field_70889_i = 1.0F; + } + + this.field_70889_i = (float)((double)this.field_70889_i * 0.9D); + + if (!this.onGround && this.motionY < 0.0D) + { + this.motionY *= 0.6D; + } + + this.field_70886_e += this.field_70889_i * 2.0F; + + if (!this.worldObj.isRemote && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0) + { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(Items.egg, 1); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } + if (!this.worldObj.isRemote && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0) + { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(ModItems.itemBigEgg, MathUtils.randInt(1, 4)); + this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000; + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + protected Item getDropItem() + { + return ModItems.itemBigEgg; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean recentHit, int lootLevel) + { + int j = this.rand.nextInt(3) + this.rand.nextInt(1 + lootLevel); + + for (int k = 0; k < j; ++k) + { + this.dropItem(Items.feather, 1); + } + + //Large Egg Chance + for (int k = 0; k < j*2; ++k) + { + this.dropItem(ModItems.itemBigEgg, MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2})); + } + + //Chicken Corpses Dropped + int mBodies = MathUtils.getRandomFromArray(new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6}); + if (this.isBurning()) + { + this.dropItem(Items.cooked_chicken, mBodies); + } + else + { + this.dropItem(Items.chicken, mBodies); + } + } + + public EntityGiantChickenBase createChild(EntityAgeable p_90011_1_) + { + return new EntityGiantChickenBase(this.worldObj); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack aStack) + { + return aStack != null && aStack.getItem() instanceof ItemGemShards; + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound aNBT) + { + super.readEntityFromNBT(aNBT); + timeUntilNextBigEgg = aNBT.getInteger("timeUntilNextBigEgg"); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return this.isChickenJockey() ? 20 : super.getExperiencePoints(p_70693_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound aNBT) + { + super.writeEntityToNBT(aNBT); + aNBT.setInteger("timeUntilNextBigEgg", timeUntilNextBigEgg); + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return this.isChickenJockey() && this.riddenByEntity == null; + } + + public void updateRiderPosition() + { + super.updateRiderPosition(); + float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float f2 = 0.1F; + float f3 = 0.0F; + this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + (double)(this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1)); + + if (this.riddenByEntity instanceof EntityLivingBase) + { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + + public boolean isChickenJockey() { + return func_152116_bZ(); + } + public void setIsChickenJockey(boolean isJockey) { + func_152117_i(isJockey); + } + + @Override + protected Entity findPlayerToAttack() { + // TODO Auto-generated method stub + return super.findPlayerToAttack(); + } + + @Override + public boolean interact(EntityPlayer p_70085_1_) { + // TODO Auto-generated method stub + return super.interact(p_70085_1_); + } + + @Override + public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) { + // TODO Auto-generated method stub + super.setHomeArea(p_110171_1_, p_110171_2_, p_110171_3_, p_110171_4_); + } + + @Override + public ChunkCoordinates getHomePosition() { + // TODO Auto-generated method stub + return super.getHomePosition(); + } + + @Override + public void detachHome() { + // TODO Auto-generated method stub + super.detachHome(); + } + + @Override + public boolean hasHome() { + // TODO Auto-generated method stub + return super.hasHome(); + } + + @Override + public void eatGrassBonus() { + if (this.isChild()) { + this.addGrowth(60); + } + } + + @Override + public float getRenderSizeModifier() { + return 1.5f; + } + + @Override + protected void jump() { + this.motionY = 0.68999998688697815D; + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F); + } + + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double)(MathHelper.sin(f) * 0.2F); + this.motionZ += (double)(MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + ForgeHooks.onLivingJump(this); + } + + @Override + public void onStruckByLightning(EntityLightningBolt p_70077_1_) { + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + this.spawnExplosionParticle(); + super.onStruckByLightning(p_70077_1_); + } + + @Override + public boolean shouldDismountInWater(Entity rider) { + return true; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/analytics/AnalyticsLoggingPlugin.java b/src/Java/gtPlusPlus/core/handler/analytics/AnalyticsLoggingPlugin.java deleted file mode 100644 index 2d7fe35522..0000000000 --- a/src/Java/gtPlusPlus/core/handler/analytics/AnalyticsLoggingPlugin.java +++ /dev/null @@ -1,36 +0,0 @@ -package gtPlusPlus.core.handler.analytics; - -import com.segment.analytics.*; -import com.segment.analytics.messages.Message; - -import gtPlusPlus.api.objects.Logger; - -/** - * A {@link Plugin} implementation that redirects client logs to standard output and logs callback - * events. - */ -public class AnalyticsLoggingPlugin implements Plugin { - @Override public void configure(Analytics.Builder builder) { - builder.log(new Log() { - @Override public void print(Level level, String format, Object... args) { - Logger.WARNING(level + ":\t" + String.format(format, args)); - } - - @Override public void print(Level level, Throwable error, String format, Object... args) { - Logger.WARNING(level + ":\t" + String.format(format, args)); - //Utils.LOG_WARNING(error); - } - }); - - builder.callback(new Callback() { - @Override public void success(Message message) { - Logger.WARNING("Uploaded " + message); - } - - @Override public void failure(Message message, Throwable throwable) { - Logger.WARNING("Could not upload " + message); - //Utils.LOG_WARNING(throwable); - } - }); - } -}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/analytics/BlockingFlush.java b/src/Java/gtPlusPlus/core/handler/analytics/BlockingFlush.java deleted file mode 100644 index f1c4ece790..0000000000 --- a/src/Java/gtPlusPlus/core/handler/analytics/BlockingFlush.java +++ /dev/null @@ -1,65 +0,0 @@ -package gtPlusPlus.core.handler.analytics; - -import java.util.concurrent.Phaser; - -import com.segment.analytics.*; -import com.segment.analytics.messages.Message; -import com.segment.analytics.messages.MessageBuilder; - -/** - * The {@link Analytics} class doesn't come with a blocking {@link Analytics#flush()} implementation - * out of the box. It's trivial to build one using a {@link Phaser} that monitors requests and is - * able to block until they're uploaded. - * - * <pre><code> - * BlockingFlush mBlockingFlush = BlockingFlush.create(); - * Analytics mHelper = Analytics.builder(writeKey) - * .plugin(mBlockingFlush) - * .build(); - * - * // Do some work. - * - * mHelper.flush(); // Trigger a flush. - * mBlockingFlush.block(); // Block until the flush completes. - * mHelper.shutdown(); // Shut down after the flush is complete. - * </code></pre> - */ -public class BlockingFlush { - - public static BlockingFlush create() { - return new BlockingFlush(); - } - - BlockingFlush() { - this.phaser = new Phaser(1); - } - - final Phaser phaser; - - public Plugin plugin() { - return new Plugin() { - @Override public void configure(Analytics.Builder builder) { - builder.messageTransformer(new MessageTransformer() { - @Override public boolean transform(MessageBuilder builder) { - phaser.register(); - return true; - } - }); - - builder.callback(new Callback() { - @Override public void success(Message message) { - phaser.arrive(); - } - - @Override public void failure(Message message, Throwable throwable) { - phaser.arrive(); - } - }); - } - }; - } - - public void block() { - phaser.arriveAndAwaitAdvance(); - } -}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/analytics/SegmentAnalytics.java b/src/Java/gtPlusPlus/core/handler/analytics/SegmentAnalytics.java deleted file mode 100644 index c64e6eae0b..0000000000 --- a/src/Java/gtPlusPlus/core/handler/analytics/SegmentAnalytics.java +++ /dev/null @@ -1,268 +0,0 @@ -package gtPlusPlus.core.handler.analytics; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Phaser; - -import com.mojang.authlib.GameProfile; -import com.segment.analytics.Analytics; - -import net.minecraft.entity.player.EntityPlayer; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.UUIDGenerator; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.data.UUIDUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import ic2.core.IC2; - -public class SegmentAnalytics { - - //Globally Enabled - public static boolean isEnabled = true; - - //Analytics Map with IDs - public static final Map<Integer, SegmentAnalytics> sAnalyticsMasterList = new ConcurrentHashMap<Integer, SegmentAnalytics>(); - //ID count - private static int sAnalyticsMapID = 0; - - //Analytics Player Mapping - public static final Map<UUID, Integer> sAnalyticsToPlayermap = new ConcurrentHashMap<UUID, Integer>(); - - //Set some Vars - final BlockingFlush mBlockingFlush; - final SegmentHelper mHelper; - final UUIDGenerator mUuidGenerator; - - public final GameProfile mLocalProfile; - public final String mLocalName; - public final UUID mUUID; - public final String mUserName; - public final String mAnonymousId; - protected Map<String, Object> mProperties = new LinkedHashMap<>(); - final protected Phaser mPhaser; - - //Build a new inst |
