Skip to content

Commit

Permalink
Merge pull request #94 from demonlexe/86-whip-not-working-manticore
Browse files Browse the repository at this point in the history
Fix for Whip Not Working on Manticore
  • Loading branch information
IcarussOne authored Dec 31, 2023
2 parents 844fdc4 + c5d197b commit a3d0ec3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ public boolean getIsSitting() {

@Override
public boolean isMovementCeased() {
return getIsSitting() || this.isBeingRidden();
return this.getIsSitting() || this.isBeingRidden();
}

public boolean getIsHunting() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,6 +74,12 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) {
return tameResult;
}

final ItemStack stack = player.getHeldItem(hand);
if (!stack.isEmpty() && getIsTamed() && (stack.getItem() == MoCItems.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;
Expand Down

0 comments on commit a3d0ec3

Please sign in to comment.