diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/SaddlePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/SaddlePeripheral.java index 82be589f7..ccd1ec2a8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/SaddlePeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/SaddlePeripheral.java @@ -69,8 +69,7 @@ public void detach(@NotNull IComputerAccess computer) { public void update() { if (this.seat != null) { if (!this.seat.isAlive()) { - this.seat = null; - this.hasRiderFlag.set(false); + this.standUp(); return; } this.seat.keepAlive(); @@ -126,6 +125,9 @@ private boolean standUp() { this.seat.discard(); this.seat = null; this.hasRiderFlag.set(false); + if (owner.getTurtle() instanceof TurtleBrain brain) { + brain.getOwner().createServerComputer().queueEvent("saddle_release"); + } return isVehicle; } @@ -148,6 +150,9 @@ public MethodResult capture() { if (!sitDown(entity)) { return MethodResult.of(null, "Entity cannot sit"); } + if (owner.getTurtle() instanceof TurtleBrain brain) { + brain.getOwner().createServerComputer().queueEvent("saddle_capture"); + } return MethodResult.of(true); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/entity/TurtleSeatEntity.java b/src/main/java/de/srendi/advancedperipherals/common/entity/TurtleSeatEntity.java index 68a947cf0..66aa8a9b5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/entity/TurtleSeatEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/entity/TurtleSeatEntity.java @@ -14,7 +14,6 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.HasCustomInventoryScreen; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.PlayerRideableJumping; import net.minecraft.world.entity.TamableAnimal; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -26,7 +25,7 @@ import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import net.minecraft.resources.ResourceLocation; -public class TurtleSeatEntity extends Entity implements HasCustomInventoryScreen, PlayerRideableJumping { +public class TurtleSeatEntity extends Entity implements HasCustomInventoryScreen { private ITurtleAccess turtle; private int life; @@ -109,22 +108,6 @@ public void openCustomInventoryScreen(Player player) { } } - public void onPlayerJump(int power) { - // - } - - public boolean canJump() { - return true; - } - - public void handleStartJump(int power) { - // - } - - public void handleStopJump() { - // - } - public static class Renderer extends EntityRenderer { public Renderer(EntityRendererProvider.Context ctx) { super(ctx);