mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-29 15:49:09 +01:00
parent
71a975b805
commit
15522aed52
2 changed files with 5 additions and 11 deletions
|
@ -50,7 +50,7 @@ public class FishingHookEntity extends ThrowableEntity {
|
|||
private boolean inWater = false;
|
||||
|
||||
@Getter
|
||||
private final boolean isOwnerSessionPlayer;
|
||||
private final long bedrockOwnerId;
|
||||
@Getter
|
||||
private long bedrockTargetId;
|
||||
|
||||
|
@ -66,14 +66,8 @@ public class FishingHookEntity extends ThrowableEntity {
|
|||
// so that it can be handled by moveAbsoluteImmediate.
|
||||
setBoundingBoxHeight(128);
|
||||
|
||||
isOwnerSessionPlayer = owner.getGeyserId() == session.getPlayerEntity().getGeyserId();
|
||||
this.dirtyMetadata.put(EntityData.OWNER_EID, owner.getGeyserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnEntity() {
|
||||
|
||||
super.spawnEntity();
|
||||
this.bedrockOwnerId = owner.getGeyserId();
|
||||
this.dirtyMetadata.put(EntityData.OWNER_EID, this.bedrockOwnerId);
|
||||
}
|
||||
|
||||
public void setHookedEntity(IntEntityMetadata entityMetadata) {
|
||||
|
|
|
@ -119,8 +119,8 @@ public class JavaEntityEventTranslator extends PacketTranslator<ClientboundEntit
|
|||
// Player is pulled from a fishing rod
|
||||
// The physics of this are clientside on Java
|
||||
FishingHookEntity fishingHook = (FishingHookEntity) entity;
|
||||
if (fishingHook.isOwnerSessionPlayer()) {
|
||||
Entity hookOwner = session.getEntityCache().getEntityByGeyserId(fishingHook.getBedrockTargetId());
|
||||
if (fishingHook.getBedrockTargetId() == session.getPlayerEntity().getGeyserId()) {
|
||||
Entity hookOwner = session.getEntityCache().getEntityByGeyserId(fishingHook.getBedrockOwnerId());
|
||||
if (hookOwner != null) {
|
||||
// https://minecraft.gamepedia.com/Fishing_Rod#Hooking_mobs_and_other_entities
|
||||
SetEntityMotionPacket motionPacket = new SetEntityMotionPacket();
|
||||
|
|
Loading…
Reference in a new issue