3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-09 17:50:23 +01:00

Allow the suppressing of metadata errors.

Dieser Commit ist enthalten in:
Myles 2016-03-07 22:55:57 +00:00
Ursprung 3780210f76
Commit 6a449f8db1
3 geänderte Dateien mit 19 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -184,6 +184,10 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
return getConfig().getBoolean("prevent-collision", true); return getConfig().getBoolean("prevent-collision", true);
} }
public boolean isSuppressMetadataErrors() {
return getConfig().getBoolean("suppress-metadata-errors", false);
}
public boolean isAutoTeam() { public boolean isAutoTeam() {
// Collision has to be enabled first // Collision has to be enabled first
if (!isPreventCollision()) return false; if (!isPreventCollision()) return false;

Datei anzeigen

@ -6,6 +6,8 @@ import lombok.Setter;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.util.EulerAngle; import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
import us.myles.ViaVersion.slot.ItemSlotRewriter; import us.myles.ViaVersion.slot.ItemSlotRewriter;
import us.myles.ViaVersion.slot.ItemSlotRewriter.ItemStack; import us.myles.ViaVersion.slot.ItemSlotRewriter.ItemStack;
import us.myles.ViaVersion.transformers.OutgoingTransformer; import us.myles.ViaVersion.transformers.OutgoingTransformer;
@ -117,11 +119,12 @@ public class MetadataRewriter {
} }
} }
} catch (Exception e) { } catch (Exception e) {
if (!((ViaVersionPlugin) ViaVersion.getInstance()).isSuppressMetadataErrors()) {
System.out.println("INCLUDE THIS IN YOUR ERROR LOG!"); System.out.println("INCLUDE THIS IN YOUR ERROR LOG!");
if (type != null) if (type != null)
System.out.println("An error occurred with entity meta data for " + type + " OldID: " + entry.oldID); System.out.println("An error occurred with entity meta data for " + type + " OldID: " + entry.oldID);
else else
System.out.println("An error occurred with entity meta data for UNKOWN_ENTITY OldID: " + entry.oldID); System.out.println("An error occurred with entity meta data for UNKNOWN_ENTITY OldID: " + entry.oldID);
if (metaIndex != null) { if (metaIndex != null) {
System.out.println("Old ID: " + metaIndex.getIndex() + " New ID: " + metaIndex.getNewIndex()); System.out.println("Old ID: " + metaIndex.getIndex() + " New ID: " + metaIndex.getNewIndex());
System.out.println("Old Type: " + metaIndex.getOldType() + " New Type: " + metaIndex.getNewType()); System.out.println("Old Type: " + metaIndex.getOldType() + " New Type: " + metaIndex.getNewType());
@ -129,6 +132,7 @@ public class MetadataRewriter {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
output.writeByte(255); output.writeByte(255);
} }

Datei anzeigen

@ -8,3 +8,5 @@ sync-chunks: true
prevent-collision: true prevent-collision: true
# If the above is true, should we automatically team players until you do? # If the above is true, should we automatically team players until you do?
auto-team: true auto-team: true
# When enabled if certain metadata can't be read we won't tell you about it
suppress-metadata-errors: false