Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 00:50:13 +01:00
Fix item projectile hierarchy in 1.14+ (#4034)
Dieser Commit ist enthalten in:
Ursprung
35fa7e78a0
Commit
b5a06181d4
@ -51,11 +51,12 @@ public enum EntityTypes1_14 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
|
EGG(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
POTION(PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_15 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
|
EGG(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
POTION(PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_16 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -51,11 +51,12 @@ public enum EntityTypes1_16_2 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_17 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_19 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -53,11 +53,12 @@ public enum EntityTypes1_19_3 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -59,11 +59,12 @@ public enum EntityTypes1_19_4 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -59,11 +59,12 @@ public enum EntityTypes1_20_3 implements EntityType {
|
|||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(PROJECTILE),
|
SHULKER_BULLET(PROJECTILE),
|
||||||
|
@ -59,12 +59,13 @@ public enum EntityTypes1_20_5 implements EntityType {
|
|||||||
GLOW_ITEM_FRAME(ITEM_FRAME),
|
GLOW_ITEM_FRAME(ITEM_FRAME),
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
PROJECTILE(ENTITY, null), // Not actually its own abstract type, but useful for categorizing
|
PROJECTILE(ENTITY, null),
|
||||||
SNOWBALL(PROJECTILE),
|
ITEM_PROJECTILE(PROJECTILE, null),
|
||||||
ENDER_PEARL(PROJECTILE),
|
SNOWBALL(ITEM_PROJECTILE),
|
||||||
EGG(PROJECTILE),
|
ENDER_PEARL(ITEM_PROJECTILE),
|
||||||
POTION(PROJECTILE),
|
EGG(ITEM_PROJECTILE),
|
||||||
EXPERIENCE_BOTTLE(PROJECTILE),
|
POTION(ITEM_PROJECTILE),
|
||||||
|
EXPERIENCE_BOTTLE(ITEM_PROJECTILE),
|
||||||
FIREWORK_ROCKET(PROJECTILE),
|
FIREWORK_ROCKET(PROJECTILE),
|
||||||
LLAMA_SPIT(PROJECTILE),
|
LLAMA_SPIT(PROJECTILE),
|
||||||
SHULKER_BULLET(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();
|
final Item item = data.value();
|
||||||
if (item == null || item.isEmpty()) {
|
if (item == null || item.isEmpty()) {
|
||||||
// The item is used for particles or projectile display and can no longer be empty
|
// The item is used for particles or projectile display and can no longer be empty
|
||||||
event.cancel();
|
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) {
|
private void addColor(@Nullable final EntityData particleMeta, final int color) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren