Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-19 14:30:16 +01:00
Fix 1.12 -> 1.13 held enderman block translation (#3781)
Dieser Commit ist enthalten in:
Ursprung
73178b504e
Commit
6f53c069ea
@ -40,7 +40,12 @@ public class MetadataRewriter1_13To1_12_2 extends EntityRewriter<ClientboundPack
|
|||||||
protected void registerRewrites() {
|
protected void registerRewrites() {
|
||||||
filter().mapMetaType(typeId -> Types1_13.META_TYPES.byId(typeId > 4 ? typeId + 1 : typeId));
|
filter().mapMetaType(typeId -> Types1_13.META_TYPES.byId(typeId > 4 ? typeId + 1 : typeId));
|
||||||
filter().metaType(Types1_13.META_TYPES.itemType).handler(((event, meta) -> protocol.getItemRewriter().handleItemToClient(meta.value())));
|
filter().metaType(Types1_13.META_TYPES.itemType).handler(((event, meta) -> protocol.getItemRewriter().handleItemToClient(meta.value())));
|
||||||
filter().metaType(Types1_13.META_TYPES.blockStateType).handler(((event, meta) -> meta.setValue(WorldPackets.toNewId(meta.value()))));
|
filter().metaType(Types1_13.META_TYPES.blockStateType).handler(((event, meta) -> {
|
||||||
|
int oldId = meta.value();
|
||||||
|
int combined = (((oldId & 4095) << 4) | (oldId >> 12 & 15));
|
||||||
|
int newId = WorldPackets.toNewId(combined);
|
||||||
|
meta.setValue(newId);
|
||||||
|
}));
|
||||||
|
|
||||||
// Previously unused, now swimming
|
// Previously unused, now swimming
|
||||||
filter().index(0).handler((event, meta) -> meta.setValue((byte) ((byte) meta.getValue() & ~0x10)));
|
filter().index(0).handler((event, meta) -> meta.setValue((byte) ((byte) meta.getValue() & ~0x10)));
|
||||||
@ -53,14 +58,6 @@ public class MetadataRewriter1_13To1_12_2 extends EntityRewriter<ClientboundPack
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
filter().type(EntityTypes1_13.EntityType.ENDERMAN).index(12).handler((event, meta) -> {
|
|
||||||
// Remap held block to match new format for remapping to flat block
|
|
||||||
int stateId = meta.value();
|
|
||||||
int id = stateId & 4095;
|
|
||||||
int data = stateId >> 12 & 15;
|
|
||||||
meta.setValue((id << 4) | (data & 0xF));
|
|
||||||
});
|
|
||||||
|
|
||||||
filter().type(EntityTypes1_13.EntityType.WOLF).index(17).handler((event, meta) -> {
|
filter().type(EntityTypes1_13.EntityType.WOLF).index(17).handler((event, meta) -> {
|
||||||
// Handle new colors
|
// Handle new colors
|
||||||
meta.setValue(15 - (int) meta.getValue());
|
meta.setValue(15 - (int) meta.getValue());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren