Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-09-07 13:22:54 +02:00
Fix 1.13<->1.12 special case handling
Dieser Commit ist enthalten in:
Ursprung
947e5c3e07
Commit
897e9545c2
@ -84,6 +84,12 @@ public class BackwardsMappings extends nl.matsv.viabackwards.api.data.BackwardsM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOldItemId(final int id) {
|
||||||
|
// Return -1 when missing
|
||||||
|
return this.itemMappings.inverse().get(id);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||||
|
@ -527,12 +527,9 @@ public class BlockItemPackets1_13 extends nl.matsv.viabackwards.api.rewriters.It
|
|||||||
// Look for custom mappings
|
// Look for custom mappings
|
||||||
super.handleItemToClient(item);
|
super.handleItemToClient(item);
|
||||||
|
|
||||||
// No custom mapping found, look at VV mappings
|
// Handle one-way special case
|
||||||
if (item.getIdentifier() == originalId) {
|
if (item.getIdentifier() == -1) {
|
||||||
int oldId = protocol.getMappingData().getItemMappings().get(item.getIdentifier());
|
if (originalId == 362) { // base/colorless shulker box
|
||||||
if (oldId != -1) {
|
|
||||||
rawId = itemIdToRaw(oldId, item, tag);
|
|
||||||
} else if (item.getIdentifier() == 362) { // base/colorless shulker box
|
|
||||||
rawId = 0xe50000; // purple shulker box
|
rawId = 0xe50000; // purple shulker box
|
||||||
} else {
|
} else {
|
||||||
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||||
@ -816,8 +813,9 @@ public class BlockItemPackets1_13 extends nl.matsv.viabackwards.api.rewriters.It
|
|||||||
int identifier = item.getIdentifier();
|
int identifier = item.getIdentifier();
|
||||||
item.setIdentifier(rawId);
|
item.setIdentifier(rawId);
|
||||||
super.handleItemToServer(item);
|
super.handleItemToServer(item);
|
||||||
|
|
||||||
// Mapped with original data, we can return here
|
// Mapped with original data, we can return here
|
||||||
if (item.getIdentifier() != rawId) return item;
|
if (item.getIdentifier() != rawId && item.getIdentifier() != -1) return item;
|
||||||
|
|
||||||
// Set to legacy id again
|
// Set to legacy id again
|
||||||
item.setIdentifier(identifier);
|
item.setIdentifier(identifier);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren