From ceaa6b35c8b5dfa7c7fc4ed78eac2adfa459c5bf Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sat, 30 Dec 2023 19:01:11 -0800 Subject: [PATCH 01/11] add whip usage to manticore --- .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index 88e3f2e02..c5a434726 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -4,12 +4,14 @@ package drzhark.mocreatures.entity.hunter; import drzhark.mocreatures.MoCreatures; +import drzhark.mocreatures.init.MoCItems; import drzhark.mocreatures.init.MoCLootTables; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -81,6 +83,11 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { return true; } + final ItemStack stack = player.getHeldItem(hand); + if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { + setSitting(!getIsSitting()); + return true; + } return super.processInteract(player, hand); } From bc26249987851ad2a66a4b4cd84e245738bbb9d5 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sat, 30 Dec 2023 19:12:42 -0800 Subject: [PATCH 02/11] add comments for testing, move code up --- .../entity/hunter/MoCEntityManticorePet.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index c5a434726..da66a798d 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -74,6 +74,15 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { return tameResult; } + final ItemStack stack = player.getHeldItem(hand); + System.out.println("STACK: ",stack.getItem(), "HAND: ",hand, "PLYR: ", player); + System.out.println("CHECKS: ",!stack.isEmpty(),getIsTamed(),(stack.getItem() == MoCItems.whip)); + if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { + System.out.println("PROCESSED WHIP."); + setSitting(!getIsSitting()); + return true; + } + if (this.getIsRideable() && this.getIsAdult() && (!this.getIsChested() || !player.isSneaking()) && !this.isBeingRidden()) { if (!this.world.isRemote && player.startRiding(this)) { player.rotationYaw = this.rotationYaw; @@ -83,11 +92,6 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { return true; } - final ItemStack stack = player.getHeldItem(hand); - if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { - setSitting(!getIsSitting()); - return true; - } return super.processInteract(player, hand); } From 23f630145b7fb8177ff88872833a852f4571d850 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sat, 30 Dec 2023 19:17:33 -0800 Subject: [PATCH 03/11] fix comments --- .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index da66a798d..edc2e4826 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -75,8 +75,8 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { } final ItemStack stack = player.getHeldItem(hand); - System.out.println("STACK: ",stack.getItem(), "HAND: ",hand, "PLYR: ", player); - System.out.println("CHECKS: ",!stack.isEmpty(),getIsTamed(),(stack.getItem() == MoCItems.whip)); + System.out.println("STACK: "+stack.getItem()+ "HAND: "+hand+ "PLYR: "+ player); + System.out.println("CHECKS: "+!stack.isEmpty()+getIsTamed()+(stack.getItem() == MoCItems.whip)); if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { System.out.println("PROCESSED WHIP."); setSitting(!getIsSitting()); From 87b9ece409ac9af4012f702f19ecba27de858e03 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sat, 30 Dec 2023 19:33:33 -0800 Subject: [PATCH 04/11] update comments, we know it enters this section --- .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index edc2e4826..596150574 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -75,10 +75,8 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { } final ItemStack stack = player.getHeldItem(hand); - System.out.println("STACK: "+stack.getItem()+ "HAND: "+hand+ "PLYR: "+ player); - System.out.println("CHECKS: "+!stack.isEmpty()+getIsTamed()+(stack.getItem() == MoCItems.whip)); if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { - System.out.println("PROCESSED WHIP."); + // TODO: Make Manticore stop moving, add orientation/model positioning setSitting(!getIsSitting()); return true; } From 34e70816a8e76b8f61bd505f637b9d5c1ddf42f0 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 12:54:28 -0800 Subject: [PATCH 05/11] add comments --- .../drzhark/mocreatures/client/model/MoCModelBigCat.java | 2 +- .../java/drzhark/mocreatures/entity/MoCEntityAnimal.java | 1 + .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java index 11465c726..3fd2d49e8 100644 --- a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java +++ b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java @@ -696,7 +696,7 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f this.Tail2.rotateAngleY = interpolatedTailSwingYaw; // Save the current value for the next frame's interpolation this.prevTailSwingYaw = interpolatedTailSwingYaw; - + System.out.println("SITTING? "+this.isSitting); if (this.isSitting) { stingYOffset = 17F; stingZOffset = -3F; diff --git a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java index 8395876fb..43b197f3a 100644 --- a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java +++ b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java @@ -886,6 +886,7 @@ public boolean getIsSitting() { @Override public boolean isMovementCeased() { + System.out.println("Cease movement?"+getIsSitting() + this.isBeingRidden()); return getIsSitting() || this.isBeingRidden(); } diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index 596150574..c37f4c552 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -67,6 +67,11 @@ public boolean isFlyer() { return true; } + @Override + public boolean getIsSitting() { + System.out.println("getIsSitting(): SITTING? "+ this.dataManager.get(SITTING)); + return this.dataManager.get(SITTING); + } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { final Boolean tameResult = this.processTameInteract(player, hand); From c54f70689f10f50f146efd9d83f955cf53c3ee18 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:01:26 -0800 Subject: [PATCH 06/11] "private" fix --- .../drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java | 1 + .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java index 63f90872c..43920e6a9 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java @@ -124,6 +124,7 @@ public void setHasAmulet(boolean flag) { @Override public boolean getIsSitting() { + System.out.println("getIsSitting(): SITTING? "+ this.dataManager.get(SITTING)); return this.dataManager.get(SITTING); } diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index c37f4c552..596150574 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -67,11 +67,6 @@ public boolean isFlyer() { return true; } - @Override - public boolean getIsSitting() { - System.out.println("getIsSitting(): SITTING? "+ this.dataManager.get(SITTING)); - return this.dataManager.get(SITTING); - } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { final Boolean tameResult = this.processTameInteract(player, hand); From 35a76bc50c8bd840af3a3048229f265f76b11231 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:14:24 -0800 Subject: [PATCH 07/11] change comments --- .../java/drzhark/mocreatures/client/model/MoCModelBigCat.java | 1 - src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java | 1 - .../java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java | 1 - .../drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java index 3fd2d49e8..9b4df83b5 100644 --- a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java +++ b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java @@ -696,7 +696,6 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f this.Tail2.rotateAngleY = interpolatedTailSwingYaw; // Save the current value for the next frame's interpolation this.prevTailSwingYaw = interpolatedTailSwingYaw; - System.out.println("SITTING? "+this.isSitting); if (this.isSitting) { stingYOffset = 17F; stingZOffset = -3F; diff --git a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java index 43b197f3a..8395876fb 100644 --- a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java +++ b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java @@ -886,7 +886,6 @@ public boolean getIsSitting() { @Override public boolean isMovementCeased() { - System.out.println("Cease movement?"+getIsSitting() + this.isBeingRidden()); return getIsSitting() || this.isBeingRidden(); } diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java index 43920e6a9..63f90872c 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityBigCat.java @@ -124,7 +124,6 @@ public void setHasAmulet(boolean flag) { @Override public boolean getIsSitting() { - System.out.println("getIsSitting(): SITTING? "+ this.dataManager.get(SITTING)); return this.dataManager.get(SITTING); } diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index 596150574..8c132b00c 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -76,6 +76,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { final ItemStack stack = player.getHeldItem(hand); if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { + System.out.println("Yes whipped. Value of getIsSitting() is "+getIsSitting()); // TODO: Make Manticore stop moving, add orientation/model positioning setSitting(!getIsSitting()); return true; From 9fe9cffc294a6258136e447be5cb3a6db4a557df Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:26:37 -0800 Subject: [PATCH 08/11] updating sitting when whipped inside BigCat --- .../java/drzhark/mocreatures/client/model/MoCModelBigCat.java | 3 ++- .../drzhark/mocreatures/client/model/MoCModelManticorePet.java | 1 + .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java index 9b4df83b5..99a60e342 100644 --- a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java +++ b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java @@ -113,7 +113,7 @@ public class MoCModelBigCat extends ModelBase { private float prevMouthAngle; private boolean isChested; private boolean diving; - private boolean isSitting; + protected boolean isSitting; public MoCModelBigCat() { this.textureWidth = 128; @@ -549,6 +549,7 @@ public MoCModelBigCat() { } public void updateAnimationModifiers(Entity entity) { + System.out.println("Updating animation modifiers for "+entity); MoCEntityBigCat bigcat = (MoCEntityBigCat) entity; this.isFlyer = bigcat.isFlyer(); this.isSaddled = bigcat.getIsRideable(); diff --git a/src/main/java/drzhark/mocreatures/client/model/MoCModelManticorePet.java b/src/main/java/drzhark/mocreatures/client/model/MoCModelManticorePet.java index d3c061b1b..15cd5a88d 100644 --- a/src/main/java/drzhark/mocreatures/client/model/MoCModelManticorePet.java +++ b/src/main/java/drzhark/mocreatures/client/model/MoCModelManticorePet.java @@ -23,6 +23,7 @@ public void updateAnimationModifiers(Entity entity) { this.hasSaberTeeth = true; this.onAir = manticorePet.isOnAir(); this.hasStinger = true; + this.isSitting = manticorePet.getIsSitting(); this.isMovingVertically = manticorePet.motionY != 0 && !manticorePet.onGround; this.hasChest = false; this.isTamed = false; diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index 8c132b00c..596150574 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -76,7 +76,6 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { final ItemStack stack = player.getHeldItem(hand); if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { - System.out.println("Yes whipped. Value of getIsSitting() is "+getIsSitting()); // TODO: Make Manticore stop moving, add orientation/model positioning setSitting(!getIsSitting()); return true; From fa64d7d4e1ed8dda70c3a03cf9f7f844819eab6c Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:34:42 -0800 Subject: [PATCH 09/11] cleanup/nitfixes --- .../java/drzhark/mocreatures/client/model/MoCModelBigCat.java | 2 +- .../mocreatures/entity/hunter/MoCEntityManticorePet.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java index 99a60e342..b360d7f8f 100644 --- a/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java +++ b/src/main/java/drzhark/mocreatures/client/model/MoCModelBigCat.java @@ -549,7 +549,6 @@ public MoCModelBigCat() { } public void updateAnimationModifiers(Entity entity) { - System.out.println("Updating animation modifiers for "+entity); MoCEntityBigCat bigcat = (MoCEntityBigCat) entity; this.isFlyer = bigcat.isFlyer(); this.isSaddled = bigcat.getIsRideable(); @@ -697,6 +696,7 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f this.Tail2.rotateAngleY = interpolatedTailSwingYaw; // Save the current value for the next frame's interpolation this.prevTailSwingYaw = interpolatedTailSwingYaw; + if (this.isSitting) { stingYOffset = 17F; stingZOffset = -3F; diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java index 596150574..ebe5ced4a 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityManticorePet.java @@ -76,7 +76,6 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { final ItemStack stack = player.getHeldItem(hand); if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.whip)) { - // TODO: Make Manticore stop moving, add orientation/model positioning setSitting(!getIsSitting()); return true; } From 4b99966ed7da8f3cad5b8806a30f4ff6c092e1b5 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:41:02 -0800 Subject: [PATCH 10/11] add comment to movement ceased funct --- src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java index 8395876fb..fd8db7c6b 100644 --- a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java +++ b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java @@ -886,7 +886,8 @@ public boolean getIsSitting() { @Override public boolean isMovementCeased() { - return getIsSitting() || this.isBeingRidden(); + System.out.println(this+"Is sitting? "+this.getIsSitting()); + return this.getIsSitting() || this.isBeingRidden(); } public boolean getIsHunting() { From c5d197b4d7d143d1b999a3a84ebbff0c453a54a1 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Sun, 31 Dec 2023 13:56:22 -0800 Subject: [PATCH 11/11] comment cleanup --- src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java index fd8db7c6b..8cf7e5c59 100644 --- a/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java +++ b/src/main/java/drzhark/mocreatures/entity/MoCEntityAnimal.java @@ -886,7 +886,6 @@ public boolean getIsSitting() { @Override public boolean isMovementCeased() { - System.out.println(this+"Is sitting? "+this.getIsSitting()); return this.getIsSitting() || this.isBeingRidden(); }