Possibility to suppress type not found errors

This commit is contained in:
Matsv 2017-07-30 12:23:00 +02:00
parent 908931e174
commit 34ca6324c5
No known key found for this signature in database
GPG Key ID: 97CEC2A2EA31350F
3 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,7 @@ package nl.matsv.viabackwards.api.entities.types;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import nl.matsv.viabackwards.ViaBackwards; import nl.matsv.viabackwards.ViaBackwards;
import us.myles.ViaVersion.api.Via;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -30,7 +31,8 @@ public class EntityType1_10 {
type = EntityType.findById(typeID); type = EntityType.findById(typeID);
if (!type.isPresent()) { if (!type.isPresent()) {
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_10] Could not find type id " + typeID + " isObject=" + isObject); if (!Via.getConfig().isSuppressMetadataErrors())
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_10] Could not find type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY return EntityType.ENTITY; // Fall back to the basic ENTITY
} }

View File

@ -13,6 +13,7 @@ package nl.matsv.viabackwards.api.entities.types;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import nl.matsv.viabackwards.ViaBackwards; import nl.matsv.viabackwards.ViaBackwards;
import us.myles.ViaVersion.api.Via;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -29,7 +30,8 @@ public class EntityType1_11 {
type = EntityType.findById(typeID); type = EntityType.findById(typeID);
if (!type.isPresent()) { if (!type.isPresent()) {
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_11] Could not find type id " + typeID + " isObject=" + isObject); if (!Via.getConfig().isSuppressMetadataErrors())
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_11] Could not find type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY return EntityType.ENTITY; // Fall back to the basic ENTITY
} }

View File

@ -13,6 +13,7 @@ package nl.matsv.viabackwards.api.entities.types;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import nl.matsv.viabackwards.ViaBackwards; import nl.matsv.viabackwards.ViaBackwards;
import us.myles.ViaVersion.api.Via;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -29,7 +30,8 @@ public class EntityType1_12 {
type = EntityType.findById(typeID); type = EntityType.findById(typeID);
if (!type.isPresent()) { if (!type.isPresent()) {
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_12] Could not find type id " + typeID + " isObject=" + isObject); if (!Via.getConfig().isSuppressMetadataErrors())
ViaBackwards.getPlatform().getLogger().severe("[EntityType1_12] Could not find type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY return EntityType.ENTITY; // Fall back to the basic ENTITY
} }