From eb602d27078ab42bfd501039d4eebd26c0618d6e Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 23 Oct 2023 21:23:23 +0200 Subject: [PATCH] wretched abominations --- changelog | 27 -------- .../java/com/hbm/entity/mob/EntityPigeon.java | 63 +++++++++++++++++- .../ai/EntityAIFlutterAroundAimlessly.java | 9 --- .../hbm/render/entity/mob/RenderPigeon.java | 13 ++++ .../com/hbm/render/model/ModelPigeon.java | 1 - .../assets/hbm/textures/entity/pigeon.png | Bin 419 -> 748 bytes 6 files changed, 75 insertions(+), 38 deletions(-) diff --git a/changelog b/changelog index f42f79ddf..e69de29bb 100644 --- a/changelog +++ b/changelog @@ -1,27 +0,0 @@ -## Added -* Plastic bag - * Rarely spawns in water with similar spawn conditions as squids - * Will slowly drift into random directions - * Can be picked up, the resulting item can be used like a backpack that stores one item - -## Changed -* Updated chinese localization -* Tweaked certain assembler recipes - * Some welded plate requirements have been lowered - * The plasma heater now requires slightly more resources, but yields 4 blocks per operation instead of 1 -* The fractioning tower now requires welded plates, but the total steel cost has been reduced by roughly a third -* The cyclotron now has three automation ports on each side, corresponding with the colors of the three input pairs -* Updated the PWR sound - -## Fixed -* Fixed multi fluid ID's search not behaving correctly -* Fixed jetpack's description using unlocalized fluid names -* Fixed the CM structure wand being broken when used in most directions -* Fixed the custom machine recipe handler using the original references to the output stacks, causing the chance percentage indicator getting stuck on the actual outputs -* Fixed the desh suit's boot models not being separated from the legs -* Fixed dupe caused by defusing TNT-like blocks -* Fixed containment box being able to contain itself when using the number keys, crashing the game -* Fixed a critical game-breaking error where the custom tool's ability toggle is misspelled -* (Hopefully) fixed the vampire ability not firing the onDeath event, causing the target to not drop any items and any death releated events to not happen -* Fixed water creatures vomitting when irradiated, when they logically shouldn't -* Fixed arc welder recipe template file not being generated properly \ No newline at end of file diff --git a/src/main/java/com/hbm/entity/mob/EntityPigeon.java b/src/main/java/com/hbm/entity/mob/EntityPigeon.java index 0c6253e02..9f3ede27e 100644 --- a/src/main/java/com/hbm/entity/mob/EntityPigeon.java +++ b/src/main/java/com/hbm/entity/mob/EntityPigeon.java @@ -16,6 +16,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class EntityPigeon extends EntityCreature implements IFlyingCreature, IAnimals { + + public float fallTime; + public float dest; + public float prevDest; + public float prevFallTime; + public float offGroundTimer = 1.0F; public EntityPigeon(World world) { super(world); @@ -25,9 +31,10 @@ public class EntityPigeon extends EntityCreature implements IFlyingCreature, IAn this.tasks.addTask(1, new EntityAISwimmingConditional(this, noFlyCondition)); this.tasks.addTask(2, new EntityAIFlutterAroundAimlessly(this, this)); //this.tasks.addTask(2, new EntityAIPanicConditional(this, 1.4D, noFlyCondition)); - this.tasks.addTask(5, new EntityAIWanderConditional(this, 1.0D, noFlyCondition)); + this.tasks.addTask(5, new EntityAIWanderConditional(this, 0.2D, noFlyCondition)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); + this.setSize(0.5F, 1.0F); } @Override @@ -62,4 +69,58 @@ public class EntityPigeon extends EntityCreature implements IFlyingCreature, IAn protected String getDeathSound() { return null; } + + @Override + protected void updateAITasks() { + super.updateAITasks(); + + if(this.getFlyingState() == this.STATE_FLYING) { + int height = worldObj.getHeightValue((int) Math.floor(posX), (int) Math.floor(posZ)); + + boolean ceil = posY - height > 10; + + this.motionY = this.getRNG().nextGaussian() * 0.05 + (ceil ? 0 : 0.04) + (this.isInWater() ? 0.2 : 0); + + if(onGround) this.motionY = Math.abs(this.motionY) + 0.1D; + + this.moveForward = 1.5F; + if(this.getRNG().nextInt(20) == 0) this.rotationYaw += this.getRNG().nextGaussian() * 30; + } else if(!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.8D; + } + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + this.prevFallTime = this.fallTime; + this.prevDest = this.dest; + this.dest = (float) ((double) this.dest + (double) (this.onGround ? -1 : 4) * 0.3D); + + if(this.dest < 0.0F) { + this.dest = 0.0F; + } + + if(this.dest > 1.0F) { + this.dest = 1.0F; + } + + if(!this.onGround && this.offGroundTimer < 1.0F) { + this.offGroundTimer = 1.0F; + } + + this.offGroundTimer = (float) ((double) this.offGroundTimer * 0.9D); + + if(!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + this.fallTime += this.offGroundTimer * 2.0F; + } + + @Override public boolean doesEntityNotTriggerPressurePlate() { return true; } + @Override protected boolean canTriggerWalking() { return false; } + + @Override protected void fall(float p_70069_1_) { } + @Override protected void updateFallState(double p_70064_1_, boolean p_70064_3_) { } } diff --git a/src/main/java/com/hbm/entity/mob/ai/EntityAIFlutterAroundAimlessly.java b/src/main/java/com/hbm/entity/mob/ai/EntityAIFlutterAroundAimlessly.java index 98556f3aa..d72bc7d4c 100644 --- a/src/main/java/com/hbm/entity/mob/ai/EntityAIFlutterAroundAimlessly.java +++ b/src/main/java/com/hbm/entity/mob/ai/EntityAIFlutterAroundAimlessly.java @@ -31,14 +31,5 @@ public class EntityAIFlutterAroundAimlessly extends EntityAIBase { /*this.living.motionX = this.living.getRNG().nextGaussian() * 0.1; this.living.motionY = this.living.getRNG().nextGaussian() * 0.1; this.living.motionZ = this.living.getRNG().nextGaussian() * 0.1;*/ - - this.living.motionX = 0; - this.living.motionY = this.living.getRNG().nextGaussian() * 0.1; - this.living.motionZ = 0; - - if(living.onGround) this.living.motionY = Math.abs(this.living.motionY) + 0.1D; - - this.living.moveForward = 0.5F; - this.living.rotationYaw += this.living.getRNG().nextGaussian() * 0.1; } } diff --git a/src/main/java/com/hbm/render/entity/mob/RenderPigeon.java b/src/main/java/com/hbm/render/entity/mob/RenderPigeon.java index 0c92d178d..8acc1a550 100644 --- a/src/main/java/com/hbm/render/entity/mob/RenderPigeon.java +++ b/src/main/java/com/hbm/render/entity/mob/RenderPigeon.java @@ -6,6 +6,8 @@ import com.hbm.lib.RefStrings; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; public class RenderPigeon extends RenderLiving { @@ -23,4 +25,15 @@ public class RenderPigeon extends RenderLiving { protected ResourceLocation getEntityTexture(EntityPigeon entity) { return texture; } + + protected float handleRotationFloat(EntityPigeon entity, float interp) { + float f1 = entity.prevFallTime + (entity.fallTime - entity.prevFallTime) * interp; + float f2 = entity.prevDest + (entity.dest - entity.prevDest) * interp; + return (MathHelper.sin(f1) + 1.0F) * f2; + } + + @Override + protected float handleRotationFloat(EntityLivingBase entity, float interp) { + return this.handleRotationFloat((EntityPigeon) entity, interp); + } } diff --git a/src/main/java/com/hbm/render/model/ModelPigeon.java b/src/main/java/com/hbm/render/model/ModelPigeon.java index 0f652efa2..f1e9f70e4 100644 --- a/src/main/java/com/hbm/render/model/ModelPigeon.java +++ b/src/main/java/com/hbm/render/model/ModelPigeon.java @@ -67,7 +67,6 @@ public class ModelPigeon extends ModelBase { } public void render(Entity entity, float f0, float f1, float f2, float f3, float f4, float scale) { - //this.initModel(); this.setRotationAngles(f0, f1, f2, f3, f4, scale, entity); this.head.render(scale); this.beak.render(scale); diff --git a/src/main/resources/assets/hbm/textures/entity/pigeon.png b/src/main/resources/assets/hbm/textures/entity/pigeon.png index b13a2ea56a9f0861cbf3acb4577b0cdbcfa48068..020c3b9b9e9d618abf0df504186112b6e4ee8d62 100644 GIT binary patch delta 709 zcmV;$0y_Pp1MCHmGk*f3Nkl73QgA#i-VTp5SmtN zmvoRUb(Idq?t)OT5Gc4f1SeO!q#c?iiIzwe1^+A(I_nTGcefHG5{!63SH;9O{m|6#kU0jz~SL{0KokGk|RZC=2HLURtk>f*k#P_ z0!b2?B#A6@HwyqrB&Lx_Ohb}HW{e5|xWE09Y}RXJBbH?4l{M422FHcLabdgaIL3Aa zXgh9vb_ySW@qYjiGUmLI^gVrOpPYU^%fG-0fTh$eS8_He2aKue5wynbtYSSg`@g@Q znFY7Aiq1L4<`z6Z4xS%(O$CQ6Pm~FQzOTgkrC2Etzl)u2*uE0GXpFoAdP;$d zl=DVRXKQ+4x$D7S-QTl1kB#en{dZ>wQr8(c@0S~EHg?4P(e7?cv+UA$TAc~Ha?A2_xC_)6jX?sj927eP-M{<1q1a? raH9|+igIe?fbaHMjC>t1@(%b5zdZorc)&!+00000NkvXXu0mjfzr{>f delta 377 zcmV-<0fzqU1)~FyGk*bENklq~sGELu!vO$0r;L|<@eghZ)Xy3YV^e*sfo<6#kzr@~%U4OnjeTrY^O)?=fDg&l8 zKkDz~Mp`R-f|Y)+{r`gE8DM5JAY1@5HNE9HLp%ZNaP<@4ovK6e45$gv4nP}|y4rAj zS3gpG{Lx-l=MP|ZAnZ|3f>}`$pdElVY67$a(8lb)!CP@a{3Pf=Xu50Uzh`x*3`o`a z9;tf&n6~q|d2+Cq1(pky0l6Re3X|0GUV$FPGoU6wI{oNW9m6^V=?ZPq_IYv^Mb