fix: use Identifier.of in new code
This commit is contained in:
parent
7ec7604dd1
commit
cf7245c915
@ -67,12 +67,12 @@ public class ValidationLayer {
|
|||||||
if (isPermittedWithoutScan(pack, name)) return true;
|
if (isPermittedWithoutScan(pack, name)) return true;
|
||||||
if (name.equals(Respackopts.ID + ".json5")) return true;
|
if (name.equals(Respackopts.ID + ".json5")) return true;
|
||||||
for (ResourceType value : ResourceType.values()) {
|
for (ResourceType value : ResourceType.values()) {
|
||||||
if (name.equals(new ResourcePath(value, new Identifier(Respackopts.ID, "conf.json")).getName())) {
|
if (name.equals(new ResourcePath(value, Identifier.of(Respackopts.ID, "conf.json")).getName())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String namespace : pack.getNamespaces(ResourceType.CLIENT_RESOURCES)) {
|
for (String namespace : pack.getNamespaces(ResourceType.CLIENT_RESOURCES)) {
|
||||||
if (name.equals(new ResourcePath(ResourceType.CLIENT_RESOURCES, new Identifier(namespace, "lang/en_us.json")).getName())) {
|
if (name.equals(new ResourcePath(ResourceType.CLIENT_RESOURCES, Identifier.of(namespace, "lang/en_us.json")).getName())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,12 @@ public class StringEntrySerializer extends TypeAdapter<ConfigStringEntry> {
|
|||||||
public static final Set<String> TYPES = Set.of("string", "text");
|
public static final Set<String> TYPES = Set.of("string", "text");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <TEx extends Exception, Writer extends SerializeWriter<TEx, Writer>> void serialize(ConfigStringEntry configBooleanEntry, Writer writer) throws TEx, MalformedDataException {
|
public <TEx extends Exception, Writer extends SerializeWriter<TEx, ?>> void serialize(ConfigStringEntry configBooleanEntry, Writer writer) throws TEx, MalformedDataException {
|
||||||
writer.value(configBooleanEntry.getValue());
|
writer.value(configBooleanEntry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <TEx extends Exception, Reader extends SerializeReader<TEx, Reader>> ConfigStringEntry deserialize(Reader reader) throws TEx, MalformedDataException {
|
public <TEx extends Exception, Reader extends SerializeReader<TEx, ?>> ConfigStringEntry deserialize(Reader reader) throws TEx, MalformedDataException {
|
||||||
if (reader.peek() == Token.BEGIN_OBJECT) {
|
if (reader.peek() == Token.BEGIN_OBJECT) {
|
||||||
reader.beginObject();
|
reader.beginObject();
|
||||||
ConfigStringEntry result = new ConfigStringEntry("");
|
ConfigStringEntry result = new ConfigStringEntry("");
|
||||||
|
Loading…
Reference in New Issue
Block a user