Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2025-01-11 23:51:11 +01:00
Ursprung
71a975b805
Commit
15522aed52
@ -50,7 +50,7 @@ public class FishingHookEntity extends ThrowableEntity {
|
|||||||
private boolean inWater = false;
|
private boolean inWater = false;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final boolean isOwnerSessionPlayer;
|
private final long bedrockOwnerId;
|
||||||
@Getter
|
@Getter
|
||||||
private long bedrockTargetId;
|
private long bedrockTargetId;
|
||||||
|
|
||||||
@ -66,14 +66,8 @@ public class FishingHookEntity extends ThrowableEntity {
|
|||||||
// so that it can be handled by moveAbsoluteImmediate.
|
// so that it can be handled by moveAbsoluteImmediate.
|
||||||
setBoundingBoxHeight(128);
|
setBoundingBoxHeight(128);
|
||||||
|
|
||||||
isOwnerSessionPlayer = owner.getGeyserId() == session.getPlayerEntity().getGeyserId();
|
this.bedrockOwnerId = owner.getGeyserId();
|
||||||
this.dirtyMetadata.put(EntityData.OWNER_EID, owner.getGeyserId());
|
this.dirtyMetadata.put(EntityData.OWNER_EID, this.bedrockOwnerId);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void spawnEntity() {
|
|
||||||
|
|
||||||
super.spawnEntity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHookedEntity(IntEntityMetadata entityMetadata) {
|
public void setHookedEntity(IntEntityMetadata entityMetadata) {
|
||||||
|
@ -119,8 +119,8 @@ public class JavaEntityEventTranslator extends PacketTranslator<ClientboundEntit
|
|||||||
// Player is pulled from a fishing rod
|
// Player is pulled from a fishing rod
|
||||||
// The physics of this are clientside on Java
|
// The physics of this are clientside on Java
|
||||||
FishingHookEntity fishingHook = (FishingHookEntity) entity;
|
FishingHookEntity fishingHook = (FishingHookEntity) entity;
|
||||||
if (fishingHook.isOwnerSessionPlayer()) {
|
if (fishingHook.getBedrockTargetId() == session.getPlayerEntity().getGeyserId()) {
|
||||||
Entity hookOwner = session.getEntityCache().getEntityByGeyserId(fishingHook.getBedrockTargetId());
|
Entity hookOwner = session.getEntityCache().getEntityByGeyserId(fishingHook.getBedrockOwnerId());
|
||||||
if (hookOwner != null) {
|
if (hookOwner != null) {
|
||||||
// https://minecraft.gamepedia.com/Fishing_Rod#Hooking_mobs_and_other_entities
|
// https://minecraft.gamepedia.com/Fishing_Rod#Hooking_mobs_and_other_entities
|
||||||
SetEntityMotionPacket motionPacket = new SetEntityMotionPacket();
|
SetEntityMotionPacket motionPacket = new SetEntityMotionPacket();
|
||||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren