Skip to content

Commit

Permalink
Reapply "nit; only allow any pets to start riding player from server …
Browse files Browse the repository at this point in the history
…side, do not initiate at all from client"

This reverts commit 7dcaff0.
  • Loading branch information
demonlexe committed Aug 23, 2024
1 parent 7dcaff0 commit 6539bf5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6539bf5

Please sign in to comment.