SteamWar/SpigotCore
Archiviert
13
0

Add some getters to REntity and RArmorStand, RFallingBlockEntity, RPlayer #248

Zusammengeführt
Lixfel hat 1 Commits von REntityUpdate nach master 2023-10-24 16:36:15 +02:00 zusammengeführt
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.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) {

Datei anzeigen

@ -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() {
Review

Warum hier nicht @Getter?

Warum hier nicht @Getter?
return isGlowing;
}
public double getX() {
return x;
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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) {