Merge pull request #189 from lenis0012/master

fix metadata type mismatch
This commit is contained in:
Myles 2016-03-10 16:21:02 +00:00
commit c08a38ff21
3 changed files with 26 additions and 2 deletions

View File

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

View File

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

View File

@ -18,3 +18,5 @@ hologram-y: -1
simulate-pt: true
# Should we patch boss bars so they work? (Default: true, disable if you're having issues)
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