mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-18 16:17:45 +01:00
fix npe, remove living bed position
This commit is contained in:
parent
8e2feeb375
commit
3252d48383
@ -523,6 +523,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
|
||||
@Override
|
||||
public Item handleItemToClient(Item i) {
|
||||
Item item = super.handleItemToClient(i);
|
||||
if (item == null) return null;
|
||||
item.setIdentifier(getOldItemId(item.getIdentifier()));
|
||||
|
||||
CompoundTag tag;
|
||||
@ -556,6 +557,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
|
||||
@Override
|
||||
public Item handleItemToServer(Item i) {
|
||||
Item item = super.handleItemToServer(i);
|
||||
if (item == null) return null;
|
||||
item.setIdentifier(getNewItemId(item.getIdentifier()));
|
||||
|
||||
CompoundTag tag;
|
||||
|
@ -126,7 +126,7 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
|
||||
Optional<Integer> oldId = EntityTypeMapping.getOldId(type);
|
||||
if (!oldId.isPresent()) {
|
||||
if (!hasData(entityType))
|
||||
ViaBackwards.getPlatform().getLogger().warning("Could not find 1.12 entity type for 1.13 entity type " + type + "/" + entityType);
|
||||
ViaBackwards.getPlatform().getLogger().warning("Could not find 1.13.2 entity type for 1.14 entity type " + type + "/" + entityType);
|
||||
} else {
|
||||
wrapper.set(Type.VAR_INT, 1, oldId.get());
|
||||
}
|
||||
@ -283,6 +283,12 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
|
||||
if (e.getIndex() > 6) e.getData().setId(e.getIndex() - 1);
|
||||
return e.getData();
|
||||
});
|
||||
// Remove bed location - todo send sleep packet
|
||||
registerMetaHandler().filter(EntityType1_14.EntityType.LIVINGENTITY, true, 12).removed();
|
||||
registerMetaHandler().filter(EntityType1_14.EntityType.LIVINGENTITY, true).handle(e -> {
|
||||
if (e.getIndex() > 12) e.getData().setId(e.getIndex() - 1);
|
||||
return e.getData();
|
||||
});
|
||||
registerMetaHandler().filter(EntityType1_14.EntityType.CAT, 13).removed();
|
||||
registerMetaHandler().filter(EntityType1_14.EntityType.CAT, 14).removed();
|
||||
registerMetaHandler().filter(EntityType1_14.EntityType.CAT, 15).removed();
|
||||
|
Loading…
Reference in New Issue
Block a user