Compare commits

..
61 Commits
Author SHA1 Message Date
retrooper 476c61ed47 bump version up to 2.7.0 release 2024-12-10 21:34:52 +01:00
retrooper 4b6bfbc08b Merge pull request #1085 from booky10/workaround/revert-shadow-color-support
Temporarily revert shadow color support
2024-12-10 20:52:44 +01:00
booky10 0be838c58f Temporarily revert shadow color support
Will be un-reverted when adventure v4.18.0 gets released
2024-12-10 20:32:19 +01:00
booky10 d6c81f32cd Fix shadow color adventure support check 2024-12-04 18:03:46 +01:00
booky10 5d2104dd91 Merge pull request #1076 from mfnalex/feat/fix-npe-nbtinterpret
fix NPE for nbtInterpret
2024-12-04 18:00:55 +01:00
retrooper 969ce9d6a3 Merge pull request #1081 from Tecnio/2.0
bugfix: Added input validation for window click
2024-12-04 16:37:18 +01:00
Tecnio 55b456cb95 bugfix: Added input validation for window click 2024-12-04 18:34:40 +03:00
booky10 062ffc18f9 Merge pull request #1078 from AoElite/biomefix
fix npe if music tag isn't present on older versions
2024-12-04 12:32:42 +01:00
AoElite 95cbd40655 fix npe if music tag isn't present on older versions 2024-12-04 05:38:55 -05:00
retrooper 70d94137dd Merge pull request #1049 from booky10/feat/1.21.4-support
1.21.4 support
2024-12-03 22:50:55 +01:00
mfnalex bbea70d1db fix NPE for nbtInterpret 2024-12-03 20:23:31 +01:00
booky10 b5e5b752a4 Bump fabric version info 2024-12-03 18:42:39 +01:00
retrooper 28b4dd8e08 bump version up to 2.7.0 SNAPSHOT 2024-12-03 18:33:07 +01:00
retrooper 1ae92a8b9d correction to comments mistakenly referring to 1.21.5 2024-12-03 17:57:29 +01:00
booky10 00bbea33f6 Bump fabric minecraft version to 1.21.4-rc3 2024-12-02 23:10:59 +01:00
booky10 3fd3c397a6 Rename attribute constants to remove "type" prefix 2024-12-02 22:56:33 +01:00
booky10 f1f95a0aac Fix name of equipment asset mapping file reference 2024-12-02 22:20:25 +01:00
booky10 6e90a3e376 Update serverbound packet type mappings 2024-12-02 22:05:26 +01:00
booky10 41d51453a5 Update mappings for all changed registries 2024-12-02 22:01:06 +01:00
booky10andBeanes c74f8b2559 Add precision loss fix while writing, not while reading
This fixes *slightly* incorrect velocity values being provided in the wrapper, while still writing the correct short value

Co-authored-by: Beanes <sikyserver@gmail.com>
2024-12-02 21:45:35 +01:00
booky10 be2eb6a8ce Update generated block tags and item tags 2024-12-02 21:40:45 +01:00
Beanesandbooky10 9819db60cd Work around loss of precision when unpacking entity velocity
Solution was discussed on discord (https://discord.com/channels/721686193061888071/721686193515003966/1313231483225378946)

Closes #1074

Co-authored-by: booky10 <boooky10@gmail.com>
2024-12-02 21:26:55 +01:00
booky10 2a86e0d355 Update trim material structure to 1.21.4 2024-12-02 21:05:12 +01:00
booky10 4a209a342e Update biome music nbt structure to 1.21.4 2024-12-02 20:46:22 +01:00
booky10 33e5b58e3b Update custom model data component to 1.21.4 2024-12-02 20:21:21 +01:00
booky10 fd11bd24a9 Add new player loaded packet type and wrapper 2024-11-30 12:48:06 +01:00
booky10 8c1f14de57 Add wrappers for new pick item packets 2024-11-30 12:46:27 +01:00
booky10 bc615355c8 Add 1.21.4 serverbound packet type constants 2024-11-30 12:42:02 +01:00
booky10 28730806f9 Small javadoc notice for ParticleTrailData duration 2024-11-29 15:23:31 +01:00
booky10 4ec975fcd1 Update block state properties to 1.21.4 2024-11-29 15:20:55 +01:00
booky10 b6ce588e10 Add new item consumable use animation 2024-11-29 15:17:13 +01:00
booky10 a1510b5f6d Update equippable item component 2024-11-29 15:15:58 +01:00
booky10 913d527a64 Mark creaking transient entity type as obsolete 2024-11-29 15:13:51 +01:00
booky10 a1e250b521 Add new sound constants 2024-11-29 15:13:18 +01:00
booky10 887c107216 Add resin trim material constant 2024-11-29 15:12:15 +01:00
booky10 b6fb699a27 Add onground flag to WrapperPlayClientVehicleMove 2024-11-29 15:09:19 +01:00
booky10 575aa4619c Add initial support for shadow colors in component styles 2024-11-29 15:07:06 +01:00
booky10 3f787c0e35 Update particle types to 1.21.4 2024-11-29 14:41:37 +01:00
retrooper a0fc7f6978 Merge pull request #1065 from rafi67000/missingServerVersion
Add missing ServerVersion.V_1_9_1
2024-11-25 17:32:54 +01:00
rafi67000 2cd069ea72 Add missing ServerVersion.V_1_9_1 2024-11-24 22:13:00 +01:00
retrooper d4b4b24e3c WrapperPlayServerResourcePackSend#setPrompt added 2024-11-17 16:35:30 +01:00
retrooper dca7daec04 Merge pull request #1044 from ShreyasAyyengar/2.0
fix: NPC objects to have unique server team names.
2024-11-14 19:43:35 +01:00
booky10 b686eb467f Fix javadoc warnings 2024-11-13 15:16:01 +01:00
booky10 d1f0618c0e Merge branch '2.0' into feat/1.21.4-support 2024-11-13 14:28:59 +01:00
Shreyas Ayyengar ce06511b52 fix: initial team name not longer than 16 characters. 2024-11-11 14:41:56 -08:00
Shreyas Ayyengar a2b0c0f28e fix: truncate team name for versions older than V_1_18 2024-11-10 10:13:20 -08:00
retrooper da71044fc4 rename BlockFace#getHorizontalId to adhere to naming convention 2024-11-08 14:47:41 +01:00
booky10 4167c949fe Merge pull request #1048 from Axionize/blockface-get-horizontal
add getHorizontalID
2024-11-07 16:02:57 +01:00
booky10 6f490a7e93 Merge pull request #1057 from booky10/fix/potion-contents-component
Fix potion contents item component for 1.21.2/1.21.3
2024-11-07 16:01:51 +01:00
booky10 b14dfc710a Fix potion contents item component for 1.21.2/1.21.3 2024-11-06 23:36:07 +01:00
You 1877bae091 add getHorizontalID 2024-11-04 22:27:29 -05:00
retrooper 4cf7069254 Bump version up to 2.6.1-SNAPSHOT 2024-11-03 21:31:26 +01:00
booky10 6e2da40aa5 Update block and item tags for 24w44a 2024-11-03 18:37:18 +01:00
booky10 dae7c2e90b Update item types for 24w44a 2024-11-03 18:37:11 +01:00
booky10 04db0ba88d Update state types for 24w44a 2024-11-03 18:37:06 +01:00
booky10 b348af9581 Update WrapperPlayServerHeldItemChange to 24w44a 2024-10-30 15:23:16 +01:00
booky10 aedb43b487 Update WrapperPlayServerPlayerInfoUpdate to 24w44a 2024-10-30 15:21:07 +01:00
booky10 3b86806d8e Update WrapperPlayServerParticle to 24w44a 2024-10-30 15:17:18 +01:00
booky10 c4cc09d8e0 Add 1.21.4 version constants 2024-10-30 15:14:51 +01:00
Shreyas Ayyengar 1a3b2471b3 refactor: add get/set for teamName 2024-10-28 11:19:55 -07:00
ShreyasAyyengar 3a004572c1 fix: NPC objects to have unique server team names. 2024-10-29 01:59:16 +08:00
68 changed files with 200102 additions and 504 deletions

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ mappingCompression {
compress("entity/wolf_variant_mappings.json")
compress("item/consume_effect_type_mappings.json")
compress("item/item_armor_material_mappings.json")
compress("item/equipment_asset_mappings.json")
compress("item/item_banner_pattern_mappings.json")
compress("item/item_component_mappings.json")
compress("item/item_instrument_mappings.json")
@@ -34,7 +34,7 @@ public enum ServerVersion {
//TODO Rename to MinecraftVersion?
V_1_7_10(5),
V_1_8(47), V_1_8_3(47), V_1_8_8(47),
V_1_9(107), V_1_9_2(109), V_1_9_4(110),
V_1_9(107), V_1_9_1(108), V_1_9_2(109), V_1_9_4(110),
//1.10 and 1.10.1 are redundant
V_1_10(210), V_1_10_1(210), V_1_10_2(210),
V_1_11(315), V_1_11_2(316),
@@ -50,7 +50,7 @@ public enum ServerVersion {
//1.20 and 1.20.1 have the same protocol version. 1.20.3 and 1.20.4 have the same protocol version. 1.20.5 and 1.20.6 have the same protocol version
V_1_20(763), V_1_20_1(763), V_1_20_2(764), V_1_20_3(765), V_1_20_4(765), V_1_20_5(766), V_1_20_6(766),
//1.21 and 1.21.1 have the same protocol version. 1.21.2 and 1.21.3 have the same protocol version
V_1_21(767), V_1_21_1(767), V_1_21_2(768), V_1_21_3(768),
V_1_21(767), V_1_21_1(767), V_1_21_2(768), V_1_21_3(768), V_1_21_4(769),
//TODO UPDATE Add server version constant
ERROR(-1, true);
@@ -59,82 +59,298 @@ public final class Attributes {
return REGISTRY.getById(version, id);
}
public static final Attribute GENERIC_ARMOR = define("armor",
public static final Attribute ARMOR = define("armor",
"generic", 0d, 0d, 30d);
public static final Attribute GENERIC_ARMOR_TOUGHNESS = define("armor_toughness",
public static final Attribute ARMOR_TOUGHNESS = define("armor_toughness",
"generic", 0d, 0d, 20d);
public static final Attribute GENERIC_ATTACK_DAMAGE = define("attack_damage",
public static final Attribute ATTACK_DAMAGE = define("attack_damage",
"generic", 2d, 0d, 2048d);
public static final Attribute GENERIC_ATTACK_KNOCKBACK = define("attack_knockback",
public static final Attribute ATTACK_KNOCKBACK = define("attack_knockback",
"generic", 0d, 0d, 5d);
public static final Attribute GENERIC_ATTACK_SPEED = define("attack_speed",
public static final Attribute ATTACK_SPEED = define("attack_speed",
"generic", 4d, 0d, 1024d);
public static final Attribute GENERIC_FLYING_SPEED = define("flying_speed",
public static final Attribute FLYING_SPEED = define("flying_speed",
"generic", 0.4d, 0d, 1024d);
public static final Attribute GENERIC_FOLLOW_RANGE = define("follow_range",
public static final Attribute FOLLOW_RANGE = define("follow_range",
"generic", 32d, 0d, 2048d);
@ApiStatus.Obsolete // renamed in 1.20.5
public static final Attribute HORSE_JUMP_STRENGTH = define("horse.jump_strength",
null, 0.7d, 0d, 2d);
public static final Attribute GENERIC_KNOCKBACK_RESISTANCE = define("knockback_resistance",
public static final Attribute KNOCKBACK_RESISTANCE = define("knockback_resistance",
"generic", 0d, 0d, 1d);
public static final Attribute GENERIC_LUCK = define("luck",
public static final Attribute LUCK = define("luck",
"generic", 0d, -1024d, 1024d);
public static final Attribute GENERIC_MAX_HEALTH = define("max_health",
public static final Attribute MAX_HEALTH = define("max_health",
"generic", 20d, 1d, 1024d);
public static final Attribute GENERIC_MOVEMENT_SPEED = define("movement_speed",
public static final Attribute MOVEMENT_SPEED = define("movement_speed",
"generic", 0.7d, 0d, 1024d);
public static final Attribute ZOMBIE_SPAWN_REINFORCEMENTS = define("spawn_reinforcements",
public static final Attribute SPAWN_REINFORCEMENTS = define("spawn_reinforcements",
"zombie", 0d, 0d, 1d);
// Added in 1.20.2
public static final Attribute GENERIC_MAX_ABSORPTION = define("max_absorption",
/**
* Added with 1.20.2
*/
public static final Attribute MAX_ABSORPTION = define("max_absorption",
"generic", 0d, 0d, 2048d);
// Added in 1.20.5
public static final Attribute PLAYER_BLOCK_BREAK_SPEED = define("block_break_speed",
/**
* Added with 1.20.5
*/
public static final Attribute BLOCK_BREAK_SPEED = define("block_break_speed",
"player", 1d, 0d, 1024d);
public static final Attribute PLAYER_BLOCK_INTERACTION_RANGE = define("block_interaction_range",
/**
* Added with 1.20.5
*/
public static final Attribute BLOCK_INTERACTION_RANGE = define("block_interaction_range",
"player", 4.5d, 0d, 64d);
public static final Attribute PLAYER_ENTITY_INTERACTION_RANGE = define("entity_interaction_range",
/**
* Added with 1.20.5
*/
public static final Attribute ENTITY_INTERACTION_RANGE = define("entity_interaction_range",
"player", 3d, 0d, 64d);
public static final Attribute GENERIC_FALL_DAMAGE_MULTIPLIER = define("fall_damage_multiplier",
/**
* Added with 1.20.5
*/
public static final Attribute FALL_DAMAGE_MULTIPLIER = define("fall_damage_multiplier",
"generic", 1d, 0d, 100d);
public static final Attribute GENERIC_GRAVITY = define("gravity",
/**
* Added with 1.20.5
*/
public static final Attribute GRAVITY = define("gravity",
"generic", 0.08d, -1d, 1d);
public static final Attribute GENERIC_JUMP_STRENGTH = define("jump_strength",
/**
* Added with 1.20.5
*/
public static final Attribute JUMP_STRENGTH = define("jump_strength",
"generic", 0.42d, 0d, 32d);
public static final Attribute GENERIC_SAFE_FALL_DISTANCE = define("safe_fall_distance",
/**
* Added with 1.20.5
*/
public static final Attribute SAFE_FALL_DISTANCE = define("safe_fall_distance",
"generic", 3d, 0d, 1024d);
public static final Attribute GENERIC_SCALE = define("scale",
/**
* Added with 1.20.5
*/
public static final Attribute SCALE = define("scale",
"generic", 1d, 1d / 16d, 16d);
public static final Attribute GENERIC_STEP_HEIGHT = define("step_height",
/**
* Added with 1.20.5
*/
public static final Attribute STEP_HEIGHT = define("step_height",
"generic", 0.6d, 0d, 10d);
// Added in 1.21
public static final Attribute GENERIC_BURNING_TIME = define("burning_time",
/**
* Added with 1.21
*/
public static final Attribute BURNING_TIME = define("burning_time",
"generic", 0d, 1d, 1024d);
public static final Attribute GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE = define("explosion_knockback_resistance",
/**
* Added with 1.21
*/
public static final Attribute EXPLOSION_KNOCKBACK_RESISTANCE = define("explosion_knockback_resistance",
"generic", 0d, 0d, 1d);
public static final Attribute PLAYER_MINING_EFFICIENCY = define("mining_efficiency",
/**
* Added with 1.21
*/
public static final Attribute MINING_EFFICIENCY = define("mining_efficiency",
"player", 0d, 0d, 1024d);
public static final Attribute GENERIC_MOVEMENT_EFFICIENCY = define("movement_efficiency",
/**
* Added with 1.21
*/
public static final Attribute MOVEMENT_EFFICIENCY = define("movement_efficiency",
"generic", 0d, 0d, 1d);
public static final Attribute GENERIC_OXYGEN_BONUS = define("oxygen_bonus",
/**
* Added with 1.21
*/
public static final Attribute OXYGEN_BONUS = define("oxygen_bonus",
"generic", 0d, 0d, 1024d);
public static final Attribute PLAYER_SNEAKING_SPEED = define("sneaking_speed",
/**
* Added with 1.21
*/
public static final Attribute SNEAKING_SPEED = define("sneaking_speed",
"player", 0.3d, 0d, 1d);
public static final Attribute PLAYER_SUBMERGED_MINING_SPEED = define("submerged_mining_speed",
/**
* Added with 1.21
*/
public static final Attribute SUBMERGED_MINING_SPEED = define("submerged_mining_speed",
"player", 0.2d, 0d, 20d);
public static final Attribute PLAYER_SWEEPING_DAMAGE_RATIO = define("sweeping_damage_ratio",
/**
* Added with 1.21
*/
public static final Attribute SWEEPING_DAMAGE_RATIO = define("sweeping_damage_ratio",
"player", 0d, 0d, 1d);
public static final Attribute GENERIC_WATER_MOVEMENT_EFFICIENCY = define("water_movement_efficiency",
/**
* Added with 1.21
*/
public static final Attribute WATER_MOVEMENT_EFFICIENCY = define("water_movement_efficiency",
"generic", 0d, 0d, 1d);
// added with 1.21.2
/**
* Added with 1.21.2
*/
public static final Attribute TEMPT_RANGE = define("tempt_range",
null, 10d, 0d, 2048d);
/**
* This attribute has been renamed in 1.20.5 to {@link #JUMP_STRENGTH}
*/
@ApiStatus.Obsolete
public static final Attribute HORSE_JUMP_STRENGTH = define("horse.jump_strength",
null, 0.7d, 0d, 2d);
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ARMOR = ARMOR;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ARMOR_TOUGHNESS = ARMOR_TOUGHNESS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_DAMAGE = ATTACK_DAMAGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_KNOCKBACK = ATTACK_KNOCKBACK;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_SPEED = ATTACK_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FLYING_SPEED = FLYING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FOLLOW_RANGE = FOLLOW_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_KNOCKBACK_RESISTANCE = KNOCKBACK_RESISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_LUCK = LUCK;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MAX_HEALTH = MAX_HEALTH;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MOVEMENT_SPEED = MOVEMENT_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute ZOMBIE_SPAWN_REINFORCEMENTS = SPAWN_REINFORCEMENTS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MAX_ABSORPTION = MAX_ABSORPTION;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_BLOCK_BREAK_SPEED = BLOCK_BREAK_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_BLOCK_INTERACTION_RANGE = BLOCK_INTERACTION_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_ENTITY_INTERACTION_RANGE = ENTITY_INTERACTION_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FALL_DAMAGE_MULTIPLIER = FALL_DAMAGE_MULTIPLIER;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_GRAVITY = GRAVITY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_JUMP_STRENGTH = JUMP_STRENGTH;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_SAFE_FALL_DISTANCE = SAFE_FALL_DISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_SCALE = SCALE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_STEP_HEIGHT = STEP_HEIGHT;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_BURNING_TIME = BURNING_TIME;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE = EXPLOSION_KNOCKBACK_RESISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_MINING_EFFICIENCY = MINING_EFFICIENCY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MOVEMENT_EFFICIENCY = MOVEMENT_EFFICIENCY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_OXYGEN_BONUS = OXYGEN_BONUS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SNEAKING_SPEED = SNEAKING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SUBMERGED_MINING_SPEED = SUBMERGED_MINING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SWEEPING_DAMAGE_RATIO = SWEEPING_DAMAGE_RATIO;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_WATER_MOVEMENT_EFFICIENCY = WATER_MOVEMENT_EFFICIENCY;
static {
REGISTRY.unloadMappings();
}
@@ -26,6 +26,7 @@ import com.github.retrooper.packetevents.protocol.nbt.NBTNumber;
import com.github.retrooper.packetevents.protocol.nbt.NBTType;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.MathUtil;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.util.RGBLike;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Range;
@@ -56,6 +57,14 @@ public class Color implements RGBLike {
this((rgb >> 16) & BIT_MASK, (rgb >> 8) & BIT_MASK, rgb & BIT_MASK);
}
public static Color read(PacketWrapper<?> wrapper) {
return new Color(wrapper.readInt());
}
public static void write(PacketWrapper<?> wrapper, Color color) {
wrapper.writeInt(color.asRGB());
}
public static Color decode(NBT nbt, ClientVersion version) {
if (nbt instanceof NBTNumber) {
return new Color(((NBTNumber) nbt).getAsInt());
@@ -22,6 +22,9 @@ import com.github.retrooper.packetevents.protocol.mapper.MappedEntity;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.Function;
public interface ComponentType<T> extends MappedEntity {
@@ -33,6 +36,9 @@ public interface ComponentType<T> extends MappedEntity {
NBT encode(T value, ClientVersion version);
@ApiStatus.Internal
<Z> ComponentType<Z> legacyMap(Function<T, Z> mapper, Function<Z, T> unmapper);
interface Decoder<T> {
T decode(NBT nbt, ClientVersion version);
@@ -34,6 +34,7 @@ import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemBlo
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemConsumable;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemContainerContents;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemContainerLoot;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemCustomModelData;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemDamageResistant;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemDeathProtection;
import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemDyeColor;
@@ -139,8 +140,14 @@ public final class ComponentTypes {
ItemAdventurePredicate::read, ItemAdventurePredicate::write);
public static final ComponentType<ItemAttributeModifiers> ATTRIBUTE_MODIFIERS = define("attribute_modifiers",
ItemAttributeModifiers::read, ItemAttributeModifiers::write);
public static final ComponentType<Integer> CUSTOM_MODEL_DATA = define("custom_model_data",
PacketWrapper::readVarInt, PacketWrapper::writeVarInt);
public static final ComponentType<ItemCustomModelData> CUSTOM_MODEL_DATA_LISTS = define("custom_model_data",
ItemCustomModelData::read, ItemCustomModelData::write);
/**
* Rewritten in 1.21.4
*/
@Deprecated
public static final ComponentType<Integer> CUSTOM_MODEL_DATA = CUSTOM_MODEL_DATA_LISTS.legacyMap(
ItemCustomModelData::getLegacyId, ItemCustomModelData::new);
public static final ComponentType<Dummy> HIDE_ADDITIONAL_TOOLTIP = define("hide_additional_tooltip",
Dummy::dummyRead, Dummy::dummyWrite);
public static final ComponentType<Dummy> HIDE_TOOLTIP = define("hide_tooltip",
@@ -27,6 +27,8 @@ import com.github.retrooper.packetevents.wrapper.PacketWrapper.Reader;
import com.github.retrooper.packetevents.wrapper.PacketWrapper.Writer;
import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
public class StaticComponentType<T> extends AbstractMappedEntity implements ComponentType<T> {
private final @Nullable Reader<T> reader;
@@ -91,4 +93,13 @@ public class StaticComponentType<T> extends AbstractMappedEntity implements Comp
}
throw new UnsupportedOperationException();
}
@Override
public <Z> ComponentType<Z> legacyMap(Function<T, Z> mapper, Function<Z, T> unmapper) {
Reader<Z> reader = this.reader != null ? wrapper -> mapper.apply(this.reader.apply(wrapper)) : null;
Writer<Z> writer = this.writer != null ? (wrapper, value) -> this.writer.accept(wrapper, unmapper.apply(value)) : null;
Decoder<Z> decoder = this.decoder != null ? (nbt, version) -> mapper.apply(this.decoder.decode(nbt, version)) : null;
Encoder<Z> encoder = this.encoder != null ? (value, version) -> this.encoder.encode(unmapper.apply(value), version) : null;
return new StaticComponentType<>(this.data, reader, writer, decoder, encoder);
}
}
@@ -31,11 +31,11 @@ public class ItemConsumable {
private Animation animation;
private Sound sound;
private boolean consumeParticles;
private List<ConsumeEffect> effects;
private List<ConsumeEffect<?>> effects;
public ItemConsumable(
float consumeSeconds, Animation animation, Sound sound,
boolean consumeParticles, List<ConsumeEffect> effects
boolean consumeParticles, List<ConsumeEffect<?>> effects
) {
this.consumeSeconds = consumeSeconds;
this.animation = animation;
@@ -49,7 +49,7 @@ public class ItemConsumable {
Animation animation = wrapper.readEnum(Animation.values());
Sound sound = Sound.read(wrapper);
boolean consumeParticles = wrapper.readBoolean();
List<ConsumeEffect> effects = wrapper.readList(ConsumeEffect::readFull);
List<ConsumeEffect<?>> effects = wrapper.readList(ConsumeEffect::readFull);
return new ItemConsumable(consumeSeconds, animation, sound, consumeParticles, effects);
}
@@ -93,11 +93,11 @@ public class ItemConsumable {
this.consumeParticles = consumeParticles;
}
public List<ConsumeEffect> getEffects() {
public List<ConsumeEffect<?>> getEffects() {
return this.effects;
}
public void setEffects(List<ConsumeEffect> effects) {
public void setEffects(List<ConsumeEffect<?>> effects) {
this.effects = effects;
}
@@ -124,6 +124,7 @@ public class ItemConsumable {
}
public enum Animation {
NONE,
EAT,
DRINK,
@@ -134,5 +135,10 @@ public class ItemConsumable {
SPYGLASS,
TOOT_HORN,
BRUSH,
/**
* Added with 1.21.4
*/
BUNDLE,
;
}
}
@@ -0,0 +1,134 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.component.builtin.item;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.color.Color;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import java.util.ArrayList;
import java.util.List;
/**
* Custom model data was completely rewritten with 1.21.4.
* <p>
* Before 1.21.4, this used to be a single integer.<br/>
* With 1.21.4, this is now a holder of many elements.
* <p>
* If possible, use {@link com.github.retrooper.packetevents.protocol.component.ComponentTypes#ITEM_MODEL}
* instead for specifying which model an item should have.
* <p>
* When working with legacy versions, the first element in the {@link #floats}
* will represent the legacy single integer, just like Mojang is handling this.
*/
public class ItemCustomModelData {
private List<Float> floats;
private List<Boolean> flags;
private List<String> strings;
private List<Color> colors;
public ItemCustomModelData(List<Float> floats, List<Boolean> flags, List<String> strings, List<Color> colors) {
this.floats = floats;
this.flags = flags;
this.strings = strings;
this.colors = colors;
}
public ItemCustomModelData(int legacyId) {
this.floats = new ArrayList<>(1);
this.flags = new ArrayList<>(0);
this.strings = new ArrayList<>(0);
this.colors = new ArrayList<>(0);
this.setLegacyId(legacyId);
}
public static ItemCustomModelData read(PacketWrapper<?> wrapper) {
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
return new ItemCustomModelData(
wrapper.readList(PacketWrapper::readFloat),
wrapper.readList(PacketWrapper::readBoolean),
wrapper.readList(PacketWrapper::readString),
wrapper.readList(Color::read));
} else {
return new ItemCustomModelData(wrapper.readVarInt());
}
}
public static void write(PacketWrapper<?> wrapper, ItemCustomModelData data) {
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
wrapper.writeList(data.floats, PacketWrapper::writeFloat);
wrapper.writeList(data.flags, PacketWrapper::writeBoolean);
wrapper.writeList(data.strings, PacketWrapper::writeString);
wrapper.writeList(data.colors, Color::write);
} else {
wrapper.writeVarInt(data.getLegacyId());
}
}
public List<Float> getFloats() {
return this.floats;
}
public void setFloats(List<Float> floats) {
this.floats = floats;
}
public List<Boolean> getFlags() {
return this.flags;
}
public void setFlags(List<Boolean> flags) {
this.flags = flags;
}
public List<String> getStrings() {
return this.strings;
}
public void setStrings(List<String> strings) {
this.strings = strings;
}
public List<Color> getColors() {
return this.colors;
}
public void setColors(List<Color> colors) {
this.colors = colors;
}
@ApiStatus.Obsolete
public int getLegacyId() {
if (!this.floats.isEmpty()) {
return this.floats.get(0).intValue();
}
return 0;
}
@ApiStatus.Obsolete
public void setLegacyId(int legacyId) {
if (this.flags.isEmpty()) {
this.floats.add((float) legacyId);
} else {
this.floats.set(0, (float) legacyId);
}
}
}
@@ -33,7 +33,7 @@ public class ItemEquippable {
private EquipmentSlot slot;
private Sound equipSound;
private @Nullable ResourceLocation model;
private @Nullable ResourceLocation assetId;
private @Nullable ResourceLocation cameraOverlay;
private @Nullable MappedEntitySet<EntityType> allowedEntities;
private boolean dispensable;
@@ -43,7 +43,7 @@ public class ItemEquippable {
public ItemEquippable(
EquipmentSlot slot,
Sound equipSound,
@Nullable ResourceLocation model,
@Nullable ResourceLocation assetId,
@Nullable ResourceLocation cameraOverlay,
@Nullable MappedEntitySet<EntityType> allowedEntities,
boolean dispensable,
@@ -52,7 +52,7 @@ public class ItemEquippable {
) {
this.slot = slot;
this.equipSound = equipSound;
this.model = model;
this.assetId = assetId;
this.cameraOverlay = cameraOverlay;
this.allowedEntities = allowedEntities;
this.dispensable = dispensable;
@@ -77,7 +77,7 @@ public class ItemEquippable {
public static void write(PacketWrapper<?> wrapper, ItemEquippable equippable) {
wrapper.writeEnum(equippable.slot);
Sound.write(wrapper, equippable.equipSound);
wrapper.writeOptional(equippable.model, PacketWrapper::writeIdentifier);
wrapper.writeOptional(equippable.assetId, PacketWrapper::writeIdentifier);
wrapper.writeOptional(equippable.cameraOverlay, PacketWrapper::writeIdentifier);
wrapper.writeOptional(equippable.allowedEntities, MappedEntitySet::write);
wrapper.writeBoolean(equippable.dispensable);
@@ -101,12 +101,12 @@ public class ItemEquippable {
this.equipSound = equipSound;
}
public @Nullable ResourceLocation getModel() {
return this.model;
public @Nullable ResourceLocation getAssetId() {
return this.assetId;
}
public void setModel(@Nullable ResourceLocation model) {
this.model = model;
public void setAssetId(@Nullable ResourceLocation assetId) {
this.assetId = assetId;
}
public @Nullable ResourceLocation getCameraOverlay() {
@@ -149,6 +149,16 @@ public class ItemEquippable {
this.damageOnHurt = damageOnHurt;
}
@Deprecated
public @Nullable ResourceLocation getModel() {
return this.assetId;
}
@Deprecated
public void setModel(@Nullable ResourceLocation assetId) {
this.assetId = assetId;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
@@ -159,18 +169,18 @@ public class ItemEquippable {
if (this.damageOnHurt != that.damageOnHurt) return false;
if (this.slot != that.slot) return false;
if (!Objects.equals(this.equipSound, that.equipSound)) return false;
if (!Objects.equals(this.model, that.model)) return false;
if (!Objects.equals(this.assetId, that.assetId)) return false;
if (!Objects.equals(this.cameraOverlay, that.cameraOverlay)) return false;
return Objects.equals(this.allowedEntities, that.allowedEntities);
}
@Override
public int hashCode() {
return Objects.hash(this.slot, this.equipSound, this.model, this.cameraOverlay, this.allowedEntities, this.dispensable, this.swappable, this.damageOnHurt);
return Objects.hash(this.slot, this.equipSound, this.assetId, this.cameraOverlay, this.allowedEntities, this.dispensable, this.swappable, this.damageOnHurt);
}
@Override
public String toString() {
return "ItemEquippable{slot=" + this.slot + ", equipSound=" + this.equipSound + ", model=" + this.model + ", cameraOverlay=" + this.cameraOverlay + ", allowedEntities=" + this.allowedEntities + ", dispensable=" + this.dispensable + ", swappable=" + this.swappable + ", damageOnHurt=" + this.damageOnHurt + '}';
return "ItemEquippable{slot=" + this.slot + ", equipSound=" + this.equipSound + ", model=" + this.assetId + ", cameraOverlay=" + this.cameraOverlay + ", allowedEntities=" + this.allowedEntities + ", dispensable=" + this.dispensable + ", swappable=" + this.swappable + ", damageOnHurt=" + this.damageOnHurt + '}';
}
}
@@ -18,6 +18,7 @@
package com.github.retrooper.packetevents.protocol.component.builtin.item;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.potion.Potion;
import com.github.retrooper.packetevents.protocol.potion.PotionEffect;
import com.github.retrooper.packetevents.protocol.potion.Potions;
@@ -32,28 +33,44 @@ public class ItemPotionContents {
private @Nullable Potion potion;
private @Nullable Integer customColor;
private List<PotionEffect> customEffects;
private @Nullable String customName;
public ItemPotionContents(
@Nullable Potion potion,
@Nullable Integer customColor,
List<PotionEffect> customEffects
) {
this(potion, customColor, customEffects, null);
}
public ItemPotionContents(
@Nullable Potion potion,
@Nullable Integer customColor,
List<PotionEffect> customEffects,
@Nullable String customName
) {
this.potion = potion;
this.customColor = customColor;
this.customEffects = customEffects;
this.customName = customName;
}
public static ItemPotionContents read(PacketWrapper<?> wrapper) {
Potion potionId = wrapper.readOptional(ew -> ew.readMappedEntity(Potions::getById));
Integer customColor = wrapper.readOptional(PacketWrapper::readInt);
List<PotionEffect> customEffects = wrapper.readList(PotionEffect::read);
return new ItemPotionContents(potionId, customColor, customEffects);
String customName = wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_2)
? wrapper.readOptional(PacketWrapper::readString) : null;
return new ItemPotionContents(potionId, customColor, customEffects, customName);
}
public static void write(PacketWrapper<?> wrapper, ItemPotionContents contents) {
wrapper.writeOptional(contents.potion, PacketWrapper::writeMappedEntity);
wrapper.writeOptional(contents.customColor, PacketWrapper::writeInt);
wrapper.writeList(contents.customEffects, PotionEffect::write);
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_2)) {
wrapper.writeOptional(contents.customName, PacketWrapper::writeString);
}
}
public @Nullable Potion getPotion() {
@@ -84,6 +101,14 @@ public class ItemPotionContents {
this.customEffects = customEffects;
}
public @Nullable String getCustomName() {
return this.customName;
}
public void setCustomName(@Nullable String customName) {
this.customName = customName;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
@@ -91,11 +116,12 @@ public class ItemPotionContents {
ItemPotionContents that = (ItemPotionContents) obj;
if (!Objects.equals(this.potion, that.potion)) return false;
if (!Objects.equals(this.customColor, that.customColor)) return false;
return this.customEffects.equals(that.customEffects);
if (!this.customEffects.equals(that.customEffects)) return false;
return Objects.equals(this.customName, that.customName);
}
@Override
public int hashCode() {
return Objects.hash(this.potion, this.customColor, this.customEffects);
return Objects.hash(this.potion, this.customColor, this.customEffects, this.customName);
}
}
@@ -22,6 +22,7 @@ import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.mappings.TypesBuilder;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
@@ -315,6 +316,10 @@ public class EntityTypes {
public static final EntityType CHERRY_BOAT = define("cherry_boat", BOAT);
public static final EntityType CHERRY_CHEST_BOAT = define("cherry_chest_boat", CHEST_BOAT);
public static final EntityType CREAKING = define("creaking", ABSTRACT_MONSTER);
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public static final EntityType CREAKING_TRANSIENT = define("creaking_transient", CREAKING);
public static final EntityType DARK_OAK_BOAT = define("dark_oak_boat", BOAT);
public static final EntityType DARK_OAK_CHEST_BOAT = define("dark_oak_chest_boat", CHEST_BOAT);
@@ -19,54 +19,47 @@
package com.github.retrooper.packetevents.protocol.item.armormaterial;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.mappings.MappingHelper;
import com.github.retrooper.packetevents.util.mappings.TypesBuilder;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import java.util.HashMap;
import java.util.Map;
public class ArmorMaterials {
/**
* This is named "equipment asset" in vanilla since 1.21.4,
* before this was also called "armor material" in vanilla.
*/
public final class ArmorMaterials {
private static final Map<String, ArmorMaterial> MATERIAL_MAP = new HashMap<>();
private static final Map<Byte, Map<Integer, ArmorMaterial>> MATERIAL_ID_MAP = new HashMap<>();
private static final TypesBuilder TYPES_BUILDER = new TypesBuilder("item/item_armor_material_mappings");
// this isn't great, but it works
private static final Map<String, String> DFU = new HashMap<>();
public static ArmorMaterial define(String key) {
TypesBuilderData data = TYPES_BUILDER.define(key);
ArmorMaterial instrument = new ArmorMaterial() {
@Override
public ResourceLocation getName() {
return data.getName();
}
@Override
public int getId(ClientVersion version) {
return MappingHelper.getId(version, TYPES_BUILDER, data);
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ArmorMaterial) {
return getName().equals(((ArmorMaterial) obj).getName());
}
return false;
}
};
MappingHelper.registerMapping(TYPES_BUILDER, MATERIAL_MAP, MATERIAL_ID_MAP, instrument);
return instrument;
static {
DFU.put("turtle", "minecraft:turtle_scute");
DFU.put("minecraft:turtle", "minecraft:turtle_scute");
DFU.put("armadillo", "minecraft:armadillo_scute");
DFU.put("minecraft:armadillo", "minecraft:armadillo_scute");
}
private static final VersionedRegistry<ArmorMaterial> REGISTRY = new VersionedRegistry<>(
"equipment_asset", "item/equipment_asset_mappings");
private ArmorMaterials() {
}
private static ArmorMaterial define(String name) {
return REGISTRY.define(name, StaticArmorMaterial::new);
}
public static VersionedRegistry<ArmorMaterial> getRegistry() {
return REGISTRY;
}
// with key
public static ArmorMaterial getByName(String name) {
return MATERIAL_MAP.get(name);
return REGISTRY.getByName(DFU.getOrDefault(name, name));
}
public static ArmorMaterial getById(ClientVersion version, int id) {
int index = TYPES_BUILDER.getDataIndex(version);
Map<Integer, ArmorMaterial> idMap = MATERIAL_ID_MAP.get((byte) index);
return idMap.get(id);
return REGISTRY.getById(version, id);
}
public static final ArmorMaterial LEATHER = define("leather");
@@ -75,16 +68,105 @@ public class ArmorMaterials {
public static final ArmorMaterial GOLD = define("gold");
public static final ArmorMaterial DIAMOND = define("diamond");
// Added with 1.13
public static final ArmorMaterial TURTLE = define("turtle");
/**
* Renamed from {@link #TURTLE} in 1.21.4
*/
public static final ArmorMaterial TURTLE_SCUTE = define("turtle_scute");
/**
* Added with 1.13, renamed to {@link #TURTLE_SCUTE} in 1.21.4
*/
@Deprecated
public static final ArmorMaterial TURTLE = TURTLE_SCUTE;
// Added with 1.16
/**
* Added with 1.16
*/
public static final ArmorMaterial NETHERITE = define("netherite");
// Added with 1.20.5
public static final ArmorMaterial ARMADILLO = define("armadillo");
/**
* Renamed from {@link #ARMADILLO} in 1.21.4
*/
public static final ArmorMaterial ARMADILLO_SCUTE = define("armadillo_scute");
/**
* Added with 1.20.5, renamed to {@link #ARMADILLO_SCUTE} in 1.21.4
*/
@Deprecated
public static final ArmorMaterial ARMADILLO = ARMADILLO_SCUTE;
/**
* Added with 1.21.4
*/
public static final ArmorMaterial ELYTRA = define("elytra");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial WHITE_CARPET = define("white_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial ORANGE_CARPET = define("orange_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial MAGENTA_CARPET = define("magenta_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial LIGHT_BLUE_CARPET = define("light_blue_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial YELLOW_CARPET = define("yellow_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial LIME_CARPET = define("lime_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial PINK_CARPET = define("pink_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial GRAY_CARPET = define("gray_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial LIGHT_GRAY_CARPET = define("light_gray_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial CYAN_CARPET = define("cyan_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial PURPLE_CARPET = define("purple_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial BLUE_CARPET = define("blue_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial BROWN_CARPET = define("brown_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial GREEN_CARPET = define("green_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial RED_CARPET = define("red_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial BLACK_CARPET = define("black_carpet");
/**
* Added with 1.21.4
*/
public static final ArmorMaterial TRADER_LLAMA = define("trader_llama");
static {
TYPES_BUILDER.unloadFileMappings();
REGISTRY.unloadMappings();
}
}
@@ -0,0 +1,30 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.item.armormaterial;
import com.github.retrooper.packetevents.protocol.mapper.AbstractMappedEntity;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import org.jetbrains.annotations.Nullable;
public class StaticArmorMaterial extends AbstractMappedEntity implements ArmorMaterial {
public StaticArmorMaterial(@Nullable TypesBuilderData data) {
super(data);
}
}
@@ -36,6 +36,21 @@ public class StaticTrimMaterial extends AbstractMappedEntity implements TrimMate
private final Map<ArmorMaterial, String> overrideArmorMaterials;
private final Component description;
public StaticTrimMaterial(
String assetName, ItemType ingredient,
Map<ArmorMaterial, String> overrideArmorMaterials, Component description
) {
this(null, assetName, ingredient, FALLBACK_ITEM_MODEL_INDEX, overrideArmorMaterials, description);
}
public StaticTrimMaterial(
@Nullable TypesBuilderData data,
String assetName, ItemType ingredient,
Map<ArmorMaterial, String> overrideArmorMaterials, Component description
) {
this(data, assetName, ingredient, FALLBACK_ITEM_MODEL_INDEX, overrideArmorMaterials, description);
}
public StaticTrimMaterial(
String assetName, ItemType ingredient, float itemModelIndex,
Map<ArmorMaterial, String> overrideArmorMaterials, Component description
@@ -18,6 +18,7 @@
package com.github.retrooper.packetevents.protocol.item.trimmaterial;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.item.armormaterial.ArmorMaterial;
import com.github.retrooper.packetevents.protocol.item.armormaterial.ArmorMaterials;
import com.github.retrooper.packetevents.protocol.item.type.ItemType;
@@ -34,6 +35,7 @@ import com.github.retrooper.packetevents.util.adventure.AdventureSerializer;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -42,10 +44,16 @@ import java.util.Map;
public interface TrimMaterial extends MappedEntity, CopyableEntity<TrimMaterial>, DeepComparableEntity {
float FALLBACK_ITEM_MODEL_INDEX = 0f;
String getAssetName();
ItemType getIngredient();
/**
* Removed in 1.21.4
*/
@ApiStatus.Obsolete
float getItemModelIndex();
default @Nullable String getArmorMaterialOverride(ArmorMaterial armorMaterial) {
@@ -63,7 +71,8 @@ public interface TrimMaterial extends MappedEntity, CopyableEntity<TrimMaterial>
static TrimMaterial readDirect(PacketWrapper<?> wrapper) {
String assetName = wrapper.readString();
ItemType ingredient = wrapper.readMappedEntity(ItemTypes::getById);
float itemModelIndex = wrapper.readFloat();
float itemModelIndex = wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)
? FALLBACK_ITEM_MODEL_INDEX : wrapper.readFloat();
Map<ArmorMaterial, String> overrideArmorMaterials = wrapper.readMap(
ew -> ew.readMappedEntity(ArmorMaterials::getById),
PacketWrapper::readString);
@@ -78,7 +87,9 @@ public interface TrimMaterial extends MappedEntity, CopyableEntity<TrimMaterial>
static void writeDirect(PacketWrapper<?> wrapper, TrimMaterial material) {
wrapper.writeString(material.getAssetName());
wrapper.writeMappedEntity(material.getIngredient());
wrapper.writeFloat(material.getItemModelIndex());
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
wrapper.writeFloat(material.getItemModelIndex());
}
wrapper.writeMap(material.getOverrideArmorMaterials(),
PacketWrapper::writeMappedEntity, PacketWrapper::writeString);
wrapper.writeComponent(material.getDescription());
@@ -88,7 +99,8 @@ public interface TrimMaterial extends MappedEntity, CopyableEntity<TrimMaterial>
NBTCompound compound = (NBTCompound) nbt;
String assetName = compound.getStringTagValueOrThrow("asset_name");
ItemType ingredient = ItemTypes.getByName(compound.getStringTagValueOrThrow("ingredient"));
float itemModelIndex = compound.getNumberTagOrThrow("item_model_index").getAsFloat();
float itemModelIndex = version.isNewerThanOrEquals(ClientVersion.V_1_21_4)
? FALLBACK_ITEM_MODEL_INDEX : compound.getNumberTagOrThrow("item_model_index").getAsFloat();
NBTCompound overrideArmorMaterialsTag = compound.getCompoundTagOrNull("override_armor_materials");
Map<ArmorMaterial, String> overrideArmorMaterials;
if (overrideArmorMaterialsTag != null) {
@@ -121,7 +133,9 @@ public interface TrimMaterial extends MappedEntity, CopyableEntity<TrimMaterial>
NBTCompound compound = new NBTCompound();
compound.setTag("asset_name", new NBTString(material.getAssetName()));
compound.setTag("ingredient", new NBTString(material.getIngredient().getName().toString()));
compound.setTag("item_model_index", new NBTFloat(material.getItemModelIndex()));
if (version.isNewerThanOrEquals(ClientVersion.V_1_21_4)) {
compound.setTag("item_model_index", new NBTFloat(material.getItemModelIndex()));
}
if (overrideArmorMaterialsTag != null) {
compound.setTag("override_armor_materials", overrideArmorMaterialsTag);
}
@@ -90,6 +90,9 @@ public final class TrimMaterials {
public static final TrimMaterial QUARTZ = define("quartz", ItemTypes.QUARTZ, 0.1f, 0xE3D4C4);
public static final TrimMaterial REDSTONE = define("redstone", ItemTypes.REDSTONE, 0.4f, 0x971607);
// added with 1.21.4
public static final TrimMaterial RESIN = define("resin", ItemTypes.RESIN_BRICK, 0.11f, 0xFC7812);
/**
* Returns an immutable view of the trim materials.
*
@@ -1449,6 +1449,18 @@ public class ItemTypes {
public static final ItemType FIELD_MASONED_BANNER_PATTERN = builder("field_masoned_banner_pattern").setMaxAmount(1).build();
public static final ItemType BORDURE_INDENTED_BANNER_PATTERN = builder("bordure_indented_banner_pattern").setMaxAmount(1).build();
// 1.21.4 items
public static final ItemType OPEN_EYEBLOSSOM = builder("open_eyeblossom").setMaxAmount(64).setPlacedType(StateTypes.OPEN_EYEBLOSSOM).build();
public static final ItemType CLOSED_EYEBLOSSOM = builder("closed_eyeblossom").setMaxAmount(64).setPlacedType(StateTypes.CLOSED_EYEBLOSSOM).build();
public static final ItemType RESIN_CLUMP = builder("resin_clump").setMaxAmount(64).setPlacedType(StateTypes.RESIN_CLUMP).build();
public static final ItemType RESIN_BLOCK = builder("resin_block").setMaxAmount(64).setPlacedType(StateTypes.RESIN_BLOCK).build();
public static final ItemType RESIN_BRICKS = builder("resin_bricks").setMaxAmount(64).setPlacedType(StateTypes.RESIN_BRICKS).build();
public static final ItemType RESIN_BRICK_STAIRS = builder("resin_brick_stairs").setMaxAmount(64).setPlacedType(StateTypes.RESIN_BRICK_STAIRS).build();
public static final ItemType RESIN_BRICK_SLAB = builder("resin_brick_slab").setMaxAmount(64).setPlacedType(StateTypes.RESIN_BRICK_SLAB).build();
public static final ItemType RESIN_BRICK_WALL = builder("resin_brick_wall").setMaxAmount(64).setPlacedType(StateTypes.RESIN_BRICK_WALL).build();
public static final ItemType CHISELED_RESIN_BRICKS = builder("chiseled_resin_bricks").setMaxAmount(64).setPlacedType(StateTypes.CHISELED_RESIN_BRICKS).build();
public static final ItemType RESIN_BRICK = builder("resin_brick").setMaxAmount(64).build();
/**
* @deprecated Burning furnace shows up as a missing texture, removed in 1.9
*/
@@ -207,7 +207,7 @@ public class NBTCompound extends NBT {
}
public boolean getBoolean(String string) {
NBTByte nbtByte = this.getTagOfTypeOrNull(string, NBTByte.class);
NBTNumber nbtByte = this.getTagOfTypeOrNull(string, NBTNumber.class);
// Empty byte tags are considered 0
return nbtByte != null && nbtByte.getAsByte() != 0;
}
@@ -40,6 +40,7 @@ public class NPC {
private NamedTextColor nameColor;
private Component prefixName;
private Component suffixName;
private String teamName;
private int displayPing = 0;
private Location location = new Location(0.0, 0.0, 0.0, 0.0f, 0.0f);
private ItemStack mainHand = null;
@@ -60,6 +61,7 @@ public class NPC {
this.nameColor = nameColor;
this.prefixName = prefixName;
this.suffixName = suffixName;
this.teamName = "npc-" + id;
}
public NPC(UserProfile profile, int entityId, @Nullable Component tabName) {
@@ -273,7 +275,7 @@ public class NPC {
for (Object channel : channels) {
//Destroy team
WrapperPlayServerTeams removeTeam =
new WrapperPlayServerTeams("custom_name_team",
new WrapperPlayServerTeams(teamName,
WrapperPlayServerTeams.TeamMode.REMOVE,
Optional.empty());
PacketEvents.getAPI().getProtocolManager().sendPacket(channel, removeTeam);
@@ -410,6 +412,16 @@ public class NPC {
this.suffixName = nameSuffix;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThan(ServerVersion.V_1_18)) {
this.teamName = teamName.substring(0, 16);
} else this.teamName = teamName;
}
@Nullable
public Component getTabName() {
return tabName;
@@ -436,11 +448,11 @@ public class NPC {
}
private WrapperPlayServerTeams generateTeamsData() {
return new WrapperPlayServerTeams("custom_name_team",
return new WrapperPlayServerTeams(teamName,
WrapperPlayServerTeams.TeamMode.CREATE,
Optional.of(
new WrapperPlayServerTeams.ScoreBoardTeamInfo(
Component.text("custom_name_team"),
Component.text(teamName),
prefixName,
suffixName,
WrapperPlayServerTeams.NameTagVisibility.ALWAYS,
@@ -66,11 +66,13 @@ import com.github.retrooper.packetevents.protocol.packettype.serverbound.Serverb
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_20_3;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_20_5;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_21_2;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_21_4;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_7_10;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_8;
import com.github.retrooper.packetevents.protocol.packettype.serverbound.ServerboundPacketType_1_9;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.VersionMapper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
@@ -128,7 +130,8 @@ public final class PacketType {
ClientVersion.V_1_20_2,
ClientVersion.V_1_20_3,
ClientVersion.V_1_20_5,
ClientVersion.V_1_21_2);
ClientVersion.V_1_21_2,
ClientVersion.V_1_21_4);
// TODO UPDATE Update packet type mappings (config clientbound pt. 1)
private static final VersionMapper CLIENTBOUND_CONFIG_VERSION_MAPPER = new VersionMapper(
@@ -621,11 +624,19 @@ public final class PacketType {
PLAYER_FLYING,
VEHICLE_MOVE,
STEER_BOAT,
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
PICK_ITEM,
CRAFT_RECIPE_REQUEST,
PLAYER_ABILITIES,
PLAYER_DIGGING,
ENTITY_ACTION,
/**
* Removed with 1.21.2
*/
@ApiStatus.Obsolete
STEER_VEHICLE,
PONG,
RECIPE_BOOK_DATA,
@@ -648,32 +659,77 @@ public final class PacketType {
PLAYER_BLOCK_PLACEMENT,
USE_ITEM,
// Added in 1.19
/**
* Added with 1.19
*/
CHAT_COMMAND,
// Added in 1.19.1
/**
* Added with 1.19.1
*/
CHAT_ACK,
// Added in 1.19.3
/**
* Added with 1.19.3
*/
CHAT_SESSION_UPDATE,
// Added in 1.20.2
/**
* Added with 1.20.2
*/
CHUNK_BATCH_ACK,
/**
* Added with 1.20.2
*/
CONFIGURATION_ACK,
/**
* Added with 1.20.2
*/
DEBUG_PING,
// Added in 1.20.3
/**
* Added with 1.20.3
*/
SLOT_STATE_CHANGE,
// Added in 1.20.5
/**
* Added with 1.20.5
*/
CHAT_COMMAND_UNSIGNED,
/**
* Added with 1.20.5
*/
COOKIE_RESPONSE,
/**
* Added with 1.20.5
*/
DEBUG_SAMPLE_SUBSCRIPTION,
// added in 1.21.2
/**
* Added with 1.21.2
*/
CLIENT_TICK_END,
/**
* Added with 1.21.2
*/
SELECT_BUNDLE_ITEM,
PLAYER_INPUT, // based on STEER_VEHICLE
/**
* Added with 1.21.2, based on {@link #STEER_VEHICLE}
*/
PLAYER_INPUT,
/**
* Added with 1.21.4
*/
PICK_ITEM_FROM_BLOCK,
/**
* Added with 1.21.4
*/
PICK_ITEM_FROM_ENTITY,
/**
* Added with 1.21.4
*/
PLAYER_LOADED,
;
private static int INDEX = 0;
@@ -729,6 +785,7 @@ public final class PacketType {
loadPacketIds(ServerboundPacketType_1_20_3.values());
loadPacketIds(ServerboundPacketType_1_20_5.values());
loadPacketIds(ServerboundPacketType_1_21_2.values());
loadPacketIds(ServerboundPacketType_1_21_4.values());
//TODO UPDATE Update packet type mappings (serverbound pt. 2)
}
@@ -0,0 +1,85 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.packettype.serverbound;
public enum ServerboundPacketType_1_21_4 {
TELEPORT_CONFIRM,
QUERY_BLOCK_NBT,
SELECT_BUNDLE_ITEM,
SET_DIFFICULTY,
CHAT_ACK,
CHAT_COMMAND_UNSIGNED,
CHAT_COMMAND,
CHAT_MESSAGE,
CHAT_SESSION_UPDATE,
CHUNK_BATCH_ACK,
CLIENT_STATUS,
CLIENT_TICK_END,
CLIENT_SETTINGS,
TAB_COMPLETE,
CONFIGURATION_ACK,
CLICK_WINDOW_BUTTON,
CLICK_WINDOW,
CLOSE_WINDOW,
SLOT_STATE_CHANGE,
COOKIE_RESPONSE,
PLUGIN_MESSAGE,
DEBUG_SAMPLE_SUBSCRIPTION,
EDIT_BOOK,
QUERY_ENTITY_NBT,
INTERACT_ENTITY,
GENERATE_STRUCTURE,
KEEP_ALIVE,
LOCK_DIFFICULTY,
PLAYER_POSITION,
PLAYER_POSITION_AND_ROTATION,
PLAYER_ROTATION,
PLAYER_FLYING,
VEHICLE_MOVE,
STEER_BOAT,
PICK_ITEM_FROM_BLOCK, // new packet
PICK_ITEM_FROM_ENTITY, // new packet
DEBUG_PING,
CRAFT_RECIPE_REQUEST,
PLAYER_ABILITIES,
PLAYER_DIGGING,
ENTITY_ACTION,
PLAYER_INPUT,
PLAYER_LOADED, // new packet
PONG,
SET_RECIPE_BOOK_STATE,
SET_DISPLAYED_RECIPE,
NAME_ITEM,
RESOURCE_PACK_STATUS,
ADVANCEMENT_TAB,
SELECT_TRADE,
SET_BEACON_EFFECT,
HELD_ITEM_CHANGE,
UPDATE_COMMAND_BLOCK,
UPDATE_COMMAND_BLOCK_MINECART,
CREATIVE_INVENTORY_ACTION,
UPDATE_JIGSAW_BLOCK,
UPDATE_STRUCTURE_BLOCK,
UPDATE_SIGN,
ANIMATION,
SPECTATE,
PLAYER_BLOCK_PLACEMENT,
USE_ITEM,
}
@@ -18,42 +18,67 @@
package com.github.retrooper.packetevents.protocol.particle.data;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.color.Color;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTInt;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
public class ParticleTrailData extends ParticleData {
private static final int FALLBACK_DURATION = 50 / 2; // use average duration as default
private Vector3d target;
private Color color;
/**
* Added with 1.21.4
*/
private int duration;
public ParticleTrailData(Vector3d target, Color color) {
this(target, color, FALLBACK_DURATION);
}
public ParticleTrailData(Vector3d target, Color color, int duration) {
this.target = target;
this.color = color;
this.duration = duration;
}
public static ParticleTrailData read(PacketWrapper<?> wrapper) {
Vector3d target = Vector3d.read(wrapper);
Color color = new Color(wrapper.readInt());
return new ParticleTrailData(target, color);
int duration = wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)
? wrapper.readVarInt() : FALLBACK_DURATION;
return new ParticleTrailData(target, color, duration);
}
public static void write(PacketWrapper<?> wrapper, ParticleTrailData data) {
Vector3d.write(wrapper, data.target);
wrapper.writeInt(data.color.asRGB());
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
wrapper.writeVarInt(data.duration);
}
}
public static ParticleTrailData decode(NBTCompound compound, ClientVersion version) {
Vector3d target = Vector3d.decode(compound.getTagOrThrow("target"), version);
Color color = Color.decode(compound.getTagOrThrow("color"), version);
return new ParticleTrailData(target, color);
int duration = FALLBACK_DURATION;
if (version.isNewerThanOrEquals(ClientVersion.V_1_21_4)) {
duration = compound.getNumberTagOrThrow("duration").getAsInt();
}
return new ParticleTrailData(target, color, duration);
}
public static void encode(ParticleTrailData data, ClientVersion version, NBTCompound compound) {
compound.setTag("target", Vector3d.encode(data.target, version));
compound.setTag("color", Color.encode(data.color, version));
if (version.isNewerThanOrEquals(ClientVersion.V_1_21_4)) {
compound.setTag("duration", new NBTInt(data.duration));
}
}
@Override
@@ -76,4 +101,18 @@ public class ParticleTrailData extends ParticleData {
public void setColor(Color color) {
this.color = color;
}
/**
* Added with 1.21.4
*/
public int getDuration() {
return this.duration;
}
/**
* Added with 1.21.4
*/
public void setDuration(int duration) {
this.duration = duration;
}
}
@@ -282,6 +282,9 @@ public class ParticleTypes {
ParticleBlockStateData::read, ParticleBlockStateData::write,
ParticleBlockStateData::decode, ParticleBlockStateData::encode);
// added with 1.21.4
public static final ParticleType<ParticleData> PALE_OAK_LEAVES = define("pale_oak_leaves");
/**
* Returns an immutable view of the particle types.
*
@@ -104,13 +104,14 @@ public enum ClientVersion {
* 1.21.2 and 1.21.3 have the same protocol version.
*/
V_1_21_2(768),
V_1_21_4(769),
//TODO UPDATE Add new protocol version field
@Deprecated
LOWER_THAN_SUPPORTED_VERSIONS(V_1_7_10.protocolVersion - 1, true),
//TODO UPDATE Update HIGHER_THAN_SUPPORTED_VERSIONS field
@Deprecated
HIGHER_THAN_SUPPORTED_VERSIONS(V_1_21_2.protocolVersion + 1, true),
HIGHER_THAN_SUPPORTED_VERSIONS(V_1_21_4.protocolVersion + 1, true),
UNKNOWN(-1, true);
@@ -1756,6 +1756,23 @@ public class Sounds {
public static final Sound BLOCK_SPAWNER_PLACE = define("block.spawner.place");
public static final Sound BLOCK_SPAWNER_STEP = define("block.spawner.step");
// added with 1.21.4
public static final Sound ENTITY_CREAKING_TWITCH = define("entity.creaking.twitch");
public static final Sound BLOCK_EYEBLOSSOM_OPEN_LONG = define("block.eyeblossom.open_long");
public static final Sound BLOCK_EYEBLOSSOM_OPEN = define("block.eyeblossom.open");
public static final Sound BLOCK_EYEBLOSSOM_CLOSE_LONG = define("block.eyeblossom.close_long");
public static final Sound BLOCK_EYEBLOSSOM_CLOSE = define("block.eyeblossom.close");
public static final Sound BLOCK_EYEBLOSSOM_IDLE = define("block.eyeblossom.idle");
public static final Sound BLOCK_RESIN_BREAK = define("block.resin.break");
public static final Sound BLOCK_RESIN_FALL = define("block.resin.fall");
public static final Sound BLOCK_RESIN_PLACE = define("block.resin.place");
public static final Sound BLOCK_RESIN_STEP = define("block.resin.step");
public static final Sound BLOCK_RESIN_BRICKS_BREAK = define("block.resin_bricks.break");
public static final Sound BLOCK_RESIN_BRICKS_FALL = define("block.resin_bricks.fall");
public static final Sound BLOCK_RESIN_BRICKS_HIT = define("block.resin_bricks.hit");
public static final Sound BLOCK_RESIN_BRICKS_PLACE = define("block.resin_bricks.place");
public static final Sound BLOCK_RESIN_BRICKS_STEP = define("block.resin_bricks.step");
/**
* Returns an immutable view of the sounds.
*
@@ -153,6 +153,33 @@ public enum BlockFace {
}
}
/**
* Returns an integer representing cardinal directions with south as the starting index at 0. UP and DOWN return -1
* <p>
* Used by Mojang for calculations involving mob AI, decorations, paintings, item frames, maps,
* structure generation, campfires, stairs, connecting blocks, and flowerbeds.
* Also used for getting directions and block faces as rotations.
*
* @return integer horizontal id
*/
public int getHorizontalId() {
switch (this) {
case DOWN:
case UP:
return -1;
case NORTH:
return 2;
case SOUTH:
return 0;
case WEST:
return 1;
case EAST:
return 3;
default:
throw new IllegalArgumentException("Invalid block face input for getHorizontalId");
}
}
public short getFaceValue() {
return faceValue;
}
@@ -68,5 +68,6 @@ public enum MaterialType {
POWDER_SNOW,
FROGSPAWN,
FROGLIGHT,
DECORATED_POT
DECORATED_POT,
RESIN,
}
@@ -29,8 +29,10 @@ import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.protocol.particle.Particle;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.sound.Sound;
import com.github.retrooper.packetevents.util.RandomWeightedList;
import net.kyori.adventure.util.Index;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalInt;
@@ -39,6 +41,8 @@ import static com.github.retrooper.packetevents.util.adventure.AdventureIndexUti
public class BiomeEffects {
private static final float FALLBACK_MUSIC_VOLUME = 1f;
private final int fogColor;
private final int waterColor;
private final int waterFogColor;
@@ -50,7 +54,8 @@ public class BiomeEffects {
private final Optional<Sound> ambientSound;
private final Optional<MoodSettings> moodSound;
private final Optional<AdditionsSettings> additionsSound;
private final Optional<MusicSettings> music;
private final RandomWeightedList<MusicSettings> music;
private final float musicVolume;
public BiomeEffects(
int fogColor, int waterColor, int waterFogColor, int skyColor,
@@ -61,6 +66,25 @@ public class BiomeEffects {
Optional<MoodSettings> moodSound,
Optional<AdditionsSettings> additionsSound,
Optional<MusicSettings> music
) {
this(fogColor, waterColor, waterFogColor, skyColor, foliageColor, grassColor,
grassColorModifier, particle, ambientSound, moodSound, additionsSound,
music.map(musicSettings ->
new RandomWeightedList<>(musicSettings, 1))
.orElseGet(RandomWeightedList::new),
FALLBACK_MUSIC_VOLUME);
}
public BiomeEffects(
int fogColor, int waterColor, int waterFogColor, int skyColor,
OptionalInt foliageColor, OptionalInt grassColor,
GrassColorModifier grassColorModifier,
Optional<ParticleSettings> particle,
Optional<Sound> ambientSound,
Optional<MoodSettings> moodSound,
Optional<AdditionsSettings> additionsSound,
RandomWeightedList<MusicSettings> music,
float musicVolume
) {
this.fogColor = fogColor;
this.waterColor = waterColor;
@@ -74,6 +98,7 @@ public class BiomeEffects {
this.moodSound = moodSound;
this.additionsSound = additionsSound;
this.music = music;
this.musicVolume = musicVolume;
}
public static BiomeEffects decode(NBT nbt, ClientVersion version) {
@@ -96,10 +121,23 @@ public class BiomeEffects {
.map(tag -> MoodSettings.decode(tag, version));
Optional<AdditionsSettings> additionsSound = Optional.ofNullable(compound.getTagOrNull("additions_sound"))
.map(tag -> AdditionsSettings.decode(tag, version));
Optional<MusicSettings> music = Optional.ofNullable(compound.getTagOrNull("music"))
.map(tag -> MusicSettings.decode(tag, version));
NBT musicTag = compound.getTagOrNull("music");
RandomWeightedList<MusicSettings> music = musicTag == null ? new RandomWeightedList<>() : null;
float musicVolume = FALLBACK_MUSIC_VOLUME;
if (version.isNewerThanOrEquals(ClientVersion.V_1_21_4)) {
NBTNumber musicVolumeTag = compound.getNumberTagOrNull("music_volume");
if (musicVolumeTag != null) {
musicVolume = musicVolumeTag.getAsFloat();
}
if (musicTag != null) {
music = RandomWeightedList.decode(musicTag, version, MusicSettings::decode);
}
} else if (musicTag != null) {
music = new RandomWeightedList<>(MusicSettings.decode(musicTag, version), 1);
}
return new BiomeEffects(fogColor, waterColor, waterFogColor, skyColor, foliageColor, grassColor,
grassColorModifier, particle, ambientSound, moodSound, additionsSound, music);
grassColorModifier, particle, ambientSound, moodSound, additionsSound, music, musicVolume);
}
public static NBT encode(BiomeEffects effects, ClientVersion version) {
@@ -123,8 +161,16 @@ public class BiomeEffects {
"mood_sound", MoodSettings.encode(sound, version)));
effects.additionsSound.ifPresent(sound -> compound.setTag(
"additions_sound", AdditionsSettings.encode(sound, version)));
effects.music.ifPresent(music -> compound.setTag(
"music", MusicSettings.encode(music, version)));
if (version.isNewerThanOrEquals(ClientVersion.V_1_21_4)) {
compound.setTag("music_volume", new NBTFloat(effects.musicVolume));
compound.setTag("music", RandomWeightedList.encode(effects.music, version, MusicSettings::encode));
} else {
List<RandomWeightedList.Entry<MusicSettings>> entries = effects.music.getEntries();
if (!entries.isEmpty()) {
compound.setTag("music", MusicSettings.encode(entries.get(0).getData(), version));
}
}
return compound;
}
@@ -168,10 +214,18 @@ public class BiomeEffects {
return this.moodSound;
}
public Optional<MusicSettings> getMusic() {
public RandomWeightedList<MusicSettings> getMusics() {
return this.music;
}
public Optional<MusicSettings> getMusic() {
List<RandomWeightedList.Entry<MusicSettings>> entries = this.music.getEntries();
if (entries.isEmpty()) {
return Optional.empty();
}
return Optional.of(entries.get(0).getData());
}
public Optional<AdditionsSettings> getAdditionsSound() {
return this.additionsSound;
}
@@ -96,28 +96,28 @@ public class EntityPositionSource extends PositionSource {
}
/**
* Note: Only used when handling particles through registries and version is >= 1.19.
* Note: Only used when handling particles through registries and version is at least 1.19.
*/
public Optional<UUID> getEntityUniqueId() {
return this.entityUniqueId;
}
/**
* Note: Only used when handling particles through registries and version is >= 1.19.
* Note: Only used when handling particles through registries and version is at least 1.19.
*/
public void setEntityUniqueId(Optional<UUID> entityUniqueId) {
this.entityUniqueId = entityUniqueId;
}
/**
* Note: Only used when handling particles through particle packets or version is < 1.19.
* Note: Only used when handling particles through particle packets or version is older than 1.19.
*/
public int getEntityId() {
return this.entityId;
}
/**
* Note: Only used when handling particles through particle packets or version is < 1.19.
* Note: Only used when handling particles through particle packets or version is older than 1.19.
*/
public void setEntityId(int entityId) {
this.entityId = entityId;
@@ -40,6 +40,7 @@ import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes;
import com.github.retrooper.packetevents.protocol.world.states.type.StateValue;
import com.github.retrooper.packetevents.util.BinaryNBTCompound;
import com.github.retrooper.packetevents.util.mappings.MappingHelper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.io.ByteArrayInputStream;
@@ -76,7 +77,7 @@ public class WrappedBlockState {
ClientVersion.V_1_13, ClientVersion.V_1_13_2, ClientVersion.V_1_14, ClientVersion.V_1_15,
ClientVersion.V_1_16, ClientVersion.V_1_16_2, ClientVersion.V_1_17, ClientVersion.V_1_19,
ClientVersion.V_1_19_3, ClientVersion.V_1_19_4, ClientVersion.V_1_20, ClientVersion.V_1_20_2,
ClientVersion.V_1_20_3, ClientVersion.V_1_20_5, ClientVersion.V_1_21_2,
ClientVersion.V_1_20_3, ClientVersion.V_1_20_5, ClientVersion.V_1_21_2, ClientVersion.V_1_21_4,
};
ClientVersion[] versions = ClientVersion.values();
@@ -1377,16 +1378,56 @@ public class WrappedBlockState {
checkIsStillValid();
}
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public CreakingHeartState getCreaking() {
return (CreakingHeartState) data.get(StateValue.CREAKING);
}
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public void setCreaking(CreakingHeartState creakingHeartState) {
checkIfCloneNeeded();
data.put(StateValue.CREAKING, creakingHeartState);
checkIsStillValid();
}
/**
* Added with 1.21.4
*/
public boolean isActive() {
return (boolean) this.data.get(StateValue.ACTIVE);
}
/**
* Added with 1.21.4
*/
public void setActive(boolean active) {
this.checkIfCloneNeeded();
this.data.put(StateValue.ACTIVE, active);
this.checkIsStillValid();
}
/**
* Added with 1.21.4
*/
public boolean isNatural() {
return (boolean) this.data.get(StateValue.NATURAL);
}
/**
* Added with 1.21.4
*/
public void setNatural(boolean natural) {
this.checkIfCloneNeeded();
this.data.put(StateValue.NATURAL, natural);
this.checkIsStillValid();
}
// End all block data types
/**
@@ -20,6 +20,7 @@ package com.github.retrooper.packetevents.protocol.world.states.defaulttags;
import com.github.retrooper.packetevents.protocol.world.states.type.StateType;
import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.VisibleForTesting;
@@ -84,6 +85,10 @@ public class BlockTags {
public static final BlockTags SMALL_FLOWERS = bind("small_flowers");
public static final BlockTags BEDS = bind("beds");
public static final BlockTags FENCES = bind("fences");
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public static final BlockTags TALL_FLOWERS = bind("tall_flowers");
public static final BlockTags FLOWERS = bind("flowers");
public static final BlockTags PIGLIN_REPELLENTS = bind("piglin_repellents");
@@ -224,24 +229,69 @@ public class BlockTags {
public static final BlockTags ENCHANTMENT_POWER_TRANSMITTER = bind("enchantment_power_transmitter");
public static final BlockTags MAINTAINS_FARMLAND = bind("maintains_farmland");
// Added in 1.20.5
/**
* Added with 1.20.5
*/
public static final BlockTags ARMADILLO_SPAWNABLE_ON = bind("armadillo_spawnable_on");
/**
* Added with 1.20.5
*/
public static final BlockTags BADLANDS_TERRACOTTA = bind("badlands_terracotta");
/**
* Added with 1.20.5
*/
public static final BlockTags BLOCKS_WIND_CHARGE_EXPLOSIONS = bind("blocks_wind_charge_explosions");
/**
* Added with 1.20.5
*/
public static final BlockTags DOES_NOT_BLOCK_HOPPERS = bind("does_not_block_hoppers");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_DIAMOND_TOOL = bind("incorrect_for_diamond_tool");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_GOLD_TOOL = bind("incorrect_for_gold_tool");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_IRON_TOOL = bind("incorrect_for_iron_tool");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_NETHERITE_TOOL = bind("incorrect_for_netherite_tool");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_STONE_TOOL = bind("incorrect_for_stone_tool");
/**
* Added with 1.20.5
*/
public static final BlockTags INCORRECT_FOR_WOODEN_TOOL = bind("incorrect_for_wooden_tool");
// added with 1.21.2
/**
* Added with 1.21.2
*/
public static final BlockTags PALE_OAK_LOGS = bind("pale_oak_logs");
/**
* Added with 1.21.2
*/
public static final BlockTags AIR = bind("air");
/**
* Added with 1.21.2
*/
public static final BlockTags MOB_INTERACTABLE_DOORS = bind("mob_interactable_doors");
/**
* Added with 1.21.2
*/
public static final BlockTags BATS_SPAWNABLE_ON = bind("bats_spawnable_on");
/**
* Added with 1.21.4
*/
public static final BlockTags BEE_ATTRACTIVE = bind("bats_spawnable_on");
/**
* Unofficial tag for all glass blocks
*/
@@ -253,20 +303,20 @@ public class BlockTags {
static {
BlockTags.WOOL.add(StateTypes.WHITE_WOOL, StateTypes.ORANGE_WOOL, StateTypes.MAGENTA_WOOL, StateTypes.LIGHT_BLUE_WOOL, StateTypes.YELLOW_WOOL, StateTypes.LIME_WOOL, StateTypes.PINK_WOOL, StateTypes.GRAY_WOOL, StateTypes.LIGHT_GRAY_WOOL, StateTypes.CYAN_WOOL, StateTypes.PURPLE_WOOL, StateTypes.BLUE_WOOL, StateTypes.BROWN_WOOL, StateTypes.GREEN_WOOL, StateTypes.RED_WOOL, StateTypes.BLACK_WOOL);
BlockTags.PLANKS.add(StateTypes.OAK_PLANKS, StateTypes.SPRUCE_PLANKS, StateTypes.BIRCH_PLANKS, StateTypes.JUNGLE_PLANKS, StateTypes.ACACIA_PLANKS, StateTypes.DARK_OAK_PLANKS, StateTypes.CRIMSON_PLANKS, StateTypes.WARPED_PLANKS, StateTypes.MANGROVE_PLANKS, StateTypes.BAMBOO_PLANKS, StateTypes.CHERRY_PLANKS, StateTypes.PALE_OAK_PLANKS);
BlockTags.PLANKS.add(StateTypes.OAK_PLANKS, StateTypes.SPRUCE_PLANKS, StateTypes.BIRCH_PLANKS, StateTypes.JUNGLE_PLANKS, StateTypes.ACACIA_PLANKS, StateTypes.DARK_OAK_PLANKS, StateTypes.PALE_OAK_PLANKS, StateTypes.CRIMSON_PLANKS, StateTypes.WARPED_PLANKS, StateTypes.MANGROVE_PLANKS, StateTypes.BAMBOO_PLANKS, StateTypes.CHERRY_PLANKS);
BlockTags.STONE_BRICKS.add(StateTypes.STONE_BRICKS, StateTypes.MOSSY_STONE_BRICKS, StateTypes.CRACKED_STONE_BRICKS, StateTypes.CHISELED_STONE_BRICKS);
BlockTags.WOODEN_BUTTONS.add(StateTypes.OAK_BUTTON, StateTypes.SPRUCE_BUTTON, StateTypes.BIRCH_BUTTON, StateTypes.JUNGLE_BUTTON, StateTypes.ACACIA_BUTTON, StateTypes.DARK_OAK_BUTTON, StateTypes.CRIMSON_BUTTON, StateTypes.WARPED_BUTTON, StateTypes.MANGROVE_BUTTON, StateTypes.BAMBOO_BUTTON, StateTypes.CHERRY_BUTTON, StateTypes.PALE_OAK_BUTTON);
BlockTags.WOODEN_BUTTONS.add(StateTypes.OAK_BUTTON, StateTypes.SPRUCE_BUTTON, StateTypes.BIRCH_BUTTON, StateTypes.JUNGLE_BUTTON, StateTypes.ACACIA_BUTTON, StateTypes.DARK_OAK_BUTTON, StateTypes.PALE_OAK_BUTTON, StateTypes.CRIMSON_BUTTON, StateTypes.WARPED_BUTTON, StateTypes.MANGROVE_BUTTON, StateTypes.BAMBOO_BUTTON, StateTypes.CHERRY_BUTTON);
BlockTags.STONE_BUTTONS.add(StateTypes.STONE_BUTTON, StateTypes.POLISHED_BLACKSTONE_BUTTON);
BlockTags.WOOL_CARPETS.add(StateTypes.WHITE_CARPET, StateTypes.ORANGE_CARPET, StateTypes.MAGENTA_CARPET, StateTypes.LIGHT_BLUE_CARPET, StateTypes.YELLOW_CARPET, StateTypes.LIME_CARPET, StateTypes.PINK_CARPET, StateTypes.GRAY_CARPET, StateTypes.LIGHT_GRAY_CARPET, StateTypes.CYAN_CARPET, StateTypes.PURPLE_CARPET, StateTypes.BLUE_CARPET, StateTypes.BROWN_CARPET, StateTypes.GREEN_CARPET, StateTypes.RED_CARPET, StateTypes.BLACK_CARPET);
BlockTags.WOODEN_DOORS.add(StateTypes.OAK_DOOR, StateTypes.SPRUCE_DOOR, StateTypes.BIRCH_DOOR, StateTypes.JUNGLE_DOOR, StateTypes.ACACIA_DOOR, StateTypes.DARK_OAK_DOOR, StateTypes.CRIMSON_DOOR, StateTypes.WARPED_DOOR, StateTypes.MANGROVE_DOOR, StateTypes.BAMBOO_DOOR, StateTypes.CHERRY_DOOR, StateTypes.PALE_OAK_DOOR);
BlockTags.WOODEN_STAIRS.add(StateTypes.OAK_STAIRS, StateTypes.SPRUCE_STAIRS, StateTypes.BIRCH_STAIRS, StateTypes.JUNGLE_STAIRS, StateTypes.ACACIA_STAIRS, StateTypes.DARK_OAK_STAIRS, StateTypes.CRIMSON_STAIRS, StateTypes.WARPED_STAIRS, StateTypes.MANGROVE_STAIRS, StateTypes.BAMBOO_STAIRS, StateTypes.CHERRY_STAIRS, StateTypes.PALE_OAK_STAIRS);
BlockTags.WOODEN_SLABS.add(StateTypes.OAK_SLAB, StateTypes.SPRUCE_SLAB, StateTypes.BIRCH_SLAB, StateTypes.JUNGLE_SLAB, StateTypes.ACACIA_SLAB, StateTypes.DARK_OAK_SLAB, StateTypes.CRIMSON_SLAB, StateTypes.WARPED_SLAB, StateTypes.MANGROVE_SLAB, StateTypes.BAMBOO_SLAB, StateTypes.CHERRY_SLAB, StateTypes.PALE_OAK_SLAB);
BlockTags.WOODEN_FENCES.add(StateTypes.OAK_FENCE, StateTypes.ACACIA_FENCE, StateTypes.DARK_OAK_FENCE, StateTypes.SPRUCE_FENCE, StateTypes.BIRCH_FENCE, StateTypes.JUNGLE_FENCE, StateTypes.CRIMSON_FENCE, StateTypes.WARPED_FENCE, StateTypes.MANGROVE_FENCE, StateTypes.BAMBOO_FENCE, StateTypes.CHERRY_FENCE, StateTypes.PALE_OAK_FENCE);
BlockTags.WOODEN_PRESSURE_PLATES.add(StateTypes.OAK_PRESSURE_PLATE, StateTypes.SPRUCE_PRESSURE_PLATE, StateTypes.BIRCH_PRESSURE_PLATE, StateTypes.JUNGLE_PRESSURE_PLATE, StateTypes.ACACIA_PRESSURE_PLATE, StateTypes.DARK_OAK_PRESSURE_PLATE, StateTypes.CRIMSON_PRESSURE_PLATE, StateTypes.WARPED_PRESSURE_PLATE, StateTypes.MANGROVE_PRESSURE_PLATE, StateTypes.BAMBOO_PRESSURE_PLATE, StateTypes.CHERRY_PRESSURE_PLATE, StateTypes.PALE_OAK_PRESSURE_PLATE);
BlockTags.WOODEN_DOORS.add(StateTypes.OAK_DOOR, StateTypes.SPRUCE_DOOR, StateTypes.BIRCH_DOOR, StateTypes.JUNGLE_DOOR, StateTypes.ACACIA_DOOR, StateTypes.DARK_OAK_DOOR, StateTypes.PALE_OAK_DOOR, StateTypes.CRIMSON_DOOR, StateTypes.WARPED_DOOR, StateTypes.MANGROVE_DOOR, StateTypes.BAMBOO_DOOR, StateTypes.CHERRY_DOOR);
BlockTags.WOODEN_STAIRS.add(StateTypes.OAK_STAIRS, StateTypes.SPRUCE_STAIRS, StateTypes.BIRCH_STAIRS, StateTypes.JUNGLE_STAIRS, StateTypes.ACACIA_STAIRS, StateTypes.DARK_OAK_STAIRS, StateTypes.PALE_OAK_STAIRS, StateTypes.CRIMSON_STAIRS, StateTypes.WARPED_STAIRS, StateTypes.MANGROVE_STAIRS, StateTypes.BAMBOO_STAIRS, StateTypes.CHERRY_STAIRS);
BlockTags.WOODEN_SLABS.add(StateTypes.OAK_SLAB, StateTypes.SPRUCE_SLAB, StateTypes.BIRCH_SLAB, StateTypes.JUNGLE_SLAB, StateTypes.ACACIA_SLAB, StateTypes.DARK_OAK_SLAB, StateTypes.PALE_OAK_SLAB, StateTypes.CRIMSON_SLAB, StateTypes.WARPED_SLAB, StateTypes.MANGROVE_SLAB, StateTypes.BAMBOO_SLAB, StateTypes.CHERRY_SLAB);
BlockTags.WOODEN_FENCES.add(StateTypes.OAK_FENCE, StateTypes.ACACIA_FENCE, StateTypes.DARK_OAK_FENCE, StateTypes.PALE_OAK_FENCE, StateTypes.SPRUCE_FENCE, StateTypes.BIRCH_FENCE, StateTypes.JUNGLE_FENCE, StateTypes.CRIMSON_FENCE, StateTypes.WARPED_FENCE, StateTypes.MANGROVE_FENCE, StateTypes.BAMBOO_FENCE, StateTypes.CHERRY_FENCE);
BlockTags.WOODEN_PRESSURE_PLATES.add(StateTypes.OAK_PRESSURE_PLATE, StateTypes.SPRUCE_PRESSURE_PLATE, StateTypes.BIRCH_PRESSURE_PLATE, StateTypes.JUNGLE_PRESSURE_PLATE, StateTypes.ACACIA_PRESSURE_PLATE, StateTypes.DARK_OAK_PRESSURE_PLATE, StateTypes.PALE_OAK_PRESSURE_PLATE, StateTypes.CRIMSON_PRESSURE_PLATE, StateTypes.WARPED_PRESSURE_PLATE, StateTypes.MANGROVE_PRESSURE_PLATE, StateTypes.BAMBOO_PRESSURE_PLATE, StateTypes.CHERRY_PRESSURE_PLATE);
BlockTags.STONE_PRESSURE_PLATES.add(StateTypes.STONE_PRESSURE_PLATE, StateTypes.POLISHED_BLACKSTONE_PRESSURE_PLATE);
BlockTags.WOODEN_TRAPDOORS.add(StateTypes.ACACIA_TRAPDOOR, StateTypes.BIRCH_TRAPDOOR, StateTypes.DARK_OAK_TRAPDOOR, StateTypes.JUNGLE_TRAPDOOR, StateTypes.OAK_TRAPDOOR, StateTypes.SPRUCE_TRAPDOOR, StateTypes.CRIMSON_TRAPDOOR, StateTypes.WARPED_TRAPDOOR, StateTypes.MANGROVE_TRAPDOOR, StateTypes.BAMBOO_TRAPDOOR, StateTypes.CHERRY_TRAPDOOR, StateTypes.PALE_OAK_TRAPDOOR);
BlockTags.SAPLINGS.add(StateTypes.OAK_SAPLING, StateTypes.SPRUCE_SAPLING, StateTypes.BIRCH_SAPLING, StateTypes.JUNGLE_SAPLING, StateTypes.ACACIA_SAPLING, StateTypes.DARK_OAK_SAPLING, StateTypes.AZALEA, StateTypes.FLOWERING_AZALEA, StateTypes.MANGROVE_PROPAGULE, StateTypes.CHERRY_SAPLING, StateTypes.PALE_OAK_SAPLING);
BlockTags.OVERWORLD_NATURAL_LOGS.add(StateTypes.ACACIA_LOG, StateTypes.BIRCH_LOG, StateTypes.OAK_LOG, StateTypes.JUNGLE_LOG, StateTypes.SPRUCE_LOG, StateTypes.DARK_OAK_LOG, StateTypes.MANGROVE_LOG, StateTypes.CHERRY_LOG, StateTypes.PALE_OAK_LOG);
BlockTags.WOODEN_TRAPDOORS.add(StateTypes.ACACIA_TRAPDOOR, StateTypes.BIRCH_TRAPDOOR, StateTypes.DARK_OAK_TRAPDOOR, StateTypes.PALE_OAK_TRAPDOOR, StateTypes.JUNGLE_TRAPDOOR, StateTypes.OAK_TRAPDOOR, StateTypes.SPRUCE_TRAPDOOR, StateTypes.CRIMSON_TRAPDOOR, StateTypes.WARPED_TRAPDOOR, StateTypes.MANGROVE_TRAPDOOR, StateTypes.BAMBOO_TRAPDOOR, StateTypes.CHERRY_TRAPDOOR);
BlockTags.SAPLINGS.add(StateTypes.OAK_SAPLING, StateTypes.SPRUCE_SAPLING, StateTypes.BIRCH_SAPLING, StateTypes.JUNGLE_SAPLING, StateTypes.ACACIA_SAPLING, StateTypes.DARK_OAK_SAPLING, StateTypes.PALE_OAK_SAPLING, StateTypes.AZALEA, StateTypes.FLOWERING_AZALEA, StateTypes.MANGROVE_PROPAGULE, StateTypes.CHERRY_SAPLING);
BlockTags.OVERWORLD_NATURAL_LOGS.add(StateTypes.ACACIA_LOG, StateTypes.BIRCH_LOG, StateTypes.OAK_LOG, StateTypes.JUNGLE_LOG, StateTypes.SPRUCE_LOG, StateTypes.DARK_OAK_LOG, StateTypes.PALE_OAK_LOG, StateTypes.MANGROVE_LOG, StateTypes.CHERRY_LOG);
BlockTags.DARK_OAK_LOGS.add(StateTypes.DARK_OAK_LOG, StateTypes.DARK_OAK_WOOD, StateTypes.STRIPPED_DARK_OAK_LOG, StateTypes.STRIPPED_DARK_OAK_WOOD);
BlockTags.PALE_OAK_LOGS.add(StateTypes.PALE_OAK_LOG, StateTypes.PALE_OAK_WOOD, StateTypes.STRIPPED_PALE_OAK_LOG, StateTypes.STRIPPED_PALE_OAK_WOOD);
BlockTags.OAK_LOGS.add(StateTypes.OAK_LOG, StateTypes.OAK_WOOD, StateTypes.STRIPPED_OAK_LOG, StateTypes.STRIPPED_OAK_WOOD);
@@ -283,13 +333,13 @@ public class BlockTags {
BlockTags.BANNERS.add(StateTypes.WHITE_BANNER, StateTypes.ORANGE_BANNER, StateTypes.MAGENTA_BANNER, StateTypes.LIGHT_BLUE_BANNER, StateTypes.YELLOW_BANNER, StateTypes.LIME_BANNER, StateTypes.PINK_BANNER, StateTypes.GRAY_BANNER, StateTypes.LIGHT_GRAY_BANNER, StateTypes.CYAN_BANNER, StateTypes.PURPLE_BANNER, StateTypes.BLUE_BANNER, StateTypes.BROWN_BANNER, StateTypes.GREEN_BANNER, StateTypes.RED_BANNER, StateTypes.BLACK_BANNER, StateTypes.WHITE_WALL_BANNER, StateTypes.ORANGE_WALL_BANNER, StateTypes.MAGENTA_WALL_BANNER, StateTypes.LIGHT_BLUE_WALL_BANNER, StateTypes.YELLOW_WALL_BANNER, StateTypes.LIME_WALL_BANNER, StateTypes.PINK_WALL_BANNER, StateTypes.GRAY_WALL_BANNER, StateTypes.LIGHT_GRAY_WALL_BANNER, StateTypes.CYAN_WALL_BANNER, StateTypes.PURPLE_WALL_BANNER, StateTypes.BLUE_WALL_BANNER, StateTypes.BROWN_WALL_BANNER, StateTypes.GREEN_WALL_BANNER, StateTypes.RED_WALL_BANNER, StateTypes.BLACK_WALL_BANNER);
BlockTags.SAND.add(StateTypes.SAND, StateTypes.RED_SAND, StateTypes.SUSPICIOUS_SAND, StateTypes.SUSPICIOUS_SAND);
BlockTags.SMELTS_TO_GLASS.add(StateTypes.SAND, StateTypes.RED_SAND);
BlockTags.WALLS.add(StateTypes.COBBLESTONE_WALL, StateTypes.MOSSY_COBBLESTONE_WALL, StateTypes.BRICK_WALL, StateTypes.PRISMARINE_WALL, StateTypes.RED_SANDSTONE_WALL, StateTypes.MOSSY_STONE_BRICK_WALL, StateTypes.GRANITE_WALL, StateTypes.STONE_BRICK_WALL, StateTypes.NETHER_BRICK_WALL, StateTypes.ANDESITE_WALL, StateTypes.RED_NETHER_BRICK_WALL, StateTypes.SANDSTONE_WALL, StateTypes.END_STONE_BRICK_WALL, StateTypes.DIORITE_WALL, StateTypes.BLACKSTONE_WALL, StateTypes.POLISHED_BLACKSTONE_BRICK_WALL, StateTypes.POLISHED_BLACKSTONE_WALL, StateTypes.COBBLED_DEEPSLATE_WALL, StateTypes.POLISHED_DEEPSLATE_WALL, StateTypes.DEEPSLATE_TILE_WALL, StateTypes.DEEPSLATE_BRICK_WALL, StateTypes.MUD_BRICK_WALL, StateTypes.TUFF_WALL, StateTypes.POLISHED_TUFF_WALL, StateTypes.TUFF_BRICK_WALL);
BlockTags.WALLS.add(StateTypes.COBBLESTONE_WALL, StateTypes.MOSSY_COBBLESTONE_WALL, StateTypes.BRICK_WALL, StateTypes.PRISMARINE_WALL, StateTypes.RED_SANDSTONE_WALL, StateTypes.MOSSY_STONE_BRICK_WALL, StateTypes.GRANITE_WALL, StateTypes.STONE_BRICK_WALL, StateTypes.NETHER_BRICK_WALL, StateTypes.ANDESITE_WALL, StateTypes.RED_NETHER_BRICK_WALL, StateTypes.SANDSTONE_WALL, StateTypes.END_STONE_BRICK_WALL, StateTypes.DIORITE_WALL, StateTypes.BLACKSTONE_WALL, StateTypes.POLISHED_BLACKSTONE_BRICK_WALL, StateTypes.POLISHED_BLACKSTONE_WALL, StateTypes.COBBLED_DEEPSLATE_WALL, StateTypes.POLISHED_DEEPSLATE_WALL, StateTypes.DEEPSLATE_TILE_WALL, StateTypes.DEEPSLATE_BRICK_WALL, StateTypes.MUD_BRICK_WALL, StateTypes.TUFF_WALL, StateTypes.POLISHED_TUFF_WALL, StateTypes.TUFF_BRICK_WALL, StateTypes.RESIN_BRICK_WALL);
BlockTags.ANVIL.add(StateTypes.ANVIL, StateTypes.CHIPPED_ANVIL, StateTypes.DAMAGED_ANVIL);
BlockTags.RAILS.add(StateTypes.RAIL, StateTypes.POWERED_RAIL, StateTypes.DETECTOR_RAIL, StateTypes.ACTIVATOR_RAIL);
BlockTags.LEAVES.add(StateTypes.JUNGLE_LEAVES, StateTypes.OAK_LEAVES, StateTypes.SPRUCE_LEAVES, StateTypes.DARK_OAK_LEAVES, StateTypes.ACACIA_LEAVES, StateTypes.BIRCH_LEAVES, StateTypes.AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.MANGROVE_LEAVES, StateTypes.CHERRY_LEAVES, StateTypes.PALE_OAK_LEAVES);
BlockTags.SMALL_FLOWERS.add(StateTypes.DANDELION, StateTypes.POPPY, StateTypes.BLUE_ORCHID, StateTypes.ALLIUM, StateTypes.AZURE_BLUET, StateTypes.RED_TULIP, StateTypes.ORANGE_TULIP, StateTypes.WHITE_TULIP, StateTypes.PINK_TULIP, StateTypes.OXEYE_DAISY, StateTypes.CORNFLOWER, StateTypes.LILY_OF_THE_VALLEY, StateTypes.WITHER_ROSE, StateTypes.TORCHFLOWER);
BlockTags.LEAVES.add(StateTypes.JUNGLE_LEAVES, StateTypes.OAK_LEAVES, StateTypes.SPRUCE_LEAVES, StateTypes.PALE_OAK_LEAVES, StateTypes.DARK_OAK_LEAVES, StateTypes.ACACIA_LEAVES, StateTypes.BIRCH_LEAVES, StateTypes.AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.MANGROVE_LEAVES, StateTypes.CHERRY_LEAVES);
BlockTags.SMALL_FLOWERS.add(StateTypes.DANDELION, StateTypes.OPEN_EYEBLOSSOM, StateTypes.POPPY, StateTypes.BLUE_ORCHID, StateTypes.ALLIUM, StateTypes.AZURE_BLUET, StateTypes.RED_TULIP, StateTypes.ORANGE_TULIP, StateTypes.WHITE_TULIP, StateTypes.PINK_TULIP, StateTypes.OXEYE_DAISY, StateTypes.CORNFLOWER, StateTypes.LILY_OF_THE_VALLEY, StateTypes.WITHER_ROSE, StateTypes.TORCHFLOWER, StateTypes.CLOSED_EYEBLOSSOM);
BlockTags.BEDS.add(StateTypes.RED_BED, StateTypes.BLACK_BED, StateTypes.BLUE_BED, StateTypes.BROWN_BED, StateTypes.CYAN_BED, StateTypes.GRAY_BED, StateTypes.GREEN_BED, StateTypes.LIGHT_BLUE_BED, StateTypes.LIGHT_GRAY_BED, StateTypes.LIME_BED, StateTypes.MAGENTA_BED, StateTypes.ORANGE_BED, StateTypes.PINK_BED, StateTypes.PURPLE_BED, StateTypes.WHITE_BED, StateTypes.YELLOW_BED);
BlockTags.TALL_FLOWERS.add(StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.PEONY, StateTypes.ROSE_BUSH, StateTypes.PITCHER_PLANT);
BlockTags.BEE_ATTRACTIVE.add(StateTypes.DANDELION, StateTypes.OPEN_EYEBLOSSOM, StateTypes.POPPY, StateTypes.BLUE_ORCHID, StateTypes.ALLIUM, StateTypes.AZURE_BLUET, StateTypes.RED_TULIP, StateTypes.ORANGE_TULIP, StateTypes.WHITE_TULIP, StateTypes.PINK_TULIP, StateTypes.OXEYE_DAISY, StateTypes.CORNFLOWER, StateTypes.LILY_OF_THE_VALLEY, StateTypes.WITHER_ROSE, StateTypes.TORCHFLOWER, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.PEONY, StateTypes.ROSE_BUSH, StateTypes.PITCHER_PLANT, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA, StateTypes.MANGROVE_PROPAGULE, StateTypes.CHERRY_LEAVES, StateTypes.PINK_PETALS, StateTypes.CHORUS_FLOWER, StateTypes.SPORE_BLOSSOM);
BlockTags.PIGLIN_REPELLENTS.add(StateTypes.SOUL_FIRE, StateTypes.SOUL_TORCH, StateTypes.SOUL_LANTERN, StateTypes.SOUL_WALL_TORCH, StateTypes.SOUL_CAMPFIRE);
BlockTags.GOLD_ORES.add(StateTypes.GOLD_ORE, StateTypes.NETHER_GOLD_ORE, StateTypes.DEEPSLATE_GOLD_ORE);
BlockTags.IRON_ORES.add(StateTypes.IRON_ORE, StateTypes.DEEPSLATE_IRON_ORE);
@@ -300,22 +350,22 @@ public class BlockTags {
BlockTags.EMERALD_ORES.add(StateTypes.EMERALD_ORE, StateTypes.DEEPSLATE_EMERALD_ORE);
BlockTags.COPPER_ORES.add(StateTypes.COPPER_ORE, StateTypes.DEEPSLATE_COPPER_ORE);
BlockTags.CANDLES.add(StateTypes.CANDLE, StateTypes.WHITE_CANDLE, StateTypes.ORANGE_CANDLE, StateTypes.MAGENTA_CANDLE, StateTypes.LIGHT_BLUE_CANDLE, StateTypes.YELLOW_CANDLE, StateTypes.LIME_CANDLE, StateTypes.PINK_CANDLE, StateTypes.GRAY_CANDLE, StateTypes.LIGHT_GRAY_CANDLE, StateTypes.CYAN_CANDLE, StateTypes.PURPLE_CANDLE, StateTypes.BLUE_CANDLE, StateTypes.BROWN_CANDLE, StateTypes.GREEN_CANDLE, StateTypes.RED_CANDLE, StateTypes.BLACK_CANDLE);
BlockTags.DIRT.add(StateTypes.DIRT, StateTypes.GRASS_BLOCK, StateTypes.PODZOL, StateTypes.COARSE_DIRT, StateTypes.MYCELIUM, StateTypes.ROOTED_DIRT, StateTypes.MOSS_BLOCK, StateTypes.MUD, StateTypes.MUDDY_MANGROVE_ROOTS, StateTypes.PALE_MOSS_BLOCK);
BlockTags.DIRT.add(StateTypes.DIRT, StateTypes.GRASS_BLOCK, StateTypes.PODZOL, StateTypes.COARSE_DIRT, StateTypes.MYCELIUM, StateTypes.ROOTED_DIRT, StateTypes.MOSS_BLOCK, StateTypes.PALE_MOSS_BLOCK, StateTypes.MUD, StateTypes.MUDDY_MANGROVE_ROOTS);
BlockTags.TERRACOTTA.add(StateTypes.TERRACOTTA, StateTypes.WHITE_TERRACOTTA, StateTypes.ORANGE_TERRACOTTA, StateTypes.MAGENTA_TERRACOTTA, StateTypes.LIGHT_BLUE_TERRACOTTA, StateTypes.YELLOW_TERRACOTTA, StateTypes.LIME_TERRACOTTA, StateTypes.PINK_TERRACOTTA, StateTypes.GRAY_TERRACOTTA, StateTypes.LIGHT_GRAY_TERRACOTTA, StateTypes.CYAN_TERRACOTTA, StateTypes.PURPLE_TERRACOTTA, StateTypes.BLUE_TERRACOTTA, StateTypes.BROWN_TERRACOTTA, StateTypes.GREEN_TERRACOTTA, StateTypes.RED_TERRACOTTA, StateTypes.BLACK_TERRACOTTA);
BlockTags.BADLANDS_TERRACOTTA.add(StateTypes.TERRACOTTA, StateTypes.WHITE_TERRACOTTA, StateTypes.YELLOW_TERRACOTTA, StateTypes.ORANGE_TERRACOTTA, StateTypes.RED_TERRACOTTA, StateTypes.BROWN_TERRACOTTA, StateTypes.LIGHT_GRAY_TERRACOTTA);
BlockTags.CONCRETE_POWDER.add(StateTypes.WHITE_CONCRETE_POWDER, StateTypes.ORANGE_CONCRETE_POWDER, StateTypes.MAGENTA_CONCRETE_POWDER, StateTypes.LIGHT_BLUE_CONCRETE_POWDER, StateTypes.YELLOW_CONCRETE_POWDER, StateTypes.LIME_CONCRETE_POWDER, StateTypes.PINK_CONCRETE_POWDER, StateTypes.GRAY_CONCRETE_POWDER, StateTypes.LIGHT_GRAY_CONCRETE_POWDER, StateTypes.CYAN_CONCRETE_POWDER, StateTypes.PURPLE_CONCRETE_POWDER, StateTypes.BLUE_CONCRETE_POWDER, StateTypes.BROWN_CONCRETE_POWDER, StateTypes.GREEN_CONCRETE_POWDER, StateTypes.RED_CONCRETE_POWDER, StateTypes.BLACK_CONCRETE_POWDER);
BlockTags.SHULKER_BOXES.add(StateTypes.SHULKER_BOX, StateTypes.BLACK_SHULKER_BOX, StateTypes.BLUE_SHULKER_BOX, StateTypes.BROWN_SHULKER_BOX, StateTypes.CYAN_SHULKER_BOX, StateTypes.GRAY_SHULKER_BOX, StateTypes.GREEN_SHULKER_BOX, StateTypes.LIGHT_BLUE_SHULKER_BOX, StateTypes.LIGHT_GRAY_SHULKER_BOX, StateTypes.LIME_SHULKER_BOX, StateTypes.MAGENTA_SHULKER_BOX, StateTypes.ORANGE_SHULKER_BOX, StateTypes.PINK_SHULKER_BOX, StateTypes.PURPLE_SHULKER_BOX, StateTypes.RED_SHULKER_BOX, StateTypes.WHITE_SHULKER_BOX, StateTypes.YELLOW_SHULKER_BOX);
BlockTags.FLOWER_POTS.add(StateTypes.FLOWER_POT, StateTypes.POTTED_POPPY, StateTypes.POTTED_BLUE_ORCHID, StateTypes.POTTED_ALLIUM, StateTypes.POTTED_AZURE_BLUET, StateTypes.POTTED_RED_TULIP, StateTypes.POTTED_ORANGE_TULIP, StateTypes.POTTED_WHITE_TULIP, StateTypes.POTTED_PINK_TULIP, StateTypes.POTTED_OXEYE_DAISY, StateTypes.POTTED_DANDELION, StateTypes.POTTED_OAK_SAPLING, StateTypes.POTTED_SPRUCE_SAPLING, StateTypes.POTTED_BIRCH_SAPLING, StateTypes.POTTED_JUNGLE_SAPLING, StateTypes.POTTED_ACACIA_SAPLING, StateTypes.POTTED_DARK_OAK_SAPLING, StateTypes.POTTED_RED_MUSHROOM, StateTypes.POTTED_BROWN_MUSHROOM, StateTypes.POTTED_DEAD_BUSH, StateTypes.POTTED_FERN, StateTypes.POTTED_CACTUS, StateTypes.POTTED_CORNFLOWER, StateTypes.POTTED_LILY_OF_THE_VALLEY, StateTypes.POTTED_WITHER_ROSE, StateTypes.POTTED_BAMBOO, StateTypes.POTTED_CRIMSON_FUNGUS, StateTypes.POTTED_WARPED_FUNGUS, StateTypes.POTTED_CRIMSON_ROOTS, StateTypes.POTTED_WARPED_ROOTS, StateTypes.POTTED_AZALEA_BUSH, StateTypes.POTTED_FLOWERING_AZALEA_BUSH, StateTypes.POTTED_MANGROVE_PROPAGULE, StateTypes.POTTED_CHERRY_SAPLING, StateTypes.POTTED_TORCHFLOWER, StateTypes.POTTED_PALE_OAK_SAPLING);
BlockTags.FLOWER_POTS.add(StateTypes.FLOWER_POT, StateTypes.POTTED_OPEN_EYEBLOSSOM, StateTypes.POTTED_CLOSED_EYEBLOSSOM, StateTypes.POTTED_POPPY, StateTypes.POTTED_BLUE_ORCHID, StateTypes.POTTED_ALLIUM, StateTypes.POTTED_AZURE_BLUET, StateTypes.POTTED_RED_TULIP, StateTypes.POTTED_ORANGE_TULIP, StateTypes.POTTED_WHITE_TULIP, StateTypes.POTTED_PINK_TULIP, StateTypes.POTTED_OXEYE_DAISY, StateTypes.POTTED_DANDELION, StateTypes.POTTED_OAK_SAPLING, StateTypes.POTTED_SPRUCE_SAPLING, StateTypes.POTTED_BIRCH_SAPLING, StateTypes.POTTED_JUNGLE_SAPLING, StateTypes.POTTED_ACACIA_SAPLING, StateTypes.POTTED_DARK_OAK_SAPLING, StateTypes.POTTED_PALE_OAK_SAPLING, StateTypes.POTTED_RED_MUSHROOM, StateTypes.POTTED_BROWN_MUSHROOM, StateTypes.POTTED_DEAD_BUSH, StateTypes.POTTED_FERN, StateTypes.POTTED_CACTUS, StateTypes.POTTED_CORNFLOWER, StateTypes.POTTED_LILY_OF_THE_VALLEY, StateTypes.POTTED_WITHER_ROSE, StateTypes.POTTED_BAMBOO, StateTypes.POTTED_CRIMSON_FUNGUS, StateTypes.POTTED_WARPED_FUNGUS, StateTypes.POTTED_CRIMSON_ROOTS, StateTypes.POTTED_WARPED_ROOTS, StateTypes.POTTED_AZALEA_BUSH, StateTypes.POTTED_FLOWERING_AZALEA_BUSH, StateTypes.POTTED_MANGROVE_PROPAGULE, StateTypes.POTTED_CHERRY_SAPLING, StateTypes.POTTED_TORCHFLOWER);
BlockTags.ICE.add(StateTypes.ICE, StateTypes.PACKED_ICE, StateTypes.BLUE_ICE, StateTypes.FROSTED_ICE);
BlockTags.VALID_SPAWN.add(StateTypes.GRASS_BLOCK, StateTypes.PODZOL);
BlockTags.IMPERMEABLE.add(StateTypes.GLASS, StateTypes.WHITE_STAINED_GLASS, StateTypes.ORANGE_STAINED_GLASS, StateTypes.MAGENTA_STAINED_GLASS, StateTypes.LIGHT_BLUE_STAINED_GLASS, StateTypes.YELLOW_STAINED_GLASS, StateTypes.LIME_STAINED_GLASS, StateTypes.PINK_STAINED_GLASS, StateTypes.GRAY_STAINED_GLASS, StateTypes.LIGHT_GRAY_STAINED_GLASS, StateTypes.CYAN_STAINED_GLASS, StateTypes.PURPLE_STAINED_GLASS, StateTypes.BLUE_STAINED_GLASS, StateTypes.BROWN_STAINED_GLASS, StateTypes.GREEN_STAINED_GLASS, StateTypes.RED_STAINED_GLASS, StateTypes.BLACK_STAINED_GLASS, StateTypes.TINTED_GLASS);
BlockTags.CORAL_BLOCKS.add(StateTypes.TUBE_CORAL_BLOCK, StateTypes.BRAIN_CORAL_BLOCK, StateTypes.BUBBLE_CORAL_BLOCK, StateTypes.FIRE_CORAL_BLOCK, StateTypes.HORN_CORAL_BLOCK);
BlockTags.WALL_CORALS.add(StateTypes.TUBE_CORAL_WALL_FAN, StateTypes.BRAIN_CORAL_WALL_FAN, StateTypes.BUBBLE_CORAL_WALL_FAN, StateTypes.FIRE_CORAL_WALL_FAN, StateTypes.HORN_CORAL_WALL_FAN);
BlockTags.CORAL_PLANTS.add(StateTypes.TUBE_CORAL, StateTypes.BRAIN_CORAL, StateTypes.BUBBLE_CORAL, StateTypes.FIRE_CORAL, StateTypes.HORN_CORAL);
BlockTags.STANDING_SIGNS.add(StateTypes.OAK_SIGN, StateTypes.SPRUCE_SIGN, StateTypes.BIRCH_SIGN, StateTypes.ACACIA_SIGN, StateTypes.JUNGLE_SIGN, StateTypes.DARK_OAK_SIGN, StateTypes.CRIMSON_SIGN, StateTypes.WARPED_SIGN, StateTypes.MANGROVE_SIGN, StateTypes.BAMBOO_SIGN, StateTypes.CHERRY_SIGN, StateTypes.PALE_OAK_SIGN);
BlockTags.WALL_SIGNS.add(StateTypes.OAK_WALL_SIGN, StateTypes.SPRUCE_WALL_SIGN, StateTypes.BIRCH_WALL_SIGN, StateTypes.ACACIA_WALL_SIGN, StateTypes.JUNGLE_WALL_SIGN, StateTypes.DARK_OAK_WALL_SIGN, StateTypes.CRIMSON_WALL_SIGN, StateTypes.WARPED_WALL_SIGN, StateTypes.MANGROVE_WALL_SIGN, StateTypes.BAMBOO_WALL_SIGN, StateTypes.CHERRY_WALL_SIGN, StateTypes.PALE_OAK_WALL_SIGN);
BlockTags.CEILING_HANGING_SIGNS.add(StateTypes.OAK_HANGING_SIGN, StateTypes.SPRUCE_HANGING_SIGN, StateTypes.BIRCH_HANGING_SIGN, StateTypes.ACACIA_HANGING_SIGN, StateTypes.CHERRY_HANGING_SIGN, StateTypes.JUNGLE_HANGING_SIGN, StateTypes.DARK_OAK_HANGING_SIGN, StateTypes.CRIMSON_HANGING_SIGN, StateTypes.WARPED_HANGING_SIGN, StateTypes.MANGROVE_HANGING_SIGN, StateTypes.BAMBOO_HANGING_SIGN, StateTypes.PALE_OAK_HANGING_SIGN);
BlockTags.WALL_HANGING_SIGNS.add(StateTypes.OAK_WALL_HANGING_SIGN, StateTypes.SPRUCE_WALL_HANGING_SIGN, StateTypes.BIRCH_WALL_HANGING_SIGN, StateTypes.ACACIA_WALL_HANGING_SIGN, StateTypes.CHERRY_WALL_HANGING_SIGN, StateTypes.JUNGLE_WALL_HANGING_SIGN, StateTypes.DARK_OAK_WALL_HANGING_SIGN, StateTypes.CRIMSON_WALL_HANGING_SIGN, StateTypes.WARPED_WALL_HANGING_SIGN, StateTypes.MANGROVE_WALL_HANGING_SIGN, StateTypes.BAMBOO_WALL_HANGING_SIGN, StateTypes.PALE_OAK_WALL_HANGING_SIGN);
BlockTags.STANDING_SIGNS.add(StateTypes.OAK_SIGN, StateTypes.SPRUCE_SIGN, StateTypes.BIRCH_SIGN, StateTypes.ACACIA_SIGN, StateTypes.JUNGLE_SIGN, StateTypes.DARK_OAK_SIGN, StateTypes.PALE_OAK_SIGN, StateTypes.CRIMSON_SIGN, StateTypes.WARPED_SIGN, StateTypes.MANGROVE_SIGN, StateTypes.BAMBOO_SIGN, StateTypes.CHERRY_SIGN);
BlockTags.WALL_SIGNS.add(StateTypes.OAK_WALL_SIGN, StateTypes.SPRUCE_WALL_SIGN, StateTypes.BIRCH_WALL_SIGN, StateTypes.ACACIA_WALL_SIGN, StateTypes.JUNGLE_WALL_SIGN, StateTypes.DARK_OAK_WALL_SIGN, StateTypes.PALE_OAK_WALL_SIGN, StateTypes.CRIMSON_WALL_SIGN, StateTypes.WARPED_WALL_SIGN, StateTypes.MANGROVE_WALL_SIGN, StateTypes.BAMBOO_WALL_SIGN, StateTypes.CHERRY_WALL_SIGN);
BlockTags.CEILING_HANGING_SIGNS.add(StateTypes.OAK_HANGING_SIGN, StateTypes.SPRUCE_HANGING_SIGN, StateTypes.BIRCH_HANGING_SIGN, StateTypes.ACACIA_HANGING_SIGN, StateTypes.CHERRY_HANGING_SIGN, StateTypes.JUNGLE_HANGING_SIGN, StateTypes.DARK_OAK_HANGING_SIGN, StateTypes.PALE_OAK_HANGING_SIGN, StateTypes.CRIMSON_HANGING_SIGN, StateTypes.WARPED_HANGING_SIGN, StateTypes.MANGROVE_HANGING_SIGN, StateTypes.BAMBOO_HANGING_SIGN);
BlockTags.WALL_HANGING_SIGNS.add(StateTypes.OAK_WALL_HANGING_SIGN, StateTypes.SPRUCE_WALL_HANGING_SIGN, StateTypes.BIRCH_WALL_HANGING_SIGN, StateTypes.ACACIA_WALL_HANGING_SIGN, StateTypes.CHERRY_WALL_HANGING_SIGN, StateTypes.JUNGLE_WALL_HANGING_SIGN, StateTypes.DARK_OAK_WALL_HANGING_SIGN, StateTypes.PALE_OAK_WALL_HANGING_SIGN, StateTypes.CRIMSON_WALL_HANGING_SIGN, StateTypes.WARPED_WALL_HANGING_SIGN, StateTypes.MANGROVE_WALL_HANGING_SIGN, StateTypes.BAMBOO_WALL_HANGING_SIGN);
BlockTags.DRAGON_IMMUNE.add(StateTypes.BARRIER, StateTypes.BEDROCK, StateTypes.END_PORTAL, StateTypes.END_PORTAL_FRAME, StateTypes.END_GATEWAY, StateTypes.COMMAND_BLOCK, StateTypes.REPEATING_COMMAND_BLOCK, StateTypes.CHAIN_COMMAND_BLOCK, StateTypes.STRUCTURE_BLOCK, StateTypes.JIGSAW, StateTypes.MOVING_PISTON, StateTypes.OBSIDIAN, StateTypes.CRYING_OBSIDIAN, StateTypes.END_STONE, StateTypes.IRON_BARS, StateTypes.RESPAWN_ANCHOR, StateTypes.REINFORCED_DEEPSLATE);
BlockTags.WITHER_IMMUNE.add(StateTypes.BARRIER, StateTypes.BEDROCK, StateTypes.END_PORTAL, StateTypes.END_PORTAL_FRAME, StateTypes.END_GATEWAY, StateTypes.COMMAND_BLOCK, StateTypes.REPEATING_COMMAND_BLOCK, StateTypes.CHAIN_COMMAND_BLOCK, StateTypes.STRUCTURE_BLOCK, StateTypes.JIGSAW, StateTypes.MOVING_PISTON, StateTypes.LIGHT, StateTypes.REINFORCED_DEEPSLATE);
BlockTags.WITHER_SUMMON_BASE_BLOCKS.add(StateTypes.SOUL_SAND, StateTypes.SOUL_SOIL);
@@ -331,7 +381,7 @@ public class BlockTags {
copy(BlockTags.WITHER_SUMMON_BASE_BLOCKS, BlockTags.SOUL_FIRE_BASE_BLOCKS);
BlockTags.STRIDER_WARM_BLOCKS.add(StateTypes.LAVA);
BlockTags.CAMPFIRES.add(StateTypes.CAMPFIRE, StateTypes.SOUL_CAMPFIRE);
BlockTags.FENCE_GATES.add(StateTypes.ACACIA_FENCE_GATE, StateTypes.BIRCH_FENCE_GATE, StateTypes.DARK_OAK_FENCE_GATE, StateTypes.JUNGLE_FENCE_GATE, StateTypes.OAK_FENCE_GATE, StateTypes.SPRUCE_FENCE_GATE, StateTypes.CRIMSON_FENCE_GATE, StateTypes.WARPED_FENCE_GATE, StateTypes.MANGROVE_FENCE_GATE, StateTypes.BAMBOO_FENCE_GATE, StateTypes.CHERRY_FENCE_GATE, StateTypes.PALE_OAK_FENCE_GATE);
BlockTags.FENCE_GATES.add(StateTypes.ACACIA_FENCE_GATE, StateTypes.BIRCH_FENCE_GATE, StateTypes.DARK_OAK_FENCE_GATE, StateTypes.PALE_OAK_FENCE_GATE, StateTypes.JUNGLE_FENCE_GATE, StateTypes.OAK_FENCE_GATE, StateTypes.SPRUCE_FENCE_GATE, StateTypes.CRIMSON_FENCE_GATE, StateTypes.WARPED_FENCE_GATE, StateTypes.MANGROVE_FENCE_GATE, StateTypes.BAMBOO_FENCE_GATE, StateTypes.CHERRY_FENCE_GATE);
BlockTags.MUSHROOM_GROW_BLOCK.add(StateTypes.MYCELIUM, StateTypes.PODZOL, StateTypes.CRIMSON_NYLIUM, StateTypes.WARPED_NYLIUM);
BlockTags.INFINIBURN_OVERWORLD.add(StateTypes.NETHERRACK, StateTypes.MAGMA_BLOCK);
BlockTags.BASE_STONE_OVERWORLD.add(StateTypes.STONE, StateTypes.GRANITE, StateTypes.DIORITE, StateTypes.ANDESITE, StateTypes.TUFF, StateTypes.DEEPSLATE);
@@ -345,10 +395,10 @@ public class BlockTags {
BlockTags.CAVE_VINES.add(StateTypes.CAVE_VINES_PLANT, StateTypes.CAVE_VINES);
BlockTags.SMALL_DRIPLEAF_PLACEABLE.add(StateTypes.CLAY, StateTypes.MOSS_BLOCK);
BlockTags.SNOW.add(StateTypes.SNOW, StateTypes.SNOW_BLOCK, StateTypes.POWDER_SNOW);
BlockTags.MINEABLE_HOE.add(StateTypes.NETHER_WART_BLOCK, StateTypes.WARPED_WART_BLOCK, StateTypes.HAY_BLOCK, StateTypes.DRIED_KELP_BLOCK, StateTypes.TARGET, StateTypes.SHROOMLIGHT, StateTypes.SPONGE, StateTypes.WET_SPONGE, StateTypes.JUNGLE_LEAVES, StateTypes.OAK_LEAVES, StateTypes.SPRUCE_LEAVES, StateTypes.DARK_OAK_LEAVES, StateTypes.ACACIA_LEAVES, StateTypes.BIRCH_LEAVES, StateTypes.AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.MANGROVE_LEAVES, StateTypes.SCULK_SENSOR, StateTypes.CALIBRATED_SCULK_SENSOR, StateTypes.MOSS_BLOCK, StateTypes.MOSS_CARPET, StateTypes.SCULK, StateTypes.SCULK_CATALYST, StateTypes.SCULK_VEIN, StateTypes.SCULK_SHRIEKER, StateTypes.PINK_PETALS, StateTypes.CHERRY_LEAVES, StateTypes.PALE_OAK_LEAVES, StateTypes.PALE_MOSS_BLOCK, StateTypes.PALE_MOSS_CARPET);
BlockTags.MINEABLE_HOE.add(StateTypes.NETHER_WART_BLOCK, StateTypes.WARPED_WART_BLOCK, StateTypes.HAY_BLOCK, StateTypes.DRIED_KELP_BLOCK, StateTypes.TARGET, StateTypes.SHROOMLIGHT, StateTypes.SPONGE, StateTypes.WET_SPONGE, StateTypes.JUNGLE_LEAVES, StateTypes.OAK_LEAVES, StateTypes.SPRUCE_LEAVES, StateTypes.PALE_OAK_LEAVES, StateTypes.DARK_OAK_LEAVES, StateTypes.ACACIA_LEAVES, StateTypes.BIRCH_LEAVES, StateTypes.AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.MANGROVE_LEAVES, StateTypes.SCULK_SENSOR, StateTypes.CALIBRATED_SCULK_SENSOR, StateTypes.MOSS_BLOCK, StateTypes.MOSS_CARPET, StateTypes.PALE_MOSS_BLOCK, StateTypes.PALE_MOSS_CARPET, StateTypes.SCULK, StateTypes.SCULK_CATALYST, StateTypes.SCULK_VEIN, StateTypes.SCULK_SHRIEKER, StateTypes.PINK_PETALS, StateTypes.CHERRY_LEAVES);
BlockTags.NEEDS_DIAMOND_TOOL.add(StateTypes.OBSIDIAN, StateTypes.CRYING_OBSIDIAN, StateTypes.NETHERITE_BLOCK, StateTypes.RESPAWN_ANCHOR, StateTypes.ANCIENT_DEBRIS);
BlockTags.NEEDS_IRON_TOOL.add(StateTypes.DIAMOND_BLOCK, StateTypes.DIAMOND_ORE, StateTypes.DEEPSLATE_DIAMOND_ORE, StateTypes.EMERALD_ORE, StateTypes.DEEPSLATE_EMERALD_ORE, StateTypes.EMERALD_BLOCK, StateTypes.GOLD_BLOCK, StateTypes.RAW_GOLD_BLOCK, StateTypes.GOLD_ORE, StateTypes.DEEPSLATE_GOLD_ORE, StateTypes.REDSTONE_ORE, StateTypes.DEEPSLATE_REDSTONE_ORE);
BlockTags.NEEDS_STONE_TOOL.add(StateTypes.IRON_BLOCK, StateTypes.RAW_IRON_BLOCK, StateTypes.IRON_ORE, StateTypes.DEEPSLATE_IRON_ORE, StateTypes.LAPIS_BLOCK, StateTypes.LAPIS_ORE, StateTypes.DEEPSLATE_LAPIS_ORE, StateTypes.COPPER_BLOCK, StateTypes.RAW_COPPER_BLOCK, StateTypes.COPPER_ORE, StateTypes.DEEPSLATE_COPPER_ORE, StateTypes.CUT_COPPER_SLAB, StateTypes.CUT_COPPER_STAIRS, StateTypes.CUT_COPPER, StateTypes.WEATHERED_COPPER, StateTypes.WEATHERED_CUT_COPPER_SLAB, StateTypes.WEATHERED_CUT_COPPER_STAIRS, StateTypes.WEATHERED_CUT_COPPER, StateTypes.OXIDIZED_COPPER, StateTypes.OXIDIZED_CUT_COPPER_SLAB, StateTypes.OXIDIZED_CUT_COPPER_STAIRS, StateTypes.OXIDIZED_CUT_COPPER, StateTypes.EXPOSED_COPPER, StateTypes.EXPOSED_CUT_COPPER_SLAB, StateTypes.EXPOSED_CUT_COPPER_STAIRS, StateTypes.EXPOSED_CUT_COPPER, StateTypes.WAXED_COPPER_BLOCK, StateTypes.WAXED_CUT_COPPER_SLAB, StateTypes.WAXED_CUT_COPPER_STAIRS, StateTypes.WAXED_CUT_COPPER, StateTypes.WAXED_WEATHERED_COPPER, StateTypes.WAXED_WEATHERED_CUT_COPPER_SLAB, StateTypes.WAXED_WEATHERED_CUT_COPPER_STAIRS, StateTypes.WAXED_WEATHERED_CUT_COPPER, StateTypes.WAXED_EXPOSED_COPPER, StateTypes.WAXED_EXPOSED_CUT_COPPER_SLAB, StateTypes.WAXED_EXPOSED_CUT_COPPER_STAIRS, StateTypes.WAXED_EXPOSED_CUT_COPPER, StateTypes.WAXED_OXIDIZED_COPPER, StateTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB, StateTypes.WAXED_OXIDIZED_CUT_COPPER_STAIRS, StateTypes.WAXED_OXIDIZED_CUT_COPPER, StateTypes.LIGHTNING_ROD, StateTypes.CRAFTER, StateTypes.CHISELED_COPPER, StateTypes.EXPOSED_CHISELED_COPPER, StateTypes.WEATHERED_CHISELED_COPPER, StateTypes.OXIDIZED_CHISELED_COPPER, StateTypes.WAXED_CHISELED_COPPER, StateTypes.WAXED_EXPOSED_CHISELED_COPPER, StateTypes.WAXED_WEATHERED_CHISELED_COPPER, StateTypes.WAXED_OXIDIZED_CHISELED_COPPER, StateTypes.COPPER_GRATE, StateTypes.EXPOSED_COPPER_GRATE, StateTypes.WEATHERED_COPPER_GRATE, StateTypes.OXIDIZED_COPPER_GRATE, StateTypes.WAXED_COPPER_GRATE, StateTypes.WAXED_EXPOSED_COPPER_GRATE, StateTypes.WAXED_WEATHERED_COPPER_GRATE, StateTypes.WAXED_OXIDIZED_COPPER_GRATE, StateTypes.COPPER_BULB, StateTypes.EXPOSED_COPPER_BULB, StateTypes.WEATHERED_COPPER_BULB, StateTypes.OXIDIZED_COPPER_BULB, StateTypes.WAXED_COPPER_BULB, StateTypes.WAXED_EXPOSED_COPPER_BULB, StateTypes.WAXED_WEATHERED_COPPER_BULB, StateTypes.WAXED_OXIDIZED_COPPER_BULB, StateTypes.COPPER_TRAPDOOR, StateTypes.EXPOSED_COPPER_TRAPDOOR, StateTypes.WEATHERED_COPPER_TRAPDOOR, StateTypes.OXIDIZED_COPPER_TRAPDOOR, StateTypes.WAXED_COPPER_TRAPDOOR, StateTypes.WAXED_EXPOSED_COPPER_TRAPDOOR, StateTypes.WAXED_WEATHERED_COPPER_TRAPDOOR, StateTypes.WAXED_OXIDIZED_COPPER_TRAPDOOR, StateTypes.COPPER_DOOR, StateTypes.EXPOSED_COPPER_DOOR, StateTypes.WEATHERED_COPPER_DOOR, StateTypes.OXIDIZED_COPPER_DOOR, StateTypes.WAXED_COPPER_DOOR, StateTypes.WAXED_EXPOSED_COPPER_DOOR, StateTypes.WAXED_WEATHERED_COPPER_DOOR, StateTypes.WAXED_OXIDIZED_COPPER_DOOR);
BlockTags.NEEDS_STONE_TOOL.add(StateTypes.IRON_BLOCK, StateTypes.RAW_IRON_BLOCK, StateTypes.IRON_ORE, StateTypes.DEEPSLATE_IRON_ORE, StateTypes.LAPIS_BLOCK, StateTypes.LAPIS_ORE, StateTypes.DEEPSLATE_LAPIS_ORE, StateTypes.COPPER_BLOCK, StateTypes.RAW_COPPER_BLOCK, StateTypes.COPPER_ORE, StateTypes.DEEPSLATE_COPPER_ORE, StateTypes.CUT_COPPER_SLAB, StateTypes.CUT_COPPER_STAIRS, StateTypes.CUT_COPPER, StateTypes.WEATHERED_COPPER, StateTypes.WEATHERED_CUT_COPPER_SLAB, StateTypes.WEATHERED_CUT_COPPER_STAIRS, StateTypes.WEATHERED_CUT_COPPER, StateTypes.OXIDIZED_COPPER, StateTypes.OXIDIZED_CUT_COPPER_SLAB, StateTypes.OXIDIZED_CUT_COPPER_STAIRS, StateTypes.OXIDIZED_CUT_COPPER, StateTypes.EXPOSED_COPPER, StateTypes.EXPOSED_CUT_COPPER_SLAB, StateTypes.EXPOSED_CUT_COPPER_STAIRS, StateTypes.EXPOSED_CUT_COPPER, StateTypes.WAXED_COPPER_BLOCK, StateTypes.WAXED_CUT_COPPER_SLAB, StateTypes.WAXED_CUT_COPPER_STAIRS, StateTypes.WAXED_CUT_COPPER, StateTypes.WAXED_WEATHERED_COPPER, StateTypes.WAXED_WEATHERED_CUT_COPPER_SLAB, StateTypes.WAXED_WEATHERED_CUT_COPPER_STAIRS, StateTypes.WAXED_WEATHERED_CUT_COPPER, StateTypes.WAXED_EXPOSED_COPPER, StateTypes.WAXED_EXPOSED_CUT_COPPER_SLAB, StateTypes.WAXED_EXPOSED_CUT_COPPER_STAIRS, StateTypes.WAXED_EXPOSED_CUT_COPPER, StateTypes.WAXED_OXIDIZED_COPPER, StateTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB, StateTypes.WAXED_OXIDIZED_CUT_COPPER_STAIRS, StateTypes.WAXED_OXIDIZED_CUT_COPPER, StateTypes.LIGHTNING_ROD, StateTypes.CRAFTER, StateTypes.CHISELED_COPPER, StateTypes.EXPOSED_CHISELED_COPPER, StateTypes.WEATHERED_CHISELED_COPPER, StateTypes.OXIDIZED_CHISELED_COPPER, StateTypes.WAXED_CHISELED_COPPER, StateTypes.WAXED_EXPOSED_CHISELED_COPPER, StateTypes.WAXED_WEATHERED_CHISELED_COPPER, StateTypes.WAXED_OXIDIZED_CHISELED_COPPER, StateTypes.COPPER_GRATE, StateTypes.EXPOSED_COPPER_GRATE, StateTypes.WEATHERED_COPPER_GRATE, StateTypes.OXIDIZED_COPPER_GRATE, StateTypes.WAXED_COPPER_GRATE, StateTypes.WAXED_EXPOSED_COPPER_GRATE, StateTypes.WAXED_WEATHERED_COPPER_GRATE, StateTypes.WAXED_OXIDIZED_COPPER_GRATE, StateTypes.COPPER_BULB, StateTypes.EXPOSED_COPPER_BULB, StateTypes.WEATHERED_COPPER_BULB, StateTypes.OXIDIZED_COPPER_BULB, StateTypes.WAXED_COPPER_BULB, StateTypes.WAXED_EXPOSED_COPPER_BULB, StateTypes.WAXED_WEATHERED_COPPER_BULB, StateTypes.WAXED_OXIDIZED_COPPER_BULB, StateTypes.COPPER_TRAPDOOR, StateTypes.EXPOSED_COPPER_TRAPDOOR, StateTypes.WEATHERED_COPPER_TRAPDOOR, StateTypes.OXIDIZED_COPPER_TRAPDOOR, StateTypes.WAXED_COPPER_TRAPDOOR, StateTypes.WAXED_EXPOSED_COPPER_TRAPDOOR, StateTypes.WAXED_WEATHERED_COPPER_TRAPDOOR, StateTypes.WAXED_OXIDIZED_COPPER_TRAPDOOR);
copy(null, BlockTags.INCORRECT_FOR_NETHERITE_TOOL);
copy(null, BlockTags.INCORRECT_FOR_DIAMOND_TOOL);
BlockTags.FEATURES_CANNOT_REPLACE.add(StateTypes.BEDROCK, StateTypes.SPAWNER, StateTypes.CHEST, StateTypes.END_PORTAL_FRAME, StateTypes.REINFORCED_DEEPSLATE, StateTypes.TRIAL_SPAWNER, StateTypes.VAULT);
@@ -370,10 +420,10 @@ public class BlockTags {
BlockTags.SNOW_LAYER_CANNOT_SURVIVE_ON.add(StateTypes.ICE, StateTypes.PACKED_ICE, StateTypes.BARRIER);
BlockTags.SNOW_LAYER_CAN_SURVIVE_ON.add(StateTypes.HONEY_BLOCK, StateTypes.SOUL_SAND, StateTypes.MUD);
BlockTags.INVALID_SPAWN_INSIDE.add(StateTypes.END_PORTAL, StateTypes.END_GATEWAY);
BlockTags.SNIFFER_DIGGABLE_BLOCK.add(StateTypes.DIRT, StateTypes.GRASS_BLOCK, StateTypes.PODZOL, StateTypes.COARSE_DIRT, StateTypes.ROOTED_DIRT, StateTypes.MOSS_BLOCK, StateTypes.MUD, StateTypes.MUDDY_MANGROVE_ROOTS);
BlockTags.SNIFFER_DIGGABLE_BLOCK.add(StateTypes.DIRT, StateTypes.GRASS_BLOCK, StateTypes.PODZOL, StateTypes.COARSE_DIRT, StateTypes.ROOTED_DIRT, StateTypes.MOSS_BLOCK, StateTypes.PALE_MOSS_BLOCK, StateTypes.MUD, StateTypes.MUDDY_MANGROVE_ROOTS);
BlockTags.SNIFFER_EGG_HATCH_BOOST.add(StateTypes.MOSS_BLOCK);
BlockTags.TRAIL_RUINS_REPLACEABLE.add(StateTypes.GRAVEL);
BlockTags.REPLACEABLE.add(StateTypes.AIR, StateTypes.WATER, StateTypes.LAVA, StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.SEAGRASS, StateTypes.TALL_SEAGRASS, StateTypes.FIRE, StateTypes.SOUL_FIRE, StateTypes.SNOW, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.LIGHT, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.STRUCTURE_VOID, StateTypes.VOID_AIR, StateTypes.CAVE_AIR, StateTypes.BUBBLE_COLUMN, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_ROOTS, StateTypes.HANGING_ROOTS);
BlockTags.REPLACEABLE.add(StateTypes.AIR, StateTypes.WATER, StateTypes.LAVA, StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.SEAGRASS, StateTypes.TALL_SEAGRASS, StateTypes.FIRE, StateTypes.SOUL_FIRE, StateTypes.SNOW, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.RESIN_CLUMP, StateTypes.LIGHT, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.STRUCTURE_VOID, StateTypes.VOID_AIR, StateTypes.CAVE_AIR, StateTypes.BUBBLE_COLUMN, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_ROOTS, StateTypes.HANGING_ROOTS);
BlockTags.ENCHANTMENT_POWER_PROVIDER.add(StateTypes.BOOKSHELF);
BlockTags.MAINTAINS_FARMLAND.add(StateTypes.PUMPKIN_STEM, StateTypes.ATTACHED_PUMPKIN_STEM, StateTypes.MELON_STEM, StateTypes.ATTACHED_MELON_STEM, StateTypes.BEETROOTS, StateTypes.CARROTS, StateTypes.POTATOES, StateTypes.TORCHFLOWER_CROP, StateTypes.TORCHFLOWER, StateTypes.PITCHER_CROP, StateTypes.WHEAT);
BlockTags.BLOCKS_WIND_CHARGE_EXPLOSIONS.add(StateTypes.BARRIER, StateTypes.BEDROCK);
@@ -382,12 +432,12 @@ public class BlockTags {
BlockTags.MOB_INTERACTABLE_DOORS.addTag(BlockTags.WOODEN_DOORS).add(StateTypes.COPPER_DOOR, StateTypes.EXPOSED_COPPER_DOOR, StateTypes.WEATHERED_COPPER_DOOR, StateTypes.OXIDIZED_COPPER_DOOR, StateTypes.WAXED_COPPER_DOOR, StateTypes.WAXED_EXPOSED_COPPER_DOOR, StateTypes.WAXED_WEATHERED_COPPER_DOOR, StateTypes.WAXED_OXIDIZED_COPPER_DOOR);
BlockTags.PRESSURE_PLATES.addTag(BlockTags.WOODEN_PRESSURE_PLATES).addTag(BlockTags.STONE_PRESSURE_PLATES).add(StateTypes.LIGHT_WEIGHTED_PRESSURE_PLATE, StateTypes.HEAVY_WEIGHTED_PRESSURE_PLATE);
BlockTags.DOORS.addTag(BlockTags.WOODEN_DOORS).add(StateTypes.COPPER_DOOR, StateTypes.EXPOSED_COPPER_DOOR, StateTypes.WEATHERED_COPPER_DOOR, StateTypes.OXIDIZED_COPPER_DOOR, StateTypes.WAXED_COPPER_DOOR, StateTypes.WAXED_EXPOSED_COPPER_DOOR, StateTypes.WAXED_WEATHERED_COPPER_DOOR, StateTypes.WAXED_OXIDIZED_COPPER_DOOR, StateTypes.IRON_DOOR);
BlockTags.LOGS_THAT_BURN.addTag(BlockTags.DARK_OAK_LOGS).addTag(BlockTags.OAK_LOGS).addTag(BlockTags.ACACIA_LOGS).addTag(BlockTags.BIRCH_LOGS).addTag(BlockTags.JUNGLE_LOGS).addTag(BlockTags.SPRUCE_LOGS).addTag(BlockTags.MANGROVE_LOGS).addTag(BlockTags.CHERRY_LOGS).addTag(BlockTags.PALE_OAK_LOGS);
BlockTags.STAIRS.addTag(BlockTags.WOODEN_STAIRS).add(StateTypes.BAMBOO_MOSAIC_STAIRS, StateTypes.COBBLESTONE_STAIRS, StateTypes.SANDSTONE_STAIRS, StateTypes.NETHER_BRICK_STAIRS, StateTypes.STONE_BRICK_STAIRS, StateTypes.BRICK_STAIRS, StateTypes.PURPUR_STAIRS, StateTypes.QUARTZ_STAIRS, StateTypes.RED_SANDSTONE_STAIRS, StateTypes.PRISMARINE_BRICK_STAIRS, StateTypes.PRISMARINE_STAIRS, StateTypes.DARK_PRISMARINE_STAIRS, StateTypes.POLISHED_GRANITE_STAIRS, StateTypes.SMOOTH_RED_SANDSTONE_STAIRS, StateTypes.MOSSY_STONE_BRICK_STAIRS, StateTypes.POLISHED_DIORITE_STAIRS, StateTypes.MOSSY_COBBLESTONE_STAIRS, StateTypes.END_STONE_BRICK_STAIRS, StateTypes.STONE_STAIRS, StateTypes.SMOOTH_SANDSTONE_STAIRS, StateTypes.SMOOTH_QUARTZ_STAIRS, StateTypes.GRANITE_STAIRS, StateTypes.ANDESITE_STAIRS, StateTypes.RED_NETHER_BRICK_STAIRS, StateTypes.POLISHED_ANDESITE_STAIRS, StateTypes.DIORITE_STAIRS, StateTypes.BLACKSTONE_STAIRS, StateTypes.POLISHED_BLACKSTONE_BRICK_STAIRS, StateTypes.POLISHED_BLACKSTONE_STAIRS, StateTypes.COBBLED_DEEPSLATE_STAIRS, StateTypes.POLISHED_DEEPSLATE_STAIRS, StateTypes.DEEPSLATE_TILE_STAIRS, StateTypes.DEEPSLATE_BRICK_STAIRS, StateTypes.OXIDIZED_CUT_COPPER_STAIRS, StateTypes.WEATHERED_CUT_COPPER_STAIRS, StateTypes.EXPOSED_CUT_COPPER_STAIRS, StateTypes.CUT_COPPER_STAIRS, StateTypes.WAXED_WEATHERED_CUT_COPPER_STAIRS, StateTypes.WAXED_EXPOSED_CUT_COPPER_STAIRS, StateTypes.WAXED_CUT_COPPER_STAIRS, StateTypes.WAXED_OXIDIZED_CUT_COPPER_STAIRS, StateTypes.MUD_BRICK_STAIRS, StateTypes.TUFF_STAIRS, StateTypes.POLISHED_TUFF_STAIRS, StateTypes.TUFF_BRICK_STAIRS);
BlockTags.SLABS.addTag(BlockTags.WOODEN_SLABS).add(StateTypes.BAMBOO_MOSAIC_SLAB, StateTypes.STONE_SLAB, StateTypes.SMOOTH_STONE_SLAB, StateTypes.STONE_BRICK_SLAB, StateTypes.SANDSTONE_SLAB, StateTypes.PURPUR_SLAB, StateTypes.QUARTZ_SLAB, StateTypes.RED_SANDSTONE_SLAB, StateTypes.BRICK_SLAB, StateTypes.COBBLESTONE_SLAB, StateTypes.NETHER_BRICK_SLAB, StateTypes.PETRIFIED_OAK_SLAB, StateTypes.PRISMARINE_SLAB, StateTypes.PRISMARINE_BRICK_SLAB, StateTypes.DARK_PRISMARINE_SLAB, StateTypes.POLISHED_GRANITE_SLAB, StateTypes.SMOOTH_RED_SANDSTONE_SLAB, StateTypes.MOSSY_STONE_BRICK_SLAB, StateTypes.POLISHED_DIORITE_SLAB, StateTypes.MOSSY_COBBLESTONE_SLAB, StateTypes.END_STONE_BRICK_SLAB, StateTypes.SMOOTH_SANDSTONE_SLAB, StateTypes.SMOOTH_QUARTZ_SLAB, StateTypes.GRANITE_SLAB, StateTypes.ANDESITE_SLAB, StateTypes.RED_NETHER_BRICK_SLAB, StateTypes.POLISHED_ANDESITE_SLAB, StateTypes.DIORITE_SLAB, StateTypes.CUT_SANDSTONE_SLAB, StateTypes.CUT_RED_SANDSTONE_SLAB, StateTypes.BLACKSTONE_SLAB, StateTypes.POLISHED_BLACKSTONE_BRICK_SLAB, StateTypes.POLISHED_BLACKSTONE_SLAB, StateTypes.COBBLED_DEEPSLATE_SLAB, StateTypes.POLISHED_DEEPSLATE_SLAB, StateTypes.DEEPSLATE_TILE_SLAB, StateTypes.DEEPSLATE_BRICK_SLAB, StateTypes.WAXED_WEATHERED_CUT_COPPER_SLAB, StateTypes.WAXED_EXPOSED_CUT_COPPER_SLAB, StateTypes.WAXED_CUT_COPPER_SLAB, StateTypes.OXIDIZED_CUT_COPPER_SLAB, StateTypes.WEATHERED_CUT_COPPER_SLAB, StateTypes.EXPOSED_CUT_COPPER_SLAB, StateTypes.CUT_COPPER_SLAB, StateTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB, StateTypes.MUD_BRICK_SLAB, StateTypes.TUFF_SLAB, StateTypes.POLISHED_TUFF_SLAB, StateTypes.TUFF_BRICK_SLAB);
BlockTags.LOGS_THAT_BURN.addTag(BlockTags.DARK_OAK_LOGS).addTag(BlockTags.PALE_OAK_LOGS).addTag(BlockTags.OAK_LOGS).addTag(BlockTags.ACACIA_LOGS).addTag(BlockTags.BIRCH_LOGS).addTag(BlockTags.JUNGLE_LOGS).addTag(BlockTags.SPRUCE_LOGS).addTag(BlockTags.MANGROVE_LOGS).addTag(BlockTags.CHERRY_LOGS);
BlockTags.STAIRS.addTag(BlockTags.WOODEN_STAIRS).add(StateTypes.BAMBOO_MOSAIC_STAIRS, StateTypes.COBBLESTONE_STAIRS, StateTypes.SANDSTONE_STAIRS, StateTypes.NETHER_BRICK_STAIRS, StateTypes.STONE_BRICK_STAIRS, StateTypes.BRICK_STAIRS, StateTypes.PURPUR_STAIRS, StateTypes.QUARTZ_STAIRS, StateTypes.RED_SANDSTONE_STAIRS, StateTypes.PRISMARINE_BRICK_STAIRS, StateTypes.PRISMARINE_STAIRS, StateTypes.DARK_PRISMARINE_STAIRS, StateTypes.POLISHED_GRANITE_STAIRS, StateTypes.SMOOTH_RED_SANDSTONE_STAIRS, StateTypes.MOSSY_STONE_BRICK_STAIRS, StateTypes.POLISHED_DIORITE_STAIRS, StateTypes.MOSSY_COBBLESTONE_STAIRS, StateTypes.END_STONE_BRICK_STAIRS, StateTypes.STONE_STAIRS, StateTypes.SMOOTH_SANDSTONE_STAIRS, StateTypes.SMOOTH_QUARTZ_STAIRS, StateTypes.GRANITE_STAIRS, StateTypes.ANDESITE_STAIRS, StateTypes.RED_NETHER_BRICK_STAIRS, StateTypes.POLISHED_ANDESITE_STAIRS, StateTypes.DIORITE_STAIRS, StateTypes.BLACKSTONE_STAIRS, StateTypes.POLISHED_BLACKSTONE_BRICK_STAIRS, StateTypes.POLISHED_BLACKSTONE_STAIRS, StateTypes.COBBLED_DEEPSLATE_STAIRS, StateTypes.POLISHED_DEEPSLATE_STAIRS, StateTypes.DEEPSLATE_TILE_STAIRS, StateTypes.DEEPSLATE_BRICK_STAIRS, StateTypes.OXIDIZED_CUT_COPPER_STAIRS, StateTypes.WEATHERED_CUT_COPPER_STAIRS, StateTypes.EXPOSED_CUT_COPPER_STAIRS, StateTypes.CUT_COPPER_STAIRS, StateTypes.WAXED_WEATHERED_CUT_COPPER_STAIRS, StateTypes.WAXED_EXPOSED_CUT_COPPER_STAIRS, StateTypes.WAXED_CUT_COPPER_STAIRS, StateTypes.WAXED_OXIDIZED_CUT_COPPER_STAIRS, StateTypes.MUD_BRICK_STAIRS, StateTypes.TUFF_STAIRS, StateTypes.POLISHED_TUFF_STAIRS, StateTypes.TUFF_BRICK_STAIRS, StateTypes.RESIN_BRICK_STAIRS);
BlockTags.SLABS.addTag(BlockTags.WOODEN_SLABS).add(StateTypes.BAMBOO_MOSAIC_SLAB, StateTypes.STONE_SLAB, StateTypes.SMOOTH_STONE_SLAB, StateTypes.STONE_BRICK_SLAB, StateTypes.SANDSTONE_SLAB, StateTypes.PURPUR_SLAB, StateTypes.QUARTZ_SLAB, StateTypes.RED_SANDSTONE_SLAB, StateTypes.BRICK_SLAB, StateTypes.COBBLESTONE_SLAB, StateTypes.NETHER_BRICK_SLAB, StateTypes.PETRIFIED_OAK_SLAB, StateTypes.PRISMARINE_SLAB, StateTypes.PRISMARINE_BRICK_SLAB, StateTypes.DARK_PRISMARINE_SLAB, StateTypes.POLISHED_GRANITE_SLAB, StateTypes.SMOOTH_RED_SANDSTONE_SLAB, StateTypes.MOSSY_STONE_BRICK_SLAB, StateTypes.POLISHED_DIORITE_SLAB, StateTypes.MOSSY_COBBLESTONE_SLAB, StateTypes.END_STONE_BRICK_SLAB, StateTypes.SMOOTH_SANDSTONE_SLAB, StateTypes.SMOOTH_QUARTZ_SLAB, StateTypes.GRANITE_SLAB, StateTypes.ANDESITE_SLAB, StateTypes.RED_NETHER_BRICK_SLAB, StateTypes.POLISHED_ANDESITE_SLAB, StateTypes.DIORITE_SLAB, StateTypes.CUT_SANDSTONE_SLAB, StateTypes.CUT_RED_SANDSTONE_SLAB, StateTypes.BLACKSTONE_SLAB, StateTypes.POLISHED_BLACKSTONE_BRICK_SLAB, StateTypes.POLISHED_BLACKSTONE_SLAB, StateTypes.COBBLED_DEEPSLATE_SLAB, StateTypes.POLISHED_DEEPSLATE_SLAB, StateTypes.DEEPSLATE_TILE_SLAB, StateTypes.DEEPSLATE_BRICK_SLAB, StateTypes.WAXED_WEATHERED_CUT_COPPER_SLAB, StateTypes.WAXED_EXPOSED_CUT_COPPER_SLAB, StateTypes.WAXED_CUT_COPPER_SLAB, StateTypes.OXIDIZED_CUT_COPPER_SLAB, StateTypes.WEATHERED_CUT_COPPER_SLAB, StateTypes.EXPOSED_CUT_COPPER_SLAB, StateTypes.CUT_COPPER_SLAB, StateTypes.WAXED_OXIDIZED_CUT_COPPER_SLAB, StateTypes.MUD_BRICK_SLAB, StateTypes.TUFF_SLAB, StateTypes.POLISHED_TUFF_SLAB, StateTypes.TUFF_BRICK_SLAB, StateTypes.RESIN_BRICK_SLAB);
BlockTags.TRAPDOORS.addTag(BlockTags.WOODEN_TRAPDOORS).add(StateTypes.IRON_TRAPDOOR, StateTypes.COPPER_TRAPDOOR, StateTypes.EXPOSED_COPPER_TRAPDOOR, StateTypes.WEATHERED_COPPER_TRAPDOOR, StateTypes.OXIDIZED_COPPER_TRAPDOOR, StateTypes.WAXED_COPPER_TRAPDOOR, StateTypes.WAXED_EXPOSED_COPPER_TRAPDOOR, StateTypes.WAXED_WEATHERED_COPPER_TRAPDOOR, StateTypes.WAXED_OXIDIZED_COPPER_TRAPDOOR);
BlockTags.FENCES.addTag(BlockTags.WOODEN_FENCES).add(StateTypes.NETHER_BRICK_FENCE);
BlockTags.FLOWERS.addTag(BlockTags.SMALL_FLOWERS).addTag(BlockTags.TALL_FLOWERS).add(StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA, StateTypes.MANGROVE_PROPAGULE, StateTypes.CHERRY_LEAVES, StateTypes.PINK_PETALS, StateTypes.CHORUS_FLOWER, StateTypes.SPORE_BLOSSOM);
BlockTags.FLOWERS.addTag(BlockTags.SMALL_FLOWERS).add(StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.PEONY, StateTypes.ROSE_BUSH, StateTypes.PITCHER_PLANT, StateTypes.FLOWERING_AZALEA_LEAVES, StateTypes.FLOWERING_AZALEA, StateTypes.MANGROVE_PROPAGULE, StateTypes.CHERRY_LEAVES, StateTypes.PINK_PETALS, StateTypes.CHORUS_FLOWER, StateTypes.SPORE_BLOSSOM);
BlockTags.ENDERMAN_HOLDABLE.addTag(BlockTags.SMALL_FLOWERS).addTag(BlockTags.DIRT).add(StateTypes.SAND, StateTypes.RED_SAND, StateTypes.GRAVEL, StateTypes.BROWN_MUSHROOM, StateTypes.RED_MUSHROOM, StateTypes.TNT, StateTypes.CACTUS, StateTypes.CLAY, StateTypes.PUMPKIN, StateTypes.CARVED_PUMPKIN, StateTypes.MELON, StateTypes.CRIMSON_FUNGUS, StateTypes.CRIMSON_NYLIUM, StateTypes.CRIMSON_ROOTS, StateTypes.WARPED_FUNGUS, StateTypes.WARPED_NYLIUM, StateTypes.WARPED_ROOTS);
BlockTags.CORALS.addTag(BlockTags.CORAL_PLANTS).add(StateTypes.TUBE_CORAL_FAN, StateTypes.BRAIN_CORAL_FAN, StateTypes.BUBBLE_CORAL_FAN, StateTypes.FIRE_CORAL_FAN, StateTypes.HORN_CORAL_FAN);
BlockTags.BAMBOO_PLANTABLE_ON.addTag(BlockTags.SAND).addTag(BlockTags.DIRT).add(StateTypes.BAMBOO, StateTypes.BAMBOO_SAPLING, StateTypes.GRAVEL, StateTypes.SUSPICIOUS_GRAVEL);
@@ -401,9 +451,9 @@ public class BlockTags {
BlockTags.UNSTABLE_BOTTOM_CENTER.addTag(BlockTags.FENCE_GATES);
BlockTags.INFINIBURN_NETHER.addTag(BlockTags.INFINIBURN_OVERWORLD);
BlockTags.INFINIBURN_END.addTag(BlockTags.INFINIBURN_OVERWORLD).add(StateTypes.BEDROCK);
BlockTags.OVERWORLD_CARVER_REPLACEABLES.addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.DIRT).addTag(BlockTags.SAND).addTag(BlockTags.TERRACOTTA).addTag(BlockTags.IRON_ORES).addTag(BlockTags.COPPER_ORES).add(StateTypes.WATER, StateTypes.GRAVEL, StateTypes.SUSPICIOUS_GRAVEL, StateTypes.SANDSTONE, StateTypes.RED_SANDSTONE, StateTypes.CALCITE, StateTypes.SNOW, StateTypes.PACKED_ICE, StateTypes.RAW_IRON_BLOCK, StateTypes.RAW_COPPER_BLOCK);
BlockTags.OVERWORLD_CARVER_REPLACEABLES.addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.DIRT).addTag(BlockTags.SAND).addTag(BlockTags.TERRACOTTA).addTag(BlockTags.IRON_ORES).addTag(BlockTags.COPPER_ORES).addTag(BlockTags.SNOW).add(StateTypes.WATER, StateTypes.GRAVEL, StateTypes.SUSPICIOUS_GRAVEL, StateTypes.SANDSTONE, StateTypes.RED_SANDSTONE, StateTypes.CALCITE, StateTypes.PACKED_ICE, StateTypes.RAW_IRON_BLOCK, StateTypes.RAW_COPPER_BLOCK);
BlockTags.NETHER_CARVER_REPLACEABLES.addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.BASE_STONE_NETHER).addTag(BlockTags.DIRT).addTag(BlockTags.NYLIUM).addTag(BlockTags.WART_BLOCKS).add(StateTypes.SOUL_SAND, StateTypes.SOUL_SOIL);
BlockTags.COMBINATION_STEP_SOUND_BLOCKS.addTag(BlockTags.WOOL_CARPETS).add(StateTypes.MOSS_CARPET, StateTypes.SNOW, StateTypes.NETHER_SPROUTS, StateTypes.WARPED_ROOTS, StateTypes.CRIMSON_ROOTS, StateTypes.PALE_MOSS_CARPET);
BlockTags.COMBINATION_STEP_SOUND_BLOCKS.addTag(BlockTags.WOOL_CARPETS).add(StateTypes.MOSS_CARPET, StateTypes.PALE_MOSS_CARPET, StateTypes.SNOW, StateTypes.NETHER_SPROUTS, StateTypes.WARPED_ROOTS, StateTypes.CRIMSON_ROOTS, StateTypes.RESIN_CLUMP);
BlockTags.CAMEL_SAND_STEP_SOUND_BLOCKS.addTag(BlockTags.SAND).addTag(BlockTags.CONCRETE_POWDER);
BlockTags.OCCLUDES_VIBRATION_SIGNALS.addTag(BlockTags.WOOL);
BlockTags.DAMPENS_VIBRATIONS.addTag(BlockTags.WOOL).addTag(BlockTags.WOOL_CARPETS);
@@ -411,9 +461,9 @@ public class BlockTags {
BlockTags.MOSS_REPLACEABLE.addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.CAVE_VINES).addTag(BlockTags.DIRT);
BlockTags.AZALEA_ROOT_REPLACEABLE.addTag(BlockTags.BASE_STONE_OVERWORLD).addTag(BlockTags.DIRT).addTag(BlockTags.TERRACOTTA).add(StateTypes.RED_SAND, StateTypes.CLAY, StateTypes.GRAVEL, StateTypes.SAND, StateTypes.SNOW_BLOCK, StateTypes.POWDER_SNOW);
BlockTags.BIG_DRIPLEAF_PLACEABLE.addTag(BlockTags.SMALL_DRIPLEAF_PLACEABLE).addTag(BlockTags.DIRT).add(StateTypes.FARMLAND);
BlockTags.MINEABLE_PICKAXE.addTag(BlockTags.STONE_BUTTONS).addTag(BlockTags.WALLS).addTag(BlockTags.SHULKER_BOXES).addTag(BlockTags.ANVIL).addTag(BlockTags.CAULDRONS).addTag(BlockTags.RAILS).add(StateTypes.STONE, StateTypes.GRANITE, StateTypes.POLISHED_GRANITE, StateTypes.DIORITE, StateTypes.POLISHED_DIORITE, StateTypes.ANDESITE, StateTypes.POLISHED_ANDESITE, StateTypes.COBBLESTONE, StateTypes.GOLD_ORE, StateTypes.DEEPSLATE_GOLD_ORE, StateTypes.IRON_ORE, StateTypes.DEEPSLATE_IRON_ORE, StateTypes.COAL_ORE, StateTypes.DEEPSLATE_COAL_ORE, StateTypes.NETHER_GOLD_ORE, StateTypes.LAPIS_ORE, StateTypes.DEEPSLATE_LAPIS_ORE, StateTypes.LAPIS_BLOCK, StateTypes.DISPENSER, StateTypes.SANDSTONE, StateTypes.CHISELED_SANDSTONE, StateTypes.CUT_SANDSTONE, StateTypes.GOLD_BLOCK, StateTypes.IRON_BLOCK, StateTypes.BRICKS, StateTypes.MOSSY_COBBLESTONE, StateTypes.OBSIDIAN, StateTypes.SPAWNER, StateTypes.DIAMOND_ORE, StateTypes.DEEPSLATE_DIAMOND_ORE, StateTypes.DIAMOND_BLOCK, StateTypes.FURNACE, StateTypes.COBBLESTONE_STAIRS, StateTypes.STONE_PRESSURE_PLATE, StateTypes.IRON_DOOR, StateTypes.REDSTONE_ORE, StateTypes.DEEPSLATE_REDSTONE_ORE, StateTypes.NETHERRACK, StateTypes.BASALT, StateTypes.POLISHED_BASALT, StateTypes.STONE_BRICKS, StateTypes.MOSSY_STONE_BRICKS, StateTypes.CRACKED_STONE_BRICKS, StateTypes.CHISELED_STONE_BRICKS, StateTypes.IRON_BARS, StateTypes.CHAIN, StateTypes.BRICK_STAIRS, StateTypes.STONE_BRICK_STAIRS, StateTypes.NETHER_BRICKS, StateTypes.NETHER_BRICK_FENCE, StateTypes.NETHER_BRICK_STAIRS, StateTypes.ENCHANTING_TABLE, StateTypes.BREWING_STAND, StateTypes.END_STONE, StateTypes.SANDSTONE_STAIRS, StateTypes.EMERALD_ORE, StateTypes.DEEPSLATE_EMERALD_ORE, StateTypes.ENDER_CHEST, StateTypes.EMERALD_BLOCK, StateTypes.LIGHT_WEIGHTED_PRESSURE_PLATE, StateTypes.HEAVY_WEIGHTED_PRESSURE_PLATE, StateTypes.REDSTONE_BLOCK, StateTypes.NETHER_QUARTZ_ORE, StateTypes.HOPPER, StateTypes.QUARTZ_BLOCK, StateTypes.CHISELED_QUARTZ_BLOCK, StateTypes.QUARTZ_PILLAR, StateTypes.QUARTZ_STAIRS, StateTypes.DROPPER, StateTypes.WHITE_TERRACOTTA, StateTypes.ORANGE_TERRACOTTA, StateTypes.MAGENTA_TERRACOTTA, StateTypes.LIGHT_BLUE_TERRACOTTA, StateTypes.YELLOW_TERRACOTTA, StateTypes.LIME_TERRACOTTA, StateTypes.PINK_TERRACOTTA, StateTypes.GRAY_TERRACOTTA, StateTypes.LIGHT_GRAY_TERRACOTTA, StateTypes.CYAN_TERRACOTTA, StateTypes.PURPLE_TERRACOTTA, StateTypes.BLUE_TERRACOTTA, StateTypes.BROWN_TERRACOTTA, StateTypes.GREEN_TERRACOTTA, StateTypes.RED_TERRACOTTA, StateTypes.BLACK_TERRACOTTA, StateTypes.IRON_TRAPDOOR, StateTypes.PRISMARINE, StateTypes.PRISMARINE_BRICKS, StateTypes.DARK_PRISMARINE, StateTypes.PRISMARINE_STAIRS, StateTypes.PRISMARINE_BRICK_STAIRS, StateTypes.DARK_PRISMARINE_STAIRS, StateTypes.PRISMARINE_SLAB, StateTypes.PRISMARINE_BRICK_SLAB, StateTypes.DARK_PRISMARINE_SLAB, StateTypes.TERRACOTTA, StateTypes.COAL_BLOCK, StateTypes.RED_SANDSTONE, StateTypes.CHISELED_RED_SANDSTONE, StateTypes.CUT_RED_SANDSTONE, StateTypes.RED_SANDSTONE_STAIRS, StateTypes.STONE_SLAB, StateTypes.SMOOTH_STONE_SLAB, StateTypes.SANDSTONE_SLAB, StateTypes.CUT_SANDSTONE_SLAB, StateTypes.PETRIFIED_OAK_SLAB, StateTypes.COBBLESTONE_SLAB, StateTypes.BRICK_SLAB, StateTypes.STONE_BRICK_SLAB, StateTypes.NETHER_BRICK_SLAB, StateTypes.QUARTZ_SLAB, StateTypes.RED_SANDSTONE_SLAB, StateTypes.CUT_RED_SANDSTONE_SLAB, StateTypes.PURPUR_SLAB, StateTypes.SMOOTH_STONE, StateTypes.SMOOTH_SANDSTONE, StateTypes.SMOOTH_QUARTZ, StateTypes.SMOOTH_RED_SANDSTONE, StateTypes.PURPUR_BLOCK, StateTypes.PURPUR_PILLAR, StateTypes.PURPUR_STAIRS, StateTypes.END_STONE_BRICKS, StateTypes.MAGMA_BLOCK, StateTypes.RED_NETHER_BRICKS, StateTypes.BONE_BLOCK, StateTypes.OBSERVER, StateTypes.WHITE_GLAZED_TERRACOTTA, StateTypes.ORANGE_GLAZED_TERRACOTTA, StateTypes.MAGENTA_GLAZED_TERRACOTTA, StateTypes.LIGHT_BLUE_GLAZED_TERRACOTTA, StateTypes.YELLOW_GLAZED_TERRACOTTA, StateTypes.LIME_GLAZED_TERRACOTTA, StateTypes.PINK_GLAZED_TERRACOTTA, StateTypes.GRAY_GLAZED_TERRACOTTA, StateTypes.LIGHT_GRAY_GLAZED_TERRACOTTA, StateTypes.CYAN_GLAZED_TERRACOTTA, StateTypes.PURPLE_GLAZED_TERRACOTTA, StateTypes.BLUE_GLAZED_TERRACOTTA, StateTypes.BROWN_GLAZED_TERRACOTTA, StateTypes.GREEN_GLAZED_TERRACOTTA, StateTypes.RED_GLAZED_TERRACOTTA, StateTypes.BLACK_GLAZED_TERRACOTTA, StateTypes.WHITE_CONCRETE, StateTypes.ORANGE_CONCRETE, StateTypes.MAGENTA_CONCRETE, StateTypes.LIGHT_BLUE_CONCRETE, StateTypes.YELLOW_CONCRETE, StateTypes.LIME_CONCRETE, StateTypes.PINK_CONCRETE, StateTypes.GRAY_CONCRETE, StateTypes.LIGHT_GRAY_CONCRETE, StateTypes.CYAN_CONCRETE, StateTypes.PURPLE_CONCRETE, StateTypes.BLUE_CONCRETE, StateTypes.BROWN_CONCRETE, StateTypes.GREEN_CONCRETE, StateTypes.RED_CONCRETE, StateTypes.BLACK_CONCRETE, StateTypes.DEAD_TUBE_CORAL_BLOCK, StateTypes.DEAD_BRAIN_CORAL_BLOCK, StateTypes.DEAD_BUBBLE_CORAL_BLOCK, StateTypes.DEAD_FIRE_CORAL_BLOCK, StateTypes.DEAD_HORN_CORAL_BLOCK, StateTypes.TUBE_CORAL_BLOCK, StateTypes.BRAIN_CORAL_BLOCK, StateTypes.BUBBLE_CORAL_BLOCK, StateTypes.FIRE_CORAL_BLOCK, StateTypes.HORN_CORAL_BLOCK,Line truncated
BlockTags.MINEABLE_PICKAXE.addTag(BlockTags.STONE_BUTTONS).addTag(BlockTags.WALLS).addTag(BlockTags.SHULKER_BOXES).addTag(BlockTags.ANVIL).addTag(BlockTags.CAULDRONS).addTag(BlockTags.RAILS).add(StateTypes.STONE, StateTypes.GRANITE, StateTypes.POLISHED_GRANITE, StateTypes.DIORITE, StateTypes.POLISHED_DIORITE, StateTypes.ANDESITE, StateTypes.POLISHED_ANDESITE, StateTypes.COBBLESTONE, StateTypes.GOLD_ORE, StateTypes.DEEPSLATE_GOLD_ORE, StateTypes.IRON_ORE, StateTypes.DEEPSLATE_IRON_ORE, StateTypes.COAL_ORE, StateTypes.DEEPSLATE_COAL_ORE, StateTypes.NETHER_GOLD_ORE, StateTypes.LAPIS_ORE, StateTypes.DEEPSLATE_LAPIS_ORE, StateTypes.LAPIS_BLOCK, StateTypes.DISPENSER, StateTypes.SANDSTONE, StateTypes.CHISELED_SANDSTONE, StateTypes.CUT_SANDSTONE, StateTypes.GOLD_BLOCK, StateTypes.IRON_BLOCK, StateTypes.BRICKS, StateTypes.MOSSY_COBBLESTONE, StateTypes.OBSIDIAN, StateTypes.SPAWNER, StateTypes.DIAMOND_ORE, StateTypes.DEEPSLATE_DIAMOND_ORE, StateTypes.DIAMOND_BLOCK, StateTypes.FURNACE, StateTypes.COBBLESTONE_STAIRS, StateTypes.STONE_PRESSURE_PLATE, StateTypes.IRON_DOOR, StateTypes.REDSTONE_ORE, StateTypes.DEEPSLATE_REDSTONE_ORE, StateTypes.NETHERRACK, StateTypes.BASALT, StateTypes.POLISHED_BASALT, StateTypes.STONE_BRICKS, StateTypes.MOSSY_STONE_BRICKS, StateTypes.CRACKED_STONE_BRICKS, StateTypes.CHISELED_STONE_BRICKS, StateTypes.IRON_BARS, StateTypes.CHAIN, StateTypes.BRICK_STAIRS, StateTypes.STONE_BRICK_STAIRS, StateTypes.NETHER_BRICKS, StateTypes.NETHER_BRICK_FENCE, StateTypes.NETHER_BRICK_STAIRS, StateTypes.ENCHANTING_TABLE, StateTypes.BREWING_STAND, StateTypes.END_STONE, StateTypes.SANDSTONE_STAIRS, StateTypes.EMERALD_ORE, StateTypes.DEEPSLATE_EMERALD_ORE, StateTypes.ENDER_CHEST, StateTypes.EMERALD_BLOCK, StateTypes.LIGHT_WEIGHTED_PRESSURE_PLATE, StateTypes.HEAVY_WEIGHTED_PRESSURE_PLATE, StateTypes.REDSTONE_BLOCK, StateTypes.NETHER_QUARTZ_ORE, StateTypes.HOPPER, StateTypes.QUARTZ_BLOCK, StateTypes.CHISELED_QUARTZ_BLOCK, StateTypes.QUARTZ_PILLAR, StateTypes.QUARTZ_STAIRS, StateTypes.DROPPER, StateTypes.WHITE_TERRACOTTA, StateTypes.ORANGE_TERRACOTTA, StateTypes.MAGENTA_TERRACOTTA, StateTypes.LIGHT_BLUE_TERRACOTTA, StateTypes.YELLOW_TERRACOTTA, StateTypes.LIME_TERRACOTTA, StateTypes.PINK_TERRACOTTA, StateTypes.GRAY_TERRACOTTA, StateTypes.LIGHT_GRAY_TERRACOTTA, StateTypes.CYAN_TERRACOTTA, StateTypes.PURPLE_TERRACOTTA, StateTypes.BLUE_TERRACOTTA, StateTypes.BROWN_TERRACOTTA, StateTypes.GREEN_TERRACOTTA, StateTypes.RED_TERRACOTTA, StateTypes.BLACK_TERRACOTTA, StateTypes.IRON_TRAPDOOR, StateTypes.PRISMARINE, StateTypes.PRISMARINE_BRICKS, StateTypes.DARK_PRISMARINE, StateTypes.PRISMARINE_STAIRS, StateTypes.PRISMARINE_BRICK_STAIRS, StateTypes.DARK_PRISMARINE_STAIRS, StateTypes.PRISMARINE_SLAB, StateTypes.PRISMARINE_BRICK_SLAB, StateTypes.DARK_PRISMARINE_SLAB, StateTypes.TERRACOTTA, StateTypes.COAL_BLOCK, StateTypes.RED_SANDSTONE, StateTypes.CHISELED_RED_SANDSTONE, StateTypes.CUT_RED_SANDSTONE, StateTypes.RED_SANDSTONE_STAIRS, StateTypes.STONE_SLAB, StateTypes.SMOOTH_STONE_SLAB, StateTypes.SANDSTONE_SLAB, StateTypes.CUT_SANDSTONE_SLAB, StateTypes.PETRIFIED_OAK_SLAB, StateTypes.COBBLESTONE_SLAB, StateTypes.BRICK_SLAB, StateTypes.STONE_BRICK_SLAB, StateTypes.NETHER_BRICK_SLAB, StateTypes.QUARTZ_SLAB, StateTypes.RED_SANDSTONE_SLAB, StateTypes.CUT_RED_SANDSTONE_SLAB, StateTypes.PURPUR_SLAB, StateTypes.SMOOTH_STONE, StateTypes.SMOOTH_SANDSTONE, StateTypes.SMOOTH_QUARTZ, StateTypes.SMOOTH_RED_SANDSTONE, StateTypes.PURPUR_BLOCK, StateTypes.PURPUR_PILLAR, StateTypes.PURPUR_STAIRS, StateTypes.END_STONE_BRICKS, StateTypes.MAGMA_BLOCK, StateTypes.RED_NETHER_BRICKS, StateTypes.BONE_BLOCK, StateTypes.OBSERVER, StateTypes.WHITE_GLAZED_TERRACOTTA, StateTypes.ORANGE_GLAZED_TERRACOTTA, StateTypes.MAGENTA_GLAZED_TERRACOTTA, StateTypes.LIGHT_BLUE_GLAZED_TERRACOTTA, StateTypes.YELLOW_GLAZED_TERRACOTTA, StateTypes.LIME_GLAZED_TERRACOTTA, StateTypes.PINK_GLAZED_TERRACOTTA, StateTypes.GRAY_GLAZED_TERRACOTTA, StateTypes.LIGHT_GRAY_GLAZED_TERRACOTTA, StateTypes.CYAN_GLAZED_TERRACOTTA, StateTypes.PURPLE_GLAZED_TERRACOTTA, StateTypes.BLUE_GLAZED_TERRACOTTA, StateTypes.BROWN_GLAZED_TERRACOTTA, StateTypes.GREEN_GLAZED_TERRACOTTA, StateTypes.RED_GLAZED_TERRACOTTA, StateTypes.BLACK_GLAZED_TERRACOTTA, StateTypes.WHITE_CONCRETE, StateTypes.ORANGE_CONCRETE, StateTypes.MAGENTA_CONCRETE, StateTypes.LIGHT_BLUE_CONCRETE, StateTypes.YELLOW_CONCRETE, StateTypes.LIME_CONCRETE, StateTypes.PINK_CONCRETE, StateTypes.GRAY_CONCRETE, StateTypes.LIGHT_GRAY_CONCRETE, StateTypes.CYAN_CONCRETE, StateTypes.PURPLE_CONCRETE, StateTypes.BLUE_CONCRETE, StateTypes.BROWN_CONCRETE, StateTypes.GREEN_CONCRETE, StateTypes.RED_CONCRETE, StateTypes.BLACK_CONCRETE, StateTypes.DEAD_TUBE_CORAL_BLOCK, StateTypes.DEAD_BRAIN_CORAL_BLOCK, StateTypes.DEAD_BUBBLE_CORAL_BLOCK, StateTypes.DEAD_FIRE_CORAL_BLOCK, StateTypes.DEAD_HORN_CORAL_BLOCK, StateTypes.TUBE_CORAL_BLOCK, StateTypes.BRAIN_CORAL_BLOCK, StateTypes.BUBBLE_CORAL_BLOCK, StateTypes.FIRE_CORAL_BLOCK, StateTypes.HORN_CORAL_BLOCK,Line truncated
BlockTags.MINEABLE_SHOVEL.addTag(BlockTags.CONCRETE_POWDER).add(StateTypes.CLAY, StateTypes.DIRT, StateTypes.COARSE_DIRT, StateTypes.PODZOL, StateTypes.FARMLAND, StateTypes.GRASS_BLOCK, StateTypes.GRAVEL, StateTypes.MYCELIUM, StateTypes.SAND, StateTypes.RED_SAND, StateTypes.SNOW_BLOCK, StateTypes.SNOW, StateTypes.SOUL_SAND, StateTypes.DIRT_PATH, StateTypes.SOUL_SOIL, StateTypes.ROOTED_DIRT, StateTypes.MUDDY_MANGROVE_ROOTS, StateTypes.MUD, StateTypes.SUSPICIOUS_SAND, StateTypes.SUSPICIOUS_GRAVEL);
BlockTags.SWORD_EFFICIENT.addTag(BlockTags.LEAVES).addTag(BlockTags.SAPLINGS).addTag(BlockTags.SMALL_FLOWERS).addTag(BlockTags.CROPS).add(StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.ROSE_BUSH, StateTypes.PEONY, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.HANGING_ROOTS, StateTypes.PITCHER_PLANT, StateTypes.BROWN_MUSHROOM, StateTypes.RED_MUSHROOM, StateTypes.SUGAR_CANE, StateTypes.PUMPKIN, StateTypes.CARVED_PUMPKIN, StateTypes.JACK_O_LANTERN, StateTypes.MELON, StateTypes.ATTACHED_PUMPKIN_STEM, StateTypes.ATTACHED_MELON_STEM, StateTypes.LILY_PAD, StateTypes.COCOA, StateTypes.PITCHER_CROP, StateTypes.SWEET_BERRY_BUSH, StateTypes.CAVE_VINES, StateTypes.CAVE_VINES_PLANT, StateTypes.SPORE_BLOSSOM, StateTypes.MOSS_CARPET, StateTypes.PINK_PETALS, StateTypes.BIG_DRIPLEAF, StateTypes.BIG_DRIPLEAF_STEM, StateTypes.SMALL_DRIPLEAF, StateTypes.NETHER_WART, StateTypes.WARPED_FUNGUS, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_FUNGUS, StateTypes.WEEPING_VINES, StateTypes.WEEPING_VINES_PLANT, StateTypes.TWISTING_VINES, StateTypes.TWISTING_VINES_PLANT, StateTypes.CRIMSON_ROOTS, StateTypes.CHORUS_PLANT, StateTypes.CHORUS_FLOWER, StateTypes.PALE_MOSS_CARPET);
BlockTags.SWORD_EFFICIENT.addTag(BlockTags.LEAVES).addTag(BlockTags.SAPLINGS).addTag(BlockTags.CROPS).add(StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.ROSE_BUSH, StateTypes.PEONY, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.HANGING_ROOTS, StateTypes.PITCHER_PLANT, StateTypes.BROWN_MUSHROOM, StateTypes.RED_MUSHROOM, StateTypes.SUGAR_CANE, StateTypes.PUMPKIN, StateTypes.CARVED_PUMPKIN, StateTypes.JACK_O_LANTERN, StateTypes.MELON, StateTypes.ATTACHED_PUMPKIN_STEM, StateTypes.ATTACHED_MELON_STEM, StateTypes.LILY_PAD, StateTypes.COCOA, StateTypes.PITCHER_CROP, StateTypes.SWEET_BERRY_BUSH, StateTypes.CAVE_VINES, StateTypes.CAVE_VINES_PLANT, StateTypes.SPORE_BLOSSOM, StateTypes.PINK_PETALS, StateTypes.BIG_DRIPLEAF, StateTypes.BIG_DRIPLEAF_STEM, StateTypes.SMALL_DRIPLEAF, StateTypes.NETHER_WART, StateTypes.WARPED_FUNGUS, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_FUNGUS, StateTypes.WEEPING_VINES, StateTypes.WEEPING_VINES_PLANT, StateTypes.TWISTING_VINES, StateTypes.TWISTING_VINES_PLANT, StateTypes.CRIMSON_ROOTS, StateTypes.CHORUS_PLANT, StateTypes.CHORUS_FLOWER);
BlockTags.INCORRECT_FOR_IRON_TOOL.addTag(BlockTags.NEEDS_DIAMOND_TOOL);
BlockTags.INCORRECT_FOR_STONE_TOOL.addTag(BlockTags.NEEDS_DIAMOND_TOOL).addTag(BlockTags.NEEDS_IRON_TOOL);
BlockTags.INCORRECT_FOR_GOLD_TOOL.addTag(BlockTags.NEEDS_DIAMOND_TOOL).addTag(BlockTags.NEEDS_IRON_TOOL).addTag(BlockTags.NEEDS_STONE_TOOL);
@@ -425,7 +475,7 @@ public class BlockTags {
BlockTags.AZALEA_GROWS_ON.addTag(BlockTags.DIRT).addTag(BlockTags.SAND).addTag(BlockTags.TERRACOTTA).add(StateTypes.SNOW_BLOCK, StateTypes.POWDER_SNOW);
BlockTags.DEAD_BUSH_MAY_PLACE_ON.addTag(BlockTags.SAND).addTag(BlockTags.TERRACOTTA).addTag(BlockTags.DIRT);
BlockTags.SNAPS_GOAT_HORN.addTag(BlockTags.OVERWORLD_NATURAL_LOGS).add(StateTypes.STONE, StateTypes.PACKED_ICE, StateTypes.IRON_ORE, StateTypes.COAL_ORE, StateTypes.COPPER_ORE, StateTypes.EMERALD_ORE);
BlockTags.REPLACEABLE_BY_TREES.addTag(BlockTags.LEAVES).add(StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.ROSE_BUSH, StateTypes.PEONY, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.HANGING_ROOTS, StateTypes.PITCHER_PLANT, StateTypes.WATER, StateTypes.SEAGRASS, StateTypes.TALL_SEAGRASS, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_ROOTS);
BlockTags.REPLACEABLE_BY_TREES.addTag(BlockTags.LEAVES).addTag(BlockTags.SMALL_FLOWERS).add(StateTypes.PALE_MOSS_CARPET, StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.ROSE_BUSH, StateTypes.PEONY, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.HANGING_ROOTS, StateTypes.PITCHER_PLANT, StateTypes.WATER, StateTypes.SEAGRASS, StateTypes.TALL_SEAGRASS, StateTypes.WARPED_ROOTS, StateTypes.NETHER_SPROUTS, StateTypes.CRIMSON_ROOTS);
BlockTags.ENCHANTMENT_POWER_TRANSMITTER.addTag(BlockTags.REPLACEABLE);
BlockTags.DOES_NOT_BLOCK_HOPPERS.addTag(BlockTags.BEEHIVES);
BlockTags.LOGS.addTag(BlockTags.LOGS_THAT_BURN).addTag(BlockTags.CRIMSON_STEMS).addTag(BlockTags.WARPED_STEMS);
@@ -438,7 +488,8 @@ public class BlockTags {
BlockTags.MINEABLE_AXE.addTag(BlockTags.BANNERS).addTag(BlockTags.FENCE_GATES).addTag(BlockTags.LOGS).addTag(BlockTags.PLANKS).addTag(BlockTags.SAPLINGS).addTag(BlockTags.SIGNS).addTag(BlockTags.WOODEN_BUTTONS).addTag(BlockTags.WOODEN_DOORS).addTag(BlockTags.WOODEN_FENCES).addTag(BlockTags.WOODEN_PRESSURE_PLATES).addTag(BlockTags.WOODEN_SLABS).addTag(BlockTags.WOODEN_STAIRS).addTag(BlockTags.WOODEN_TRAPDOORS).addTag(BlockTags.ALL_HANGING_SIGNS).addTag(BlockTags.BAMBOO_BLOCKS).add(StateTypes.NOTE_BLOCK, StateTypes.ATTACHED_MELON_STEM, StateTypes.ATTACHED_PUMPKIN_STEM, StateTypes.AZALEA, StateTypes.BAMBOO, StateTypes.BARREL, StateTypes.BEE_NEST, StateTypes.BEEHIVE, StateTypes.BEETROOTS, StateTypes.BIG_DRIPLEAF_STEM, StateTypes.BIG_DRIPLEAF, StateTypes.BOOKSHELF, StateTypes.BROWN_MUSHROOM_BLOCK, StateTypes.BROWN_MUSHROOM, StateTypes.CAMPFIRE, StateTypes.CARROTS, StateTypes.CARTOGRAPHY_TABLE, StateTypes.CARVED_PUMPKIN, StateTypes.CAVE_VINES_PLANT, StateTypes.CAVE_VINES, StateTypes.CHEST, StateTypes.CHORUS_FLOWER, StateTypes.CHORUS_PLANT, StateTypes.COCOA, StateTypes.COMPOSTER, StateTypes.CRAFTING_TABLE, StateTypes.CRIMSON_FUNGUS, StateTypes.DAYLIGHT_DETECTOR, StateTypes.DEAD_BUSH, StateTypes.FERN, StateTypes.FLETCHING_TABLE, StateTypes.GLOW_LICHEN, StateTypes.SHORT_GRASS, StateTypes.HANGING_ROOTS, StateTypes.JACK_O_LANTERN, StateTypes.JUKEBOX, StateTypes.LADDER, StateTypes.LARGE_FERN, StateTypes.LECTERN, StateTypes.LILY_PAD, StateTypes.LOOM, StateTypes.MELON_STEM, StateTypes.MELON, StateTypes.MUSHROOM_STEM, StateTypes.NETHER_WART, StateTypes.POTATOES, StateTypes.PUMPKIN_STEM, StateTypes.PUMPKIN, StateTypes.RED_MUSHROOM_BLOCK, StateTypes.RED_MUSHROOM, StateTypes.SCAFFOLDING, StateTypes.SMALL_DRIPLEAF, StateTypes.SMITHING_TABLE, StateTypes.SOUL_CAMPFIRE, StateTypes.SPORE_BLOSSOM, StateTypes.SUGAR_CANE, StateTypes.SWEET_BERRY_BUSH, StateTypes.TALL_GRASS, StateTypes.TRAPPED_CHEST, StateTypes.TWISTING_VINES_PLANT, StateTypes.TWISTING_VINES, StateTypes.VINE, StateTypes.WARPED_FUNGUS, StateTypes.WEEPING_VINES_PLANT, StateTypes.WEEPING_VINES, StateTypes.WHEAT, StateTypes.MANGROVE_ROOTS, StateTypes.BAMBOO_MOSAIC, StateTypes.BAMBOO_MOSAIC_SLAB, StateTypes.BAMBOO_MOSAIC_STAIRS, StateTypes.CHISELED_BOOKSHELF, StateTypes.CREAKING_HEART);
BlockTags.LAVA_POOL_STONE_CANNOT_REPLACE.addTag(BlockTags.FEATURES_CANNOT_REPLACE).addTag(BlockTags.LEAVES).addTag(BlockTags.LOGS);
BlockTags.PARROTS_SPAWNABLE_ON.addTag(BlockTags.LEAVES).addTag(BlockTags.LOGS).add(StateTypes.GRASS_BLOCK, StateTypes.AIR);
// Legacy/Unofficial, I don't know
// legacy
BlockTags.TALL_FLOWERS.add(StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.PEONY, StateTypes.ROSE_BUSH, StateTypes.PITCHER_PLANT);
BlockTags.AZALEA_GROWS_ON.addTag(BlockTags.DIRT).addTag(BlockTags.SAND).addTag(BlockTags.TERRACOTTA).add(StateTypes.SNOW_BLOCK, StateTypes.POWDER_SNOW);
BlockTags.REPLACEABLE_PLANTS.add(StateTypes.SHORT_GRASS, StateTypes.FERN, StateTypes.DEAD_BUSH, StateTypes.VINE, StateTypes.GLOW_LICHEN, StateTypes.SUNFLOWER, StateTypes.LILAC, StateTypes.ROSE_BUSH, StateTypes.PEONY, StateTypes.TALL_GRASS, StateTypes.LARGE_FERN, StateTypes.HANGING_ROOTS, StateTypes.PITCHER_PLANT);
// Unofficial blocks to help packetevents users
@@ -75,7 +75,15 @@ public class ItemTags {
public static final ItemTags SMALL_FLOWERS = bind("small_flowers");
public static final ItemTags BEDS = bind("beds");
public static final ItemTags FENCES = bind("fences");
/**
* Removed with 1.21.4
*/
@Deprecated
public static final ItemTags TALL_FLOWERS = bind("tall_flowers");
/**
* Removed with 1.21.4
*/
@Deprecated
public static final ItemTags FLOWERS = bind("flowers");
public static final ItemTags PIGLIN_REPELLENTS = bind("piglin_repellents");
public static final ItemTags PIGLIN_LOVED = bind("piglin_loved");
@@ -122,6 +130,10 @@ public class ItemTags {
public static final ItemTags NOTEBLOCK_TOP_INSTRUMENTS = bind("noteblock_top_instruments");
public static final ItemTags TRIMMABLE_ARMOR = bind("trimmable_armor");
public static final ItemTags TRIM_MATERIALS = bind("trim_materials");
/**
* Removed with 1.21.4
*/
@Deprecated
public static final ItemTags TRIM_TEMPLATES = bind("trim_templates");
public static final ItemTags SNIFFER_FOOD = bind("sniffer_food");
public static final ItemTags DECORATED_POT_SHERDS = bind("decorated_pot_sherds");
@@ -132,91 +144,341 @@ public class ItemTags {
public static final ItemTags PICKAXES = bind("pickaxes");
public static final ItemTags SHOVELS = bind("shovels");
public static final ItemTags BREAKS_DECORATED_POTS = bind("breaks_decorated_pots");
@Deprecated // removed in 1.20.5 as "duplicate"
/**
* Removed in 1.20.5 as "duplicate"
*/
@Deprecated
public static final ItemTags TOOLS = BREAKS_DECORATED_POTS;
public static final ItemTags VILLAGER_PLANTABLE_SEEDS = bind("villager_plantable_seeds");
// Added in 1.20.5
/**
* Added with 1.20.5
*/
public static final ItemTags ARMADILLO_FOOD = bind("armadillo_food");
/**
* Added with 1.20.5
*/
public static final ItemTags AXOLOTL_FOOD = bind("axolotl_food");
@Deprecated // renamed in 1.20.5
/**
* Renamed to {@link #AXOLOTL_FOOD} in 1.20.5
*/
@Deprecated
public static final ItemTags AXOLOTL_TEMPT_ITEMS = AXOLOTL_FOOD;
/**
* Added with 1.20.5
*/
public static final ItemTags BEE_FOOD = bind("bee_food");
/**
* Added with 1.20.5
*/
public static final ItemTags CAMEL_FOOD = bind("camel_food");
/**
* Added with 1.20.5
*/
public static final ItemTags CAT_FOOD = bind("cat_food");
/**
* Added with 1.20.5
*/
public static final ItemTags CHEST_ARMOR = bind("chest_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags CHICKEN_FOOD = bind("chicken_food");
/**
* Added with 1.20.5
*/
public static final ItemTags COW_FOOD = bind("cow_food");
/**
* Added with 1.20.5
*/
public static final ItemTags DYEABLE = bind("dyeable");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_ARMOR = bind("enchantable/armor");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_BOW = bind("enchantable/bow");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_CHEST_ARMOR = bind("enchantable/chest_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_CROSSBOW = bind("enchantable/crossbow");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_DURABILITY = bind("enchantable/durability");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_EQUIPPABLE = bind("enchantable/equippable");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_FIRE_ASPECT = bind("enchantable/fire_aspect");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_FISHING = bind("enchantable/fishing");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_FOOT_ARMOR = bind("enchantable/foot_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_HEAD_ARMOR = bind("enchantable/head_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_LEG_ARMOR = bind("enchantable/leg_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_MACE = bind("enchantable/mace");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_MINING = bind("enchantable/mining");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_MINING_LOOT = bind("enchantable/mining_loot");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_SHARP_WEAPON = bind("enchantable/sharp_weapon");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_SWORD = bind("enchantable/sword");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_TRIDENT = bind("enchantable/trident");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_VANISHING = bind("enchantable/vanishing");
/**
* Added with 1.20.5
*/
public static final ItemTags ENCHANTABLE_WEAPON = bind("enchantable/weapon");
/**
* Added with 1.20.5
*/
public static final ItemTags FOOT_ARMOR = bind("foot_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags FROG_FOOD = bind("frog_food");
/**
* Added with 1.20.5
*/
public static final ItemTags GOAT_FOOD = bind("goat_food");
/**
* Added with 1.20.5
*/
public static final ItemTags HEAD_ARMOR = bind("head_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags HOGLIN_FOOD = bind("hoglin_food");
/**
* Added with 1.20.5
*/
public static final ItemTags HORSE_FOOD = bind("horse_food");
/**
* Added with 1.20.5
*/
public static final ItemTags HORSE_TEMPT_ITEMS = bind("horse_tempt_items");
/**
* Added with 1.20.5
*/
public static final ItemTags LEG_ARMOR = bind("leg_armor");
/**
* Added with 1.20.5
*/
public static final ItemTags LLAMA_FOOD = bind("llama_food");
/**
* Added with 1.20.5
*/
public static final ItemTags LLAMA_TEMPT_ITEMS = bind("llama_tempt_items");
/**
* Added with 1.20.5
*/
public static final ItemTags MEAT = bind("meat");
/**
* Added with 1.20.5
*/
public static final ItemTags OCELOT_FOOD = bind("ocelot_food");
/**
* Added with 1.20.5
*/
public static final ItemTags PANDA_FOOD = bind("panda_food");
/**
* Added with 1.20.5
*/
public static final ItemTags PARROT_FOOD = bind("parrot_food");
/**
* Added with 1.20.5
*/
public static final ItemTags PARROT_POISONOUS_FOOD = bind("parrot_poisonous_food");
/**
* Added with 1.20.5
*/
public static final ItemTags PIG_FOOD = bind("pig_food");
/**
* Added with 1.20.5
*/
public static final ItemTags RABBIT_FOOD = bind("rabbit_food");
/**
* Added with 1.20.5
*/
public static final ItemTags SHEEP_FOOD = bind("sheep_food");
/**
* Added with 1.20.5
*/
public static final ItemTags SKULLS = bind("skulls");
/**
* Added with 1.20.5
*/
public static final ItemTags STRIDER_FOOD = bind("strider_food");
/**
* Added with 1.20.5
*/
public static final ItemTags STRIDER_TEMPT_ITEMS = bind("strider_tempt_items");
/**
* Added with 1.20.5
*/
public static final ItemTags TURTLE_FOOD = bind("turtle_food");
/**
* Added with 1.20.5
*/
public static final ItemTags WOLF_FOOD = bind("wolf_food");
// added with 1.21.2
/**
* Added with 1.21.2
*/
public static final ItemTags PALE_OAK_LOGS = bind("pale_oak_logs");
/**
* Added with 1.21.2
*/
public static final ItemTags PIGLIN_SAFE_ARMOR = bind("piglin_safe_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags DUPLICATES_ALLAYS = bind("duplicates_allays");
/**
* Added with 1.21.2
*/
public static final ItemTags BREWING_FUEL = bind("brewing_fuel");
/**
* Added with 1.21.2
*/
public static final ItemTags SHULKER_BOXES = bind("shulker_boxes");
/**
* Added with 1.21.2
*/
public static final ItemTags IRON_TOOL_MATERIALS = bind("iron_tool_materials");
/**
* Added with 1.21.2
*/
public static final ItemTags GOLD_TOOL_MATERIALS = bind("gold_tool_materials");
/**
* Added with 1.21.2
*/
public static final ItemTags DIAMOND_TOOL_MATERIALS = bind("diamond_tool_materials");
/**
* Added with 1.21.2
*/
public static final ItemTags NETHERITE_TOOL_MATERIALS = bind("netherite_tool_materials");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_LEATHER_ARMOR = bind("repairs_leather_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_CHAIN_ARMOR = bind("repairs_chain_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_IRON_ARMOR = bind("repairs_iron_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_GOLD_ARMOR = bind("repairs_gold_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_DIAMOND_ARMOR = bind("repairs_diamond_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_NETHERITE_ARMOR = bind("repairs_netherite_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_TURTLE_HELMET = bind("repairs_turtle_helmet");
/**
* Added with 1.21.2
*/
public static final ItemTags REPAIRS_WOLF_ARMOR = bind("repairs_wolf_armor");
/**
* Added with 1.21.2
*/
public static final ItemTags FURNACE_MINECART_FUEL = bind("furnace_minecart_fuel");
/**
* Added with 1.21.2
*/
public static final ItemTags BUNDLES = bind("bundles");
/**
* Added with 1.21.2
*/
public static final ItemTags MAP_INVISIBILITY_EQUIPMENT = bind("map_invisibility_equipment");
/**
* Added with 1.21.2
*/
public static final ItemTags GAZE_DISGUISE_EQUIPMENT = bind("gaze_disguise_equipment");
/**
* Added with 1.21.2
*/
public static final ItemTags PANDA_EATS_FROM_GROUND = bind("panda_eats_from_ground");
/**
* Added with 1.21.2
*/
public static final ItemTags WOODEN_TOOL_MATERIALS = bind("wooden_tool_materials");
/**
* Added with 1.21.2
*/
public static final ItemTags VILLAGER_PICKS_UP = bind("villager_picks_up");
/**
* Added with 1.21.4
*/
public static final ItemTags SKELETON_PREFERRED_WEAPONS = bind("skeleton_preferred_weapons");
/**
* Added with 1.21.4
*/
public static final ItemTags DROWNED_PREFERRED_WEAPONS = bind("drowned_preferred_weapons");
/**
* Added with 1.21.4
*/
public static final ItemTags PIGLIN_PREFERRED_WEAPONS = bind("piglin_preferred_weapons");
/**
* Added with 1.21.4
*/
public static final ItemTags PILLAGER_PREFERRED_WEAPONS = bind("pillager_preferred_weapons");
/**
* Added with 1.21.4
*/
public static final ItemTags WITHER_SKELETON_DISLIKED_WEAPONS = bind("wither_skeleton_disliked_weapons");
static {
copy(BlockTags.WOOL, ItemTags.WOOL);
copy(BlockTags.PLANKS, ItemTags.PLANKS);
@@ -254,7 +516,6 @@ public class ItemTags {
copy(BlockTags.LEAVES, ItemTags.LEAVES);
copy(BlockTags.SMALL_FLOWERS, ItemTags.SMALL_FLOWERS);
copy(BlockTags.BEDS, ItemTags.BEDS);
copy(BlockTags.TALL_FLOWERS, ItemTags.TALL_FLOWERS);
ItemTags.PIGLIN_REPELLENTS.add(ItemTypes.SOUL_TORCH, ItemTypes.SOUL_LANTERN, ItemTypes.SOUL_CAMPFIRE);
ItemTags.IGNORED_BY_PIGLIN_BABIES.add(ItemTypes.LEATHER);
ItemTags.PIGLIN_SAFE_ARMOR.add(ItemTypes.GOLDEN_HELMET, ItemTypes.GOLDEN_CHESTPLATE, ItemTypes.GOLDEN_LEGGINGS, ItemTypes.GOLDEN_BOOTS);
@@ -273,6 +534,7 @@ public class ItemTags {
ItemTags.HORSE_TEMPT_ITEMS.add(ItemTypes.GOLDEN_CARROT, ItemTypes.GOLDEN_APPLE, ItemTypes.ENCHANTED_GOLDEN_APPLE);
ItemTags.CAMEL_FOOD.add(ItemTypes.CACTUS);
ItemTags.ARMADILLO_FOOD.add(ItemTypes.SPIDER_EYE);
copy(BlockTags.BEE_ATTRACTIVE, ItemTags.BEE_FOOD);
ItemTags.CHICKEN_FOOD.add(ItemTypes.WHEAT_SEEDS, ItemTypes.MELON_SEEDS, ItemTypes.PUMPKIN_SEEDS, ItemTypes.BEETROOT_SEEDS, ItemTypes.TORCHFLOWER_SEEDS, ItemTypes.PITCHER_POD);
ItemTags.FROG_FOOD.add(ItemTypes.SLIME_BALL);
ItemTags.HOGLIN_FOOD.add(ItemTypes.CRIMSON_FUNGUS);
@@ -300,7 +562,7 @@ public class ItemTags {
copy(BlockTags.CANDLES, ItemTags.CANDLES);
copy(BlockTags.DIRT, ItemTags.DIRT);
copy(BlockTags.TERRACOTTA, ItemTags.TERRACOTTA);
ItemTags.CHEST_BOATS.add(ItemTypes.OAK_CHEST_BOAT, ItemTypes.SPRUCE_CHEST_BOAT, ItemTypes.BIRCH_CHEST_BOAT, ItemTypes.JUNGLE_CHEST_BOAT, ItemTypes.ACACIA_CHEST_BOAT, ItemTypes.DARK_OAK_CHEST_BOAT, ItemTypes.MANGROVE_CHEST_BOAT, ItemTypes.BAMBOO_CHEST_RAFT, ItemTypes.CHERRY_CHEST_BOAT, ItemTypes.PALE_OAK_CHEST_BOAT);
ItemTags.CHEST_BOATS.add(ItemTypes.OAK_CHEST_BOAT, ItemTypes.SPRUCE_CHEST_BOAT, ItemTypes.BIRCH_CHEST_BOAT, ItemTypes.JUNGLE_CHEST_BOAT, ItemTypes.ACACIA_CHEST_BOAT, ItemTypes.DARK_OAK_CHEST_BOAT, ItemTypes.PALE_OAK_CHEST_BOAT, ItemTypes.MANGROVE_CHEST_BOAT, ItemTypes.BAMBOO_CHEST_RAFT, ItemTypes.CHERRY_CHEST_BOAT);
ItemTags.FISHES.add(ItemTypes.COD, ItemTypes.COOKED_COD, ItemTypes.SALMON, ItemTypes.COOKED_SALMON, ItemTypes.PUFFERFISH, ItemTypes.TROPICAL_FISH);
copy(BlockTags.STANDING_SIGNS, ItemTags.SIGNS);
ItemTags.CREEPER_DROP_MUSIC_DISCS.add(ItemTypes.MUSIC_DISC_13, ItemTypes.MUSIC_DISC_CAT, ItemTypes.MUSIC_DISC_BLOCKS, ItemTypes.MUSIC_DISC_CHIRP, ItemTypes.MUSIC_DISC_FAR, ItemTypes.MUSIC_DISC_MALL, ItemTypes.MUSIC_DISC_MELLOHI, ItemTypes.MUSIC_DISC_STAL, ItemTypes.MUSIC_DISC_STRAD, ItemTypes.MUSIC_DISC_WARD, ItemTypes.MUSIC_DISC_11, ItemTypes.MUSIC_DISC_WAIT);
@@ -334,8 +596,7 @@ public class ItemTags {
ItemTags.CHEST_ARMOR.add(ItemTypes.LEATHER_CHESTPLATE, ItemTypes.CHAINMAIL_CHESTPLATE, ItemTypes.GOLDEN_CHESTPLATE, ItemTypes.IRON_CHESTPLATE, ItemTypes.DIAMOND_CHESTPLATE, ItemTypes.NETHERITE_CHESTPLATE);
ItemTags.HEAD_ARMOR.add(ItemTypes.LEATHER_HELMET, ItemTypes.CHAINMAIL_HELMET, ItemTypes.GOLDEN_HELMET, ItemTypes.IRON_HELMET, ItemTypes.DIAMOND_HELMET, ItemTypes.NETHERITE_HELMET, ItemTypes.TURTLE_HELMET);
ItemTags.SKULLS.add(ItemTypes.PLAYER_HEAD, ItemTypes.CREEPER_HEAD, ItemTypes.ZOMBIE_HEAD, ItemTypes.SKELETON_SKULL, ItemTypes.WITHER_SKELETON_SKULL, ItemTypes.DRAGON_HEAD, ItemTypes.PIGLIN_HEAD);
ItemTags.TRIM_MATERIALS.add(ItemTypes.IRON_INGOT, ItemTypes.COPPER_INGOT, ItemTypes.GOLD_INGOT, ItemTypes.LAPIS_LAZULI, ItemTypes.EMERALD, ItemTypes.DIAMOND, ItemTypes.NETHERITE_INGOT, ItemTypes.REDSTONE, ItemTypes.QUARTZ, ItemTypes.AMETHYST_SHARD);
ItemTags.TRIM_TEMPLATES.add(ItemTypes.WARD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.COAST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.EYE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.WILD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.RIB_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.VEX_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.HOST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.FLOW_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE);
ItemTags.TRIM_MATERIALS.add(ItemTypes.AMETHYST_SHARD, ItemTypes.COPPER_INGOT, ItemTypes.DIAMOND, ItemTypes.EMERALD, ItemTypes.GOLD_INGOT, ItemTypes.IRON_INGOT, ItemTypes.LAPIS_LAZULI, ItemTypes.NETHERITE_INGOT, ItemTypes.QUARTZ, ItemTypes.REDSTONE, ItemTypes.RESIN_BRICK);
ItemTags.DECORATED_POT_SHERDS.add(ItemTypes.ANGLER_POTTERY_SHERD, ItemTypes.ARCHER_POTTERY_SHERD, ItemTypes.ARMS_UP_POTTERY_SHERD, ItemTypes.BLADE_POTTERY_SHERD, ItemTypes.BREWER_POTTERY_SHERD, ItemTypes.BURN_POTTERY_SHERD, ItemTypes.DANGER_POTTERY_SHERD, ItemTypes.EXPLORER_POTTERY_SHERD, ItemTypes.FRIEND_POTTERY_SHERD, ItemTypes.HEART_POTTERY_SHERD, ItemTypes.HEARTBREAK_POTTERY_SHERD, ItemTypes.HOWL_POTTERY_SHERD, ItemTypes.MINER_POTTERY_SHERD, ItemTypes.MOURNER_POTTERY_SHERD, ItemTypes.PLENTY_POTTERY_SHERD, ItemTypes.PRIZE_POTTERY_SHERD, ItemTypes.SHEAF_POTTERY_SHERD, ItemTypes.SHELTER_POTTERY_SHERD, ItemTypes.SKULL_POTTERY_SHERD, ItemTypes.SNORT_POTTERY_SHERD, ItemTypes.FLOW_POTTERY_SHERD, ItemTypes.GUSTER_POTTERY_SHERD, ItemTypes.SCRAPE_POTTERY_SHERD);
ItemTags.SWORDS.add(ItemTypes.DIAMOND_SWORD, ItemTypes.STONE_SWORD, ItemTypes.GOLDEN_SWORD, ItemTypes.NETHERITE_SWORD, ItemTypes.WOODEN_SWORD, ItemTypes.IRON_SWORD);
ItemTags.AXES.add(ItemTypes.DIAMOND_AXE, ItemTypes.STONE_AXE, ItemTypes.GOLDEN_AXE, ItemTypes.NETHERITE_AXE, ItemTypes.WOODEN_AXE, ItemTypes.IRON_AXE);
@@ -346,10 +607,15 @@ public class ItemTags {
ItemTags.DYEABLE.add(ItemTypes.LEATHER_HELMET, ItemTypes.LEATHER_CHESTPLATE, ItemTypes.LEATHER_LEGGINGS, ItemTypes.LEATHER_BOOTS, ItemTypes.LEATHER_HORSE_ARMOR, ItemTypes.WOLF_ARMOR);
copy(ItemTags.COALS, ItemTags.FURNACE_MINECART_FUEL);
ItemTags.BUNDLES.add(ItemTypes.BUNDLE, ItemTypes.BLACK_BUNDLE, ItemTypes.BLUE_BUNDLE, ItemTypes.BROWN_BUNDLE, ItemTypes.CYAN_BUNDLE, ItemTypes.GRAY_BUNDLE, ItemTypes.GREEN_BUNDLE, ItemTypes.LIGHT_BLUE_BUNDLE, ItemTypes.LIGHT_GRAY_BUNDLE, ItemTypes.LIME_BUNDLE, ItemTypes.MAGENTA_BUNDLE, ItemTypes.ORANGE_BUNDLE, ItemTypes.PINK_BUNDLE, ItemTypes.PURPLE_BUNDLE, ItemTypes.RED_BUNDLE, ItemTypes.YELLOW_BUNDLE, ItemTypes.WHITE_BUNDLE);
ItemTags.SKELETON_PREFERRED_WEAPONS.add(ItemTypes.BOW);
ItemTags.DROWNED_PREFERRED_WEAPONS.add(ItemTypes.TRIDENT);
ItemTags.PIGLIN_PREFERRED_WEAPONS.add(ItemTypes.CROSSBOW);
copy(ItemTags.PIGLIN_PREFERRED_WEAPONS, ItemTags.PILLAGER_PREFERRED_WEAPONS);
ItemTags.WITHER_SKELETON_DISLIKED_WEAPONS.add(ItemTypes.BOW, ItemTypes.CROSSBOW);
ItemTags.ENCHANTABLE_FISHING.add(ItemTypes.FISHING_ROD);
ItemTags.ENCHANTABLE_TRIDENT.add(ItemTypes.TRIDENT);
ItemTags.ENCHANTABLE_BOW.add(ItemTypes.BOW);
ItemTags.ENCHANTABLE_CROSSBOW.add(ItemTypes.CROSSBOW);
copy(ItemTags.DROWNED_PREFERRED_WEAPONS, ItemTags.ENCHANTABLE_TRIDENT);
copy(ItemTags.SKELETON_PREFERRED_WEAPONS, ItemTags.ENCHANTABLE_BOW);
copy(ItemTags.PIGLIN_PREFERRED_WEAPONS, ItemTags.ENCHANTABLE_CROSSBOW);
ItemTags.ENCHANTABLE_MACE.add(ItemTypes.MACE);
ItemTags.MAP_INVISIBILITY_EQUIPMENT.add(ItemTypes.CARVED_PUMPKIN);
copy(ItemTags.MAP_INVISIBILITY_EQUIPMENT, ItemTags.GAZE_DISGUISE_EQUIPMENT);
@@ -360,12 +626,11 @@ public class ItemTags {
copy(BlockTags.SLABS, ItemTags.SLABS);
copy(BlockTags.TRAPDOORS, ItemTags.TRAPDOORS);
copy(BlockTags.FENCES, ItemTags.FENCES);
copy(BlockTags.FLOWERS, ItemTags.FLOWERS);
ItemTags.PIGLIN_LOVED.addTag(ItemTags.GOLD_ORES).add(ItemTypes.GOLD_BLOCK, ItemTypes.GILDED_BLACKSTONE, ItemTypes.LIGHT_WEIGHTED_PRESSURE_PLATE, ItemTypes.GOLD_INGOT, ItemTypes.BELL, ItemTypes.CLOCK, ItemTypes.GOLDEN_CARROT, ItemTypes.GLISTERING_MELON_SLICE, ItemTypes.GOLDEN_APPLE, ItemTypes.ENCHANTED_GOLDEN_APPLE, ItemTypes.GOLDEN_HELMET, ItemTypes.GOLDEN_CHESTPLATE, ItemTypes.GOLDEN_LEGGINGS, ItemTypes.GOLDEN_BOOTS, ItemTypes.GOLDEN_HORSE_ARMOR, ItemTypes.GOLDEN_SWORD, ItemTypes.GOLDEN_PICKAXE, ItemTypes.GOLDEN_SHOVEL, ItemTypes.GOLDEN_AXE, ItemTypes.GOLDEN_HOE, ItemTypes.RAW_GOLD, ItemTypes.RAW_GOLD_BLOCK);
ItemTags.WOLF_FOOD.addTag(ItemTags.MEAT).add(ItemTypes.COD, ItemTypes.COOKED_COD, ItemTypes.SALMON, ItemTypes.COOKED_SALMON, ItemTypes.TROPICAL_FISH, ItemTypes.PUFFERFISH, ItemTypes.RABBIT_STEW);
ItemTags.PANDA_EATS_FROM_GROUND.addTag(ItemTags.PANDA_FOOD).add(ItemTypes.CAKE);
ItemTags.STRIDER_TEMPT_ITEMS.addTag(ItemTags.STRIDER_FOOD).add(ItemTypes.WARPED_FUNGUS_ON_A_STICK);
ItemTags.BOATS.addTag(ItemTags.CHEST_BOATS).add(ItemTypes.OAK_BOAT, ItemTypes.SPRUCE_BOAT, ItemTypes.BIRCH_BOAT, ItemTypes.JUNGLE_BOAT, ItemTypes.ACACIA_BOAT, ItemTypes.DARK_OAK_BOAT, ItemTypes.MANGROVE_BOAT, ItemTypes.BAMBOO_RAFT, ItemTypes.CHERRY_BOAT, ItemTypes.PALE_OAK_BOAT);
ItemTags.BOATS.addTag(ItemTags.CHEST_BOATS).add(ItemTypes.OAK_BOAT, ItemTypes.SPRUCE_BOAT, ItemTypes.BIRCH_BOAT, ItemTypes.JUNGLE_BOAT, ItemTypes.ACACIA_BOAT, ItemTypes.DARK_OAK_BOAT, ItemTypes.PALE_OAK_BOAT, ItemTypes.MANGROVE_BOAT, ItemTypes.BAMBOO_RAFT, ItemTypes.CHERRY_BOAT);
ItemTags.WOODEN_TOOL_MATERIALS.addTag(ItemTags.PLANKS);
copy(BlockTags.DAMPENS_VIBRATIONS, ItemTags.DAMPENS_VIBRATIONS);
ItemTags.TRIMMABLE_ARMOR.addTag(ItemTags.FOOT_ARMOR).addTag(ItemTags.LEG_ARMOR).addTag(ItemTags.CHEST_ARMOR).addTag(ItemTags.HEAD_ARMOR);
@@ -383,19 +648,21 @@ public class ItemTags {
ItemTags.ENCHANTABLE_DURABILITY.addTag(ItemTags.FOOT_ARMOR).addTag(ItemTags.LEG_ARMOR).addTag(ItemTags.CHEST_ARMOR).addTag(ItemTags.HEAD_ARMOR).addTag(ItemTags.SWORDS).addTag(ItemTags.AXES).addTag(ItemTags.PICKAXES).addTag(ItemTags.SHOVELS).addTag(ItemTags.HOES).add(ItemTypes.ELYTRA, ItemTypes.SHIELD, ItemTypes.BOW, ItemTypes.CROSSBOW, ItemTypes.TRIDENT, ItemTypes.FLINT_AND_STEEL, ItemTypes.SHEARS, ItemTypes.BRUSH, ItemTypes.FISHING_ROD, ItemTypes.CARROT_ON_A_STICK, ItemTypes.WARPED_FUNGUS_ON_A_STICK, ItemTypes.MACE);
ItemTags.ENCHANTABLE_EQUIPPABLE.addTag(ItemTags.FOOT_ARMOR).addTag(ItemTags.LEG_ARMOR).addTag(ItemTags.CHEST_ARMOR).addTag(ItemTags.HEAD_ARMOR).addTag(ItemTags.SKULLS).add(ItemTypes.ELYTRA, ItemTypes.CARVED_PUMPKIN);
copy(BlockTags.LOGS, ItemTags.LOGS);
ItemTags.BEE_FOOD.addTag(ItemTags.FLOWERS);
ItemTags.ENCHANTABLE_ARMOR.addTag(ItemTags.ENCHANTABLE_FOOT_ARMOR).addTag(ItemTags.ENCHANTABLE_LEG_ARMOR).addTag(ItemTags.ENCHANTABLE_CHEST_ARMOR).addTag(ItemTags.ENCHANTABLE_HEAD_ARMOR);
ItemTags.ENCHANTABLE_FIRE_ASPECT.addTag(ItemTags.ENCHANTABLE_SWORD).add(ItemTypes.MACE);
ItemTags.ENCHANTABLE_WEAPON.addTag(ItemTags.ENCHANTABLE_SHARP_WEAPON).add(ItemTypes.MACE);
ItemTags.ENCHANTABLE_VANISHING.addTag(ItemTags.ENCHANTABLE_DURABILITY).addTag(ItemTags.SKULLS).add(ItemTypes.COMPASS, ItemTypes.CARVED_PUMPKIN);
copy(BlockTags.COMPLETES_FIND_TREE_TUTORIAL, ItemTags.COMPLETES_FIND_TREE_TUTORIAL);
// deprecated tags
// deprecated/legacy tags
for (ItemType type : ItemTypes.getRegistry().getEntries()) {
if (type.getComponents().has(ComponentTypes.JUKEBOX_PLAYABLE)) {
ItemTags.MUSIC_DISCS.add(type);
}
}
copy(BlockTags.TALL_FLOWERS, ItemTags.TALL_FLOWERS);
copy(BlockTags.FLOWERS, ItemTags.FLOWERS);
ItemTags.TRIM_TEMPLATES.add(ItemTypes.WARD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.COAST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.EYE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.WILD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.RIB_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.VEX_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.HOST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.FLOW_ARMOR_TRIM_SMITHING_TEMPLATE, ItemTypes.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE);
}
String name;
@@ -18,6 +18,12 @@
package com.github.retrooper.packetevents.protocol.world.states.enums;
import org.jetbrains.annotations.ApiStatus;
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public enum CreakingHeartState {
DISABLED,
@@ -1184,6 +1184,19 @@ public class StateTypes {
public static StateType PALE_MOSS_CARPET = StateTypes.builder().name("PALE_MOSS_CARPET").blastResistance(0.1f).hardness(0.1f).isBlocking(true).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.PLANT).build();
public static StateType PALE_HANGING_MOSS = StateTypes.builder().name("PALE_HANGING_MOSS").blastResistance(0.1f).hardness(0.1f).isBlocking(false).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.PLANT).build();
// 1.21.4 added types
public static StateType RESIN_CLUMP = StateTypes.builder().name("RESIN_CLUMP").blastResistance(0.0f).hardness(0.0f).isBlocking(false).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.RESIN).build();
public static StateType RESIN_BLOCK = StateTypes.builder().name("RESIN_BLOCK").blastResistance(0.0f).hardness(0.0f).isBlocking(true).requiresCorrectTool(false).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType RESIN_BRICKS = StateTypes.builder().name("RESIN_BRICKS").blastResistance(6.0f).hardness(1.5f).isBlocking(true).requiresCorrectTool(true).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType RESIN_BRICK_STAIRS = StateTypes.builder().name("RESIN_BRICK_STAIRS").blastResistance(6.0f).hardness(1.5f).isBlocking(true).requiresCorrectTool(true).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType RESIN_BRICK_SLAB = StateTypes.builder().name("RESIN_BRICK_SLAB").blastResistance(6.0f).hardness(1.5f).isBlocking(true).requiresCorrectTool(true).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType RESIN_BRICK_WALL = StateTypes.builder().name("RESIN_BRICK_WALL").blastResistance(6.0f).hardness(1.5f).isBlocking(true).requiresCorrectTool(true).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType CHISELED_RESIN_BRICKS = StateTypes.builder().name("CHISELED_RESIN_BRICKS").blastResistance(6.0f).hardness(1.5f).isBlocking(true).requiresCorrectTool(true).isSolid(true).setMaterial(MaterialType.RESIN).build();
public static StateType OPEN_EYEBLOSSOM = StateTypes.builder().name("OPEN_EYEBLOSSOM").blastResistance(0.0f).hardness(0.0f).isBlocking(false).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.PLANT).build();
public static StateType CLOSED_EYEBLOSSOM = StateTypes.builder().name("CLOSED_EYEBLOSSOM").blastResistance(0.0f).hardness(0.0f).isBlocking(false).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.PLANT).build();
public static StateType POTTED_OPEN_EYEBLOSSOM = StateTypes.builder().name("POTTED_OPEN_EYEBLOSSOM").blastResistance(0.0f).hardness(0.0f).isBlocking(true).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.DECORATION).build();
public static StateType POTTED_CLOSED_EYEBLOSSOM = StateTypes.builder().name("POTTED_CLOSED_EYEBLOSSOM").blastResistance(0.0f).hardness(0.0f).isBlocking(true).requiresCorrectTool(false).isSolid(false).setMaterial(MaterialType.DECORATION).build();
static {
TYPES_BUILDER.unloadFileMappings();
}
@@ -43,6 +43,7 @@ import com.github.retrooper.packetevents.protocol.world.states.enums.VaultState;
import com.github.retrooper.packetevents.protocol.world.states.enums.VerticalDirection;
import com.github.retrooper.packetevents.protocol.world.states.enums.West;
import net.kyori.adventure.util.Index;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
@@ -135,7 +136,20 @@ public enum StateValue {
VERTICAL_DIRECTION("vertical_direction", VerticalDirection.class, VerticalDirection::valueOf),
WATERLOGGED("waterlogged", boolean.class, Boolean::parseBoolean),
WEST("west", West.class, West::valueOf),
CREAKING("creaking", CreakingHeartState.class, CreakingHeartState::valueOf);
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
CREAKING("creaking", CreakingHeartState.class, CreakingHeartState::valueOf),
/**
* Added with 1.21.4
*/
ACTIVE("active", boolean.class, Boolean::parseBoolean),
/**
* Added with 1.21.4
*/
NATURAL("natural", boolean.class, Boolean::parseBoolean),
;
public static final Index<String, StateValue> NAME_INDEX = Index.create(
StateValue.class, StateValue::getName);
@@ -0,0 +1,125 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.util;
import com.github.retrooper.packetevents.protocol.component.ComponentType.Decoder;
import com.github.retrooper.packetevents.protocol.component.ComponentType.Encoder;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTInt;
import com.github.retrooper.packetevents.protocol.nbt.NBTList;
import com.github.retrooper.packetevents.protocol.nbt.NBTType;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class RandomWeightedList<T> implements Iterable<RandomWeightedList.Entry<T>> {
private List<Entry<T>> entries;
public RandomWeightedList() {
this(new ArrayList<>());
}
public RandomWeightedList(List<Entry<T>> entries) {
this.entries = entries;
}
public RandomWeightedList(T entry, int weight) {
this(new Entry<>(entry, weight));
}
public RandomWeightedList(Entry<T> entry) {
this.entries = new ArrayList<>(1);
this.entries.add(entry);
}
public static <T> RandomWeightedList<T> decode(NBT nbt, ClientVersion version, Decoder<T> decoder) {
List<Entry<T>> entries;
if (nbt instanceof NBTCompound) {
entries = new ArrayList<>(1);
entries.add(Entry.decode(nbt, version, decoder));
} else if (nbt instanceof NBTList<?>) {
NBTList<?> list = (NBTList<?>) nbt;
entries = new ArrayList<>(list.size());
for (NBT tag : list.getTags()) {
entries.add(Entry.decode(tag, version, decoder));
}
} else {
throw new UnsupportedOperationException("Can't decode " + nbt + " as random weighted list");
}
return new RandomWeightedList<>(entries);
}
public static <T> NBT encode(RandomWeightedList<T> list, ClientVersion version, Encoder<T> encoder) {
NBTList<NBTCompound> nbt = new NBTList<>(NBTType.COMPOUND, list.entries.size());
for (Entry<T> entry : list.entries) {
nbt.addTag(Entry.encode(entry, version, encoder));
}
return nbt;
}
public List<Entry<T>> getEntries() {
return this.entries;
}
public void setEntries(List<Entry<T>> entries) {
this.entries = entries;
}
@Override
public @NotNull Iterator<Entry<T>> iterator() {
return this.entries.iterator();
}
public static final class Entry<T> {
private final T data;
private final int weight;
public Entry(T data, int weight) {
this.data = data;
this.weight = weight;
}
public static <T> Entry<T> decode(NBT nbt, ClientVersion version, Decoder<T> decoder) {
NBTCompound compound = (NBTCompound) nbt;
int weight = compound.getNumberTagOrThrow("weight").getAsInt();
T data = decoder.decode(compound.getTagOrThrow("data"), version);
return new Entry<>(data, weight);
}
public static <T> NBTCompound encode(Entry<T> entry, ClientVersion version, Encoder<T> encoder) {
NBTCompound compound = new NBTCompound();
compound.setTag("weight", new NBTInt(entry.weight));
compound.setTag("data", encoder.encode(entry.data, version));
return compound;
}
public T getData() {
return this.data;
}
public int getWeight() {
return this.weight;
}
}
}
@@ -67,6 +67,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -152,7 +153,7 @@ public class AdventureNBTSerializer implements ComponentSerializer<Component, Co
String selector = reader.readUTF("selector", Function.identity());
String keybind = reader.readUTF("keybind", Function.identity());
String nbt = reader.readUTF("nbt", Function.identity());
Boolean nbtInterpret = reader.readBoolean("interpret", Function.identity());
boolean nbtInterpret = Optional.ofNullable(reader.readBoolean("interpret", Function.identity())).orElse(false);
BlockNBTComponent.Pos nbtBlock = reader.readUTF("block", BlockNBTComponent.Pos::fromString);
String nbtEntity = reader.readUTF("entity", Function.identity());
Key nbtStorage = reader.readUTF("storage", Key::key);
@@ -325,9 +326,16 @@ public class AdventureNBTSerializer implements ComponentSerializer<Component, Co
reader.useUTF("font", value -> style.font(Key.key(value)));
reader.useUTF("color", value -> {
TextColor color = deserializeColor(value);
TextColor color = this.deserializeColor(value);
if (color != null) style.color(color);
});
if (BackwardCompatUtil.IS_4_18_0_OR_NEWER) {
// FIXME adventure v4.18.0
// reader.useUTF("shadow_color", value -> {
// ShadowColor color = ShadowColor.fromHexString(value);
// if (color != null) style.shadowColor(color);
// });
}
for (String decorationKey : TextDecoration.NAMES.keys()) {
reader.useBoolean(decorationKey, value -> style.decoration(
@@ -401,7 +409,13 @@ public class AdventureNBTSerializer implements ComponentSerializer<Component, Co
if (font != null) writer.writeUTF("font", font.asString());
TextColor color = style.color();
if (color != null) writer.writeUTF("color", serializeColor(color));
if (color != null) writer.writeUTF("color", this.serializeColor(color));
if (BackwardCompatUtil.IS_4_18_0_OR_NEWER) {
// FIXME adventure v4.18.0
// ShadowColor shadowColor = style.shadowColor();
// if (shadowColor != null) writer.writeUTF("shadow_color", shadowColor.asHexString());
}
for (TextDecoration decoration : TextDecoration.NAMES.values()) {
TextDecoration.State state = style.decoration(decoration);
@@ -72,7 +72,7 @@ public class WrapperPlayClientClickWindow extends PacketWrapper<WrapperPlayClien
this.actionNumber = Optional.empty();
}
int clickTypeIndex = readVarInt();
this.windowClickType = WindowClickType.VALUES[clickTypeIndex];
this.windowClickType = WindowClickType.getById(clickTypeIndex);
if (v1_17) {
this.slots = Optional.of(readMap(
packetWrapper -> Math.toIntExact(packetWrapper.readShort()),
@@ -180,8 +180,17 @@ public class WrapperPlayClientClickWindow extends PacketWrapper<WrapperPlayClien
}
public enum WindowClickType {
PICKUP, QUICK_MOVE, SWAP, CLONE, THROW, QUICK_CRAFT, PICKUP_ALL;
PICKUP, QUICK_MOVE, SWAP, CLONE, THROW, QUICK_CRAFT, PICKUP_ALL, UNKNOWN;
public static final WindowClickType[] VALUES = values();
public static WindowClickType getById(int id) {
// We subtract by 1 as unknown is not a valid choice.
if (id < 0 || id >= (VALUES.length - 1)) {
return UNKNOWN;
}
return VALUES[id];
}
}
}
@@ -21,7 +21,12 @@ package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
/**
* Removed with 1.21.4
*/
@ApiStatus.Obsolete
public class WrapperPlayClientPickItem extends PacketWrapper<WrapperPlayClientPickItem> {
private int slot;
@@ -0,0 +1,77 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.util.Vector3i;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
/**
* Added with 1.21.4
*/
public class WrapperPlayClientPickItemFromBlock extends PacketWrapper<WrapperPlayClientPickItemFromBlock> {
private Vector3i blockPos;
private boolean includeData;
public WrapperPlayClientPickItemFromBlock(PacketReceiveEvent event) {
super(event);
}
public WrapperPlayClientPickItemFromBlock(Vector3i blockPos, boolean includeData) {
super(PacketType.Play.Client.PICK_ITEM_FROM_BLOCK);
this.blockPos = blockPos;
this.includeData = includeData;
}
@Override
public void read() {
this.blockPos = this.readBlockPosition();
this.includeData = this.readBoolean();
}
@Override
public void write() {
this.writeBlockPosition(this.blockPos);
this.writeBoolean(this.includeData);
}
@Override
public void copy(WrapperPlayClientPickItemFromBlock wrapper) {
this.blockPos = wrapper.blockPos;
this.includeData = wrapper.includeData;
}
public Vector3i getBlockPos() {
return this.blockPos;
}
public void setBlockPos(Vector3i blockPos) {
this.blockPos = blockPos;
}
public boolean isIncludeData() {
return this.includeData;
}
public void setIncludeData(boolean includeData) {
this.includeData = includeData;
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
/**
* Added with 1.21.4
*/
public class WrapperPlayClientPickItemFromEntity extends PacketWrapper<WrapperPlayClientPickItemFromEntity> {
private int entityId;
private boolean includeData;
public WrapperPlayClientPickItemFromEntity(PacketReceiveEvent event) {
super(event);
}
public WrapperPlayClientPickItemFromEntity(int entityId, boolean includeData) {
super(PacketType.Play.Client.PICK_ITEM_FROM_ENTITY);
this.entityId = entityId;
this.includeData = includeData;
}
@Override
public void read() {
this.entityId = this.readVarInt();
this.includeData = this.readBoolean();
}
@Override
public void write() {
this.writeVarInt(this.entityId);
this.writeBoolean(this.includeData);
}
@Override
public void copy(WrapperPlayClientPickItemFromEntity wrapper) {
this.entityId = wrapper.entityId;
this.includeData = wrapper.includeData;
}
public int getEntityId() {
return this.entityId;
}
public void setEntityId(int entityId) {
this.entityId = entityId;
}
public boolean isIncludeData() {
return this.includeData;
}
public void setIncludeData(boolean includeData) {
this.includeData = includeData;
}
}
@@ -0,0 +1,37 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
/**
* Added with 1.21.4
*/
public class WrapperPlayClientPlayerLoaded extends PacketWrapper<WrapperPlayClientPlayerLoaded> {
public WrapperPlayClientPlayerLoaded(PacketReceiveEvent event) {
super(event);
}
public WrapperPlayClientPlayerLoaded() {
super(PacketType.Play.Client.PLAYER_LOADED);
}
}
@@ -21,6 +21,7 @@ package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
/**
* Not to be confused with {@link WrapperPlayClientSteerBoat}
@@ -30,8 +31,10 @@ import com.github.retrooper.packetevents.wrapper.PacketWrapper;
* On 1.8 and older, vehicle control is server sided. This packet includes inputs for movement.
* On 1.9 to 1.21.2, plugins may use this packet to create vehicles out of ordinary entities.
* <p>
* Starting with 1.21.2, the server sends all movement inputs using the {@link WrapperPlayClientPlayerInput} packet.
* Starting with 1.21.2, the server sends all movement inputs
* using the {@link WrapperPlayClientPlayerInput} packet instead.
*/
@ApiStatus.Obsolete
public class WrapperPlayClientSteerVehicle extends PacketWrapper<WrapperPlayClientSteerVehicle> {
private float sideways;
private float forward;
@@ -19,43 +19,55 @@
package com.github.retrooper.packetevents.wrapper.play.client;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
public class WrapperPlayClientVehicleMove extends PacketWrapper<WrapperPlayClientVehicleMove> {
private Vector3d position;
private float yaw;
private float pitch;
/**
* Added with 1.21.4
*/
private boolean onGround;
public WrapperPlayClientVehicleMove(PacketReceiveEvent event) {
super(event);
}
public WrapperPlayClientVehicleMove(Vector3d position, float yaw, float pitch) {
this(position, yaw, pitch, false);
}
public WrapperPlayClientVehicleMove(Vector3d position, float yaw, float pitch, boolean onGround) {
super(PacketType.Play.Client.VEHICLE_MOVE);
this.position = position;
this.yaw = yaw;
this.pitch = pitch;
this.onGround = onGround;
}
@Override
public void read() {
double x = readDouble();
double y = readDouble();
double z = readDouble();
this.position = new Vector3d(x, y, z);
this.yaw = readFloat();
this.pitch = readFloat();
this.position = Vector3d.read(this);
this.yaw = this.readFloat();
this.pitch = this.readFloat();
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
this.onGround = this.readBoolean();
}
}
@Override
public void write() {
writeDouble(position.x);
writeDouble(position.y);
writeDouble(position.z);
writeFloat(yaw);
writeFloat(pitch);
Vector3d.write(this, this.position);
this.writeFloat(this.yaw);
this.writeFloat(this.pitch);
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
this.writeBoolean(this.onGround);
}
}
@Override
@@ -63,6 +75,7 @@ public class WrapperPlayClientVehicleMove extends PacketWrapper<WrapperPlayClien
this.position = wrapper.position;
this.yaw = wrapper.yaw;
this.pitch = wrapper.pitch;
this.onGround = wrapper.onGround;
}
public Vector3d getPosition() {
@@ -88,4 +101,12 @@ public class WrapperPlayClientVehicleMove extends PacketWrapper<WrapperPlayClien
public void setPitch(float pitch) {
this.pitch = pitch;
}
public boolean isOnGround() {
return this.onGround;
}
public void setOnGround(boolean onGround) {
this.onGround = onGround;
}
}
@@ -25,6 +25,15 @@ import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
public class WrapperPlayServerEntityVelocity extends PacketWrapper<WrapperPlayServerEntityVelocity> {
// with larger short values there is a loss of precision and
// re-encoding packets may cause the velocity to change
//
// as vanilla just casts to an int instead of properly rounding,
// packetevents has to add a small number to the calculated velocity
// to work around the loss of precision
private static final double PRECISION_LOSS_FIX = 1e-11d;
private int entityID;
private Vector3d velocity;
@@ -45,10 +54,10 @@ public class WrapperPlayServerEntityVelocity extends PacketWrapper<WrapperPlaySe
} else {
entityID = readVarInt();
}
double velX = (double) readShort() / 8000.0;
double velY = (double) readShort() / 8000.0;
double velZ = (double) readShort() / 8000.0;
velocity = new Vector3d(velX, velY, velZ);
double velX = (double) this.readShort() / 8000d;
double velY = (double) this.readShort() / 8000d;
double velZ = (double) this.readShort() / 8000d;
this.velocity = new Vector3d(velX, velY, velZ);
}
@Override
@@ -58,9 +67,9 @@ public class WrapperPlayServerEntityVelocity extends PacketWrapper<WrapperPlaySe
} else {
writeVarInt(entityID);
}
writeShort((int) (velocity.x * 8000.0));
writeShort((int) (velocity.y * 8000.0));
writeShort((int) (velocity.z * 8000.0));
this.writeShort((int) (this.velocity.x * 8000d + Math.copySign(PRECISION_LOSS_FIX, this.velocity.x)));
this.writeShort((int) (this.velocity.y * 8000d + Math.copySign(PRECISION_LOSS_FIX, this.velocity.y)));
this.writeShort((int) (this.velocity.z * 8000d + Math.copySign(PRECISION_LOSS_FIX, this.velocity.z)));
}
@Override
@@ -19,6 +19,7 @@
package com.github.retrooper.packetevents.wrapper.play.server;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
@@ -36,12 +37,17 @@ public class WrapperPlayServerHeldItemChange extends PacketWrapper<WrapperPlaySe
@Override
public void read() {
this.slot = readByte();
this.slot = this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)
? this.readVarInt() : this.readByte();
}
@Override
public void write() {
writeByte(slot);
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
this.writeVarInt(this.slot);
} else {
this.writeByte(this.slot);
}
}
@Override
@@ -41,13 +41,26 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
private Vector3f offset;
private float maxSpeed;
private int particleCount;
/**
* Added with 1.21.4
*/
private boolean alwaysShow;
public WrapperPlayServerParticle(PacketSendEvent event) {
super(event);
}
public WrapperPlayServerParticle(Particle<?> particle, boolean longDistance, Vector3d position, Vector3f offset,
float maxSpeed, int particleCount) {
public WrapperPlayServerParticle(
Particle<?> particle, boolean longDistance, Vector3d position, Vector3f offset,
float maxSpeed, int particleCount
) {
this(particle, longDistance, position, offset, maxSpeed, particleCount, false);
}
public WrapperPlayServerParticle(
Particle<?> particle, boolean longDistance, Vector3d position, Vector3f offset,
float maxSpeed, int particleCount, boolean alwaysShow
) {
super(PacketType.Play.Server.PARTICLE);
this.particle = particle;
this.longDistance = longDistance;
@@ -55,6 +68,7 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
this.offset = offset;
this.maxSpeed = maxSpeed;
this.particleCount = particleCount;
this.alwaysShow = alwaysShow;
}
@SuppressWarnings("unchecked")
@@ -71,6 +85,9 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
particleType = ParticleTypes.getById(serverVersion.toClientVersion(), particleTypeId);
}
longDistance = readBoolean();
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
this.alwaysShow = this.readBoolean();
}
if (serverVersion.isNewerThanOrEquals(ServerVersion.V_1_15)) {
position = new Vector3d(readDouble(), readDouble(), readDouble());
} else {
@@ -112,6 +129,9 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
}
}
writeBoolean(longDistance);
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
this.writeBoolean(this.alwaysShow);
}
if (serverVersion.isNewerThanOrEquals(ServerVersion.V_1_15)) {
writeDouble(position.getX());
writeDouble(position.getY());
@@ -142,12 +162,13 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
@Override
public void copy(WrapperPlayServerParticle wrapper) {
particle = wrapper.particle;
longDistance = wrapper.longDistance;
position = wrapper.position;
offset = wrapper.offset;
maxSpeed = wrapper.maxSpeed;
particleCount = wrapper.particleCount;
this.particle = wrapper.particle;
this.longDistance = wrapper.longDistance;
this.position = wrapper.position;
this.offset = wrapper.offset;
this.maxSpeed = wrapper.maxSpeed;
this.particleCount = wrapper.particleCount;
this.alwaysShow = wrapper.alwaysShow;
}
public Particle<?> getParticle() {
@@ -198,4 +219,17 @@ public class WrapperPlayServerParticle extends PacketWrapper<WrapperPlayServerPa
this.particleCount = particleCount;
}
/**
* Added with 1.21.4
*/
public boolean isAlwaysShow() {
return this.alwaysShow;
}
/**
* Added with 1.21.4
*/
public void setAlwaysShow(boolean alwaysShow) {
this.alwaysShow = alwaysShow;
}
}
@@ -19,6 +19,7 @@
package com.github.retrooper.packetevents.wrapper.play.server;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.chat.RemoteChatSession;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.GameMode;
@@ -47,9 +48,15 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
UPDATE_LATENCY,
UPDATE_DISPLAY_NAME,
/**
* Updates the order in which the player is listed in the tablist.
* Updates the order in which the player is listed in the tablist.<br>
* Added with 1.21.2
*/
UPDATE_LIST_ORDER;
UPDATE_LIST_ORDER,
/**
* Updates whether the outer skin layer (hat) of the player will be shown in tablist.<br>
* Added with 1.21.4
*/
UPDATE_HAT;
public static final WrapperPlayServerPlayerInfoUpdate.Action[] VALUES = values();
}
@@ -63,7 +70,14 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
private Component displayName;
@Nullable
private RemoteChatSession chatSession;
private int listOrder; // added in 1.21.2
/**
* Added with 1.21.2
*/
private int listOrder;
/**
* Added with 1.21.4
*/
private boolean showHat;
public PlayerInfo(UUID profileId) {
this(new UserProfile(profileId, ""));
@@ -88,6 +102,16 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
@Nullable Component displayName,
@Nullable RemoteChatSession chatSession,
int listOrder
) {
this(profile, listed, latency, gameMode, displayName, chatSession, listOrder, false);
}
public PlayerInfo(
UserProfile profile, boolean listed,
int latency, GameMode gameMode,
@Nullable Component displayName,
@Nullable RemoteChatSession chatSession,
int listOrder, boolean showHat
) {
this.profile = profile;
this.listed = listed;
@@ -96,6 +120,7 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
this.displayName = displayName;
this.chatSession = chatSession;
this.listOrder = listOrder;
this.showHat = showHat;
}
public UUID getProfileId() {
@@ -126,10 +151,20 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
return chatSession;
}
/**
* Added with 1.21.2
*/
public int getListOrder() {
return this.listOrder;
}
/**
* Added with 1.21.4
*/
public boolean isShowHat() {
return this.showHat;
}
public void setGameProfile(UserProfile gameProfile) {
this.profile = gameProfile;
}
@@ -154,9 +189,19 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
this.chatSession = chatSession;
}
/**
* Added with 1.21.2
*/
public void setListOrder(int listOrder) {
this.listOrder = listOrder;
}
/**
* Added with 1.21.4
*/
public void setShowHat(boolean showHat) {
this.showHat = showHat;
}
}
public WrapperPlayServerPlayerInfoUpdate(PacketSendEvent event) {
@@ -196,6 +241,7 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
@Nullable RemoteChatSession chatSession = null;
@Nullable Component displayName = null;
int listOrder = 0;
boolean showHat = false;
for (Action action : actions) {
switch (action) {
case ADD_PLAYER:
@@ -227,11 +273,18 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
displayName = wrapper.readOptional(PacketWrapper::readComponent);
break;
case UPDATE_LIST_ORDER:
listOrder = wrapper.readVarInt();
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_2)) {
listOrder = wrapper.readVarInt();
}
break;
case UPDATE_HAT:
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
showHat = wrapper.readBoolean();
}
break;
}
}
return new PlayerInfo(gameProfile, listed, latency, gameMode, displayName, chatSession, listOrder);
return new PlayerInfo(gameProfile, listed, latency, gameMode, displayName, chatSession, listOrder, showHat);
});
}
@@ -266,7 +319,14 @@ public class WrapperPlayServerPlayerInfoUpdate extends PacketWrapper<WrapperPlay
wrapper.writeOptional(playerInfo.getDisplayName(), PacketWrapper::writeComponent);
break;
case UPDATE_LIST_ORDER:
wrapper.writeVarInt(playerInfo.getListOrder());
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_2)) {
wrapper.writeVarInt(playerInfo.getListOrder());
}
break;
case UPDATE_HAT:
if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_21_4)) {
wrapper.writeBoolean(playerInfo.isShowHat());
}
break;
}
}
@@ -137,4 +137,8 @@ public class WrapperPlayServerResourcePackSend extends PacketWrapper<WrapperPlay
public Component getPrompt() {
return prompt;
}
public void setPrompt(Component prompt) {
this.prompt = prompt;
}
}
@@ -41,26 +41,26 @@ import java.util.stream.Collectors;
public class WrapperPlayServerUpdateAttributes extends PacketWrapper<WrapperPlayServerUpdateAttributes> {
private static final List<Map.Entry<String, Attribute>> PRE_1_16_ATTRIBUTES = Collections.unmodifiableList(Arrays.asList(
new SimpleEntry<>("generic.maxHealth", Attributes.GENERIC_MAX_HEALTH),
new SimpleEntry<>("Max Health", Attributes.GENERIC_MAX_HEALTH),
new SimpleEntry<>("zombie.spawnReinforcements", Attributes.ZOMBIE_SPAWN_REINFORCEMENTS),
new SimpleEntry<>("Spawn Reinforcements Chance", Attributes.ZOMBIE_SPAWN_REINFORCEMENTS),
new SimpleEntry<>("generic.maxHealth", Attributes.MAX_HEALTH),
new SimpleEntry<>("Max Health", Attributes.MAX_HEALTH),
new SimpleEntry<>("zombie.spawnReinforcements", Attributes.SPAWN_REINFORCEMENTS),
new SimpleEntry<>("Spawn Reinforcements Chance", Attributes.SPAWN_REINFORCEMENTS),
new SimpleEntry<>("horse.jumpStrength", Attributes.HORSE_JUMP_STRENGTH),
new SimpleEntry<>("Jump Strength", Attributes.HORSE_JUMP_STRENGTH),
new SimpleEntry<>("generic.followRange", Attributes.GENERIC_FOLLOW_RANGE),
new SimpleEntry<>("Follow Range", Attributes.GENERIC_FOLLOW_RANGE),
new SimpleEntry<>("generic.knockbackResistance", Attributes.GENERIC_KNOCKBACK_RESISTANCE),
new SimpleEntry<>("Knockback Resistance", Attributes.GENERIC_KNOCKBACK_RESISTANCE),
new SimpleEntry<>("generic.movementSpeed", Attributes.GENERIC_MOVEMENT_SPEED),
new SimpleEntry<>("Movement Speed", Attributes.GENERIC_MOVEMENT_SPEED),
new SimpleEntry<>("generic.flyingSpeed", Attributes.GENERIC_FLYING_SPEED),
new SimpleEntry<>("Flying Speed", Attributes.GENERIC_FLYING_SPEED),
new SimpleEntry<>("generic.attackDamage", Attributes.GENERIC_ATTACK_DAMAGE),
new SimpleEntry<>("generic.attackKnockback", Attributes.GENERIC_ATTACK_KNOCKBACK),
new SimpleEntry<>("generic.attackSpeed", Attributes.GENERIC_ATTACK_SPEED),
new SimpleEntry<>("generic.armorToughness", Attributes.GENERIC_ARMOR_TOUGHNESS),
new SimpleEntry<>("generic.armor", Attributes.GENERIC_ARMOR),
new SimpleEntry<>("generic.luck", Attributes.GENERIC_LUCK)
new SimpleEntry<>("generic.followRange", Attributes.FOLLOW_RANGE),
new SimpleEntry<>("Follow Range", Attributes.FOLLOW_RANGE),
new SimpleEntry<>("generic.knockbackResistance", Attributes.KNOCKBACK_RESISTANCE),
new SimpleEntry<>("Knockback Resistance", Attributes.KNOCKBACK_RESISTANCE),
new SimpleEntry<>("generic.movementSpeed", Attributes.MOVEMENT_SPEED),
new SimpleEntry<>("Movement Speed", Attributes.MOVEMENT_SPEED),
new SimpleEntry<>("generic.flyingSpeed", Attributes.FLYING_SPEED),
new SimpleEntry<>("Flying Speed", Attributes.FLYING_SPEED),
new SimpleEntry<>("generic.attackDamage", Attributes.ATTACK_DAMAGE),
new SimpleEntry<>("generic.attackKnockback", Attributes.ATTACK_KNOCKBACK),
new SimpleEntry<>("generic.attackSpeed", Attributes.ATTACK_SPEED),
new SimpleEntry<>("generic.armorToughness", Attributes.ARMOR_TOUGHNESS),
new SimpleEntry<>("generic.armor", Attributes.ARMOR),
new SimpleEntry<>("generic.luck", Attributes.LUCK)
));
private static final Map<String, Attribute> PRE_1_16_ATTRIBUTES_MAP = PRE_1_16_ATTRIBUTES.stream()
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
@@ -23,8 +23,8 @@ public class MappingIntegrityTest extends BaseDummyAPITest {
@Test
@DisplayName("Test attribute mapping")
public void testAttributeMapping() {
assertEquals(11, Attributes.GENERIC_GRAVITY.getId(ClientVersion.V_1_20_5));
assertEquals(1, Attributes.GENERIC_FOLLOW_RANGE.getId(ClientVersion.V_1_20_2));
assertEquals(11, Attributes.GRAVITY.getId(ClientVersion.V_1_20_5));
assertEquals(1, Attributes.FOLLOW_RANGE.getId(ClientVersion.V_1_20_2));
}
@Test
+1 -1
View File
@@ -1,7 +1,7 @@
import java.io.ByteArrayOutputStream
// TODO UPDATE
val fullVersion = "2.6.0"
val fullVersion = "2.7.0"
val snapshot = false
group = "com.github.retrooper"
@@ -40,4 +40,4 @@ tasks {
}
defaultTasks("build")
}
}
+3 -3
View File
@@ -4,7 +4,7 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21
parchment_mappings=2024.06.23
parchment_minecraft_version=1.21
minecraft_version=1.21.4
parchment_mappings=2024.11.17
parchment_minecraft_version=1.21.1
loader_version=0.15.11
+1 -1
View File
@@ -1,5 +1,5 @@
[versions]
adventure = "4.17.0"
adventure = "4.17.0" # FIXME adventure v4.18.0
examination = "1.3.0"
netty = "4.1.72.Final"
jetbrains-annotations = "23.0.0"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+151
View File
@@ -1,4 +1,155 @@
{
"V_1_21_4": {
"acacia_boat": 0,
"acacia_chest_boat": 1,
"allay": 2,
"area_effect_cloud": 3,
"armadillo": 4,
"armor_stand": 5,
"arrow": 6,
"axolotl": 7,
"bamboo_chest_raft": 8,
"bamboo_raft": 9,
"bat": 10,
"bee": 11,
"birch_boat": 12,
"birch_chest_boat": 13,
"blaze": 14,
"block_display": 15,
"bogged": 16,
"breeze": 17,
"breeze_wind_charge": 18,
"camel": 19,
"cat": 20,
"cave_spider": 21,
"cherry_boat": 22,
"cherry_chest_boat": 23,
"chest_minecart": 24,
"chicken": 25,
"cod": 26,
"command_block_minecart": 27,
"cow": 28,
"creaking": 29,
"creeper": 30,
"dark_oak_boat": 31,
"dark_oak_chest_boat": 32,
"dolphin": 33,
"donkey": 34,
"dragon_fireball": 35,
"drowned": 36,
"egg": 37,
"elder_guardian": 38,
"enderman": 39,
"endermite": 40,
"ender_dragon": 41,
"ender_pearl": 42,
"end_crystal": 43,
"evoker": 44,
"evoker_fangs": 45,
"experience_bottle": 46,
"experience_orb": 47,
"eye_of_ender": 48,
"falling_block": 49,
"fireball": 50,
"firework_rocket": 51,
"fox": 52,
"frog": 53,
"furnace_minecart": 54,
"ghast": 55,
"giant": 56,
"glow_item_frame": 57,
"glow_squid": 58,
"goat": 59,
"guardian": 60,
"hoglin": 61,
"hopper_minecart": 62,
"horse": 63,
"husk": 64,
"illusioner": 65,
"interaction": 66,
"iron_golem": 67,
"item": 68,
"item_display": 69,
"item_frame": 70,
"jungle_boat": 71,
"jungle_chest_boat": 72,
"leash_knot": 73,
"lightning_bolt": 74,
"llama": 75,
"llama_spit": 76,
"magma_cube": 77,
"mangrove_boat": 78,
"mangrove_chest_boat": 79,
"marker": 80,
"minecart": 81,
"mooshroom": 82,
"mule": 83,
"oak_boat": 84,
"oak_chest_boat": 85,
"ocelot": 86,
"ominous_item_spawner": 87,
"painting": 88,
"pale_oak_boat": 89,
"pale_oak_chest_boat": 90,
"panda": 91,
"parrot": 92,
"phantom": 93,
"pig": 94,
"piglin": 95,
"piglin_brute": 96,
"pillager": 97,
"polar_bear": 98,
"potion": 99,
"pufferfish": 100,
"rabbit": 101,
"ravager": 102,
"salmon": 103,
"sheep": 104,
"shulker": 105,
"shulker_bullet": 106,
"silverfish": 107,
"skeleton": 108,
"skeleton_horse": 109,
"slime": 110,
"small_fireball": 111,
"sniffer": 112,
"snowball": 113,
"snow_golem": 114,
"spawner_minecart": 115,
"spectral_arrow": 116,
"spider": 117,
"spruce_boat": 118,
"spruce_chest_boat": 119,
"squid": 120,
"stray": 121,
"strider": 122,
"tadpole": 123,
"text_display": 124,
"tnt": 125,
"tnt_minecart": 126,
"trader_llama": 127,
"trident": 128,
"tropical_fish": 129,
"turtle": 130,
"vex": 131,
"villager": 132,
"vindicator": 133,
"wandering_trader": 134,
"warden": 135,
"wind_charge": 136,
"witch": 137,
"wither": 138,
"wither_skeleton": 139,
"wither_skull": 140,
"wolf": 141,
"zoglin": 142,
"zombie": 143,
"zombie_horse": 144,
"zombie_villager": 145,
"zombified_piglin": 146,
"player": 147,
"fishing_bobber": 148
},
"V_1_21_2": {
"acacia_boat": 0,
"acacia_chest_boat": 1,
@@ -0,0 +1,64 @@
{
"V_1_21_4": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle_scute",
"netherite",
"armadillo_scute",
"elytra",
"white_carpet",
"orange_carpet",
"magenta_carpet",
"light_blue_carpet",
"yellow_carpet",
"lime_carpet",
"pink_carpet",
"gray_carpet",
"light_gray_carpet",
"cyan_carpet",
"purple_carpet",
"blue_carpet",
"brown_carpet",
"green_carpet",
"red_carpet",
"black_carpet",
"trader_llama"
],
"V_1_20_5": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle_scute",
"netherite",
"armadillo_scute"
],
"V_1_16": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle_scute",
"netherite"
],
"V_1_13": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle_scute"
],
"V_1_7_10": [
"leather",
"chainmail",
"iron",
"gold",
"diamond"
]
}
@@ -1,36 +0,0 @@
{
"V_1_20_5": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle",
"netherite",
"armadillo"
],
"V_1_16": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle",
"netherite"
],
"V_1_13": [
"leather",
"chainmail",
"iron",
"gold",
"diamond",
"turtle"
],
"V_1_7_10": [
"leather",
"chainmail",
"iron",
"gold",
"diamond"
]
}
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,17 @@
{
"V_1_21_4": [
"amethyst",
"copper",
"diamond",
"emerald",
"gold",
"iron",
"lapis",
"netherite",
"quartz",
"redstone",
"resin"
],
"V_1_19_4": [
"amethyst",
"copper",
File diff suppressed because it is too large. Load diff
@@ -1,4 +1,118 @@
{
"V_1_21_4": [
"angry_villager",
"block",
"block_marker",
"bubble",
"cloud",
"crit",
"damage_indicator",
"dragon_breath",
"dripping_lava",
"falling_lava",
"landing_lava",
"dripping_water",
"falling_water",
"dust",
"dust_color_transition",
"effect",
"elder_guardian",
"enchanted_hit",
"enchant",
"end_rod",
"entity_effect",
"explosion_emitter",
"explosion",
"gust",
"small_gust",
"gust_emitter_large",
"gust_emitter_small",
"sonic_boom",
"falling_dust",
"firework",
"fishing",
"flame",
"infested",
"cherry_leaves",
"pale_oak_leaves",
"sculk_soul",
"sculk_charge",
"sculk_charge_pop",
"soul_fire_flame",
"soul",
"flash",
"happy_villager",
"composter",
"heart",
"instant_effect",
"item",
"vibration",
"trail",
"item_slime",
"item_cobweb",
"item_snowball",
"large_smoke",
"lava",
"mycelium",
"note",
"poof",
"portal",
"rain",
"smoke",
"white_smoke",
"sneeze",
"spit",
"squid_ink",
"sweep_attack",
"totem_of_undying",
"underwater",
"splash",
"witch",
"bubble_pop",
"current_down",
"bubble_column_up",
"nautilus",
"dolphin",
"campfire_cosy_smoke",
"campfire_signal_smoke",
"dripping_honey",
"falling_honey",
"landing_honey",
"falling_nectar",
"falling_spore_blossom",
"ash",
"crimson_spore",
"warped_spore",
"spore_blossom_air",
"dripping_obsidian_tear",
"falling_obsidian_tear",
"landing_obsidian_tear",
"reverse_portal",
"white_ash",
"small_flame",
"snowflake",
"dripping_dripstone_lava",
"falling_dripstone_lava",
"dripping_dripstone_water",
"falling_dripstone_water",
"glow_squid_ink",
"glow",
"wax_on",
"wax_off",
"electric_spark",
"scrape",
"shriek",
"egg_crack",
"dust_plume",
"trial_spawner_detection",
"trial_spawner_detection_ominous",
"vault_connection",
"dust_pillar",
"ominous_spawning",
"raid_omen",
"trial_omen",
"block_crumble"
],
"V_1_21_2": [
"angry_villager",
"block",
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -21,6 +21,7 @@ import net.kyori.adventure.key.Key;
import net.kyori.adventure.nbt.api.BinaryTagHolder;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.util.Codec;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -35,6 +36,7 @@ public final class BackwardCompatUtil {
public static final boolean IS_4_13_0_OR_NEWER;
public static final boolean IS_4_15_0_OR_NEWER;
public static final boolean IS_4_17_0_OR_NEWER;
public static final boolean IS_4_18_0_OR_NEWER;
static {
boolean is4_10_0OrNewer = false;
@@ -71,6 +73,16 @@ public final class BackwardCompatUtil {
} catch (Throwable ignored) {
}
IS_4_17_0_OR_NEWER = is4_17_0OrNewer;
boolean is4_18_0OrNewer = false;
try {
// shadow color support was added in 4.18.0
// FIXME adventure v4.18.0
// Style.empty().shadowColor();
// is4_18_0OrNewer = true;
} catch (Throwable ignored) {
}
IS_4_18_0_OR_NEWER = is4_18_0OrNewer;
}
private BackwardCompatUtil() {