SteamWar/SpigotCore
Archiviert
13
0

Add some getters to REntity and RArmorStand, RFallingBlockEntity, RPlayer
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-10-24 16:23:21 +02:00
Ursprung 97461b198d
Commit 43e805d46f
4 geänderte Dateien mit 21 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.entity;
import de.steamwar.core.BountifulWrapper; import de.steamwar.core.BountifulWrapper;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import lombok.Getter;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.EntityType; 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); private static final Object sizeWatcher = BountifulWrapper.impl.getDataWatcherObject(sizeIndex(), Byte.class);
@Getter
private final Size size; private final Size size;
public RArmorStand(REntityServer server, Location location, Size size) { public RArmorStand(REntityServer server, Location location, Size size) {

Datei anzeigen

@ -59,9 +59,13 @@ public class REntity {
private byte pitch; private byte pitch;
private byte headYaw; private byte headYaw;
@Getter
private boolean invisible; private boolean invisible;
@Getter
private FlatteningWrapper.EntityPose pose = FlatteningWrapper.EntityPose.NORMAL; private FlatteningWrapper.EntityPose pose = FlatteningWrapper.EntityPose.NORMAL;
@Getter
private boolean bowDrawn; private boolean bowDrawn;
@Getter
private boolean noGravity; private boolean noGravity;
private boolean isGlowing; private boolean isGlowing;
private int fireTick; private int fireTick;
@ -186,6 +190,10 @@ public class REntity {
server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus())); server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus()));
} }
public boolean isOnFire() {
return fireTick == -1 || fireTick > 0;
}
public void setInvisible(boolean invisible) { public void setInvisible(boolean invisible) {
this.invisible = invisible; this.invisible = invisible;
server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus())); server.updateEntity(this, getDataWatcherPacket(entityStatusWatcher, getEntityStatus()));
@ -230,6 +238,10 @@ public class REntity {
} }
} }
public boolean isGlowing() {
return isGlowing;
}
public double getX() { public double getX() {
return x; return x;
} }

Datei anzeigen

@ -21,14 +21,19 @@ package de.steamwar.entity;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.techhider.BlockIds; import de.steamwar.techhider.BlockIds;
import lombok.Getter;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@Getter
public class RFallingBlockEntity extends REntity{ public class RFallingBlockEntity extends REntity{
private final Material material;
public RFallingBlockEntity(REntityServer server, Location location, 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)); super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(material) >> (Core.getVersion() <= 12 ? 4 : 0));
this.material = material;
server.addEntity(this); server.addEntity(this);
} }
} }

Datei anzeigen

@ -25,6 +25,7 @@ import de.steamwar.core.BountifulWrapper;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.FlatteningWrapper; import de.steamwar.core.FlatteningWrapper;
import de.steamwar.core.ProtocolWrapper; import de.steamwar.core.ProtocolWrapper;
import lombok.Getter;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.EntityType; 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); private static final Object skinPartsDataWatcher = BountifulWrapper.impl.getDataWatcherObject(skinPartsIndex(), Byte.class);
@Getter
private final String name; private final String name;
public RPlayer(REntityServer server, UUID uuid, String name, Location location) { public RPlayer(REntityServer server, UUID uuid, String name, Location location) {