mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-22 16:38:20 +01:00
Fix item projectile hierarchy in 1.14+ (#4034)
This commit is contained in:
parent
35fa7e78a0
commit
b5a06181d4
@ -51,11 +51,12 @@ public enum EntityTypes1_14 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_15 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_16 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_16_2 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_17 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_19 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_19_3 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -59,11 +59,12 @@ public enum EntityTypes1_19_4 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -59,11 +59,12 @@ public enum EntityTypes1_20_3 implements EntityType {
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -59,12 +59,13 @@ public enum EntityTypes1_20_5 implements EntityType {
|
||||
GLOW_ITEM_FRAME(ITEM_FRAME),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||
SNOWBALL(PROJECTILE),
|
||||
ENDER_PEARL(PROJECTILE),
|
||||
EGG(PROJECTILE),
|
||||
POTION(PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
||||
PROJECTILE(ENTITY, null),
|
||||
ITEM_PROJECTILE(PROJECTILE, null),
|
||||
SNOWBALL(ITEM_PROJECTILE),
|
||||
ENDER_PEARL(ITEM_PROJECTILE),
|
||||
EGG(ITEM_PROJECTILE),
|
||||
POTION(ITEM_PROJECTILE),
|
||||
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||
FIREWORK_ROCKET(PROJECTILE),
|
||||
LLAMA_SPIT(PROJECTILE),
|
||||
SHULKER_BULLET(PROJECTILE),
|
||||
|
@ -474,17 +474,13 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
}
|
||||
});
|
||||
|
||||
final EntityDataHandler emptyItemHandler = (event, data) -> {
|
||||
filter().type(EntityTypes1_20_5.ITEM_PROJECTILE).index(8).handler((event, data) -> {
|
||||
final Item item = data.value();
|
||||
if (item == null || item.isEmpty()) {
|
||||
// The item is used for particles or projectile display and can no longer be empty
|
||||
event.cancel();
|
||||
}
|
||||
};
|
||||
filter().type(EntityTypes1_20_5.EGG).index(8).handler(emptyItemHandler);
|
||||
filter().type(EntityTypes1_20_5.SNOWBALL).index(8).handler(emptyItemHandler);
|
||||
filter().type(EntityTypes1_20_5.ENDER_PEARL).index(8).handler(emptyItemHandler);
|
||||
filter().type(EntityTypes1_20_5.EXPERIENCE_BOTTLE).index(8).handler(emptyItemHandler);
|
||||
});
|
||||
}
|
||||
|
||||
private void addColor(@Nullable final EntityData particleMeta, final int color) {
|
||||
|
Loading…
Reference in New Issue
Block a user