Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Fix BarAPI, (adds new metaindex, and change colour to be right and remove debug)
Dieser Commit ist enthalten in:
Ursprung
c42b9351b8
Commit
1b77e1c89f
@ -92,6 +92,7 @@ public enum MetaIndex {
|
|||||||
WITHER_TARGET3(Wither.class, 19, Type.Int, 13, NewType.VarInt),
|
WITHER_TARGET3(Wither.class, 19, Type.Int, 13, NewType.VarInt),
|
||||||
WITHER_INVULN_TIME(Wither.class, 20, Type.Int, 14, NewType.VarInt),
|
WITHER_INVULN_TIME(Wither.class, 20, Type.Int, 14, NewType.VarInt),
|
||||||
WITHER_PROPERTIES(Wither.class, 10, Type.Byte, NewType.Byte),
|
WITHER_PROPERTIES(Wither.class, 10, Type.Byte, NewType.Byte),
|
||||||
|
WITHER_UNKNOWN(Wither.class, 11, Type.Byte, NewType.Discontinued),
|
||||||
// wither skull
|
// wither skull
|
||||||
WITHERSKULL_INVULN(WitherSkull.class, 10, Type.Byte, 5, NewType.Boolean),
|
WITHERSKULL_INVULN(WitherSkull.class, 10, Type.Byte, 5, NewType.Boolean),
|
||||||
// guardian
|
// guardian
|
||||||
@ -125,9 +126,12 @@ public enum MetaIndex {
|
|||||||
ITEMFRAME_ROTATION(ItemFrame.class, 9, Type.Byte, 6, NewType.VarInt),
|
ITEMFRAME_ROTATION(ItemFrame.class, 9, Type.Byte, 6, NewType.VarInt),
|
||||||
// ender crystal
|
// ender crystal
|
||||||
ENDERCRYSTAL_HEALTH(EnderCrystal.class, 8, Type.Int, NewType.Discontinued),
|
ENDERCRYSTAL_HEALTH(EnderCrystal.class, 8, Type.Int, NewType.Discontinued),
|
||||||
// Ender dragon
|
// Ender dragon boss bar issues
|
||||||
|
ENDERDRAGON_UNKNOWN(EnderDragon.class, 5, Type.Byte, NewType.Discontinued),
|
||||||
|
ENDERDRAGON_NAME(EnderDragon.class, 10, Type.String, NewType.Discontinued),
|
||||||
|
// Normal Ender dragon
|
||||||
ENDERDRAGON_FLAG(EnderDragon.class, 15, Type.Byte, NewType.Discontinued),
|
ENDERDRAGON_FLAG(EnderDragon.class, 15, Type.Byte, NewType.Discontinued),
|
||||||
ENDERDRAGON_PHASE(EnderDragon.class, 11, Type.Int, NewType.VarInt);
|
ENDERDRAGON_PHASE(EnderDragon.class, 11, Type.Byte, NewType.VarInt);
|
||||||
|
|
||||||
private Class<?> clazz;
|
private Class<?> clazz;
|
||||||
private int newIndex;
|
private int newIndex;
|
||||||
|
@ -850,7 +850,7 @@ public class OutgoingTransformer {
|
|||||||
}
|
}
|
||||||
// Fix: Dragon (crash fix)
|
// Fix: Dragon (crash fix)
|
||||||
if(type == EntityType.ENDER_DRAGON) {
|
if(type == EntityType.ENDER_DRAGON) {
|
||||||
list.add(new Entry(MetaIndex.ENDERDRAGON_PHASE, 0, 11));
|
list.add(new Entry(MetaIndex.ENDERDRAGON_PHASE, (byte) 0, 11));
|
||||||
}
|
}
|
||||||
MetadataRewriter.writeMetadata1_9(type, list, output);
|
MetadataRewriter.writeMetadata1_9(type, list, output);
|
||||||
}
|
}
|
||||||
@ -904,7 +904,7 @@ public class OutgoingTransformer {
|
|||||||
String title = (String) entry.getValue();
|
String title = (String) entry.getValue();
|
||||||
title = title.isEmpty() ? (type == EntityType.ENDER_DRAGON ? "Ender Dragon" : "Wither") : title;
|
title = title.isEmpty() ? (type == EntityType.ENDER_DRAGON ? "Ender Dragon" : "Wither") : title;
|
||||||
if (bar == null) {
|
if (bar == null) {
|
||||||
bar = ViaVersion.getInstance().createBossBar(title, BossColor.PURPLE, BossStyle.SOLID);
|
bar = ViaVersion.getInstance().createBossBar(title, BossColor.PINK, BossStyle.SOLID);
|
||||||
bossBarMap.put(entityID, bar);
|
bossBarMap.put(entityID, bar);
|
||||||
bar.addPlayer(info.getPlayer());
|
bar.addPlayer(info.getPlayer());
|
||||||
bar.show();
|
bar.show();
|
||||||
@ -916,10 +916,9 @@ public class OutgoingTransformer {
|
|||||||
// Make health range between 0 and 1
|
// Make health range between 0 and 1
|
||||||
float maxHealth = type == EntityType.ENDER_DRAGON ? 200.0f : 300.0f;
|
float maxHealth = type == EntityType.ENDER_DRAGON ? 200.0f : 300.0f;
|
||||||
float health = Math.max(0.0f, Math.min(((float) entry.getValue()) / maxHealth, 1.0f));
|
float health = Math.max(0.0f, Math.min(((float) entry.getValue()) / maxHealth, 1.0f));
|
||||||
System.out.println(health + " " + entry.getValue());
|
|
||||||
if (bar == null) {
|
if (bar == null) {
|
||||||
String title = type == EntityType.ENDER_DRAGON ? "Ender Dragon" : "Wither";
|
String title = type == EntityType.ENDER_DRAGON ? "Ender Dragon" : "Wither";
|
||||||
bar = ViaVersion.getInstance().createBossBar(title, health, BossColor.PURPLE, BossStyle.SOLID);
|
bar = ViaVersion.getInstance().createBossBar(title, health, BossColor.PINK, BossStyle.SOLID);
|
||||||
bossBarMap.put(entityID, bar);
|
bossBarMap.put(entityID, bar);
|
||||||
bar.addPlayer(info.getPlayer());
|
bar.addPlayer(info.getPlayer());
|
||||||
bar.show();
|
bar.show();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren