SteamWar/FightSystem
Archiviert
13
1

Fix 1.7 init
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-03-05 16:31:17 +01:00
Ursprung c4a2d8a04b
Commit e66f108823
4 geänderte Dateien mit 16 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -128,6 +128,11 @@ public class BountifulWrapper8 implements BountifulWrapper.IBountifulWrapper {
// field not present
}
@Override
public void setNamedSpawnPosition(Object packet, double x, double y, double z) {
//no implementation for 1.8
}
private final Set<Player> seesDragon = new HashSet<>();
private final PacketPlayOutSpawnEntityLiving spawnDragon;
private final int spawnDragonId;

Datei anzeigen

@ -162,6 +162,15 @@ public class BountifulWrapper9 implements BountifulWrapper.IBountifulWrapper {
spawnUUID.set(packet, uuid);
}
private static final Reflection.FieldAccessor<Double> namedSpawnX = Reflection.getField(REntity.namedSpawnPacket, double.class, 0);
private static final Reflection.FieldAccessor<Double> namedSpawnY = Reflection.getField(REntity.namedSpawnPacket, double.class, 1);
private static final Reflection.FieldAccessor<Double> namedSpawnZ = Reflection.getField(REntity.namedSpawnPacket, double.class, 2);
@Override
public void setNamedSpawnPosition(Object packet, double x, double y, double z) {
namedSpawnX.set(packet, x);
namedSpawnY.set(packet, y);
namedSpawnZ.set(packet, z);
}
private final Map<Player, BossBar> barMap = new HashMap<>();
@Override

Datei anzeigen

@ -337,16 +337,11 @@ public class REntity {
public static final Class<?> namedSpawnPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutNamedEntitySpawn");
private static final Reflection.FieldAccessor<Integer> namedSpawnEntity = Reflection.getField(namedSpawnPacket, int.class, 0);
private static final Reflection.FieldAccessor<UUID> namedSpawnUUID = Reflection.getField(namedSpawnPacket, UUID.class, 0);
private static final Reflection.FieldAccessor<Double> namedSpawnX = Reflection.getField(namedSpawnPacket, double.class, 0);
private static final Reflection.FieldAccessor<Double> namedSpawnY = Reflection.getField(namedSpawnPacket, double.class, 1);
private static final Reflection.FieldAccessor<Double> namedSpawnZ = Reflection.getField(namedSpawnPacket, double.class, 2);
private Object getNamedSpawnPacket(){
Object packet = Reflection.newInstance(namedSpawnPacket);
namedSpawnEntity.set(packet, entityId);
namedSpawnUUID.set(packet, uuid);
namedSpawnX.set(packet, locX);
namedSpawnY.set(packet, locY);
namedSpawnZ.set(packet, locZ);
BountifulWrapper.impl.setNamedSpawnPosition(packet, locX, locY, locZ);
FlatteningWrapper.impl.setNamedSpawnPacketDataWatcher(packet);
return packet;
}

Datei anzeigen

@ -54,6 +54,7 @@ public class BountifulWrapper {
Object getDataWatcherItem(Object dataWatcherObject, Object value);
void setTeleportPacketPosition(Object packet, double x, double y, double z);
void setSpawnPacketUUID(Object packet, UUID uuid);
void setNamedSpawnPosition(Object packet, double x, double y, double z);
void sendBar(Player player, FightTeam team, double progress, String text);
}