mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2025-01-06 18:57:40 +01:00
Updated Via*
This commit is contained in:
parent
e98bfb8aa5
commit
1db01c5d75
@ -6,4 +6,4 @@ org.gradle.configureondemand=true
|
||||
# Project properties
|
||||
maven_name=ViaAprilFools
|
||||
maven_group=net.raphimc
|
||||
maven_version=2.0.2
|
||||
maven_version=2.0.3
|
||||
|
@ -23,7 +23,7 @@ import com.viaversion.viabackwards.api.rewriters.SoundRewriter;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ClientboundPackets1_14;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2;
|
||||
@ -58,9 +58,9 @@ public class Protocol1_14to3D_Shareware extends BackwardsProtocol<ClientboundPac
|
||||
soundRewriter.registerNamedSound(ClientboundPackets3D_Shareware.NAMED_SOUND);
|
||||
soundRewriter.registerStopSound(ClientboundPackets3D_Shareware.STOP_SOUND);
|
||||
|
||||
this.registerClientbound(ClientboundPackets3D_Shareware.CHUNK_DATA, new PacketRemapper() {
|
||||
this.registerClientbound(ClientboundPackets3D_Shareware.CHUNK_DATA, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
final Chunk chunk = wrapper.passthrough(new Chunk1_14Type());
|
||||
ChunkCenterTracker3D_Shareware entityTracker = wrapper.user().get(ChunkCenterTracker3D_Shareware.class);
|
||||
@ -77,9 +77,9 @@ public class Protocol1_14to3D_Shareware extends BackwardsProtocol<ClientboundPac
|
||||
});
|
||||
}
|
||||
});
|
||||
this.registerClientbound(ClientboundPackets3D_Shareware.RESPAWN, new PacketRemapper() {
|
||||
this.registerClientbound(ClientboundPackets3D_Shareware.RESPAWN, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
ChunkCenterTracker3D_Shareware entityTracker = wrapper.user().get(ChunkCenterTracker3D_Shareware.class);
|
||||
// The client may reset the center chunk if dimension is changed
|
||||
|
@ -18,7 +18,7 @@
|
||||
package net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.packets;
|
||||
|
||||
import com.viaversion.viabackwards.api.rewriters.ItemRewriter;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ServerboundPackets1_14;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.ClientboundPackets3D_Shareware;
|
||||
@ -41,8 +41,8 @@ public class BlockItemPackets3D_Shareware extends ItemRewriter<ClientboundPacket
|
||||
this.registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
|
||||
this.registerSpawnParticle(ClientboundPackets3D_Shareware.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.FLOAT);
|
||||
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.TRADE_LIST, new PacketRemapper() {
|
||||
public void registerMap() {
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.TRADE_LIST, new PacketHandlers() {
|
||||
public void register() {
|
||||
this.handler((wrapper) -> {
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||
|
@ -19,7 +19,7 @@ package net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.packets;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_14;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.ClientboundPackets3D_Shareware;
|
||||
@ -36,9 +36,9 @@ public class EntityPackets3D_Shareware {
|
||||
}
|
||||
|
||||
public void registerPackets() {
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.SPAWN_MOB, new PacketRemapper() {
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.SPAWN_MOB, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
map(Type.UUID); // 1 - Entity UUID
|
||||
map(Type.VAR_INT); // 2 - Entity Type
|
||||
@ -55,9 +55,9 @@ public class EntityPackets3D_Shareware {
|
||||
handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0)));
|
||||
}
|
||||
});
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.SPAWN_PLAYER, new PacketRemapper() {
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.SPAWN_PLAYER, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
map(Type.UUID); // 1 - Player UUID
|
||||
map(Type.DOUBLE); // 2 - X
|
||||
@ -69,9 +69,9 @@ public class EntityPackets3D_Shareware {
|
||||
handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0)));
|
||||
}
|
||||
});
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.ENTITY_METADATA, new PacketRemapper() {
|
||||
this.protocol.registerClientbound(ClientboundPackets3D_Shareware.ENTITY_METADATA, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
map(Types1_14.METADATA_LIST);
|
||||
handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0)));
|
||||
|
@ -18,7 +18,7 @@
|
||||
package net.raphimc.viaaprilfools.protocols.protocol1_16_2toCombatTest8c;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.AbstractProtocol;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ServerboundPackets1_16_2;
|
||||
@ -31,9 +31,9 @@ public class Protocol1_16_2toCombatTest8c extends AbstractProtocol<ClientboundPa
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
this.registerServerbound(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
|
||||
this.registerServerbound(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.STRING); //language
|
||||
map(Type.BYTE); //viewDistance
|
||||
map(Type.VAR_INT); //chatVisibility
|
||||
|
@ -23,7 +23,7 @@ import com.viaversion.viabackwards.api.rewriters.SoundRewriter;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.data.RecipeRewriter1_14;
|
||||
@ -75,9 +75,9 @@ public class Protocol1_16to20w14infinite extends BackwardsProtocol<ClientboundPa
|
||||
soundRewriter.registerStopSound(ClientboundPackets20w14infinite.STOP_SOUND);
|
||||
new RecipeRewriter1_14<>(this).registerDefaultHandler(ClientboundPackets20w14infinite.DECLARE_RECIPES);
|
||||
|
||||
this.registerClientbound(ClientboundPackets20w14infinite.CHAT_MESSAGE, new PacketRemapper() {
|
||||
this.registerClientbound(ClientboundPackets20w14infinite.CHAT_MESSAGE, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.COMPONENT);
|
||||
map(Type.BYTE);
|
||||
handler(wrapper -> {
|
||||
@ -87,9 +87,9 @@ public class Protocol1_16to20w14infinite extends BackwardsProtocol<ClientboundPa
|
||||
});
|
||||
|
||||
this.cancelServerbound(ServerboundPackets1_16.GENERATE_JIGSAW);
|
||||
this.registerServerbound(ServerboundPackets1_16.INTERACT_ENTITY, new PacketRemapper() {
|
||||
this.registerServerbound(ServerboundPackets1_16.INTERACT_ENTITY, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
wrapper.passthrough(Type.VAR_INT); // Entity Id
|
||||
int action = wrapper.passthrough(Type.VAR_INT);
|
||||
@ -109,9 +109,9 @@ public class Protocol1_16to20w14infinite extends BackwardsProtocol<ClientboundPa
|
||||
});
|
||||
}
|
||||
});
|
||||
this.registerServerbound(ServerboundPackets1_16.PLAYER_ABILITIES, new PacketRemapper() {
|
||||
this.registerServerbound(ServerboundPackets1_16.PLAYER_ABILITIES, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
// Flying and walking speed - not important anyways
|
||||
|
@ -43,7 +43,7 @@ public class MetadataRewriter1_16to20w14infinite extends EntityRewriter<Clientbo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMetadata(int entityId, EntityType type, Metadata metadata, List<Metadata> metadatas, UserConnection connection) throws Exception {
|
||||
public void handleMetadata(int entityId, EntityType type, Metadata metadata, List<Metadata> metadatas, UserConnection connection) {
|
||||
if (metadata.metaType() == MetaType1_14.Slot) {
|
||||
metadata.setValue(this.protocol.getItemRewriter().handleItemToClient(metadata.value()));
|
||||
} else if (metadata.metaType() == MetaType1_14.BlockID) {
|
||||
|
@ -22,7 +22,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.DataPalette;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.PaletteType;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.LongArrayTag;
|
||||
@ -61,17 +61,17 @@ public class BlockItemPackets20w14infinite extends ItemRewriter<ClientboundPacke
|
||||
blockRewriter.registerAcknowledgePlayerDigging(ClientboundPackets20w14infinite.ACKNOWLEDGE_PLAYER_DIGGING);
|
||||
blockRewriter.registerEffect(ClientboundPackets20w14infinite.EFFECT, 1010, 2001);
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.UPDATE_LIGHT, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.UPDATE_LIGHT, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.VAR_INT); // x
|
||||
map(Type.VAR_INT); // y
|
||||
handler(wrapper -> wrapper.write(Type.BOOLEAN, true)); // Take neighbour's light into account as well
|
||||
}
|
||||
});
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.CHUNK_DATA, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.CHUNK_DATA, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
Chunk chunk = wrapper.read(new Chunk1_15Type());
|
||||
wrapper.write(new Chunk1_16Type(), chunk);
|
||||
@ -106,9 +106,9 @@ public class BlockItemPackets20w14infinite extends ItemRewriter<ClientboundPacke
|
||||
});
|
||||
}
|
||||
});
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.ENTITY_EQUIPMENT, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.ENTITY_EQUIPMENT, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
|
||||
handler(wrapper -> {
|
||||
@ -119,9 +119,9 @@ public class BlockItemPackets20w14infinite extends ItemRewriter<ClientboundPacke
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, new PacketRemapper() {
|
||||
protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
|
||||
}
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_14;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16;
|
||||
@ -69,9 +69,9 @@ public class EntityPackets20w14infinite {
|
||||
metadataRewriter.registerRemoveEntities(ClientboundPackets20w14infinite.DESTROY_ENTITIES);
|
||||
|
||||
// Spawn lightning -> Spawn entity
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.SPAWN_GLOBAL_ENTITY, ClientboundPackets1_16.SPAWN_ENTITY, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.SPAWN_GLOBAL_ENTITY, ClientboundPackets1_16.SPAWN_ENTITY, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(new PacketHandler() {
|
||||
@Override
|
||||
public void handle(PacketWrapper packetWrapper) throws Exception {
|
||||
@ -96,9 +96,9 @@ public class EntityPackets20w14infinite {
|
||||
});
|
||||
}
|
||||
});
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.RESPAWN, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.RESPAWN, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(DIMENSION_HANDLER);
|
||||
map(Type.LONG); // Seed
|
||||
map(Type.UNSIGNED_BYTE); // Gamemode
|
||||
@ -112,9 +112,9 @@ public class EntityPackets20w14infinite {
|
||||
});
|
||||
}
|
||||
});
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.JOIN_GAME, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.JOIN_GAME, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
map(Type.INT); // Entity ID
|
||||
map(Type.UNSIGNED_BYTE); // Gamemode
|
||||
handler(wrapper -> {
|
||||
@ -138,9 +138,9 @@ public class EntityPackets20w14infinite {
|
||||
});
|
||||
}
|
||||
});
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.ENTITY_PROPERTIES, new PacketRemapper() {
|
||||
protocol.registerClientbound(ClientboundPackets20w14infinite.ENTITY_PROPERTIES, new PacketHandlers() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
public void register() {
|
||||
handler(wrapper -> {
|
||||
wrapper.passthrough(Type.VAR_INT);
|
||||
int size = wrapper.passthrough(Type.INT);
|
||||
|
Loading…
Reference in New Issue
Block a user