From 4f24fe862dde3401b961097205f0919b093c31db Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 21 Feb 2023 10:15:52 +0100 Subject: [PATCH] Fix REntity initialization --- SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java | 3 ++- SpigotCore_Main/src/de/steamwar/entity/REntity.java | 4 +--- .../src/de/steamwar/entity/RFallingBlockEntity.java | 1 + SpigotCore_Main/src/de/steamwar/entity/RPlayer.java | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java b/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java index 5513d2b..369754a 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java @@ -52,8 +52,9 @@ public class RArmorStand extends REntity { private final Size size; public RArmorStand(REntityServer server, Location location, Size size) { - super(server, EntityType.ARMOR_STAND, location); + super(server, EntityType.ARMOR_STAND, location, 0); this.size = size; + server.addEntity(this); } @Override diff --git a/SpigotCore_Main/src/de/steamwar/entity/REntity.java b/SpigotCore_Main/src/de/steamwar/entity/REntity.java index 5d01b40..83dc391 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/REntity.java +++ b/SpigotCore_Main/src/de/steamwar/entity/REntity.java @@ -30,7 +30,6 @@ import lombok.Getter; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; import java.util.*; import java.util.function.Consumer; @@ -77,6 +76,7 @@ public class REntity { public REntity(REntityServer server, EntityType entityType, Location location) { this(server,entityType,location,0); + server.addEntity(this); } protected REntity(REntityServer server, EntityType entityType, Location location,int objectData) { @@ -101,8 +101,6 @@ public class REntity { this.isGlowing = false; this.objectData = objectData; - - server.addEntity(this); } public void move(Location location) { diff --git a/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java b/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java index b436997..b17fefa 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java @@ -29,5 +29,6 @@ public class RFallingBlockEntity extends REntity{ public RFallingBlockEntity(REntityServer server, Location location, Material material) { super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(material) >> (Core.getVersion() <= 12 ? 4 : 0)); + server.addEntity(this); } } diff --git a/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java b/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java index fa6d513..c862db6 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java @@ -79,6 +79,7 @@ public class RPlayer extends REntity { super(server, EntityType.PLAYER, uuid, location,0); this.name = name; //team.addEntry(name); + server.addEntity(this); } @Override