This commit is contained in:
creeper123123321 2018-04-19 16:29:50 -03:00
parent 8bf43648ce
commit 1e0113a58a
11 changed files with 69 additions and 62 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -62,7 +62,7 @@ public class ProtocolVersion {
register(v1_12 = new ProtocolVersion(335, "1.12"));
register(v1_12_1 = new ProtocolVersion(338, "1.12.1"));
register(v1_12_2 = new ProtocolVersion(340, "1.12.2"));
register(v1_13 = new ProtocolVersion(371, "18w16a"));
register(v1_13 = new ProtocolVersion(372, "18w16a"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}

View File

@ -158,6 +158,8 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
wrapper.write(Type.VAR_INT, 0); // Root node index
}
}).send(ProtocolSnapshotTo1_12_2.class);
// Send tags packet twice to not crash client
PacketWrapper tagsPacket = wrapper.create(0x54, new ValueCreator() {
@Override
public void write(PacketWrapper wrapper) throws Exception {
@ -172,21 +174,22 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
}
});
// Map packet
registerOutgoing(State.PLAY, 0x24, 0x25, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
map(Type.BYTE);
map(Type.BOOLEAN);
map(Type.VAR_INT); // Map id
map(Type.BYTE); // Scale
map(Type.BOOLEAN); // Tracking Position
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
int iconCount = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < iconCount; i++) {
wrapper.passthrough(Type.BYTE);
wrapper.passthrough(Type.BYTE);
wrapper.passthrough(Type.BYTE);
wrapper.write(Type.BOOLEAN, false);
wrapper.passthrough(Type.BYTE); // Icon X
wrapper.passthrough(Type.BYTE); // Icon Y
wrapper.passthrough(Type.BYTE); // Icon Z
wrapper.write(Type.OPTIONAL_CHAT, null); // Display Name
}
wrapper.passthroughAll();
}

View File

@ -64,6 +64,7 @@ public class WorldPackets {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
Position position = wrapper.get(Type.POSITION, 0);
short action = wrapper.get(Type.UNSIGNED_BYTE, 0);
CompoundTag tag = wrapper.get(Type.NBT, 0);
BlockEntityProvider provider = Via.getManager().getProviders().get(BlockEntityProvider.class);
@ -74,6 +75,9 @@ public class WorldPackets {
if (storage.contains(position))
storage.get(position).setReplacement(newId);
}
if (action == 5) // Set type of flower in flower pot
wrapper.cancel(); // Removed
}
});
}

View File

@ -9041,53 +9041,53 @@
"624": "minecraft:blaze_spawn_egg",
"625": "minecraft:cave_spider_spawn_egg",
"626": "minecraft:chicken_spawn_egg",
"627": "minecraft:cow_spawn_egg",
"628": "minecraft:creeper_spawn_egg",
"629": "minecraft:dolphin_spawn_egg",
"630": "minecraft:donkey_spawn_egg",
"631": "minecraft:drowned_spawn_egg",
"632": "minecraft:elder_guardian_spawn_egg",
"633": "minecraft:enderman_spawn_egg",
"634": "minecraft:endermite_spawn_egg",
"635": "minecraft:evocation_illager_spawn_egg",
"636": "minecraft:ghast_spawn_egg",
"637": "minecraft:guardian_spawn_egg",
"638": "minecraft:horse_spawn_egg",
"639": "minecraft:husk_spawn_egg",
"640": "minecraft:llama_spawn_egg",
"641": "minecraft:magma_cube_spawn_egg",
"642": "minecraft:mooshroom_spawn_egg",
"643": "minecraft:mule_spawn_egg",
"644": "minecraft:ocelot_spawn_egg",
"645": "minecraft:parrot_spawn_egg",
"646": "minecraft:pig_spawn_egg",
"647": "minecraft:phantom_spawn_egg",
"648": "minecraft:polar_bear_spawn_egg",
"649": "minecraft:rabbit_spawn_egg",
"650": "minecraft:sheep_spawn_egg",
"651": "minecraft:shulker_spawn_egg",
"652": "minecraft:silverfish_spawn_egg",
"653": "minecraft:skeleton_spawn_egg",
"654": "minecraft:skeleton_horse_spawn_egg",
"655": "minecraft:slime_spawn_egg",
"656": "minecraft:spider_spawn_egg",
"657": "minecraft:squid_spawn_egg",
"658": "minecraft:stray_spawn_egg",
"659": "minecraft:turtle_spawn_egg",
"660": "minecraft:vex_spawn_egg",
"661": "minecraft:villager_spawn_egg",
"662": "minecraft:vindication_illager_spawn_egg",
"663": "minecraft:witch_spawn_egg",
"664": "minecraft:wither_skeleton_spawn_egg",
"665": "minecraft:wolf_spawn_egg",
"666": "minecraft:zombie_spawn_egg",
"667": "minecraft:zombie_horse_spawn_egg",
"668": "minecraft:zombie_pigman_spawn_egg",
"669": "minecraft:zombie_villager_spawn_egg",
"670": "minecraft:puffer_fish_spawn_egg",
"671": "minecraft:salmon_mob_spawn_egg",
"672": "minecraft:cod_mob_spawn_egg",
"673": "minecraft:tropical_fish_spawn_egg",
"627": "minecraft:cod_mob_spawn_egg",
"628": "minecraft:cow_spawn_egg",
"629": "minecraft:creeper_spawn_egg",
"630": "minecraft:dolphin_spawn_egg",
"631": "minecraft:donkey_spawn_egg",
"632": "minecraft:drowned_spawn_egg",
"633": "minecraft:elder_guardian_spawn_egg",
"634": "minecraft:enderman_spawn_egg",
"635": "minecraft:endermite_spawn_egg",
"636": "minecraft:evocation_illager_spawn_egg",
"637": "minecraft:ghast_spawn_egg",
"638": "minecraft:guardian_spawn_egg",
"639": "minecraft:horse_spawn_egg",
"640": "minecraft:husk_spawn_egg",
"641": "minecraft:llama_spawn_egg",
"642": "minecraft:magma_cube_spawn_egg",
"643": "minecraft:mooshroom_spawn_egg",
"644": "minecraft:mule_spawn_egg",
"645": "minecraft:ocelot_spawn_egg",
"646": "minecraft:parrot_spawn_egg",
"647": "minecraft:pig_spawn_egg",
"648": "minecraft:phantom_spawn_egg",
"649": "minecraft:polar_bear_spawn_egg",
"650": "minecraft:puffer_fish_spawn_egg",
"651": "minecraft:rabbit_spawn_egg",
"652": "minecraft:salmon_mob_spawn_egg",
"653": "minecraft:sheep_spawn_egg",
"654": "minecraft:shulker_spawn_egg",
"655": "minecraft:silverfish_spawn_egg",
"656": "minecraft:skeleton_spawn_egg",
"657": "minecraft:skeleton_horse_spawn_egg",
"658": "minecraft:slime_spawn_egg",
"659": "minecraft:spider_spawn_egg",
"660": "minecraft:squid_spawn_egg",
"661": "minecraft:stray_spawn_egg",
"662": "minecraft:tropical_fish_spawn_egg",
"663": "minecraft:turtle_spawn_egg",
"664": "minecraft:vex_spawn_egg",
"665": "minecraft:villager_spawn_egg",
"666": "minecraft:vindication_illager_spawn_egg",
"667": "minecraft:witch_spawn_egg",
"668": "minecraft:wither_skeleton_spawn_egg",
"669": "minecraft:wolf_spawn_egg",
"670": "minecraft:zombie_spawn_egg",
"671": "minecraft:zombie_horse_spawn_egg",
"672": "minecraft:zombie_pigman_spawn_egg",
"673": "minecraft:zombie_villager_spawn_egg",
"674": "minecraft:experience_bottle",
"675": "minecraft:fire_charge",
"676": "minecraft:writable_book",

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>viaversion-jar</name>

View File

@ -6,7 +6,7 @@
<groupId>us.myles</groupId>
<artifactId>viaversion-parent</artifactId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
<packaging>pom</packaging>
<name>viaversion-parent</name>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.4.0-18w15a</version>
<version>1.4.0-18w16a</version>
</parent>
<modelVersion>4.0.0</modelVersion>