Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 09:00:09 +01:00
Adapt tagdata loading
Dieser Commit ist enthalten in:
Ursprung
081781f223
Commit
ebff5e2f4d
@ -21,6 +21,8 @@ import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||
|
||||
public class Protocol1_15To1_14_4 extends Protocol {
|
||||
|
||||
private TagRewriter tagRewriter;
|
||||
|
||||
public Protocol1_15To1_14_4() {
|
||||
super(true);
|
||||
}
|
||||
@ -118,13 +120,7 @@ public class Protocol1_15To1_14_4 extends Protocol {
|
||||
});
|
||||
|
||||
// Tags
|
||||
TagRewriter tagRewriter = new TagRewriter(this, Protocol1_15To1_14_4::getNewBlockId, InventoryPackets::getNewItemId, EntityPackets::getNewEntityId);
|
||||
int[] shulkerBoxes = new int[17];
|
||||
int shulkerBoxOffset = 501;
|
||||
for (int i = 0; i < 17; i++) {
|
||||
shulkerBoxes[i] = shulkerBoxOffset + i;
|
||||
}
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:shulker_boxes", shulkerBoxes);
|
||||
tagRewriter = new TagRewriter(this, Protocol1_15To1_14_4::getNewBlockId, InventoryPackets::getNewItemId, EntityPackets::getNewEntityId);
|
||||
tagRewriter.register(0x5B, 0x5C);
|
||||
|
||||
registerOutgoing(State.PLAY, 0x08, 0x09);
|
||||
@ -209,6 +205,13 @@ public class Protocol1_15To1_14_4 extends Protocol {
|
||||
@Override
|
||||
protected void loadMappingData() {
|
||||
MappingData.init();
|
||||
|
||||
int[] shulkerBoxes = new int[17];
|
||||
int shulkerBoxOffset = 501;
|
||||
for (int i = 0; i < 17; i++) {
|
||||
shulkerBoxes[i] = shulkerBoxOffset + i;
|
||||
}
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:shulker_boxes", shulkerBoxes);
|
||||
}
|
||||
|
||||
public static int getNewBlockStateId(int id) {
|
||||
|
@ -20,6 +20,8 @@ import java.util.UUID;
|
||||
|
||||
public class Protocol1_16To1_15_2 extends Protocol {
|
||||
|
||||
private TagRewriter tagRewriter;
|
||||
|
||||
public Protocol1_16To1_15_2() {
|
||||
super(true);
|
||||
}
|
||||
@ -32,16 +34,7 @@ public class Protocol1_16To1_15_2 extends Protocol {
|
||||
WorldPackets.register(this);
|
||||
InventoryPackets.register(this);
|
||||
|
||||
TagRewriter tagRewriter = new TagRewriter(this, Protocol1_16To1_15_2::getNewBlockId, InventoryPackets::getNewItemId, metadataRewriter::getNewEntityId);
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:beacon_base_blocks", 133, 134, 148, 265);
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:climbable", 160, 241, 658);
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:fire", 142);
|
||||
tagRewriter.addTag(TagType.ITEM, "minecraft:beacon_payment_items", 529, 530, 531, 760);
|
||||
// The client crashes if we don't send all tags it may use
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:soul_speed_blocks");
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:soul_fire_base_blocks");
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:non_flammable_wood");
|
||||
tagRewriter.addEmptyTag(TagType.ITEM, "minecraft:non_flammable_wood");
|
||||
tagRewriter = new TagRewriter(this, Protocol1_16To1_15_2::getNewBlockId, InventoryPackets::getNewItemId, metadataRewriter::getNewEntityId);
|
||||
tagRewriter.register(0x5C, 0x5C);
|
||||
|
||||
// Login Success
|
||||
@ -138,6 +131,16 @@ public class Protocol1_16To1_15_2 extends Protocol {
|
||||
@Override
|
||||
protected void loadMappingData() {
|
||||
MappingData.init();
|
||||
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:beacon_base_blocks", 133, 134, 148, 265);
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:climbable", 160, 241, 658);
|
||||
tagRewriter.addTag(TagType.BLOCK, "minecraft:fire", 142);
|
||||
tagRewriter.addTag(TagType.ITEM, "minecraft:beacon_payment_items", 529, 530, 531, 760);
|
||||
// The client crashes if we don't send all tags it may use
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:soul_speed_blocks");
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:soul_fire_base_blocks");
|
||||
tagRewriter.addEmptyTag(TagType.BLOCK, "minecraft:non_flammable_wood");
|
||||
tagRewriter.addEmptyTag(TagType.ITEM, "minecraft:non_flammable_wood");
|
||||
}
|
||||
|
||||
public static int getNewBlockStateId(int id) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren