Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

150 bunny water desync issue #180

Draft
wants to merge 26 commits into
base: 1.12.2
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7c9d90e
partial fix; dismount command when going underwater
demonlexe Aug 22, 2024
84f3b82
nit; only allow bunny to start riding player from server side, do not…
demonlexe Aug 23, 2024
6e8f010
nit; only allow any pets to start riding player from server side, do …
demonlexe Aug 23, 2024
7dcaff0
Revert "nit; only allow any pets to start riding player from server s…
demonlexe Aug 23, 2024
6539bf5
Reapply "nit; only allow any pets to start riding player from server …
demonlexe Aug 23, 2024
59223d4
try to allow re-mounting if entity is the same as before
demonlexe Aug 23, 2024
48e926c
Merge remote-tracking branch 'origin/1.12.2' into 150-bunny-water-des…
demonlexe Aug 23, 2024
3aa4f8d
Revert "Reapply "nit; only allow any pets to start riding player from…
demonlexe Aug 25, 2024
5beb6b6
add rats dependency for testing
demonlexe Aug 25, 2024
b2c19c2
revert unneeded changes
demonlexe Aug 25, 2024
30a8d1d
add rats dependency, llibrary
demonlexe Aug 25, 2024
abf5619
fix rats version, add forced mounting
demonlexe Aug 25, 2024
b5b715b
WIP; start copying Rats workflow for mounting/dismounting
demonlexe Aug 25, 2024
a2e22db
add the rats riding logic
demonlexe Aug 25, 2024
265a256
cleanup MOCEntity_Riding_Player logic
demonlexe Aug 25, 2024
0c5b267
nitfixes, add messenging
demonlexe Aug 25, 2024
38af288
use two different messaging channels, client/server
demonlexe Aug 25, 2024
0ec37b0
move client handling code to packet task
demonlexe Aug 25, 2024
e14fa98
nit; entityId => passengerId
demonlexe Aug 25, 2024
2c40070
nitfix; remove from server side
demonlexe Aug 25, 2024
d237658
force the dismount from client and server side
demonlexe Aug 25, 2024
9750aad
try to remove separate client message
demonlexe Aug 25, 2024
00c6d75
try passing player to handler fm
demonlexe Aug 25, 2024
1631709
Revert "try passing player to handler fm"
demonlexe Aug 25, 2024
87444e0
Revert "try to remove separate client message"
demonlexe Aug 25, 2024
7e07d99
use sendToAll for more stability
demonlexe Aug 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nit; only allow any pets to start riding player from server side, do …
…not initiate at all from client
  • Loading branch information
demonlexe committed Aug 23, 2024
commit 6e8f010f2f1d7202f4c26ce926947df0a00c8980
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}