mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-04 08:56:01 +02:00
Fix destroyed state logging
This commit is contained in:
@@ -60,7 +60,6 @@ public class PlayerManager {
|
|||||||
Entity oldEntity = chunk.getEntity(blockCoordinate);
|
Entity oldEntity = chunk.getEntity(blockCoordinate);
|
||||||
|
|
||||||
if(oldEntity != null && oldEntity.getClass().getSimpleName() == entity.getClass().getSimpleName()) {
|
if(oldEntity != null && oldEntity.getClass().getSimpleName() == entity.getClass().getSimpleName()) {
|
||||||
oldEntity.setData("destroyed", true);
|
|
||||||
entity.setRotation(oldEntity.getRotation() + 1);
|
entity.setRotation(oldEntity.getRotation() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class Chunk extends GridPane {
|
|||||||
|
|
||||||
public void removeEntity(Coordinate pos) {
|
public void removeEntity(Coordinate pos) {
|
||||||
Entity entity = getEntity(pos);
|
Entity entity = getEntity(pos);
|
||||||
|
entity.setData("destroyed", true);
|
||||||
this.getChildren().remove(entity);
|
this.getChildren().remove(entity);
|
||||||
data[pos.x + pos.y * CHUNK_SIZE] = null;
|
data[pos.x + pos.y * CHUNK_SIZE] = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user