mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-03 13:21:22 +01:00
Handle minecart block data (#2424)
This commit is contained in:
parent
3c7d481a39
commit
9f380a7598
@ -53,6 +53,13 @@ public class MetadataRewriter1_15To1_14_4 extends MetadataRewriter {
|
||||
|
||||
if (type == null) return;
|
||||
|
||||
if (type.isOrHasParent(Entity1_15Types.MINECART_ABSTRACT)
|
||||
&& metadata.getId() == 10) {
|
||||
// Convert to new block id
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
}
|
||||
|
||||
// Metadata 12 added to abstract_living
|
||||
if (metadata.getId() > 11 && type.isOrHasParent(Entity1_15Types.LIVINGENTITY)) {
|
||||
metadata.setId(metadata.getId() + 1); //TODO is it 11 or 12? what is it for?
|
||||
|
@ -52,6 +52,13 @@ public class MetadataRewriter1_16_2To1_16_1 extends MetadataRewriter {
|
||||
|
||||
if (type == null) return;
|
||||
|
||||
if (type.isOrHasParent(Entity1_16_2Types.MINECART_ABSTRACT)
|
||||
&& metadata.getId() == 10) {
|
||||
// Convert to new block id
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
}
|
||||
|
||||
if (type.isOrHasParent(Entity1_16_2Types.ABSTRACT_PIGLIN)) {
|
||||
if (metadata.getId() == 15) {
|
||||
metadata.setId(16);
|
||||
|
@ -53,6 +53,13 @@ public class MetadataRewriter1_16To1_15_2 extends MetadataRewriter {
|
||||
|
||||
if (type == null) return;
|
||||
|
||||
if (type.isOrHasParent(Entity1_16Types.MINECART_ABSTRACT)
|
||||
&& metadata.getId() == 10) {
|
||||
// Convert to new block id
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
}
|
||||
|
||||
if (type.isOrHasParent(Entity1_16Types.ABSTRACT_ARROW)) {
|
||||
if (metadata.getId() == 8) {
|
||||
metadatas.remove(metadata);
|
||||
|
@ -65,6 +65,13 @@ public class MetadataRewriter1_17To1_16_4 extends MetadataRewriter {
|
||||
}
|
||||
}
|
||||
|
||||
if (type.isOrHasParent(Entity1_17Types.MINECART_ABSTRACT)
|
||||
&& metadata.getId() == 11) {
|
||||
// Convert to new block id
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
}
|
||||
|
||||
if (type == Entity1_17Types.SHULKER) {
|
||||
// Attachment position removed
|
||||
if (metadata.getId() == 16) {
|
||||
|
Loading…
Reference in New Issue
Block a user