Skip to content

Commit fe4986b

Browse files
committed
Fix sniffer entity data removal
Fixes #757
1 parent 0618037 commit fe4986b

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_14to1_13_2/rewriter/EntityPacketRewriter1_14.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,7 @@ protected void registerRewrites() {
351351
filter().type(EntityTypes1_14.CAT).cancel(19);
352352
filter().type(EntityTypes1_14.CAT).cancel(20);
353353

354-
filter().handler((event, meta) -> {
355-
EntityType type = event.entityType();
356-
if (type == null) return;
357-
if (type.isOrHasParent(EntityTypes1_14.ABSTRACT_ILLAGER) || type == EntityTypes1_14.RAVAGER || type == EntityTypes1_14.WITCH) {
358-
int index = event.index();
359-
if (index == 14) {
360-
event.cancel();
361-
} else if (index > 14) {
362-
event.setIndex(index - 1);
363-
}
364-
}
365-
});
354+
filter().type(EntityTypes1_14.ABSTRACT_RAIDER).removeIndex(14); // Celebrating
366355

367356
filter().type(EntityTypes1_14.AREA_EFFECT_CLOUD).index(10).handler((event, meta) -> {
368357
rewriteParticle(event.user(), (Particle) meta.getValue());

common/src/main/java/com/viaversion/viabackwards/protocol/v1_19_3to1_19_1/rewriter/EntityPacketRewriter1_19_3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public void registerRewrites() {
240240
registerMetaTypeHandler(Types1_19.ENTITY_DATA_TYPES.itemType, null, Types1_19.ENTITY_DATA_TYPES.optionalBlockStateType, Types1_19.ENTITY_DATA_TYPES.particleType,
241241
Types1_19.ENTITY_DATA_TYPES.componentType, Types1_19.ENTITY_DATA_TYPES.optionalComponentType);
242242

243-
filter().index(6).handler((event, meta) -> {
243+
filter().dataType(Types1_19.ENTITY_DATA_TYPES.poseType).handler((event, meta) -> {
244244
// Sitting pose added
245245
final int pose = meta.value();
246246
if (pose == 10) {

common/src/main/java/com/viaversion/viabackwards/protocol/v1_19_4to1_19_3/rewriter/EntityPacketRewriter1_19_4.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ public void registerRewrites() {
173173
}
174174
});
175175

176-
filter().type(EntityTypes1_19_4.INTERACTION).removeIndex(8); // Width
177-
filter().type(EntityTypes1_19_4.INTERACTION).removeIndex(9); // Height
178-
filter().type(EntityTypes1_19_4.INTERACTION).removeIndex(10); // Response
176+
filter().type(EntityTypes1_19_4.INTERACTION).cancel(8); // Width
177+
filter().type(EntityTypes1_19_4.INTERACTION).cancel(9); // Height
178+
filter().type(EntityTypes1_19_4.INTERACTION).cancel(10); // Response
179179

180-
filter().type(EntityTypes1_19_4.SNIFFER).removeIndex(17); // State
181-
filter().type(EntityTypes1_19_4.SNIFFER).removeIndex(18); // Drop seed at tick
180+
filter().type(EntityTypes1_19_4.SNIFFER).cancel(17); // State
181+
filter().type(EntityTypes1_19_4.SNIFFER).cancel(18); // Drop seed at tick
182182

183183
filter().type(EntityTypes1_19_4.ABSTRACT_HORSE).addIndex(18); // Owner UUID
184184
}

0 commit comments

Comments
 (0)