mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
[ci skip] Merge pull request #29 from architectury/fixes/server-registry-crash
Fix mojank stripping containsKey from Registries on Server
This commit is contained in:
@@ -140,7 +140,7 @@ public class RegistriesImpl {
|
||||
|
||||
@Override
|
||||
public boolean contains(ResourceLocation id) {
|
||||
return delegate.containsKey(id);
|
||||
return delegate.keySet().contains(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -116,27 +116,27 @@ public class RegistriesImpl {
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
return delegate.key().location();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPresent() {
|
||||
return contains(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return value.get();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(getRegistryId(), getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
@@ -144,7 +144,7 @@ public class RegistriesImpl {
|
||||
RegistrySupplier<?> other = (RegistrySupplier<?>) obj;
|
||||
return other.getRegistryId().equals(getRegistryId()) && other.getId().equals(getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getRegistryId().toString() + "@" + id.toString();
|
||||
@@ -177,7 +177,7 @@ public class RegistriesImpl {
|
||||
|
||||
@Override
|
||||
public boolean contains(ResourceLocation resourceLocation) {
|
||||
return delegate.containsKey(resourceLocation);
|
||||
return delegate.keySet().contains(resourceLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -223,27 +223,27 @@ public class RegistriesImpl {
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
return delegate.getRegistryName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPresent() {
|
||||
return contains(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return value.get();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(getRegistryId(), getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
@@ -251,7 +251,7 @@ public class RegistriesImpl {
|
||||
RegistrySupplier<?> other = (RegistrySupplier<?>) obj;
|
||||
return other.getRegistryId().equals(getRegistryId()) && other.getId().equals(getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getRegistryId().toString() + "@" + id.toString();
|
||||
@@ -268,27 +268,27 @@ public class RegistriesImpl {
|
||||
public @NotNull ResourceLocation getRegistryId() {
|
||||
return delegate.getRegistryName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull ResourceLocation getId() {
|
||||
return registryObject.getId();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPresent() {
|
||||
return registryObject.isPresent();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return (T) registryObject.get();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(getRegistryId(), getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
@@ -296,7 +296,7 @@ public class RegistriesImpl {
|
||||
RegistrySupplier<?> other = (RegistrySupplier<?>) obj;
|
||||
return other.getRegistryId().equals(getRegistryId()) && other.getId().equals(getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getRegistryId().toString() + "@" + id.toString();
|
||||
|
||||
Reference in New Issue
Block a user