From 6539bf56a9ec0f11cc30b53287502f3cec374354 Mon Sep 17 00:00:00 2001 From: Alexis Kaufman Date: Fri, 23 Aug 2024 08:08:17 -0500 Subject: [PATCH] Reapply "nit; only allow any pets to start riding player from server side, do not initiate at all from client" This reverts commit 7dcaff012cad4b05ca29dd0492ef4264b2262f2e. --- .../mocreatures/entity/hunter/MoCEntityPetScorpion.java | 4 ++-- .../drzhark/mocreatures/entity/hunter/MoCEntitySnake.java | 2 +- .../drzhark/mocreatures/entity/neutral/MoCEntityKitty.java | 4 ++-- .../drzhark/mocreatures/entity/passive/MoCEntityBird.java | 2 +- .../drzhark/mocreatures/entity/passive/MoCEntityBunny.java | 6 +----- .../drzhark/mocreatures/entity/passive/MoCEntityMouse.java | 2 +- .../drzhark/mocreatures/entity/passive/MoCEntityTurtle.java | 2 +- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityPetScorpion.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityPetScorpion.java index a10409f71..a938aa8b3 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityPetScorpion.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntityPetScorpion.java @@ -486,10 +486,10 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { } } - if (this.getRidingEntity() == null && this.getAge() < 60 && !getIsAdult()) { + if (!this.world.isRemote && this.getRidingEntity() == null && this.getAge() < 60 && !getIsAdult()) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; - if (!this.world.isRemote && !getIsTamed()) { + if (!getIsTamed()) { MoCTools.tameWithName(player, this); } } diff --git a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntitySnake.java b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntitySnake.java index ddcc5c561..c1d9a1a02 100644 --- a/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntitySnake.java +++ b/src/main/java/drzhark/mocreatures/entity/hunter/MoCEntitySnake.java @@ -175,7 +175,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { return false; } - if (this.getRidingEntity() == null) { + if (!this.world.isRemote && this.getRidingEntity() == null) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; } diff --git a/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java b/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java index 8bdd4c751..7410a1a81 100644 --- a/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java +++ b/src/main/java/drzhark/mocreatures/entity/neutral/MoCEntityKitty.java @@ -476,7 +476,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { return MoCTools.tameWithName(player, this); } if (!stack.isEmpty() && getKittyState() > 2 && pickable() && stack.getItem() == Items.LEAD) { - if (this.startRidingPlayer(player)) { + if (!this.world.isRemote && this.startRidingPlayer(player)) { changeKittyState(14); } return true; @@ -490,7 +490,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { } // Can be picked up, then pick it up if (getKittyState() > 2 && pickable()) { - if (this.startRidingPlayer(player)) { + if (!this.world.isRemote && this.startRidingPlayer(player)) { changeKittyState(15); } return true; diff --git a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBird.java b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBird.java index 168c82f11..f30264d5f 100644 --- a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBird.java +++ b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBird.java @@ -324,7 +324,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { if (!getIsTamed()) { return false; } - if (this.getRidingEntity() == null) { + if (!this.world.isRemote && this.getRidingEntity() == null) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; } diff --git a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBunny.java b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBunny.java index 3cd3a7f76..00b04d62f 100644 --- a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBunny.java +++ b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityBunny.java @@ -182,7 +182,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { MoCTools.playCustomSound(this, MoCSoundEvents.ENTITY_GENERIC_EAT); return true; } - if (this.getRidingEntity() == null && !this.world.isRemote) { + if (!this.world.isRemote && this.getRidingEntity() == null) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; if (!getIsTamed()) { @@ -203,10 +203,6 @@ public void onUpdate() { if (this.getRidingEntity() != null) { this.rotationYaw = this.getRidingEntity().rotationYaw; } - if (this.isInsideOfMaterial(Material.WATER) && this.isRiding() && this.getRidingEntity() != null && this.getRidingEntity().isInWater()) - { - MoCTools.dismountPassengerFromEntity(this, this.getRidingEntity(), true); - } if (!this.world.isRemote) { if (--this.jumpTimer <= 0 && this.onGround && ((this.motionX > 0.05D) || (this.motionZ > 0.05D) || (this.motionX < -0.05D) || (this.motionZ < -0.05D))) { this.motionY = 0.3D; diff --git a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityMouse.java b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityMouse.java index 2174c5ec9..543f9ec33 100644 --- a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityMouse.java +++ b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityMouse.java @@ -155,7 +155,7 @@ public double getYOffset() { @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { - if (this.getRidingEntity() == null) { + if (!this.world.isRemote && this.getRidingEntity() == null) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; } diff --git a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityTurtle.java b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityTurtle.java index 6e245b222..5754e5fb8 100644 --- a/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityTurtle.java +++ b/src/main/java/drzhark/mocreatures/entity/passive/MoCEntityTurtle.java @@ -147,7 +147,7 @@ public boolean processInteract(EntityPlayer player, EnumHand hand) { flipflop(false); return true; } - if (this.getRidingEntity() == null) { + if (!this.world.isRemote && this.getRidingEntity() == null) { if (this.startRidingPlayer(player)) { this.rotationYaw = player.rotationYaw; }