mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
fabric-registry-sync: show name of affected registry
This commit is contained in:
parent
6ae80abc2e
commit
1622eb70d6
3 changed files with 9 additions and 9 deletions
fabric-registry-sync/src/main/java/net/fabricmc/fabric
|
@ -119,7 +119,7 @@ public final class RegistrySyncManager {
|
|||
for (String key : registryTag.getKeys()) {
|
||||
idMap.put(new Identifier(key), registryTag.getInt(key));
|
||||
}
|
||||
((RemappableRegistry) registry).remap(idMap, mode);
|
||||
((RemappableRegistry) registry).remap(registryId.toString(), idMap, mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public final class RegistrySyncManager {
|
|||
for (Identifier registryId : Registry.REGISTRIES.getIds()) {
|
||||
MutableRegistry registry = Registry.REGISTRIES.get(registryId);
|
||||
if (registry instanceof RemappableRegistry) {
|
||||
((RemappableRegistry) registry).unmap();
|
||||
((RemappableRegistry) registry).unmap(registryId.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public interface RemappableRegistry {
|
|||
EXACT
|
||||
}
|
||||
|
||||
void remap(Object2IntMap<Identifier> remoteIndexedEntries, RemapMode mode) throws RemapException;
|
||||
void remap(String name, Object2IntMap<Identifier> remoteIndexedEntries, RemapMode mode) throws RemapException;
|
||||
|
||||
void unmap() throws RemapException;
|
||||
void unmap(String name) throws RemapException;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
|
|||
}
|
||||
|
||||
@Override
|
||||
public void remap(Object2IntMap<Identifier> remoteIndexedEntries, RemapMode mode) throws RemapException {
|
||||
public void remap(String name, Object2IntMap<Identifier> remoteIndexedEntries, RemapMode mode) throws RemapException {
|
||||
//noinspection unchecked, ConstantConditions
|
||||
SimpleRegistry<Object> registry = (SimpleRegistry<Object>) (Object) this;
|
||||
|
||||
|
@ -103,7 +103,7 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
|
|||
}
|
||||
|
||||
if (!strings.isEmpty()) {
|
||||
StringBuilder builder = new StringBuilder("Received ID map contains IDs unknown to the receiver!");
|
||||
StringBuilder builder = new StringBuilder("Received ID map for " + name + " contains IDs unknown to the receiver!");
|
||||
for (String s : strings) {
|
||||
builder.append('\n').append(s);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
|
|||
}
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder("Local and remote ID sets do not match!");
|
||||
StringBuilder builder = new StringBuilder("Local and remote ID sets for " + name + " do not match!");
|
||||
for (String s : strings) {
|
||||
builder.append('\n').append(s);
|
||||
}
|
||||
|
@ -227,12 +227,12 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
|
|||
}
|
||||
|
||||
@Override
|
||||
public void unmap() throws RemapException {
|
||||
public void unmap(String name) throws RemapException {
|
||||
if (fabric_prevIndexedEntries != null) {
|
||||
entries.clear();
|
||||
entries.putAll(fabric_prevEntries);
|
||||
|
||||
remap(fabric_prevIndexedEntries, RemapMode.AUTHORITATIVE);
|
||||
remap(name, fabric_prevIndexedEntries, RemapMode.AUTHORITATIVE);
|
||||
|
||||
fabric_prevIndexedEntries = null;
|
||||
fabric_prevEntries = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue