From 43e805d46ffb992f215318e7b372e50e29e7dfdf Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 24 Oct 2023 16:23:21 +0200 Subject: [PATCH] Add some getters to REntity and RArmorStand, RFallingBlockEntity, RPlayer --- .../src/de/steamwar/entity/RArmorStand.java | 2 ++ SpigotCore_Main/src/de/steamwar/entity/REntity.java | 12 ++++++++++++ .../src/de/steamwar/entity/RFallingBlockEntity.java | 5 +++++ SpigotCore_Main/src/de/steamwar/entity/RPlayer.java | 2 ++ 4 files changed, 21 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java b/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java index 369754a..420c6f4 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RArmorStand.java @@ -21,6 +21,7 @@ package de.steamwar.entity; import de.steamwar.core.BountifulWrapper; import de.steamwar.core.Core; +import lombok.Getter; import org.bukkit.Location; import org.bukkit.entity.EntityType; @@ -49,6 +50,7 @@ public class RArmorStand extends REntity { private static final Object sizeWatcher = BountifulWrapper.impl.getDataWatcherObject(sizeIndex(), Byte.class); + @Getter private final Size size; public RArmorStand(REntityServer server, Location location, Size size) { diff --git a/SpigotCore_Main/src/de/steamwar/entity/REntity.java b/SpigotCore_Main/src/de/steamwar/entity/REntity.java index e819cf6..1868c26 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/REntity.java +++ b/SpigotCore_Main/src/de/steamwar/entity/REntity.java @@ -59,9 +59,13 @@ public class REntity { private byte pitch; private byte headYaw; + @Getter private boolean invisible; + @Getter private FlatteningWrapper.EntityPose pose = FlatteningWrapper.EntityPose.NORMAL; + @Getter private boolean bowDrawn; + @Getter private boolean noGravity; private boolean isGlowing; private int fireTick; @@ -186,6 +190,10 @@ public class REntity { server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus())); } + public boolean isOnFire() { + return fireTick == -1 || fireTick > 0; + } + public void setInvisible(boolean invisible) { this.invisible = invisible; server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus())); @@ -230,6 +238,10 @@ public class REntity { } } + public boolean isGlowing() { + return isGlowing; + } + public double getX() { return x; } diff --git a/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java b/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java index b17fefa..ae70775 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RFallingBlockEntity.java @@ -21,14 +21,19 @@ package de.steamwar.entity; import de.steamwar.core.Core; import de.steamwar.techhider.BlockIds; +import lombok.Getter; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.EntityType; +@Getter public class RFallingBlockEntity extends REntity{ + private final Material material; + public RFallingBlockEntity(REntityServer server, Location location, Material material) { super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(material) >> (Core.getVersion() <= 12 ? 4 : 0)); + this.material = material; server.addEntity(this); } } diff --git a/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java b/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java index dde86cb..c0f3a6b 100644 --- a/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java +++ b/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java @@ -25,6 +25,7 @@ import de.steamwar.core.BountifulWrapper; import de.steamwar.core.Core; import de.steamwar.core.FlatteningWrapper; import de.steamwar.core.ProtocolWrapper; +import lombok.Getter; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.EntityType; @@ -72,6 +73,7 @@ public class RPlayer extends REntity { private static final Object skinPartsDataWatcher = BountifulWrapper.impl.getDataWatcherObject(skinPartsIndex(), Byte.class); + @Getter private final String name; public RPlayer(REntityServer server, UUID uuid, String name, Location location) {