Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4722202468 committed Jun 8, 2022
1 parent a97979b commit 712e6bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/main/java/net/worldseed/multipart/GenericModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minestom.server.coordinate.Point;
import net.minestom.server.entity.Entity;
import net.minestom.server.entity.Player;
import org.jetbrains.annotations.ApiStatus;

import java.util.Set;
Expand Down Expand Up @@ -68,7 +67,7 @@ public interface GenericModel {

void mountEntity(Entity entity);
void dismountEntity(Entity entity);
Set<Entity> getPassenger();
Set<Entity> getPassengers();

/**
* Get a VFX bone location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void dismountEntity(Entity e) {
this.seat.getEntity().removePassenger(e);
}

public Set<Entity> getPassenger() {
public Set<Entity> getPassengers() {
return this.seat.getEntity().getPassengers();
}

Expand Down
7 changes: 4 additions & 3 deletions src/test/java/GemGolem/GemGolemMob.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public GemGolemMob(Instance instance, Pos pos) {
private void facePlayer() {
Entity target = this.getTarget();
if (target == null) return;
if (getRider().contains(target)) return;
if (getPassengers().contains(target)) return;

Point e = this.position.sub(target.getPosition());
model.setGlobalRotation(-PositionUtils.getLookYaw(e.x(), e.z()) + 180);
Expand Down Expand Up @@ -117,7 +117,8 @@ public boolean isSleeping() {
return sleeping;
}

public Set<Entity> getRider() {
return model.getPassenger();
@Override
public @NotNull Set<Entity> getPassengers() {
return model.getPassengers();
}
}
4 changes: 2 additions & 2 deletions src/test/java/GemGolem/GemGolemMoveGoal.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public GemGolemMoveGoal(@NotNull GemGolemMob entityCreature, AnimationHandler ha
public boolean shouldStart() {
target = findTarget();
if (target == null) return false;
if (((GemGolemMob)entityCreature).getRider().contains(target)) return false;
if (entityCreature.getPassengers().contains(target)) return false;
if (((GemGolemMob)entityCreature).isSleeping()) return false;
if (!this.animationHandler.getPlaying().equals("idle_extended")) return false;

Expand Down Expand Up @@ -78,7 +78,7 @@ public boolean shouldEnd() {
|| target.isRemoved()
|| entityCreature.getDistance(target) >= maxDistance
|| entityCreature.getDistance(target) <= minDistance
|| (((GemGolemMob)entityCreature).getRider().contains(target))
|| (((GemGolemMob)entityCreature).getPassengers().contains(target))
|| !this.animationHandler.getPlaying().equals("walk");
}

Expand Down

0 comments on commit 712e6bf

Please sign in to comment.