Skip to content

Commit

Permalink
24w46a
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Nov 27, 2024
1 parent 402aff9 commit 68b8481
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.viaversion.viabackwards.protocol.v1_21_4to1_21_2.rewriter.ParticleRewriter1_21_4;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Particle;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_21_2;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_21_4;
import com.viaversion.viaversion.api.protocol.packet.provider.PacketTypesProvider;
import com.viaversion.viaversion.api.protocol.packet.provider.SimplePacketTypesProvider;
import com.viaversion.viaversion.api.type.Types;
Expand Down Expand Up @@ -161,7 +161,7 @@ protected void registerPackets() {

@Override
public void init(final UserConnection user) {
addEntityTracker(user, new EntityTrackerBase(user, EntityTypes1_21_2.PLAYER));
addEntityTracker(user, new EntityTrackerBase(user, EntityTypes1_21_4.PLAYER));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.RegistryEntry;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_21_2;
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_21_4;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.version.Types1_21_2;
Expand All @@ -45,7 +45,7 @@ public EntityPacketRewriter1_21_4(final Protocol1_21_4To1_21_2 protocol) {

@Override
public void registerPackets() {
registerTrackerWithData1_19(ClientboundPackets1_21_2.ADD_ENTITY, EntityTypes1_21_2.FALLING_BLOCK);
registerTrackerWithData1_19(ClientboundPackets1_21_2.ADD_ENTITY, EntityTypes1_21_4.FALLING_BLOCK);
registerSetEntityData(ClientboundPackets1_21_2.SET_ENTITY_DATA, Types1_21_4.ENTITY_DATA_LIST, Types1_21_2.ENTITY_DATA_LIST);
registerRemoveEntities(ClientboundPackets1_21_2.REMOVE_ENTITIES);

Expand Down Expand Up @@ -157,10 +157,10 @@ protected void registerRewrites() {
Types1_21_2.ENTITY_DATA_TYPES.componentType,
Types1_21_2.ENTITY_DATA_TYPES.optionalComponentType
);
registerBlockStateHandler(EntityTypes1_21_2.ABSTRACT_MINECART, 11);
registerBlockStateHandler(EntityTypes1_21_4.ABSTRACT_MINECART, 11);

filter().type(EntityTypes1_21_2.CREAKING_TRANSIENT).removeIndex(18); // Is tearing down
filter().type(EntityTypes1_21_2.SALMON).index(17).handler((event, data) -> {
filter().type(EntityTypes1_21_4.CREAKING).removeIndex(18); // Is tearing down
filter().type(EntityTypes1_21_4.SALMON).index(17).handler((event, data) -> {
final int typeId = data.value();
final String type = switch (typeId) {
case 0 -> "small";
Expand All @@ -171,8 +171,13 @@ protected void registerRewrites() {
});
}

@Override
public void onMappingDataLoaded() {
mapTypes();
}

@Override
public EntityType typeFromId(final int type) {
return EntityTypes1_21_2.getTypeFromId(type);
return EntityTypes1_21_4.getTypeFromId(type);
}
}
Binary file not shown.

0 comments on commit 68b8481

Please sign in to comment.