Skip to content

Commit

Permalink
remove rideableJumping interface on turtleSeat
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Apr 28, 2024
1 parent cd6288c commit 41e84d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<TurtleSeatEntity> {
public Renderer(EntityRendererProvider.Context ctx) {
super(ctx);
Expand Down

0 comments on commit 41e84d7

Please sign in to comment.