Add rotation to /spawn (#2372)

This commit is contained in:
jie65535
2023-09-17 10:55:25 +08:00
committed by GitHub
parent 92bd09eeed
commit 5f5e6c38b1
11 changed files with 52 additions and 47 deletions

View File

@@ -18,8 +18,8 @@ public class EntityHomeAnimal extends EntityMonster implements Rebornable {
@Getter private final int rebirthCD;
private final AtomicBoolean disappeared = new AtomicBoolean();
public EntityHomeAnimal(Scene scene, HomeWorldAnimalData data, Position pos) {
super(scene, GameData.getMonsterDataMap().get(data.getMonsterID()), pos, 1);
public EntityHomeAnimal(Scene scene, HomeWorldAnimalData data, Position pos, Position rot) {
super(scene, GameData.getMonsterDataMap().get(data.getMonsterID()), pos, rot, 1);
this.rebornPos = pos.clone();
this.rebirth = data.getIsRebirth();

View File

@@ -54,14 +54,14 @@ public class EntityMonster extends GameEntity {
@Getter private List<Player> playerOnBattle;
@Nullable @Getter @Setter private SceneMonster metaMonster;
public EntityMonster(Scene scene, MonsterData monsterData, Position pos, int level) {
public EntityMonster(Scene scene, MonsterData monsterData, Position pos, Position rot, int level) {
super(scene);
this.id = this.getWorld().getNextEntityId(EntityIdType.MONSTER);
this.monsterData = monsterData;
this.fightProperties = new Int2FloatOpenHashMap();
this.position = new Position(pos);
this.rotation = new Position();
this.rotation = new Position(rot);
this.bornPos = this.getPosition().clone();
this.level = level;
this.playerOnBattle = new ArrayList<>();