mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Merge pull request #189 from lenis0012/master
fix metadata type mismatch
This commit is contained in:
commit
c08a38ff21
@ -235,6 +235,10 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
|
||||
return getConfig().getBoolean("bossbar-patch", true);
|
||||
}
|
||||
|
||||
public boolean isBossbarAntiflicker() {
|
||||
return getConfig().getBoolean("bossbar-anti-flicker", false);
|
||||
}
|
||||
|
||||
public double getHologramYOffset() {
|
||||
return getConfig().getDouble("hologram-y", -1D);
|
||||
}
|
||||
|
@ -846,10 +846,28 @@ public class OutgoingTransformer {
|
||||
}
|
||||
// Fix: wither (crash fix)
|
||||
if(type == EntityType.WITHER) {
|
||||
// Remove custom value if already exist
|
||||
Iterator<Entry> it = list.iterator();
|
||||
while(it.hasNext()) {
|
||||
Entry e = it.next();
|
||||
if(e.getOldID() == 10) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
list.add(new Entry(MetaIndex.WITHER_PROPERTIES, (byte) 0, 10));
|
||||
}
|
||||
// Fix: Dragon (crash fix)
|
||||
if(type == EntityType.ENDER_DRAGON) {
|
||||
// Remove custom value if already exist
|
||||
Iterator<Entry> it = list.iterator();
|
||||
while(it.hasNext()) {
|
||||
Entry e = it.next();
|
||||
if(e.getOldID() == 11) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
list.add(new Entry(MetaIndex.ENDERDRAGON_PHASE, (byte) 0, 11));
|
||||
}
|
||||
MetadataRewriter.writeMetadata1_9(type, list, output);
|
||||
@ -911,7 +929,7 @@ public class OutgoingTransformer {
|
||||
} else {
|
||||
bar.setTitle(title);
|
||||
}
|
||||
} else if (entry.getOldID() == 6) {
|
||||
} else if (entry.getOldID() == 6 && !plugin.isBossbarAntiflicker()) { // If anti flicker is enabled, don't update health
|
||||
BossBar bar = bossBarMap.get(entityID);
|
||||
// Make health range between 0 and 1
|
||||
float maxHealth = type == EntityType.ENDER_DRAGON ? 200.0f : 300.0f;
|
||||
|
@ -17,4 +17,6 @@ hologram-y: -1
|
||||
# Enable player tick simulation, this fixes eating, drinking, nether portals.
|
||||
simulate-pt: true
|
||||
# Should we patch boss bars so they work? (Default: true, disable if you're having issues)
|
||||
bossbar-patch: true
|
||||
bossbar-patch: true
|
||||
# If your boss bar flickers on 1.9, set this to 'true'. It will keep all boss bars on 100% (not recommended)
|
||||
bossbar-anti-flicker: false
|
Loading…
Reference in New Issue
Block a user