diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
commit | cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch) | |
tree | f647b20e1823f1846af88e832cf82a4a02e96e69 /src/Items | |
parent | Improve clang-format config file, remove automatically enforced code style from contrib guide. (diff) | |
download | cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.gz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.bz2 cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.lz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.xz cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.tar.zst cuberite-cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a.zip |
Diffstat (limited to '')
83 files changed, 2204 insertions, 2055 deletions
diff --git a/src/Items/ItemAnvil.h b/src/Items/ItemAnvil.h index 3262c322c..2b8b5e3f1 100644 --- a/src/Items/ItemAnvil.h +++ b/src/Items/ItemAnvil.h @@ -8,18 +8,21 @@ -class cItemAnvilHandler final : - public cItemHandler +class cItemAnvilHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock( a_PlacePosition, diff --git a/src/Items/ItemArmor.h b/src/Items/ItemArmor.h index eb7e31c79..287ec3296 100644 --- a/src/Items/ItemArmor.h +++ b/src/Items/ItemArmor.h @@ -8,13 +8,11 @@ -class cItemArmorHandler final : - public cItemHandler +class cItemArmorHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -100,7 +98,8 @@ public: { return (a_ItemType == E_ITEM_GOLD); } - case E_ITEM_ELYTRA: // TODO: require Phantom Membrane instead of leather starting from protocol version 369 or 1.13 release + case E_ITEM_ELYTRA: // TODO: require Phantom Membrane instead of leather starting from protocol version 369 + // or 1.13 release case E_ITEM_LEATHER_BOOTS: case E_ITEM_LEATHER_CAP: case E_ITEM_LEATHER_PANTS: @@ -111,9 +110,4 @@ public: } return false; } - -} ; - - - - +}; diff --git a/src/Items/ItemAxe.h b/src/Items/ItemAxe.h index 3cd82fb73..21c7a84be 100644 --- a/src/Items/ItemAxe.h +++ b/src/Items/ItemAxe.h @@ -8,13 +8,11 @@ -class cItemAxeHandler final : - public cItemHandler +class cItemAxeHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -23,9 +21,9 @@ public: { switch (a_Action) { - case dlaAttackEntity: return 2; - case dlaBreakBlock: return 1; - case dlaBreakBlockInstant: return 0; + case dlaAttackEntity: return 2; + case dlaBreakBlock: return 1; + case dlaBreakBlockInstant: return 0; } UNREACHABLE("Unsupported durability loss action"); } @@ -42,15 +40,14 @@ public: { switch (m_ItemType) { - case E_ITEM_WOODEN_AXE: return 2.0f; - case E_ITEM_STONE_AXE: return 4.0f; - case E_ITEM_IRON_AXE: return 6.0f; - case E_ITEM_GOLD_AXE: return 12.0f; + case E_ITEM_WOODEN_AXE: return 2.0f; + case E_ITEM_STONE_AXE: return 4.0f; + case E_ITEM_IRON_AXE: return 6.0f; + case E_ITEM_GOLD_AXE: return 12.0f; case E_ITEM_DIAMOND_AXE: return 8.0f; } } ASSERT(!"Something is wrong here... Maybe they are axes out of a new material?"); return 1.0f; } - -} ; +}; diff --git a/src/Items/ItemBanner.h b/src/Items/ItemBanner.h index 551c41429..cc73cf96e 100644 --- a/src/Items/ItemBanner.h +++ b/src/Items/ItemBanner.h @@ -12,18 +12,21 @@ -class cItemBannerHandler final: - public cItemHandler +class cItemBannerHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Cannot place a banner at "no face" and from the bottom: if ((a_ClickedBlockFace == BLOCK_FACE_NONE) || (a_ClickedBlockFace == BLOCK_FACE_BOTTOM)) @@ -36,15 +39,21 @@ private: return false; } - a_Player.GetWorld()->DoWithBlockEntityAt(a_PlacePosition, [&a_HeldItem](cBlockEntity & a_BlockEntity) - { - ASSERT((a_BlockEntity.GetBlockType() == E_BLOCK_STANDING_BANNER) || (a_BlockEntity.GetBlockType() == E_BLOCK_WALL_BANNER)); + a_Player.GetWorld()->DoWithBlockEntityAt( + a_PlacePosition, + [&a_HeldItem](cBlockEntity & a_BlockEntity) + { + ASSERT( + (a_BlockEntity.GetBlockType() == E_BLOCK_STANDING_BANNER) || + (a_BlockEntity.GetBlockType() == E_BLOCK_WALL_BANNER) + ); - cBannerEntity & BannerEntity = static_cast<cBannerEntity &>(a_BlockEntity); - BannerEntity.SetBaseColor(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)); - BannerEntity.SetCustomName(a_HeldItem.m_CustomName); - return false; - }); + cBannerEntity & BannerEntity = static_cast<cBannerEntity &>(a_BlockEntity); + BannerEntity.SetBaseColor(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)); + BannerEntity.SetCustomName(a_HeldItem.m_CustomName); + return false; + } + ); return true; } @@ -53,10 +62,7 @@ private: - virtual bool IsPlaceable(void) const override - { - return true; - } + virtual bool IsPlaceable(void) const override { return true; } diff --git a/src/Items/ItemBed.h b/src/Items/ItemBed.h index a2e254171..5c6d77243 100644 --- a/src/Items/ItemBed.h +++ b/src/Items/ItemBed.h @@ -9,17 +9,21 @@ -class cItemBedHandler final : - public cItemHandler +class cItemBedHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { const auto BlockMeta = cBlockBedHandler::YawToMetaData(a_Player.GetYaw()); const auto HeadPosition = a_PlacePosition + cBlockBedHandler::MetaDataToDirection(BlockMeta); @@ -31,19 +35,17 @@ public: // Vanilla only allows beds to be placed into air. // Check if there is empty space for the "head" block: - if (!cBlockHandler::For(HeadType).DoesIgnoreBuildCollision(World, a_HeldItem, HeadPosition, HeadMeta, a_ClickedBlockFace, false)) + if (!cBlockHandler::For(HeadType) + .DoesIgnoreBuildCollision(World, a_HeldItem, HeadPosition, HeadMeta, a_ClickedBlockFace, false)) { return false; } // The "foot", and the "head" block: - if ( - !a_Player.PlaceBlocks( - { - { a_PlacePosition, E_BLOCK_BED, BlockMeta }, - { HeadPosition, E_BLOCK_BED, static_cast<NIBBLETYPE>(BlockMeta | 0x08) } - }) - ) + if (!a_Player.PlaceBlocks( + {{a_PlacePosition, E_BLOCK_BED, BlockMeta}, + {HeadPosition, E_BLOCK_BED, static_cast<NIBBLETYPE>(BlockMeta | 0x08)}} + )) { return false; } @@ -62,8 +64,5 @@ public: } - virtual bool IsPlaceable(void) const override - { - return true; - } + virtual bool IsPlaceable(void) const override { return true; } }; diff --git a/src/Items/ItemBigFlower.h b/src/Items/ItemBigFlower.h index cbdecbed7..4a498d020 100644 --- a/src/Items/ItemBigFlower.h +++ b/src/Items/ItemBigFlower.h @@ -8,16 +8,20 @@ -class cItemBigFlowerHandler final: - public cItemHandler +class cItemBigFlowerHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Needs at least two free blocks to build in: if (a_PlacePosition.y >= (cChunkDef::Height - 1)) @@ -31,15 +35,15 @@ public: NIBBLETYPE TopMeta; World.GetBlockTypeMeta(TopPos, TopType, TopMeta); - if (!cBlockHandler::For(TopType).DoesIgnoreBuildCollision(World, a_HeldItem, TopPos, TopMeta, a_ClickedBlockFace, false)) + if (!cBlockHandler::For(TopType) + .DoesIgnoreBuildCollision(World, a_HeldItem, TopPos, TopMeta, a_ClickedBlockFace, false)) { return false; } return a_Player.PlaceBlocks( - { - { a_PlacePosition, E_BLOCK_BIG_FLOWER, static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage & 0x07) }, - { TopPos, E_BLOCK_BIG_FLOWER, E_META_BIG_FLOWER_TOP } - }); + {{a_PlacePosition, E_BLOCK_BIG_FLOWER, static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage & 0x07)}, + {TopPos, E_BLOCK_BIG_FLOWER, E_META_BIG_FLOWER_TOP}} + ); } }; diff --git a/src/Items/ItemBoat.h b/src/Items/ItemBoat.h index 4fc041787..cb97e785f 100644 --- a/src/Items/ItemBoat.h +++ b/src/Items/ItemBoat.h @@ -8,13 +8,11 @@ -class cItemBoatHandler final: - public cItemHandler +class cItemBoatHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -37,19 +35,23 @@ public: } // Find the actual placement position by tracing line of sight until non-air block: - class cCallbacks: - public cBlockTracer::cCallbacks + class cCallbacks : public cBlockTracer::cCallbacks { - public: + public: Vector3d m_Pos; bool m_HasFound; - cCallbacks(): + cCallbacks() : m_HasFound(false) { } - virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + virtual bool OnNextBlock( + Vector3i a_CBBlockPos, + BLOCKTYPE a_CBBlockType, + NIBBLETYPE a_CBBlockMeta, + eBlockFace a_CBEntryFace + ) override { if (a_CBBlockType != E_BLOCK_AIR) { @@ -81,7 +83,10 @@ public: } // Spawn block at water level - if (a_World->SpawnBoat(Callbacks.m_Pos + Vector3d(0.5, 1, 0.5), cBoat::ItemToMaterial(a_Player->GetEquippedItem())) == cEntity::INVALID_ID) + if (a_World->SpawnBoat( + Callbacks.m_Pos + Vector3d(0.5, 1, 0.5), + cBoat::ItemToMaterial(a_Player->GetEquippedItem()) + ) == cEntity::INVALID_ID) { return false; } @@ -94,4 +99,4 @@ public: return true; } -} ; +}; diff --git a/src/Items/ItemBottle.h b/src/Items/ItemBottle.h index a324eb101..ee390dc16 100644 --- a/src/Items/ItemBottle.h +++ b/src/Items/ItemBottle.h @@ -9,13 +9,11 @@ -class cItemBottleHandler final: - public cItemHandler +class cItemBottleHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -27,20 +25,24 @@ public: Returns false if not. */ bool GetBlockFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos) const { - class cCallbacks: - public cBlockTracer::cCallbacks + class cCallbacks : public cBlockTracer::cCallbacks { - public: + public: Vector3i m_Pos; - bool m_HasHitFluid; + bool m_HasHitFluid; - cCallbacks(): + cCallbacks() : m_HasHitFluid(false) { } - virtual bool OnNextBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override + virtual bool OnNextBlock( + Vector3i a_BlockPosition, + BLOCKTYPE a_BlockType, + NIBBLETYPE a_BlockMeta, + eBlockFace a_EntryFace + ) override { if (IsBlockWater(a_BlockType)) { @@ -98,8 +100,4 @@ public: } return true; } -} ; - - - - +}; diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index d1993c03c..a7d5b683d 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -8,13 +8,11 @@ -class cItemBowHandler final: - public cItemHandler +class cItemBowHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -73,12 +71,8 @@ public: { return; } - a_Player->GetWorld()->BroadcastSoundEffect( - "entity.arrow.shoot", - a_Player->GetPosition(), - 0.5, - static_cast<float>(Force) - ); + a_Player->GetWorld() + ->BroadcastSoundEffect("entity.arrow.shoot", a_Player->GetPosition(), 0.5, static_cast<float>(Force)); if (!a_Player->IsGameModeCreative()) { if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchInfinity) == 0) @@ -97,4 +91,4 @@ public: ArrowPtr->StartBurning(100); } } -} ; +}; diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index e7fa0fe38..ab2cb8fd1 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -13,17 +13,14 @@ -class cItemBucketHandler final : - public cItemHandler +class cItemBucketHandler final : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemBucketHandler(int a_ItemType): + public: + constexpr cItemBucketHandler(int a_ItemType) : Super(a_ItemType) { - } @@ -41,9 +38,28 @@ public: { switch (m_ItemType) { - case E_ITEM_BUCKET: return ScoopUpFluid(a_World, a_Player, a_HeldItem, a_ClickedBlockPos, a_ClickedBlockFace); - case E_ITEM_LAVA_BUCKET: return PlaceFluid (a_World, a_Player, a_PluginInterface, a_HeldItem, a_ClickedBlockPos, a_ClickedBlockFace, E_BLOCK_LAVA); - case E_ITEM_WATER_BUCKET: return PlaceFluid (a_World, a_Player, a_PluginInterface, a_HeldItem, a_ClickedBlockPos, a_ClickedBlockFace, E_BLOCK_WATER); + case E_ITEM_BUCKET: + return ScoopUpFluid(a_World, a_Player, a_HeldItem, a_ClickedBlockPos, a_ClickedBlockFace); + case E_ITEM_LAVA_BUCKET: + return PlaceFluid( + a_World, + a_Player, + a_PluginInterface, + a_HeldItem, + a_ClickedBlockPos, + a_ClickedBlockFace, + E_BLOCK_LAVA + ); + case E_ITEM_WATER_BUCKET: + return PlaceFluid( + a_World, + a_Player, + a_PluginInterface, + a_HeldItem, + a_ClickedBlockPos, + a_ClickedBlockFace, + E_BLOCK_WATER + ); default: { ASSERT(!"Unhandled ItemType"); @@ -56,7 +72,13 @@ public: - bool ScoopUpFluid(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace) const + bool ScoopUpFluid( + cWorld * a_World, + cPlayer * a_Player, + const cItem & a_Item, + const Vector3i a_ClickedBlockPos, + eBlockFace a_ClickedBlockFace + ) const { // Players can't pick up fluid while in adventure mode. if (a_Player->IsGameModeAdventure()) @@ -125,8 +147,13 @@ public: bool PlaceFluid( - cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, - const Vector3i a_BlockPos, eBlockFace a_BlockFace, BLOCKTYPE a_FluidBlock + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_Item, + const Vector3i a_BlockPos, + eBlockFace a_BlockFace, + BLOCKTYPE a_FluidBlock ) const { // Players can't place fluid while in adventure mode. @@ -165,13 +192,15 @@ public: // Wash away anything that was there prior to placing: if (cFluidSimulator::CanWashAway(CurrentBlockType)) { - if (a_PluginInterface.CallHookPlayerBreakingBlock(*a_Player, BlockPos, EntryFace, CurrentBlockType, CurrentBlockMeta)) + if (a_PluginInterface + .CallHookPlayerBreakingBlock(*a_Player, BlockPos, EntryFace, CurrentBlockType, CurrentBlockMeta)) { // Plugin disagrees with the washing-away return false; } a_World->DropBlockAsPickups(BlockPos, a_Player, nullptr); - a_PluginInterface.CallHookPlayerBrokenBlock(*a_Player, BlockPos, EntryFace, CurrentBlockType, CurrentBlockMeta); + a_PluginInterface + .CallHookPlayerBrokenBlock(*a_Player, BlockPos, EntryFace, CurrentBlockType, CurrentBlockMeta); } // Place the actual fluid block: @@ -184,12 +213,11 @@ public: bool GetBlockFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos) const { - class cCallbacks : - public cBlockTracer::cCallbacks + class cCallbacks : public cBlockTracer::cCallbacks { - public: + public: Vector3i m_Pos; - bool m_HasHitFluid; + bool m_HasHitFluid; cCallbacks(void) : @@ -197,11 +225,17 @@ public: { } - virtual bool OnNextBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override + virtual bool OnNextBlock( + Vector3i a_BlockPosition, + BLOCKTYPE a_BlockType, + NIBBLETYPE a_BlockMeta, + eBlockFace a_EntryFace + ) override { if (IsBlockWater(a_BlockType) || IsBlockLava(a_BlockType)) { - if (a_BlockMeta != 0) // GetBlockFromTrace is called for scooping up fluids; the hit block should be a source + if (a_BlockMeta != + 0) // GetBlockFromTrace is called for scooping up fluids; the hit block should be a source { return false; } @@ -233,18 +267,29 @@ public: - bool GetPlacementCoordsFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta, eBlockFace & a_BlockFace) const + bool GetPlacementCoordsFromTrace( + cWorld * a_World, + cPlayer * a_Player, + Vector3i & a_BlockPos, + BLOCKTYPE & a_BlockType, + NIBBLETYPE & a_BlockMeta, + eBlockFace & a_BlockFace + ) const { - class cCallbacks : - public cBlockTracer::cCallbacks + class cCallbacks : public cBlockTracer::cCallbacks { - public: - Vector3i m_Pos; - BLOCKTYPE m_ReplacedBlockType; + public: + Vector3i m_Pos; + BLOCKTYPE m_ReplacedBlockType; NIBBLETYPE m_ReplacedBlockMeta; eBlockFace m_EntryFace; - virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + virtual bool OnNextBlock( + Vector3i a_CBBlockPos, + BLOCKTYPE a_CBBlockType, + NIBBLETYPE a_CBBlockMeta, + eBlockFace a_CBEntryFace + ) override { if ((a_CBBlockType != E_BLOCK_AIR) && !IsBlockLiquid(a_CBBlockType)) { @@ -253,7 +298,10 @@ public: m_EntryFace = static_cast<eBlockFace>(a_CBEntryFace); if (!cFluidSimulator::CanWashAway(a_CBBlockType)) { - a_CBBlockPos = AddFaceDirection(a_CBBlockPos, a_CBEntryFace); // Was an unwashawayable block, can't overwrite it! + a_CBBlockPos = AddFaceDirection( + a_CBBlockPos, + a_CBEntryFace + ); // Was an unwashawayable block, can't overwrite it! } m_Pos = a_CBBlockPos; // (Block could be washed away, replace it) return true; // Abort tracing @@ -266,9 +314,9 @@ public: Vector3d Start(a_Player->GetEyePosition()); Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5); - // cLineBlockTracer::Trace() returns true when whole line was traversed. By returning true from the callback when we hit something, - // we ensure that this never happens if liquid could be placed - // Use this to judge whether the position is valid + // cLineBlockTracer::Trace() returns true when whole line was traversed. By returning true from the callback + // when we hit something, we ensure that this never happens if liquid could be placed Use this to judge whether + // the position is valid if (!Tracer.Trace(Start, End)) { a_BlockPos = Callbacks.m_Pos; diff --git a/src/Items/ItemButton.h b/src/Items/ItemButton.h index c106f393f..9736661c2 100644 --- a/src/Items/ItemButton.h +++ b/src/Items/ItemButton.h @@ -7,17 +7,14 @@ -class cItemButtonHandler final : - public cItemHandler +class cItemButtonHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the neighbor to which the button is attached, to the block meta for this button. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { @@ -38,8 +35,18 @@ private: } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), BlockFaceToMetaData(a_ClickedBlockFace)); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + BlockFaceToMetaData(a_ClickedBlockFace) + ); } }; diff --git a/src/Items/ItemChest.h b/src/Items/ItemChest.h index db5bd4493..687da626d 100644 --- a/src/Items/ItemChest.h +++ b/src/Items/ItemChest.h @@ -8,28 +8,30 @@ -class cItemChestHandler final : - public cItemHandler +class cItemChestHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; cItemChestHandler(const cItemChestHandler &) = delete; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Check that there is at most one single neighbor of the same chest type: - static const Vector3i CrossCoords[] = - { - {-1, 0, 0}, - { 0, 0, -1}, - { 1, 0, 0}, - { 0, 0, 1}, + static const Vector3i CrossCoords[] = { + {-1, 0, 0}, + {0, 0, -1}, + {1, 0, 0}, + {0, 0, 1}, }; auto & World = *a_Player.GetWorld(); diff --git a/src/Items/ItemChorusFruit.h b/src/Items/ItemChorusFruit.h index d60c2730f..077752099 100644 --- a/src/Items/ItemChorusFruit.h +++ b/src/Items/ItemChorusFruit.h @@ -8,13 +8,11 @@ -class cItemChorusFruitHandler final: - public cItemFoodHandler +class cItemChorusFruitHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - + public: constexpr cItemChorusFruitHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(4, 2.4)) { @@ -40,5 +38,4 @@ public: } return true; } - }; diff --git a/src/Items/ItemCloth.h b/src/Items/ItemCloth.h index 149bd642b..cdee8e6d1 100644 --- a/src/Items/ItemCloth.h +++ b/src/Items/ItemCloth.h @@ -7,17 +7,11 @@ -class cItemClothHandler final : - public cItemHandler +class cItemClothHandler final : public cItemHandler { -public: - constexpr cItemClothHandler(int a_ItemType) - : cItemHandler(a_ItemType) + public: + constexpr cItemClothHandler(int a_ItemType) : + cItemHandler(a_ItemType) { - } -} ; - - - - +}; diff --git a/src/Items/ItemComparator.h b/src/Items/ItemComparator.h index 48db85959..95ef6e7ff 100644 --- a/src/Items/ItemComparator.h +++ b/src/Items/ItemComparator.h @@ -8,24 +8,29 @@ -class cItemComparatorHandler final: - public cItemHandler +class cItemComparatorHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_INACTIVE_COMPARATOR, cBlockComparatorHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_INACTIVE_COMPARATOR, + cBlockComparatorHandler::YawToMetaData(a_Player.GetYaw()) + ); } - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemCookedFish.h b/src/Items/ItemCookedFish.h index 32933e058..06ceb3fc8 100644 --- a/src/Items/ItemCookedFish.h +++ b/src/Items/ItemCookedFish.h @@ -7,22 +7,19 @@ -class cItemCookedFishHandler final: - public cItemFoodHandler +class cItemCookedFishHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemCookedFishHandler(int a_ItemType): + public: + constexpr cItemCookedFishHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(0, 0)) { } virtual FoodInfo GetFoodInfo(const cItem * a_Item) const override { - static const FoodInfo CookedFishInfos[] = - { + static const FoodInfo CookedFishInfos[] = { FoodInfo(5, 6.0), // Cooked fish FoodInfo(6, 9.6), // Cooked salmon }; @@ -34,5 +31,4 @@ public: } return CookedFishInfos[a_Item->m_ItemDamage]; } - }; diff --git a/src/Items/ItemDefaultItem.h b/src/Items/ItemDefaultItem.h index afd5ab126..e00d4c008 100644 --- a/src/Items/ItemDefaultItem.h +++ b/src/Items/ItemDefaultItem.h @@ -7,10 +7,8 @@ -class cDefaultItemHandler final : - public cItemHandler +class cDefaultItemHandler final : public cItemHandler { -public: - + public: using cItemHandler::cItemHandler; }; diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index 6538a5bef..555aa3980 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -9,23 +9,26 @@ -class cItemDoorHandler final: - public cItemHandler +class cItemDoorHandler final : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemDoorHandler(int a_ItemType): + public: + constexpr cItemDoorHandler(int a_ItemType) : Super(a_ItemType) { - } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Vanilla only allows door placement while clicking on the top face of the block below the door: if (a_ClickedBlockFace != BLOCK_FACE_TOP) @@ -37,14 +40,14 @@ public: BLOCKTYPE BlockType; switch (m_ItemType) { - case E_ITEM_WOODEN_DOOR: BlockType = E_BLOCK_OAK_DOOR; break; - case E_ITEM_IRON_DOOR: BlockType = E_BLOCK_IRON_DOOR; break; - case E_ITEM_SPRUCE_DOOR: BlockType = E_BLOCK_SPRUCE_DOOR; break; - case E_ITEM_BIRCH_DOOR: BlockType = E_BLOCK_BIRCH_DOOR; break; - case E_ITEM_JUNGLE_DOOR: BlockType = E_BLOCK_JUNGLE_DOOR; break; + case E_ITEM_WOODEN_DOOR: BlockType = E_BLOCK_OAK_DOOR; break; + case E_ITEM_IRON_DOOR: BlockType = E_BLOCK_IRON_DOOR; break; + case E_ITEM_SPRUCE_DOOR: BlockType = E_BLOCK_SPRUCE_DOOR; break; + case E_ITEM_BIRCH_DOOR: BlockType = E_BLOCK_BIRCH_DOOR; break; + case E_ITEM_JUNGLE_DOOR: BlockType = E_BLOCK_JUNGLE_DOOR; break; case E_ITEM_DARK_OAK_DOOR: BlockType = E_BLOCK_DARK_OAK_DOOR; break; - case E_ITEM_ACACIA_DOOR: BlockType = E_BLOCK_ACACIA_DOOR; break; - default: UNREACHABLE("Unhandled door type"); + case E_ITEM_ACACIA_DOOR: BlockType = E_BLOCK_ACACIA_DOOR; break; + default: UNREACHABLE("Unhandled door type"); } const auto & World = *a_Player.GetWorld(); @@ -56,7 +59,14 @@ public: NIBBLETYPE TopMeta; World.GetBlockTypeMeta(UpperBlockPosition, TopType, TopMeta); - if (!cBlockHandler::For(TopType).DoesIgnoreBuildCollision(World, a_HeldItem, UpperBlockPosition, TopMeta, a_ClickedBlockFace, false)) + if (!cBlockHandler::For(TopType).DoesIgnoreBuildCollision( + World, + a_HeldItem, + UpperBlockPosition, + TopMeta, + a_ClickedBlockFace, + false + )) { return false; } @@ -81,18 +91,16 @@ public: // DEBUG: FLOGD("Door being placed at {0}", a_PlacePosition); FLOGD("RelDirToOutside: {0}", RelDirToOutside); - FLOGD("Left neighbor at {0}: {1} ({2})", LeftNeighborPos, LeftNeighborBlock, ItemTypeToString(LeftNeighborBlock)); - FLOGD("Right neighbor at {0}: {1} ({2})", RightNeighborPos, RightNeighborBlock, ItemTypeToString(RightNeighborBlock)); + FLOGD("Left neighbor at {0}: {1} ({2})", LeftNeighborPos, LeftNeighborBlock, + ItemTypeToString(LeftNeighborBlock)); FLOGD("Right neighbor at {0}: {1} ({2})", RightNeighborPos, + RightNeighborBlock, ItemTypeToString(RightNeighborBlock)); */ - if ( - cBlockDoorHandler::IsDoorBlockType(LeftNeighborBlock) || // The block to the left is a door block - ( - !cBlockInfo::IsSolid(LeftNeighborBlock) && // Prioritize hinge on the left side - cBlockInfo::IsSolid(RightNeighborBlock) && // The block to the right is solid... - !cBlockDoorHandler::IsDoorBlockType(RightNeighborBlock) // ... but not a door - ) - ) + if (cBlockDoorHandler::IsDoorBlockType(LeftNeighborBlock) || // The block to the left is a door block + (!cBlockInfo::IsSolid(LeftNeighborBlock) && // Prioritize hinge on the left side + cBlockInfo::IsSolid(RightNeighborBlock) && // The block to the right is solid... + !cBlockDoorHandler::IsDoorBlockType(RightNeighborBlock) // ... but not a door + )) { // DEBUG: LOGD("Setting hinge to right side"); UpperBlockMeta = 0x09; // Upper block | hinge on right @@ -100,17 +108,12 @@ public: // Set the blocks: return a_Player.PlaceBlocks( - { - { a_PlacePosition, BlockType, LowerBlockMeta }, - { UpperBlockPosition, BlockType, UpperBlockMeta } - }); + {{a_PlacePosition, BlockType, LowerBlockMeta}, {UpperBlockPosition, BlockType, UpperBlockMeta}} + ); } - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemDropSpenser.h b/src/Items/ItemDropSpenser.h index 68f2cc137..e44a017be 100644 --- a/src/Items/ItemDropSpenser.h +++ b/src/Items/ItemDropSpenser.h @@ -8,19 +8,30 @@ -class cItemDropSpenserHandler final : - public cItemHandler +class cItemDropSpenserHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), cBlockDropSpenserHandler::DisplacementYawToMetaData(a_PlacePosition, a_Player.GetEyePosition(), a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + cBlockDropSpenserHandler::DisplacementYawToMetaData( + a_PlacePosition, + a_Player.GetEyePosition(), + a_Player.GetYaw() + ) + ); } }; diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h index 636a1b477..4c28e63b3 100644 --- a/src/Items/ItemDye.h +++ b/src/Items/ItemDye.h @@ -10,12 +10,11 @@ -class cItemDyeHandler final : - public cItemHandler +class cItemDyeHandler final : public cItemHandler { using Super = cItemHandler; -public: + public: using Super::Super; @@ -43,7 +42,8 @@ public: } } } - else if ((a_HeldItem.m_ItemDamage == E_META_DYE_BROWN) && (a_ClickedBlockFace >= BLOCK_FACE_ZM) && (a_ClickedBlockFace <= BLOCK_FACE_XP)) + else if ((a_HeldItem.m_ItemDamage == E_META_DYE_BROWN) && (a_ClickedBlockFace >= BLOCK_FACE_ZM) && + (a_ClickedBlockFace <= BLOCK_FACE_XP)) { // Players can't place blocks while in adventure mode. if (a_Player->IsGameModeAdventure()) @@ -126,7 +126,8 @@ public: case E_BLOCK_BEETROOTS: { // Fix GH #4805. - // Bonemeal should only advance growth, not spawn produce, and should not be consumed if plant at maturity: + // Bonemeal should only advance growth, not spawn produce, and should not be consumed if plant at + // maturity: if (a_World.GrowPlantAt(a_BlockPos, 1) <= 0) { return false; @@ -157,10 +158,14 @@ public: cItems Pickups; switch (BlockMeta) { - case E_META_BIG_FLOWER_SUNFLOWER: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_SUNFLOWER); break; - case E_META_BIG_FLOWER_LILAC: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_LILAC); break; - case E_META_BIG_FLOWER_ROSE_BUSH: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_ROSE_BUSH); break; - case E_META_BIG_FLOWER_PEONY: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_PEONY); break; + case E_META_BIG_FLOWER_SUNFLOWER: + Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_SUNFLOWER); + break; + case E_META_BIG_FLOWER_LILAC: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_LILAC); break; + case E_META_BIG_FLOWER_ROSE_BUSH: + Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_ROSE_BUSH); + break; + case E_META_BIG_FLOWER_PEONY: Pickups.Add(E_BLOCK_BIG_FLOWER, 1, E_META_BIG_FLOWER_PEONY); break; } // TODO: Should we call any hook for this? a_World.SpawnItemPickups(Pickups, a_BlockPos); @@ -201,10 +206,10 @@ public: return true; } - // TODO: case E_BLOCK_SWEET_BERRY_BUSH: - // TODO: case E_BLOCK_SEA_PICKLE: - // TODO: case E_BLOCK_KELP: - // TODO: case E_BLOCK_BAMBOO: + // TODO: case E_BLOCK_SWEET_BERRY_BUSH: + // TODO: case E_BLOCK_SEA_PICKLE: + // TODO: case E_BLOCK_KELP: + // TODO: case E_BLOCK_BAMBOO: } // switch (blockType) return false; } @@ -284,13 +289,17 @@ public: case 0: a_World.SetBlock(a_Position, E_BLOCK_DANDELION, 0); break; case 1: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_POPPY); break; case 2: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_ALLIUM); break; - case 3: a_World.SetBlock(a_Position, E_BLOCK_RED_ROSE, 0); break; // was renamed to Azure Bluet later + case 3: + a_World.SetBlock(a_Position, E_BLOCK_RED_ROSE, 0); + break; // was renamed to Azure Bluet later case 4: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_RED_TULIP); break; case 5: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_PINK_TULIP); break; case 6: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_WHITE_TULIP); break; case 7: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_ORANGE_TULIP); break; - case 8: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_OXEYE_DAISY); break; - // TODO: Add cornflower + case 8: + a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_OXEYE_DAISY); + break; + // TODO: Add cornflower } break; } @@ -307,13 +316,17 @@ public: case 0: a_World.SetBlock(a_Position, E_BLOCK_DANDELION, 0); break; case 1: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_POPPY); break; case 2: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_ALLIUM); break; - case 3: a_World.SetBlock(a_Position, E_BLOCK_RED_ROSE, 0); break; // was renamed to Azure Bluet later + case 3: + a_World.SetBlock(a_Position, E_BLOCK_RED_ROSE, 0); + break; // was renamed to Azure Bluet later case 4: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_RED_TULIP); break; case 5: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_PINK_TULIP); break; case 6: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_WHITE_TULIP); break; case 7: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_ORANGE_TULIP); break; - case 8: a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_OXEYE_DAISY); break; - // TODO: Add cornflower, lily of the valley + case 8: + a_World.SetBlock(a_Position, E_BLOCK_FLOWER, E_META_FLOWER_OXEYE_DAISY); + break; + // TODO: Add cornflower, lily of the valley } break; } @@ -342,30 +355,26 @@ public: } } - /** Walks adjacent grass blocks up to 7 taxicab distance away from a_Position and calls the Planter function on the first suitable one found. - Does nothing if no position suitable for growing was found. */ - template <auto Planter> - static void FindAdjacentGrassAnd(cWorld & a_World, const Vector3i a_Position) + /** Walks adjacent grass blocks up to 7 taxicab distance away from a_Position and calls the Planter function on the + first suitable one found. Does nothing if no position suitable for growing was found. */ + template <auto Planter> static void FindAdjacentGrassAnd(cWorld & a_World, const Vector3i a_Position) { auto & Random = GetRandomProvider(); auto Position = a_Position; // Maximum 7 taxicab distance away from centre: - for ( - int Tries = 0; - Tries != 8; - Tries++, - - // Get the adjacent block to visit this iteration: - Position += Vector3i( - Random.RandInt(-1, 1), - Random.RandInt(-1, 1) * (Random.RandInt(2) / 2), // Y offset, with discouragement to values that aren't zero - Random.RandInt(-1, 1) - ) - ) + for (int Tries = 0; Tries != 8; + Tries++, + + // Get the adjacent block to visit this iteration: + Position += Vector3i( + Random.RandInt(-1, 1), + Random.RandInt(-1, 1) * + (Random.RandInt(2) / 2), // Y offset, with discouragement to values that aren't zero + Random.RandInt(-1, 1) + )) { - if ( - !cChunkDef::IsValidHeight(Position) || + if (!cChunkDef::IsValidHeight(Position) || (a_World.GetBlock(Position) != E_BLOCK_GRASS) // Are we looking at grass? ) { @@ -395,8 +404,4 @@ public: return; } } -} ; - - - - +}; diff --git a/src/Items/ItemEmptyMap.h b/src/Items/ItemEmptyMap.h index d06102fab..af72c5cad 100644 --- a/src/Items/ItemEmptyMap.h +++ b/src/Items/ItemEmptyMap.h @@ -7,15 +7,13 @@ -class cItemEmptyMapHandler final: - public cItemHandler +class cItemEmptyMapHandler final : public cItemHandler { using Super = cItemHandler; static const unsigned int DEFAULT_SCALE = 0; -public: - + public: using Super::Super; @@ -34,7 +32,8 @@ public: UNUSED(a_HeldItem); UNUSED(a_ClickedBlockFace); - // The map center is fixed at the central point of the 8x8 block of chunks you are standing in when you right-click it. + // The map center is fixed at the central point of the 8x8 block of chunks you are standing in when you + // right-click it. const int RegionWidth = cChunkDef::Width * 8; @@ -51,4 +50,4 @@ public: a_Player->ReplaceOneEquippedItemTossRest(cItem(E_ITEM_MAP, 1, static_cast<short>(NewMap->GetID() & 0x7fff))); return true; } -} ; +}; diff --git a/src/Items/ItemEnchantingTable.h b/src/Items/ItemEnchantingTable.h index c89de2a34..804456194 100644 --- a/src/Items/ItemEnchantingTable.h +++ b/src/Items/ItemEnchantingTable.h @@ -9,18 +9,21 @@ -class cItemEnchantingTableHandler final: - public cItemHandler +class cItemEnchantingTableHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { if (!Super::CommitPlacement(a_Player, a_HeldItem, a_PlacePosition, a_ClickedBlockFace, a_CursorPosition)) { @@ -32,20 +35,20 @@ private: return true; } - a_Player.GetWorld()->DoWithBlockEntityAt(a_PlacePosition, [&a_HeldItem](cBlockEntity & a_BlockEntity) - { - ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE); + a_Player.GetWorld()->DoWithBlockEntityAt( + a_PlacePosition, + [&a_HeldItem](cBlockEntity & a_BlockEntity) + { + ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE); - static_cast<cEnchantingTableEntity &>(a_BlockEntity).SetCustomName(a_HeldItem.m_CustomName); - return false; - }); + static_cast<cEnchantingTableEntity &>(a_BlockEntity).SetCustomName(a_HeldItem.m_CustomName); + return false; + } + ); return true; } - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemEndCrystal.h b/src/Items/ItemEndCrystal.h index 976bc83ec..4653354f1 100644 --- a/src/Items/ItemEndCrystal.h +++ b/src/Items/ItemEndCrystal.h @@ -9,13 +9,11 @@ -class cItemEndCrystalHandler final : - public cItemHandler +class cItemEndCrystalHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: constexpr cItemEndCrystalHandler(int a_ItemType) : Super(a_ItemType) { @@ -23,10 +21,13 @@ public: virtual bool OnItemUse( - cWorld * a_World, cPlayer * a_Player, - cBlockPluginInterface & a_PluginInterface, const cItem & a_HeldItem, + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_HeldItem, const Vector3i a_BlockPos, - eBlockFace a_ClickedBlockFace) const override + eBlockFace a_ClickedBlockFace + ) const override { // Must click a valid block: if (a_ClickedBlockFace < 0) @@ -34,12 +35,10 @@ public: return false; } - if ( - const auto BlockType = a_World->GetBlock(a_BlockPos); + if (const auto BlockType = a_World->GetBlock(a_BlockPos); // Don't place if placement block is not obsidian or bedrock: - (BlockType != E_BLOCK_OBSIDIAN) && (BlockType != E_BLOCK_BEDROCK) - ) + (BlockType != E_BLOCK_OBSIDIAN) && (BlockType != E_BLOCK_BEDROCK)) { return false; } diff --git a/src/Items/ItemEndPortalFrame.h b/src/Items/ItemEndPortalFrame.h index 4f4d8a81f..3f4a6310e 100644 --- a/src/Items/ItemEndPortalFrame.h +++ b/src/Items/ItemEndPortalFrame.h @@ -8,19 +8,26 @@ -class cItemEndPortalFrameHandler final : - public cItemHandler +class cItemEndPortalFrameHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_END_PORTAL_FRAME, cBlockEndPortalFrameHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_END_PORTAL_FRAME, + cBlockEndPortalFrameHandler::YawToMetaData(a_Player.GetYaw()) + ); } }; diff --git a/src/Items/ItemEnderChest.h b/src/Items/ItemEnderChest.h index 120abb8e6..401a54d1d 100644 --- a/src/Items/ItemEnderChest.h +++ b/src/Items/ItemEnderChest.h @@ -8,19 +8,26 @@ -class cItemEnderChestHandler final : - public cItemHandler +class cItemEnderChestHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_ENDER_CHEST, cBlockEnderChestHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_ENDER_CHEST, + cBlockEnderChestHandler::YawToMetaData(a_Player.GetYaw()) + ); } }; diff --git a/src/Items/ItemEyeOfEnder.h b/src/Items/ItemEyeOfEnder.h index fc6fac336..6418d50ad 100644 --- a/src/Items/ItemEyeOfEnder.h +++ b/src/Items/ItemEyeOfEnder.h @@ -8,14 +8,12 @@ -class cItemEyeOfEnderHandler final: - public cItemThrowableHandler +class cItemEyeOfEnderHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemEyeOfEnderHandler(int a_ItemType): + public: + constexpr cItemEyeOfEnderHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkSnowball, 30) { } @@ -25,7 +23,10 @@ public: virtual bool OnItemUse( - cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_Item, const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace ) const override @@ -41,7 +42,11 @@ public: // Fill the portal frame. E_META_END_PORTAL_EYE is the bit for holding the eye of ender. if ((FacingMeta & E_META_END_PORTAL_FRAME_EYE) != E_META_END_PORTAL_FRAME_EYE) { - a_World->SetBlock(a_ClickedBlockPos, E_BLOCK_END_PORTAL_FRAME, FacingMeta | E_META_END_PORTAL_FRAME_EYE); + a_World->SetBlock( + a_ClickedBlockPos, + E_BLOCK_END_PORTAL_FRAME, + FacingMeta | E_META_END_PORTAL_FRAME_EYE + ); if (!a_Player->IsGameModeCreative()) { a_Player->GetInventory().RemoveOneEquippedItem(); @@ -67,7 +72,12 @@ public: /** Returns false if portal cannot be made, true if portal was made. */ - static bool FindAndSetPortal(Vector3i a_FirstFrame, NIBBLETYPE a_Direction, cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface) + static bool FindAndSetPortal( + Vector3i a_FirstFrame, + NIBBLETYPE a_Direction, + cChunkInterface & a_ChunkInterface, + cWorldInterface & a_WorldInterface + ) { /* PORTAL FINDING ALGORITH @@ -75,8 +85,10 @@ public: - Get clicked base block - Check diagonally (clockwise) for another portal block - if exists, and has eye, Continue. Abort if any are facing the wrong direction. - - if doesn't exist, check horizontally (the block to the left of this block). Abort if there is no horizontal block. - - After a corner has been met, traverse the portal clockwise, ensuring valid portal frames connect the rectangle. + - if doesn't exist, check horizontally (the block to the left of this block). Abort if there is no + horizontal block. + - After a corner has been met, traverse the portal clockwise, ensuring valid portal frames connect the + rectangle. - Track the NorthWest Corner, and the dimensions. - If dimensions are valid, create the portal. */ @@ -87,25 +99,23 @@ public: const int MAX_PORTAL_WIDTH = 4; // Directions to use for the clockwise traversal. - static const Vector3i Left[] = - { - { 1, 0, 0}, // 0, South, left block is East / XP - { 0, 0, 1}, // 1, West, left block is South / ZP - {-1, 0, 0}, // 2, North, left block is West / XM - { 0, 0, -1}, // 3, East, left block is North / ZM + static const Vector3i Left[] = { + {1, 0, 0}, // 0, South, left block is East / XP + {0, 0, 1}, // 1, West, left block is South / ZP + {-1, 0, 0}, // 2, North, left block is West / XM + {0, 0, -1}, // 3, East, left block is North / ZM }; - static const Vector3i LeftForward[] = - { - { 1, 0, 1}, // 0, South, left block is SouthEast / XP ZP - {-1, 0, 1}, // 1, West, left block is SouthWest / XM ZP + static const Vector3i LeftForward[] = { + {1, 0, 1}, // 0, South, left block is SouthEast / XP ZP + {-1, 0, 1}, // 1, West, left block is SouthWest / XM ZP {-1, 0, -1}, // 2, North, left block is NorthWest / XM ZM - { 1, 0, -1}, // 3, East, left block is NorthEast / XP ZM + {1, 0, -1}, // 3, East, left block is NorthEast / XP ZM }; int EdgesComplete = -1; // We start search _before_ finding the first edge Vector3i NorthWestCorner; - int EdgeWidth[4] = { 1, 1, 1, 1 }; + int EdgeWidth[4] = {1, 1, 1, 1}; NIBBLETYPE CurrentDirection = a_Direction; Vector3i CurrentPos = a_FirstFrame; @@ -171,7 +181,8 @@ public: { for (int j = 0; j < EdgeWidth[1]; j++) { - a_ChunkInterface.SetBlock(NorthWestCorner.x + i, NorthWestCorner.y, NorthWestCorner.z + j, E_BLOCK_END_PORTAL, 0); + a_ChunkInterface + .SetBlock(NorthWestCorner.x + i, NorthWestCorner.y, NorthWestCorner.z + j, E_BLOCK_END_PORTAL, 0); } } return true; @@ -189,8 +200,7 @@ public: return ( a_ChunkInterface.GetBlockTypeMeta(a_BlockPos, BlockType, BlockMeta) && - (BlockType == E_BLOCK_END_PORTAL_FRAME) && - (BlockMeta == (a_ShouldFace | E_META_END_PORTAL_FRAME_EYE)) + (BlockType == E_BLOCK_END_PORTAL_FRAME) && (BlockMeta == (a_ShouldFace | E_META_END_PORTAL_FRAME_EYE)) ); } @@ -198,13 +208,5 @@ public: /** Return true if this block is a portal frame. */ - static bool IsPortalFrame(BLOCKTYPE BlockType) - { - return (BlockType == E_BLOCK_END_PORTAL_FRAME); - } -} ; - - - - - + static bool IsPortalFrame(BLOCKTYPE BlockType) { return (BlockType == E_BLOCK_END_PORTAL_FRAME); } +}; diff --git a/src/Items/ItemFenceGate.h b/src/Items/ItemFenceGate.h index a3e02f5b1..8a8436120 100644 --- a/src/Items/ItemFenceGate.h +++ b/src/Items/ItemFenceGate.h @@ -8,19 +8,26 @@ -class cItemFenceGateHandler final : - public cItemHandler +class cItemFenceGateHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), cBlockFenceGateHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + cBlockFenceGateHandler::YawToMetaData(a_Player.GetYaw()) + ); } }; diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 840ff7d5c..34f7c0875 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -14,14 +14,13 @@ // cFloaterCallback class cFloaterCallback { -public: + public: cFloaterCallback(void) : - m_CanPickup(false), - m_AttachedMobID(cEntity::INVALID_ID) + m_CanPickup(false), m_AttachedMobID(cEntity::INVALID_ID) { } - bool operator () (cEntity & a_Entity) + bool operator()(cEntity & a_Entity) { auto & Floater = static_cast<cFloater &>(a_Entity); m_CanPickup = Floater.CanPickup(); @@ -32,30 +31,28 @@ public: return true; } - bool CanPickup(void) const { return m_CanPickup; } - bool IsAttached(void) const { return (m_AttachedMobID != cEntity::INVALID_ID); } + bool CanPickup(void) const { return m_CanPickup; } + bool IsAttached(void) const { return (m_AttachedMobID != cEntity::INVALID_ID); } UInt32 GetAttachedMobID(void) const { return m_AttachedMobID; } - Vector3d GetPos(void) const { return m_Pos; } - Vector3d GetBitePos(void) const { return m_BitePos; } + Vector3d GetPos(void) const { return m_Pos; } + Vector3d GetBitePos(void) const { return m_BitePos; } -protected: + protected: bool m_CanPickup; UInt32 m_AttachedMobID; Vector3d m_Pos; Vector3d m_BitePos; -} ; +}; -class cItemFishingRodHandler final: - public cItemHandler +class cItemFishingRodHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -84,9 +81,11 @@ public: { // Cast a hook: auto & Random = GetRandomProvider(); - auto CountDownTime = Random.RandInt(100, 900) - static_cast<int>(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100); + auto CountDownTime = Random.RandInt(100, 900) - + static_cast<int>(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100); auto Floater = std::make_unique<cFloater>( - a_Player->GetEyePosition(), a_Player->GetLookVector() * 15, + a_Player->GetEyePosition(), + a_Player->GetLookVector() * 15, a_Player->GetUniqueID(), CountDownTime ); @@ -104,7 +103,8 @@ public: - /** Reels back the fishing line, reeling any attached mob, or creating fished loot, or just breaking the fishing rod. */ + /** Reels back the fishing line, reeling any attached mob, or creating fished loot, or just breaking the fishing + * rod. */ void ReelIn(cWorld & a_World, cPlayer & a_Player) const { cFloaterCallback FloaterInfo; @@ -140,7 +140,9 @@ public: void ReelInEntity(cWorld & a_World, cPlayer & a_Player, UInt32 a_EntityID) const { auto PlayerPos = a_Player.GetPosition(); - a_World.DoWithEntityByID(a_EntityID, [=](cEntity & a_Entity) + a_World.DoWithEntityByID( + a_EntityID, + [=](cEntity & a_Entity) { auto Speed = PlayerPos - a_Entity.GetPosition(); a_Entity.AddSpeed(Speed); @@ -156,7 +158,8 @@ public: void ReelInLoot(cWorld & a_World, cPlayer & a_Player, const Vector3d a_FloaterBitePos) const { - auto LotSLevel = std::min(a_Player.GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLuckOfTheSea), 3u); + auto LotSLevel = + std::min(a_Player.GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLuckOfTheSea), 3u); // Chances for getting an item from the category for each level of Luck of the Sea (0 - 3) const int TreasureChances[] = {50, 71, 92, 113}; // 5% | 7.1% | 9.2% | 11.3% @@ -303,4 +306,4 @@ public: // Notify plugins cRoot::Get()->GetPluginManager()->CallHookPlayerFished(a_Player, Drops, Experience); } -} ; +}; diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 7ec879b5d..a70351305 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -7,24 +7,18 @@ -class cItemFoodHandler: - public cItemHandler +class cItemFoodHandler : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemFoodHandler(int a_ItemType, FoodInfo a_FoodInfo): - Super(a_ItemType), - m_FoodInfo(a_FoodInfo) + public: + constexpr cItemFoodHandler(int a_ItemType, FoodInfo a_FoodInfo) : + Super(a_ItemType), m_FoodInfo(a_FoodInfo) { } - virtual bool IsFood(void) const override - { - return true; - } + virtual bool IsFood(void) const override { return true; } virtual FoodInfo GetFoodInfo(const cItem * a_Item) const override { @@ -47,14 +41,13 @@ public: return true; } -protected: + protected: FoodInfo m_FoodInfo; ~cItemFoodHandler() = default; }; -class cItemSimpleFoodHandler final: - public cItemFoodHandler +class cItemSimpleFoodHandler final : public cItemFoodHandler { using cItemFoodHandler::cItemFoodHandler; }; diff --git a/src/Items/ItemFoodSeeds.h b/src/Items/ItemFoodSeeds.h index 381bcc4eb..3d2db455c 100644 --- a/src/Items/ItemFoodSeeds.h +++ b/src/Items/ItemFoodSeeds.h @@ -8,25 +8,18 @@ -class cItemFoodSeedsHandler final: - public cItemSeedsHandler +class cItemFoodSeedsHandler final : public cItemSeedsHandler { using Super = cItemSeedsHandler; -public: - - constexpr cItemFoodSeedsHandler(int a_ItemType, FoodInfo a_FoodInfo): - Super(a_ItemType), - m_FoodInfo(a_FoodInfo) + public: + constexpr cItemFoodSeedsHandler(int a_ItemType, FoodInfo a_FoodInfo) : + Super(a_ItemType), m_FoodInfo(a_FoodInfo) { - } - virtual bool IsFood(void) const override - { - return true; - } + virtual bool IsFood(void) const override { return true; } virtual FoodInfo GetFoodInfo(const cItem * a_Item) const override { @@ -49,7 +42,6 @@ public: return true; } -protected: + protected: FoodInfo m_FoodInfo; - }; diff --git a/src/Items/ItemFurnace.h b/src/Items/ItemFurnace.h index 48f725f4f..54c91136f 100644 --- a/src/Items/ItemFurnace.h +++ b/src/Items/ItemFurnace.h @@ -8,19 +8,23 @@ -class cItemFurnaceHandler final : - public cItemHandler +class cItemFurnaceHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_FURNACE, cBlockFurnaceHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player + .PlaceBlock(a_PlacePosition, E_BLOCK_FURNACE, cBlockFurnaceHandler::YawToMetaData(a_Player.GetYaw())); } }; diff --git a/src/Items/ItemGlazedTerracotta.h b/src/Items/ItemGlazedTerracotta.h index 0ce74d5aa..cf6c63af1 100644 --- a/src/Items/ItemGlazedTerracotta.h +++ b/src/Items/ItemGlazedTerracotta.h @@ -8,19 +8,26 @@ -class cItemGlazedTerracottaHandler final : - public cItemHandler +class cItemGlazedTerracottaHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), cBlockGlazedTerracottaHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + cBlockGlazedTerracottaHandler::YawToMetaData(a_Player.GetYaw()) + ); } }; diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h index 25ed284e6..9bcc210d8 100644 --- a/src/Items/ItemGoldenApple.h +++ b/src/Items/ItemGoldenApple.h @@ -7,14 +7,12 @@ -class cItemGoldenAppleHandler final: - public cItemFoodHandler +class cItemGoldenAppleHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemGoldenAppleHandler(int a_ItemType): + public: + constexpr cItemGoldenAppleHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(4, 9.6)) { } @@ -43,5 +41,4 @@ public: return true; } - }; diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 11b544815..617dc08aa 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -98,469 +98,470 @@ namespace { - constexpr cDefaultItemHandler Item11DiscHandler (E_ITEM_11_DISC); - constexpr cDefaultItemHandler Item13DiscHandler (E_ITEM_13_DISC); - constexpr cItemBoatHandler ItemAcaciaBoatHandler (E_ITEM_ACACIA_BOAT); - constexpr cDefaultItemHandler ItemAcaciaDoorBlockHandler (E_BLOCK_ACACIA_DOOR); - constexpr cItemDoorHandler ItemAcaciaDoorHandler (E_ITEM_ACACIA_DOOR); - constexpr cItemFenceGateHandler ItemAcaciaFenceGateHandler (E_BLOCK_ACACIA_FENCE_GATE); - constexpr cDefaultItemHandler ItemAcaciaFenceHandler (E_BLOCK_ACACIA_FENCE); - constexpr cItemStairsHandler ItemAcaciaStairsHandler (E_BLOCK_ACACIA_WOOD_STAIRS); - constexpr cItemRailHandler ItemActivatorRailHandler (E_BLOCK_ACTIVATOR_RAIL); - constexpr cDefaultItemHandler ItemActiveComparatorHandler (E_BLOCK_ACTIVE_COMPARATOR); - constexpr cDefaultItemHandler ItemAirHandler (E_BLOCK_AIR); - constexpr cItemAnvilHandler ItemAnvilHandler (E_BLOCK_ANVIL); - constexpr cItemSimpleFoodHandler ItemAppleHandler (E_ITEM_RED_APPLE, cItemHandler::FoodInfo(4, 2.4)); - constexpr cDefaultItemHandler ItemArmorStandHandler (E_ITEM_ARMOR_STAND); - constexpr cDefaultItemHandler ItemArrowHandler (E_ITEM_ARROW); - constexpr cItemSimpleFoodHandler ItemBakedPotatoHandler (E_ITEM_BAKED_POTATO, cItemHandler::FoodInfo(5, 6)); - constexpr cItemBannerHandler ItemBannerHandler (E_ITEM_BANNER); - constexpr cDefaultItemHandler ItemBarrierHandler (E_BLOCK_BARRIER); - constexpr cDefaultItemHandler ItemBeaconHandler (E_BLOCK_BEACON); - constexpr cDefaultItemHandler ItemBedBlockHandler (E_BLOCK_BED); - constexpr cItemBedHandler ItemBedHandler (E_ITEM_BED); - constexpr cDefaultItemHandler ItemBedrockHandler (E_BLOCK_BEDROCK); - constexpr cItemSimpleFoodHandler ItemBeetrootHandler (E_ITEM_BEETROOT, cItemHandler::FoodInfo(1, 1.2)); - constexpr cDefaultItemHandler ItemBeetrootsBlockHandler (E_BLOCK_BEETROOTS); - constexpr cItemSimpleSeedsHandler ItemBeetrootSeedsHandler (E_ITEM_BEETROOT_SEEDS); - constexpr cItemSoupHandler ItemBeetrootSoupHandler (E_ITEM_BEETROOT_SOUP, cItemHandler::FoodInfo(6, 7.2)); - constexpr cItemBigFlowerHandler ItemBigFlowerHandler (E_BLOCK_BIG_FLOWER); - constexpr cItemBoatHandler ItemBirchBoatHandler (E_ITEM_BIRCH_BOAT); - constexpr cDefaultItemHandler ItemBirchDoorBlockHandler (E_BLOCK_BIRCH_DOOR); - constexpr cItemDoorHandler ItemBirchDoorHandler (E_ITEM_BIRCH_DOOR); - constexpr cItemFenceGateHandler ItemBirchFenceGateHandler (E_BLOCK_BIRCH_FENCE_GATE); - constexpr cDefaultItemHandler ItemBirchFenceHandler (E_BLOCK_BIRCH_FENCE); - constexpr cItemStairsHandler ItemBirchStairsHandler (E_BLOCK_BIRCH_WOOD_STAIRS); - constexpr cItemGlazedTerracottaHandler ItemBlackGlazedTerracottaHandler (E_BLOCK_BLACK_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemBlackShulkerBoxHandler (E_BLOCK_BLACK_SHULKER_BOX); - constexpr cDefaultItemHandler ItemBlazePowderHandler (E_ITEM_BLAZE_POWDER); - constexpr cDefaultItemHandler ItemBlazeRodHandler (E_ITEM_BLAZE_ROD); - constexpr cDefaultItemHandler ItemBlocksDiscHandler (E_ITEM_BLOCKS_DISC); - constexpr cItemGlazedTerracottaHandler ItemBlueGlazedTerracottaHandler (E_BLOCK_BLUE_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemBlueShulkerBoxHandler (E_BLOCK_BLUE_SHULKER_BOX); - constexpr cDefaultItemHandler ItemBoneBlockHandler (E_BLOCK_BONE_BLOCK); - constexpr cDefaultItemHandler ItemBoneHandler (E_ITEM_BONE); - constexpr cDefaultItemHandler ItemBookAndQuillHandler (E_ITEM_BOOK_AND_QUILL); - constexpr cDefaultItemHandler ItemBookHandler (E_ITEM_BOOK); - constexpr cDefaultItemHandler ItemBookshelfHandler (E_BLOCK_BOOKCASE); - constexpr cItemBottleOEnchantingHandler ItemBottleOEnchantingHandler (E_ITEM_BOTTLE_O_ENCHANTING); - constexpr cItemBowHandler ItemBowHandler (E_ITEM_BOW); - constexpr cDefaultItemHandler ItemBowlHandler (E_ITEM_BOWL); - constexpr cItemSimpleFoodHandler ItemBreadHandler (E_ITEM_BREAD, cItemHandler::FoodInfo(5, 6)); - constexpr cDefaultItemHandler ItemBrewingStandBlockHandler (E_BLOCK_BREWING_STAND); - constexpr cSimplePlaceableItemHandler ItemBrewingStandHandler (E_ITEM_BREWING_STAND, E_BLOCK_BREWING_STAND); - constexpr cDefaultItemHandler ItemBrickHandler (E_ITEM_CLAY_BRICK); - constexpr cDefaultItemHandler ItemBricksHandler (E_BLOCK_BRICK); - constexpr cItemStairsHandler ItemBricksStairsHandler (E_BLOCK_BRICK_STAIRS); - constexpr cItemGlazedTerracottaHandler ItemBrownGlazedTerracottaHandler (E_BLOCK_BROWN_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemBrownMushroomBlockHandler (E_BLOCK_BROWN_MUSHROOM); - constexpr cDefaultItemHandler ItemBrownShulkerBoxHandler (E_BLOCK_BROWN_SHULKER_BOX); - constexpr cItemBucketHandler ItemBucketHandler (E_ITEM_BUCKET); - constexpr cDefaultItemHandler ItemCactusHandler (E_BLOCK_CACTUS); - constexpr cDefaultItemHandler ItemCakeBlockHandler (E_BLOCK_CAKE); - constexpr cSimplePlaceableItemHandler ItemCakeHandler (E_ITEM_CAKE, E_BLOCK_CAKE); - constexpr cDefaultItemHandler ItemCarpetHandler (E_BLOCK_CARPET); - constexpr cItemFoodSeedsHandler ItemCarrotHandler (E_ITEM_CARROT, cItemHandler::FoodInfo(3, 6.6)); - constexpr cDefaultItemHandler ItemCarrotOnStickHandler (E_ITEM_CARROT_ON_STICK); - constexpr cDefaultItemHandler ItemCarrotsBlockHandler (E_BLOCK_CARROTS); - constexpr cDefaultItemHandler ItemCatDiscHandler (E_ITEM_CAT_DISC); - constexpr cDefaultItemHandler ItemCauldronBlockHandler (E_BLOCK_CAULDRON); - constexpr cSimplePlaceableItemHandler ItemCauldronHandler (E_ITEM_CAULDRON, E_BLOCK_CAULDRON);; - constexpr cItemArmorHandler ItemChainBootsHandler (E_ITEM_CHAIN_BOOTS); - constexpr cItemArmorHandler ItemChainChestplateHandler (E_ITEM_CHAIN_CHESTPLATE); - constexpr cDefaultItemHandler ItemChainCommandBlockHandler (E_BLOCK_CHAIN_COMMAND_BLOCK); - constexpr cItemArmorHandler ItemChainHelmetHandler (E_ITEM_CHAIN_HELMET); - constexpr cItemArmorHandler ItemChainLeggingsHandler (E_ITEM_CHAIN_LEGGINGS); - constexpr cItemChestHandler ItemChestHandler (E_BLOCK_CHEST); - constexpr cItemMinecartHandler ItemChestMinecartHandler (E_ITEM_CHEST_MINECART); - constexpr cDefaultItemHandler ItemChirpDiscHandler (E_ITEM_CHIRP_DISC); - constexpr cDefaultItemHandler ItemChorusFlowerHandler (E_BLOCK_CHORUS_FLOWER); - constexpr cItemChorusFruitHandler ItemChorusFruitHandler (E_ITEM_CHORUS_FRUIT); - constexpr cDefaultItemHandler ItemChorusPlantHandler (E_BLOCK_CHORUS_PLANT); - constexpr cDefaultItemHandler ItemClayBlockHandler (E_BLOCK_CLAY); - constexpr cDefaultItemHandler ItemClayHandler (E_ITEM_CLAY); - constexpr cDefaultItemHandler ItemClockHandler (E_ITEM_CLOCK); - constexpr cDefaultItemHandler ItemCoalBlockHandler (E_BLOCK_BLOCK_OF_COAL); - constexpr cDefaultItemHandler ItemCoalHandler (E_ITEM_COAL); - constexpr cDefaultItemHandler ItemCoalOreHandler (E_BLOCK_COAL_ORE); - constexpr cDefaultItemHandler ItemCobblestoneHandler (E_BLOCK_COBBLESTONE); - constexpr cItemStairsHandler ItemCobblestoneStairsHandler (E_BLOCK_COBBLESTONE_STAIRS); - constexpr cDefaultItemHandler ItemCobblestoneWallHandler (E_BLOCK_COBBLESTONE_WALL); - constexpr cDefaultItemHandler ItemCobwebHandler (E_BLOCK_COBWEB); - constexpr cDefaultItemHandler ItemCocoaPodHandler (E_BLOCK_COCOA_POD); - constexpr cDefaultItemHandler ItemCommandBlockHandler (E_BLOCK_COMMAND_BLOCK); - constexpr cItemComparatorHandler ItemComparatorHandler (E_ITEM_COMPARATOR); - constexpr cDefaultItemHandler ItemCompassHandler (E_ITEM_COMPASS); - constexpr cDefaultItemHandler ItemConcreteBlockHandler (E_BLOCK_CONCRETE); - constexpr cDefaultItemHandler ItemConcretePowderHandler (E_BLOCK_CONCRETE_POWDER); - constexpr cItemSimpleFoodHandler ItemCookedBeefHandler (E_ITEM_STEAK, cItemHandler::FoodInfo(8, 12.8)); - constexpr cItemSimpleFoodHandler ItemCookedChickenHandler (E_ITEM_COOKED_CHICKEN, cItemHandler::FoodInfo(6, 7.2)); - constexpr cItemCookedFishHandler ItemCookedFishHandler (E_ITEM_COOKED_FISH); - constexpr cItemSimpleFoodHandler ItemCookedMuttonHandler (E_ITEM_COOKED_MUTTON, cItemHandler::FoodInfo(6, 9.6)); - constexpr cItemSimpleFoodHandler ItemCookedPorkchopHandler (E_ITEM_COOKED_PORKCHOP, cItemHandler::FoodInfo(8, 12.8)); - constexpr cItemSimpleFoodHandler ItemCookedRabbitHandler (E_ITEM_COOKED_RABBIT, cItemHandler::FoodInfo(5, 6)); - constexpr cItemSimpleFoodHandler ItemCookieHandler (E_ITEM_COOKIE, cItemHandler::FoodInfo(2, 0.5)); - constexpr cItemGlazedTerracottaHandler ItemCyanGlazedTerracottaHandler (E_BLOCK_CYAN_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemCyanShulkerBoxHandler (E_BLOCK_CYAN_SHULKER_BOX); - constexpr cDefaultItemHandler ItemDandelionHandler (E_BLOCK_DANDELION); - constexpr cItemBoatHandler ItemDarkOakBoatHandler (E_ITEM_DARK_OAK_BOAT); - constexpr cDefaultItemHandler ItemDarkOakDoorBlockHandler (E_BLOCK_DARK_OAK_DOOR); - constexpr cItemDoorHandler ItemDarkOakDoorHandler (E_ITEM_DARK_OAK_DOOR); - constexpr cItemFenceGateHandler ItemDarkOakFenceGateHandler (E_BLOCK_DARK_OAK_FENCE_GATE); - constexpr cDefaultItemHandler ItemDarkOakFenceHandler (E_BLOCK_DARK_OAK_FENCE); - constexpr cItemStairsHandler ItemDarkOakStairsHandler (E_BLOCK_DARK_OAK_WOOD_STAIRS); - constexpr cDefaultItemHandler ItemDaylightSensorBlockHandler (E_BLOCK_DAYLIGHT_SENSOR); - constexpr cDefaultItemHandler ItemDeadBushHandler (E_BLOCK_DEAD_BUSH); - constexpr cItemRailHandler ItemDetectorRailHandler (E_BLOCK_DETECTOR_RAIL); - constexpr cItemAxeHandler ItemDiamondAxeHandler (E_ITEM_DIAMOND_AXE); - constexpr cDefaultItemHandler ItemDiamondBlockHandler (E_BLOCK_DIAMOND_BLOCK); - constexpr cItemArmorHandler ItemDiamondBootsHandler (E_ITEM_DIAMOND_BOOTS); - constexpr cItemArmorHandler ItemDiamondChestplateHandler (E_ITEM_DIAMOND_CHESTPLATE); - constexpr cDefaultItemHandler ItemDiamondHandler (E_ITEM_DIAMOND); - constexpr cItemArmorHandler ItemDiamondHelmetHandler (E_ITEM_DIAMOND_HELMET); - constexpr cItemHoeHandler ItemDiamondHoeHandler (E_ITEM_DIAMOND_HOE); - constexpr cDefaultItemHandler ItemDiamondHorseArmorHandler (E_ITEM_DIAMOND_HORSE_ARMOR); - constexpr cItemArmorHandler ItemDiamondLeggingsHandler (E_ITEM_DIAMOND_LEGGINGS); - constexpr cDefaultItemHandler ItemDiamondOreHandler (E_BLOCK_DIAMOND_ORE); - constexpr cItemPickaxeHandler ItemDiamondPickaxeHandler (E_ITEM_DIAMOND_PICKAXE); - constexpr cItemShovelHandler ItemDiamondShovelHandler (E_ITEM_DIAMOND_SHOVEL); - constexpr cItemSwordHandler ItemDiamondSwordHandler (E_ITEM_DIAMOND_SWORD); - constexpr cDefaultItemHandler ItemDirtHandler (E_BLOCK_DIRT); - constexpr cItemDropSpenserHandler ItemDispenserHandler (E_BLOCK_DISPENSER); - constexpr cDefaultItemHandler ItemDoubleOakSlabHandler (E_BLOCK_DOUBLE_WOODEN_SLAB); - constexpr cDefaultItemHandler ItemDoubleRedSandstoneSlabHandler (E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB); - constexpr cDefaultItemHandler ItemDoubleStoneSlabHandler (E_BLOCK_DOUBLE_STONE_SLAB); - constexpr cDefaultItemHandler ItemDragonBreathHandler (E_ITEM_DRAGON_BREATH); - constexpr cDefaultItemHandler ItemDragonEggBlockHandler (E_BLOCK_DRAGON_EGG); - constexpr cItemDropSpenserHandler ItemDropperHandler (E_BLOCK_DROPPER); - constexpr cItemDyeHandler ItemDyeHandler (E_ITEM_DYE); - constexpr cItemEggHandler ItemEggHandler (E_ITEM_EGG); - constexpr cItemArmorHandler ItemElytraHandler (E_ITEM_ELYTRA); - constexpr cDefaultItemHandler ItemEmeraldBlockHandler (E_BLOCK_EMERALD_BLOCK); - constexpr cDefaultItemHandler ItemEmeraldHandler (E_ITEM_EMERALD); - constexpr cDefaultItemHandler ItemEmeraldOreHandler (E_BLOCK_EMERALD_ORE); - constexpr cItemEmptyMapHandler ItemEmptyMapHandler (E_ITEM_EMPTY_MAP); - constexpr cDefaultItemHandler ItemEnchantedBookHandler (E_ITEM_ENCHANTED_BOOK); - constexpr cItemEnchantingTableHandler ItemEnchantingTableHandler (E_BLOCK_ENCHANTMENT_TABLE); - constexpr cDefaultItemHandler ItemEndBricksHandler (E_BLOCK_END_BRICKS); - constexpr cItemEndCrystalHandler ItemEndCrystalHandler (E_ITEM_END_CRYSTAL); - constexpr cItemEnderChestHandler ItemEnderChestHandler (E_BLOCK_ENDER_CHEST); - constexpr cItemEnderPearlHandler ItemEnderPearlHandler (E_ITEM_ENDER_PEARL); - constexpr cDefaultItemHandler ItemEndGatewayHandler (E_BLOCK_END_GATEWAY); - constexpr cDefaultItemHandler ItemEndPortalBlockHandler (E_BLOCK_END_PORTAL); - constexpr cItemEndPortalFrameHandler ItemEndPortalFrameHandler (E_BLOCK_END_PORTAL_FRAME); - constexpr cDefaultItemHandler ItemEndRodHandler (E_BLOCK_END_ROD); - constexpr cDefaultItemHandler ItemEndStoneBlockHandler (E_BLOCK_END_STONE); - constexpr cItemEyeOfEnderHandler ItemEyeOfEnderHandler (E_ITEM_EYE_OF_ENDER); - constexpr cDefaultItemHandler ItemFarDiscHandler (E_ITEM_FAR_DISC); - constexpr cDefaultItemHandler ItemFarmlandHandler (E_BLOCK_FARMLAND); - constexpr cDefaultItemHandler ItemFeatherHandler (E_ITEM_FEATHER); - constexpr cDefaultItemHandler ItemFermentedSpiderEyeHandler (E_ITEM_FERMENTED_SPIDER_EYE); - constexpr cDefaultItemHandler ItemFireBlockHandler (E_BLOCK_FIRE); - constexpr cItemLighterHandler ItemFireChargeHandler (E_ITEM_FIRE_CHARGE); - constexpr cItemFireworkHandler ItemFireworkRocketHandler (E_ITEM_FIREWORK_ROCKET); - constexpr cDefaultItemHandler ItemFireworkStarHandler (E_ITEM_FIREWORK_STAR); - constexpr cItemFishingRodHandler ItemFishingRodHandler (E_ITEM_FISHING_ROD); - constexpr cItemLighterHandler ItemFlintAndSteelHandler (E_ITEM_FLINT_AND_STEEL); - constexpr cDefaultItemHandler ItemFlintHandler (E_ITEM_FLINT); - constexpr cDefaultItemHandler ItemFlowerPotBlockHandler (E_BLOCK_FLOWER_POT); - constexpr cSimplePlaceableItemHandler ItemFlowerPotHandler (E_ITEM_FLOWER_POT, E_BLOCK_FLOWER_POT); - constexpr cDefaultItemHandler ItemFrostedIceHandler (E_BLOCK_FROSTED_ICE); - constexpr cItemFurnaceHandler ItemFurnaceHandler (E_BLOCK_FURNACE); - constexpr cItemMinecartHandler ItemFurnaceMinecartHandler (E_ITEM_FURNACE_MINECART); - constexpr cDefaultItemHandler ItemGhastTearHandler (E_ITEM_GHAST_TEAR); - constexpr cItemBottleHandler ItemGlassBottleHandler (E_ITEM_GLASS_BOTTLE); - constexpr cDefaultItemHandler ItemGlassHandler (E_BLOCK_GLASS); - constexpr cDefaultItemHandler ItemGlassPaneHandler (E_BLOCK_GLASS_PANE); - constexpr cDefaultItemHandler ItemGlisteringMelonHandler (E_ITEM_GLISTERING_MELON); - constexpr cDefaultItemHandler ItemGlowstoneBlockHandler (E_BLOCK_GLOWSTONE); - constexpr cDefaultItemHandler ItemGlowstoneDustHandler (E_ITEM_GLOWSTONE_DUST); - constexpr cDefaultItemHandler ItemGoldBlockHandler (E_BLOCK_GOLD_BLOCK); - constexpr cItemGoldenAppleHandler ItemGoldenAppleHandler (E_ITEM_GOLDEN_APPLE); - constexpr cItemAxeHandler ItemGoldenAxeHandler (E_ITEM_GOLD_AXE); - constexpr cItemArmorHandler ItemGoldenBootsHandler (E_ITEM_GOLD_BOOTS); - constexpr cItemSimpleFoodHandler ItemGoldenCarrotHandler (E_ITEM_GOLDEN_CARROT, cItemHandler::FoodInfo(6, 14.4)); - constexpr cItemArmorHandler ItemGoldenChestplateHandler (E_ITEM_GOLD_CHESTPLATE); - constexpr cItemArmorHandler ItemGoldenHelmetHandler (E_ITEM_GOLD_HELMET); - constexpr cItemHoeHandler ItemGoldenHoeHandler (E_ITEM_GOLD_HOE); - constexpr cDefaultItemHandler ItemGoldenHorseArmorHandler (E_ITEM_GOLD_HORSE_ARMOR); - constexpr cItemArmorHandler ItemGoldenLeggingsHandler (E_ITEM_GOLD_LEGGINGS); - constexpr cItemPickaxeHandler ItemGoldenPickaxeHandler (E_ITEM_GOLD_PICKAXE); - constexpr cItemShovelHandler ItemGoldenShovelHandler (E_ITEM_GOLD_SHOVEL); - constexpr cItemSwordHandler ItemGoldenSwordHandler (E_ITEM_GOLD_SWORD); - constexpr cDefaultItemHandler ItemGoldHandler (E_ITEM_GOLD); - constexpr cDefaultItemHandler ItemGoldNuggetHandler (E_ITEM_GOLD_NUGGET); - constexpr cDefaultItemHandler ItemGoldOreHandler (E_BLOCK_GOLD_ORE); - constexpr cDefaultItemHandler ItemGrassBlockHandler (E_BLOCK_GRASS); - constexpr cDefaultItemHandler ItemGrassPathHandler (E_BLOCK_GRASS_PATH); - constexpr cDefaultItemHandler ItemGravelHandler (E_BLOCK_GRAVEL); - constexpr cItemGlazedTerracottaHandler ItemGrayGlazedTerracottaHandler (E_BLOCK_GRAY_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemGrayShulkerBoxHandler (E_BLOCK_GRAY_SHULKER_BOX); - constexpr cItemGlazedTerracottaHandler ItemGreenGlazedTerracottaHandler (E_BLOCK_GREEN_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemGreenShulkerBoxHandler (E_BLOCK_GREEN_SHULKER_BOX); - constexpr cDefaultItemHandler ItemGunpowderHandler (E_ITEM_GUNPOWDER); - constexpr cDefaultItemHandler ItemHardenedClayHandler (E_BLOCK_HARDENED_CLAY); - constexpr cItemSidewaysHandler ItemHayBaleHandler (E_BLOCK_HAY_BALE); - constexpr cDefaultItemHandler ItemHeadBlockHandler (E_BLOCK_HEAD); - constexpr cItemMobHeadHandler ItemHeadHandler (E_ITEM_HEAD); - constexpr cDefaultItemHandler ItemHeavyWeightedPressurePlateHandler (E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE); - constexpr cItemHopperHandler ItemHopperHandler (E_BLOCK_HOPPER); - constexpr cDefaultItemHandler ItemHugeBrownMushroomBlockHandler (E_BLOCK_HUGE_BROWN_MUSHROOM); - constexpr cDefaultItemHandler ItemHugeRedMushroomBlockHandler (E_BLOCK_HUGE_RED_MUSHROOM); - constexpr cDefaultItemHandler ItemIceHandler (E_BLOCK_ICE); - constexpr cDefaultItemHandler ItemInactiveComparatorHandler (E_BLOCK_INACTIVE_COMPARATOR); - constexpr cDefaultItemHandler ItemInvertedDaylightSensorHandler (E_BLOCK_INVERTED_DAYLIGHT_SENSOR); - constexpr cItemAxeHandler ItemIronAxeHandler (E_ITEM_IRON_AXE); - constexpr cDefaultItemHandler ItemIronBarsBlockHandler (E_BLOCK_IRON_BARS); - constexpr cDefaultItemHandler ItemIronBlockHandler (E_BLOCK_IRON_BLOCK); - constexpr cItemArmorHandler ItemIronBootsHandler (E_ITEM_IRON_BOOTS); - constexpr cItemArmorHandler ItemIronChestplateHandler (E_ITEM_IRON_CHESTPLATE); - constexpr cDefaultItemHandler ItemIronDoorBlockHandler (E_BLOCK_IRON_DOOR); - constexpr cItemDoorHandler ItemIronDoorHandler (E_ITEM_IRON_DOOR); - constexpr cDefaultItemHandler ItemIronHandler (E_ITEM_IRON); - constexpr cItemArmorHandler ItemIronHelmetHandler (E_ITEM_IRON_HELMET); - constexpr cItemHoeHandler ItemIronHoeHandler (E_ITEM_IRON_HOE); - constexpr cDefaultItemHandler ItemIronHorseArmorHandler (E_ITEM_IRON_HORSE_ARMOR); - constexpr cItemArmorHandler ItemIronLeggingsHandler (E_ITEM_IRON_LEGGINGS); - constexpr cDefaultItemHandler ItemIronNuggetHandler (E_ITEM_IRON_NUGGET); - constexpr cDefaultItemHandler ItemIronOreHandler (E_BLOCK_IRON_ORE); - constexpr cItemPickaxeHandler ItemIronPickaxeHandler (E_ITEM_IRON_PICKAXE); - constexpr cItemShovelHandler ItemIronShovelHandler (E_ITEM_IRON_SHOVEL); - constexpr cItemSwordHandler ItemIronSwordHandler (E_ITEM_IRON_SWORD); - constexpr cItemTrapdoorHandler ItemIronTrapdoorHandler (E_BLOCK_IRON_TRAPDOOR); - constexpr cItemItemFrameHandler ItemItemFrameHandler (E_ITEM_ITEM_FRAME); - constexpr cItemJackOLanternHandler ItemJackOLanternHandler (E_BLOCK_JACK_O_LANTERN); - constexpr cDefaultItemHandler ItemJukeboxHandler (E_BLOCK_JUKEBOX); - constexpr cItemBoatHandler ItemJungleBoatHandler (E_ITEM_JUNGLE_BOAT); - constexpr cDefaultItemHandler ItemJungleDoorBlockHandler (E_BLOCK_JUNGLE_DOOR); - constexpr cItemDoorHandler ItemJungleDoorHandler (E_ITEM_JUNGLE_DOOR); - constexpr cItemFenceGateHandler ItemJungleFenceGateHandler (E_BLOCK_JUNGLE_FENCE_GATE); - constexpr cDefaultItemHandler ItemJungleFenceHandler (E_BLOCK_JUNGLE_FENCE); - constexpr cItemStairsHandler ItemJungleStairsHandler (E_BLOCK_JUNGLE_WOOD_STAIRS); - constexpr cItemLadderHandler ItemLadderHandler (E_BLOCK_LADDER); - constexpr cDefaultItemHandler ItemLapisBlockHandler (E_BLOCK_LAPIS_BLOCK); - constexpr cDefaultItemHandler ItemLapisOreHandler (E_BLOCK_LAPIS_ORE); - constexpr cItemBucketHandler ItemLavaBucketHandler (E_ITEM_LAVA_BUCKET); - constexpr cDefaultItemHandler ItemLavaHandler (E_BLOCK_LAVA); - constexpr cDefaultItemHandler ItemLeashHandler (E_ITEM_LEAD); - constexpr cItemArmorHandler ItemLeatherBootsHandler (E_ITEM_LEATHER_BOOTS); - constexpr cItemArmorHandler ItemLeatherCapHandler (E_ITEM_LEATHER_CAP); - constexpr cDefaultItemHandler ItemLeatherHandler (E_ITEM_LEATHER); - constexpr cItemArmorHandler ItemLeatherPantsHandler (E_ITEM_LEATHER_PANTS); - constexpr cItemArmorHandler ItemLeatherTunicHandler (E_ITEM_LEATHER_TUNIC); - constexpr cItemLeavesHandler ItemLeavesHandler (E_BLOCK_LEAVES); - constexpr cItemLeverHandler ItemLeverHandler (E_BLOCK_LEVER); - constexpr cItemGlazedTerracottaHandler ItemLightBlueGlazedTerracottaHandler (E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemLightBlueShulkerBoxHandler (E_BLOCK_LIGHT_BLUE_SHULKER_BOX); - constexpr cItemGlazedTerracottaHandler ItemLightGrayGlazedTerracottaHandler (E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemLightGrayShulkerBoxHandler (E_BLOCK_LIGHT_GRAY_SHULKER_BOX); - constexpr cDefaultItemHandler ItemLightWeightedPressurePlateHandler (E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE); - constexpr cItemLilypadHandler ItemLilypadHandler (E_BLOCK_LILY_PAD); - constexpr cItemGlazedTerracottaHandler ItemLimeGlazedTerracottaHandler (E_BLOCK_LIME_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemLimeShulkerBoxHandler (E_BLOCK_LIME_SHULKER_BOX); - constexpr cItemPotionHandler ItemLingeringPotionHandler (E_ITEM_LINGERING_POTION); - constexpr cDefaultItemHandler ItemLitFurnaceHandler (E_BLOCK_LIT_FURNACE); - constexpr cItemSidewaysHandler ItemLogHandler (E_BLOCK_LOG); - constexpr cItemGlazedTerracottaHandler ItemMagentaGlazedTerracottaHandler (E_BLOCK_MAGENTA_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemMagentaShulkerBoxHandler (E_BLOCK_MAGENTA_SHULKER_BOX); - constexpr cDefaultItemHandler ItemMagmaBlockHandler (E_BLOCK_MAGMA); - constexpr cDefaultItemHandler ItemMagmaCreamHandler (E_ITEM_MAGMA_CREAM); - constexpr cDefaultItemHandler ItemMallDiscHandler (E_ITEM_MALL_DISC); - constexpr cItemMapHandler ItemMapHandler (E_ITEM_MAP); - constexpr cDefaultItemHandler ItemMellohiDiscHandler (E_ITEM_MELLOHI_DISC); - constexpr cDefaultItemHandler ItemMelonBlockHandler (E_BLOCK_MELON); - constexpr cItemSimpleSeedsHandler ItemMelonSeedsHandler (E_ITEM_MELON_SEEDS); - constexpr cItemSimpleFoodHandler ItemMelonSliceHandler (E_ITEM_MELON_SLICE, cItemHandler::FoodInfo(2, 1.2)); - constexpr cDefaultItemHandler ItemMelonStemHandler (E_BLOCK_MELON_STEM); - constexpr cItemMilkHandler ItemMilkHandler (E_ITEM_MILK); - constexpr cItemMinecartHandler ItemMinecartHandler (E_ITEM_MINECART); - constexpr cItemMinecartHandler ItemMinecartWithCommandBlockHandler (E_ITEM_MINECART_WITH_COMMAND_BLOCK); - constexpr cItemMinecartHandler ItemMinecartWithHopperHandler (E_ITEM_MINECART_WITH_HOPPER); - constexpr cItemMinecartHandler ItemMinecartWithTNTHandler (E_ITEM_MINECART_WITH_TNT); - constexpr cDefaultItemHandler ItemMobSpawnerBlockHandler (E_BLOCK_MOB_SPAWNER); - constexpr cDefaultItemHandler ItemMossyCobblestoneHandler (E_BLOCK_MOSSY_COBBLESTONE); - constexpr cItemSoupHandler ItemMushroomSoupHandler (E_ITEM_MUSHROOM_SOUP, cItemHandler::FoodInfo(6, 7.2)); - constexpr cDefaultItemHandler ItemMyceliumHandler (E_BLOCK_MYCELIUM); - constexpr cDefaultItemHandler ItemNameTagHandler (E_ITEM_NAME_TAG); - constexpr cDefaultItemHandler ItemNetherBrickFenceHandler (E_BLOCK_NETHER_BRICK_FENCE); - constexpr cDefaultItemHandler ItemNetherBrickHandler (E_ITEM_NETHER_BRICK); - constexpr cDefaultItemHandler ItemNetherBricksHandler (E_BLOCK_NETHER_BRICK); - constexpr cItemStairsHandler ItemNetherBrickStairsHandler (E_BLOCK_NETHER_BRICK_STAIRS); - constexpr cDefaultItemHandler ItemNetherPortalBlockHandler (E_BLOCK_NETHER_PORTAL); - constexpr cDefaultItemHandler ItemNetherQuartzHandler (E_ITEM_NETHER_QUARTZ); - constexpr cDefaultItemHandler ItemNetherQuartzOreHandler (E_BLOCK_NETHER_QUARTZ_ORE); - constexpr cDefaultItemHandler ItemNetherrackHandler (E_BLOCK_NETHERRACK); - constexpr cDefaultItemHandler ItemNetherStarHandler (E_ITEM_NETHER_STAR); - constexpr cDefaultItemHandler ItemNetherWartBlockHandler (E_BLOCK_NETHER_WART_BLOCK); - constexpr cItemNetherWartHandler ItemNetherWartHandler (E_ITEM_NETHER_WART); - constexpr cDefaultItemHandler ItemNetherWartTechnicalBlockHandler (E_BLOCK_NETHER_WART); - constexpr cItemLeavesHandler ItemNewLeavesHandler (E_BLOCK_NEW_LEAVES); - constexpr cItemSidewaysHandler ItemNewLogHandler (E_BLOCK_NEW_LOG); - constexpr cDefaultItemHandler ItemNoteBlockHandler (E_BLOCK_NOTE_BLOCK); - constexpr cItemBoatHandler ItemOakBoatHandler (E_ITEM_BOAT); - constexpr cItemButtonHandler ItemOakButtonHandler (E_BLOCK_WOODEN_BUTTON); - constexpr cDefaultItemHandler ItemOakDoorBlockHandler (E_BLOCK_OAK_DOOR); - constexpr cItemDoorHandler ItemOakDoorHandler (E_ITEM_WOODEN_DOOR); - constexpr cItemFenceGateHandler ItemOakFenceGateHandler (E_BLOCK_OAK_FENCE_GATE); - constexpr cDefaultItemHandler ItemOakFenceHandler (E_BLOCK_FENCE); - constexpr cItemSlabHandler ItemOakSlabHandler (E_BLOCK_WOODEN_SLAB); - constexpr cItemStairsHandler ItemOakStairsHandler (E_BLOCK_OAK_WOOD_STAIRS); - constexpr cItemTrapdoorHandler ItemOakTrapdoorHandler (E_BLOCK_TRAPDOOR); - constexpr cItemObserverHandler ItemObserverHandler (E_BLOCK_OBSERVER); - constexpr cDefaultItemHandler ItemObsidianHandler (E_BLOCK_OBSIDIAN); - constexpr cItemGlazedTerracottaHandler ItemOrangeGlazedTerracottaHandler (E_BLOCK_ORANGE_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemOrangeShulkerBoxHandler (E_BLOCK_ORANGE_SHULKER_BOX); - constexpr cDefaultItemHandler ItemPackedIceHandler (E_BLOCK_PACKED_ICE); - constexpr cItemPaintingHandler ItemPaintingHandler (E_ITEM_PAINTING); - constexpr cDefaultItemHandler ItemPaperHandler (E_ITEM_PAPER); - constexpr cItemGlazedTerracottaHandler ItemPinkGlazedTerracottaHandler (E_BLOCK_PINK_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemPinkShulkerBoxHandler (E_BLOCK_PINK_SHULKER_BOX); - constexpr cDefaultItemHandler ItemPistonExtensionHandler (E_BLOCK_PISTON_EXTENSION); - constexpr cItemPistonHandler ItemPistonHandler (E_BLOCK_PISTON); - constexpr cDefaultItemHandler ItemPistonMovedBlockHandler (E_BLOCK_PISTON_MOVED_BLOCK); - constexpr cItemPlanksHandler ItemPlanksHandler (E_BLOCK_PLANKS); - constexpr cItemPoisonousPotatoHandler ItemPoisonousPotatoHandler (E_ITEM_POISONOUS_POTATO); - constexpr cDefaultItemHandler ItemPoppedChorusFruitHandler (E_ITEM_POPPED_CHORUS_FRUIT); - constexpr cDefaultItemHandler ItemPoppyHandler (E_BLOCK_FLOWER); - constexpr cDefaultItemHandler ItemPotatoesBlockHandler (E_BLOCK_POTATOES); - constexpr cItemFoodSeedsHandler ItemPotatoHandler (E_ITEM_POTATO, cItemHandler::FoodInfo(1, 0.6)); - constexpr cItemPotionHandler ItemPotionHandler (E_ITEM_POTION); - constexpr cItemRailHandler ItemPoweredRailHandler (E_BLOCK_POWERED_RAIL); - constexpr cDefaultItemHandler ItemPrismarineBlockHandler (E_BLOCK_PRISMARINE_BLOCK); - constexpr cDefaultItemHandler ItemPrismarineCrystalsHandler (E_ITEM_PRISMARINE_CRYSTALS); - constexpr cDefaultItemHandler ItemPrismarineShardHandler (E_ITEM_PRISMARINE_SHARD); - constexpr cItemPumpkinHandler ItemPumpkinHandler (E_BLOCK_PUMPKIN); - constexpr cItemSimpleFoodHandler ItemPumpkinPieHandler (E_ITEM_PUMPKIN_PIE, cItemHandler::FoodInfo(8, 4.8)); - constexpr cItemSimpleSeedsHandler ItemPumpkinSeedsHandler (E_ITEM_PUMPKIN_SEEDS); - constexpr cDefaultItemHandler ItemPumpkinStemHandler (E_BLOCK_PUMPKIN_STEM); - constexpr cItemGlazedTerracottaHandler ItemPurpleGlazedTerracottaHandler (E_BLOCK_PURPLE_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemPurpleShulkerBoxHandler (E_BLOCK_PURPLE_SHULKER_BOX); - constexpr cDefaultItemHandler ItemPurpurBlockHandler (E_BLOCK_PURPUR_BLOCK); - constexpr cDefaultItemHandler ItemPurpurDoubleSlabHandler (E_BLOCK_PURPUR_DOUBLE_SLAB); - constexpr cDefaultItemHandler ItemPurpurPillarHandler (E_BLOCK_PURPUR_PILLAR); - constexpr cItemSlabHandler ItemPurpurSlabHandler (E_BLOCK_PURPUR_SLAB); - constexpr cItemStairsHandler ItemPurpurStairsHandler (E_BLOCK_PURPUR_STAIRS); - constexpr cItemQuartzHandler ItemQuartzBlockHandler (E_BLOCK_QUARTZ_BLOCK); - constexpr cItemStairsHandler ItemQuartzStairsHandler (E_BLOCK_QUARTZ_STAIRS); - constexpr cDefaultItemHandler ItemRabbitHideHandler (E_ITEM_RABBIT_HIDE); - constexpr cDefaultItemHandler ItemRabbitsFootHandler (E_ITEM_RABBITS_FOOT); - constexpr cItemSoupHandler ItemRabbitStewHandler (E_ITEM_RABBIT_STEW, cItemHandler::FoodInfo(10, 12)); - constexpr cItemRailHandler ItemRailHandler (E_BLOCK_RAIL); - constexpr cItemSimpleFoodHandler ItemRawBeefHandler (E_ITEM_RAW_BEEF, cItemHandler::FoodInfo(3, 1.8)); - constexpr cItemRawChickenHandler ItemRawChickenHandler (E_ITEM_RAW_CHICKEN); - constexpr cItemRawFishHandler ItemRawFishHandler (E_ITEM_RAW_FISH); - constexpr cItemSimpleFoodHandler ItemRawMuttonHandler (E_ITEM_RAW_MUTTON, cItemHandler::FoodInfo(2, 1.2)); - constexpr cItemSimpleFoodHandler ItemRawPorkchopHandler (E_ITEM_RAW_PORKCHOP, cItemHandler::FoodInfo(3, 1.8)); - constexpr cItemSimpleFoodHandler ItemRawRabbitHandler (E_ITEM_RAW_RABBIT, cItemHandler::FoodInfo(3, 1.8)); - constexpr cItemGlazedTerracottaHandler ItemRedGlazedTerracottaHandler (E_BLOCK_RED_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemRedMushroomBlockHandler (E_BLOCK_RED_MUSHROOM); - constexpr cDefaultItemHandler ItemRedNetherBricksHandler (E_BLOCK_RED_NETHER_BRICK); - constexpr cDefaultItemHandler ItemRedSandstoneHandler (E_BLOCK_RED_SANDSTONE); - constexpr cItemSlabHandler ItemRedSandstoneSlabHandler (E_BLOCK_RED_SANDSTONE_SLAB); - constexpr cItemStairsHandler ItemRedSandstoneStairsHandler (E_BLOCK_RED_SANDSTONE_STAIRS); - constexpr cDefaultItemHandler ItemRedShulkerBoxHandler (E_BLOCK_RED_SHULKER_BOX); - constexpr cDefaultItemHandler ItemRedstoneBlockHandler (E_BLOCK_BLOCK_OF_REDSTONE); - constexpr cItemRedstoneDustHandler ItemRedstoneDustHandler (E_ITEM_REDSTONE_DUST); - constexpr cDefaultItemHandler ItemRedstoneLampOffHandler (E_BLOCK_REDSTONE_LAMP_OFF); - constexpr cDefaultItemHandler ItemRedstoneLampOnHandler (E_BLOCK_REDSTONE_LAMP_ON); - constexpr cDefaultItemHandler ItemRedstoneOreGlowingHandler (E_BLOCK_REDSTONE_ORE_GLOWING); - constexpr cDefaultItemHandler ItemRedstoneOreHandler (E_BLOCK_REDSTONE_ORE); - constexpr cItemRedstoneRepeaterHandler ItemRedstoneRepeaterHandler (E_ITEM_REDSTONE_REPEATER); - constexpr cDefaultItemHandler ItemRedstoneRepeaterOffHandler (E_BLOCK_REDSTONE_REPEATER_OFF); - constexpr cDefaultItemHandler ItemRedstoneRepeaterOnHandler (E_BLOCK_REDSTONE_REPEATER_ON); - constexpr cItemTorchHandler ItemRedstoneTorchHandler (E_BLOCK_REDSTONE_TORCH_ON); - constexpr cDefaultItemHandler ItemRedstoneTorchOffBlockHandler (E_BLOCK_REDSTONE_TORCH_OFF); - constexpr cDefaultItemHandler ItemRedstoneWireHandler (E_BLOCK_REDSTONE_WIRE); - constexpr cDefaultItemHandler ItemRepeatingCommandBlockHandler (E_BLOCK_REPEATING_COMMAND_BLOCK); - constexpr cItemRottenFleshHandler ItemRottenFleshHandler (E_ITEM_ROTTEN_FLESH); - constexpr cDefaultItemHandler ItemSaddleHandler (E_ITEM_SADDLE); - constexpr cDefaultItemHandler ItemSandHandler (E_BLOCK_SAND); - constexpr cDefaultItemHandler ItemSandstoneHandler (E_BLOCK_SANDSTONE); - constexpr cItemStairsHandler ItemSandstoneStairsHandler (E_BLOCK_SANDSTONE_STAIRS); - constexpr cItemSaplingHandler ItemSaplingHandler (E_BLOCK_SAPLING); - constexpr cDefaultItemHandler ItemSeaLanternHandler (E_BLOCK_SEA_LANTERN); - constexpr cItemSimpleSeedsHandler ItemSeedsHandler (E_ITEM_SEEDS); - constexpr cItemShearsHandler ItemShearsHandler (E_ITEM_SHEARS); - constexpr cDefaultItemHandler ItemShieldHandler (E_ITEM_SHIELD); - constexpr cDefaultItemHandler ItemShulkerShellHandler (E_ITEM_SHULKER_SHELL); - constexpr cItemSignHandler ItemSignHandler (E_ITEM_SIGN); - constexpr cDefaultItemHandler ItemSignPostHandler (E_BLOCK_SIGN_POST); - constexpr cDefaultItemHandler ItemSilverfishEggBlockHandler (E_BLOCK_SILVERFISH_EGG); - constexpr cDefaultItemHandler ItemSlimeballHandler (E_ITEM_SLIMEBALL); - constexpr cDefaultItemHandler ItemSlimeBlockHandler (E_BLOCK_SLIME_BLOCK); - constexpr cItemSnowballHandler ItemSnowballHandler (E_ITEM_SNOWBALL); - constexpr cDefaultItemHandler ItemSnowBlockHandler (E_BLOCK_SNOW_BLOCK); - constexpr cItemSnowHandler ItemSnowHandler (E_BLOCK_SNOW); - constexpr cDefaultItemHandler ItemSoulsandHandler (E_BLOCK_SOULSAND); - constexpr cItemSpawnEggHandler ItemSpawnEggHandler (E_ITEM_SPAWN_EGG); - constexpr cDefaultItemHandler ItemSpectralArrowHandler (E_ITEM_SPECTRAL_ARROW); - constexpr cItemSpiderEyeHandler ItemSpiderEyeHandler (E_ITEM_SPIDER_EYE); - constexpr cItemPotionHandler ItemSplashPotionHandler (E_ITEM_SPLASH_POTION); - constexpr cDefaultItemHandler ItemSpongeHandler (E_BLOCK_SPONGE); - constexpr cItemBoatHandler ItemSpruceBoatHandler (E_ITEM_SPRUCE_BOAT); - constexpr cDefaultItemHandler ItemSpruceDoorBlockHandler (E_BLOCK_SPRUCE_DOOR); - constexpr cItemDoorHandler ItemSpruceDoorHandler (E_ITEM_SPRUCE_DOOR); - constexpr cItemFenceGateHandler ItemSpruceFenceGateHandler (E_BLOCK_SPRUCE_FENCE_GATE); - constexpr cDefaultItemHandler ItemSpruceFenceHandler (E_BLOCK_SPRUCE_FENCE); - constexpr cItemStairsHandler ItemSpruceStairsHandler (E_BLOCK_SPRUCE_WOOD_STAIRS); - constexpr cDefaultItemHandler ItemStainedGlassHandler (E_BLOCK_STAINED_GLASS); - constexpr cDefaultItemHandler ItemStainedGlassPaneHandler (E_BLOCK_STAINED_GLASS_PANE); - constexpr cDefaultItemHandler ItemStalDiscHandler (E_ITEM_STAL_DISC); - constexpr cDefaultItemHandler ItemStandingBannerHandler (E_BLOCK_STANDING_BANNER); - constexpr cDefaultItemHandler ItemStationaryLavaHandler (E_BLOCK_STATIONARY_LAVA); - constexpr cDefaultItemHandler ItemStationaryWaterHandler (E_BLOCK_STATIONARY_WATER); - constexpr cDefaultItemHandler ItemStickHandler (E_ITEM_STICK); - constexpr cItemPistonHandler ItemStickyPistonHandler (E_BLOCK_STICKY_PISTON); - constexpr cItemAxeHandler ItemStoneAxeHandler (E_ITEM_STONE_AXE); - constexpr cDefaultItemHandler ItemStoneBricksHandler (E_BLOCK_STONE_BRICKS); - constexpr cItemStairsHandler ItemStoneBrickStairsHandler (E_BLOCK_STONE_BRICK_STAIRS); - constexpr cItemButtonHandler ItemStoneButtonHandler (E_BLOCK_STONE_BUTTON); - constexpr cDefaultItemHandler ItemStoneHandler (E_BLOCK_STONE); - constexpr cItemHoeHandler ItemStoneHoeHandler (E_ITEM_STONE_HOE); - constexpr cItemPickaxeHandler ItemStonePickaxeHandler (E_ITEM_STONE_PICKAXE); - constexpr cDefaultItemHandler ItemStonePressurePlateHandler (E_BLOCK_STONE_PRESSURE_PLATE); - constexpr cItemShovelHandler ItemStoneShovelHandler (E_ITEM_STONE_SHOVEL); - constexpr cItemSlabHandler ItemStoneSlabHandler (E_BLOCK_STONE_SLAB); - constexpr cItemSwordHandler ItemStoneSwordHandler (E_ITEM_STONE_SWORD); - constexpr cDefaultItemHandler ItemStradDiscHandler (E_ITEM_STRAD_DISC); - constexpr cSimplePlaceableItemHandler ItemStringHandler (E_ITEM_STRING, E_BLOCK_TRIPWIRE); - constexpr cDefaultItemHandler ItemStructureBlockHandler (E_BLOCK_STRUCTURE_BLOCK); - constexpr cDefaultItemHandler ItemStructureVoidHandler (E_BLOCK_STRUCTURE_VOID); - constexpr cDefaultItemHandler ItemSugarCaneBlockHandler (E_BLOCK_SUGARCANE); - constexpr cSimplePlaceableItemHandler ItemSugarCaneHandler (E_ITEM_SUGARCANE, E_BLOCK_SUGARCANE); - constexpr cDefaultItemHandler ItemSugarHandler (E_ITEM_SUGAR); - constexpr cDefaultItemHandler ItemTallGrassHandler (E_BLOCK_TALL_GRASS); - constexpr cDefaultItemHandler ItemTerracottaHandler (E_BLOCK_TERRACOTTA); - constexpr cDefaultItemHandler ItemTippedArrowHandler (E_ITEM_TIPPED_ARROW); - constexpr cDefaultItemHandler ItemTNTHandler (E_BLOCK_TNT); - constexpr cItemTorchHandler ItemTorchHandler (E_BLOCK_TORCH); - constexpr cDefaultItemHandler ItemTotemOfUndyingHandler (E_ITEM_TOTEM_OF_UNDYING); - constexpr cItemChestHandler ItemTrappedChestHandler (E_BLOCK_TRAPPED_CHEST); - constexpr cDefaultItemHandler ItemTripwireHandler (E_BLOCK_TRIPWIRE); - constexpr cItemTripwireHookHandler ItemTripwireHookHandler (E_BLOCK_TRIPWIRE_HOOK); - constexpr cItemVinesHandler ItemVinesHandler (E_BLOCK_VINES); - constexpr cDefaultItemHandler ItemWaitDiscHandler (E_ITEM_WAIT_DISC); - constexpr cDefaultItemHandler ItemWallBannerHandler (E_BLOCK_WALL_BANNER); - constexpr cDefaultItemHandler ItemWallsignHandler (E_BLOCK_WALLSIGN); - constexpr cDefaultItemHandler ItemWardDiscHandler (E_ITEM_WARD_DISC); - constexpr cItemBucketHandler ItemWaterBucketHandler (E_ITEM_WATER_BUCKET); - constexpr cDefaultItemHandler ItemWaterHandler (E_BLOCK_WATER); - constexpr cDefaultItemHandler ItemWheatBlockHandler (E_BLOCK_WHEAT); - constexpr cDefaultItemHandler ItemWheatHandler (E_ITEM_WHEAT); - constexpr cItemGlazedTerracottaHandler ItemWhiteGlazedTerracottaHandler (E_BLOCK_WHITE_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemWhiteShulkerBoxHandler (E_BLOCK_WHITE_SHULKER_BOX); - constexpr cItemAxeHandler ItemWoodenAxeHandler (E_ITEM_WOODEN_AXE); - constexpr cItemHoeHandler ItemWoodenHoeHandler (E_ITEM_WOODEN_HOE); - constexpr cItemPickaxeHandler ItemWoodenPickaxeHandler (E_ITEM_WOODEN_PICKAXE); - constexpr cDefaultItemHandler ItemWoodenPressurePlateHandler (E_BLOCK_WOODEN_PRESSURE_PLATE); - constexpr cItemShovelHandler ItemWoodenShovelHandler (E_ITEM_WOODEN_SHOVEL); - constexpr cItemSwordHandler ItemWoodenSwordHandler (E_ITEM_WOODEN_SWORD); - constexpr cItemClothHandler ItemWoolHandler (E_BLOCK_WOOL); - constexpr cDefaultItemHandler ItemWorkbenchHandler (E_BLOCK_WORKBENCH); - constexpr cDefaultItemHandler ItemWrittenBookHandler (E_ITEM_WRITTEN_BOOK); - constexpr cItemGlazedTerracottaHandler ItemYellowGlazedTerracottaHandler (E_BLOCK_YELLOW_GLAZED_TERRACOTTA); - constexpr cDefaultItemHandler ItemYellowShulkerBoxHandler (E_BLOCK_YELLOW_SHULKER_BOX); -} +constexpr cDefaultItemHandler Item11DiscHandler(E_ITEM_11_DISC); +constexpr cDefaultItemHandler Item13DiscHandler(E_ITEM_13_DISC); +constexpr cItemBoatHandler ItemAcaciaBoatHandler(E_ITEM_ACACIA_BOAT); +constexpr cDefaultItemHandler ItemAcaciaDoorBlockHandler(E_BLOCK_ACACIA_DOOR); +constexpr cItemDoorHandler ItemAcaciaDoorHandler(E_ITEM_ACACIA_DOOR); +constexpr cItemFenceGateHandler ItemAcaciaFenceGateHandler(E_BLOCK_ACACIA_FENCE_GATE); +constexpr cDefaultItemHandler ItemAcaciaFenceHandler(E_BLOCK_ACACIA_FENCE); +constexpr cItemStairsHandler ItemAcaciaStairsHandler(E_BLOCK_ACACIA_WOOD_STAIRS); +constexpr cItemRailHandler ItemActivatorRailHandler(E_BLOCK_ACTIVATOR_RAIL); +constexpr cDefaultItemHandler ItemActiveComparatorHandler(E_BLOCK_ACTIVE_COMPARATOR); +constexpr cDefaultItemHandler ItemAirHandler(E_BLOCK_AIR); +constexpr cItemAnvilHandler ItemAnvilHandler(E_BLOCK_ANVIL); +constexpr cItemSimpleFoodHandler ItemAppleHandler(E_ITEM_RED_APPLE, cItemHandler::FoodInfo(4, 2.4)); +constexpr cDefaultItemHandler ItemArmorStandHandler(E_ITEM_ARMOR_STAND); +constexpr cDefaultItemHandler ItemArrowHandler(E_ITEM_ARROW); +constexpr cItemSimpleFoodHandler ItemBakedPotatoHandler(E_ITEM_BAKED_POTATO, cItemHandler::FoodInfo(5, 6)); +constexpr cItemBannerHandler ItemBannerHandler(E_ITEM_BANNER); +constexpr cDefaultItemHandler ItemBarrierHandler(E_BLOCK_BARRIER); +constexpr cDefaultItemHandler ItemBeaconHandler(E_BLOCK_BEACON); +constexpr cDefaultItemHandler ItemBedBlockHandler(E_BLOCK_BED); +constexpr cItemBedHandler ItemBedHandler(E_ITEM_BED); +constexpr cDefaultItemHandler ItemBedrockHandler(E_BLOCK_BEDROCK); +constexpr cItemSimpleFoodHandler ItemBeetrootHandler(E_ITEM_BEETROOT, cItemHandler::FoodInfo(1, 1.2)); +constexpr cDefaultItemHandler ItemBeetrootsBlockHandler(E_BLOCK_BEETROOTS); +constexpr cItemSimpleSeedsHandler ItemBeetrootSeedsHandler(E_ITEM_BEETROOT_SEEDS); +constexpr cItemSoupHandler ItemBeetrootSoupHandler(E_ITEM_BEETROOT_SOUP, cItemHandler::FoodInfo(6, 7.2)); +constexpr cItemBigFlowerHandler ItemBigFlowerHandler(E_BLOCK_BIG_FLOWER); +constexpr cItemBoatHandler ItemBirchBoatHandler(E_ITEM_BIRCH_BOAT); +constexpr cDefaultItemHandler ItemBirchDoorBlockHandler(E_BLOCK_BIRCH_DOOR); +constexpr cItemDoorHandler ItemBirchDoorHandler(E_ITEM_BIRCH_DOOR); +constexpr cItemFenceGateHandler ItemBirchFenceGateHandler(E_BLOCK_BIRCH_FENCE_GATE); +constexpr cDefaultItemHandler ItemBirchFenceHandler(E_BLOCK_BIRCH_FENCE); +constexpr cItemStairsHandler ItemBirchStairsHandler(E_BLOCK_BIRCH_WOOD_STAIRS); +constexpr cItemGlazedTerracottaHandler ItemBlackGlazedTerracottaHandler(E_BLOCK_BLACK_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemBlackShulkerBoxHandler(E_BLOCK_BLACK_SHULKER_BOX); +constexpr cDefaultItemHandler ItemBlazePowderHandler(E_ITEM_BLAZE_POWDER); +constexpr cDefaultItemHandler ItemBlazeRodHandler(E_ITEM_BLAZE_ROD); +constexpr cDefaultItemHandler ItemBlocksDiscHandler(E_ITEM_BLOCKS_DISC); +constexpr cItemGlazedTerracottaHandler ItemBlueGlazedTerracottaHandler(E_BLOCK_BLUE_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemBlueShulkerBoxHandler(E_BLOCK_BLUE_SHULKER_BOX); +constexpr cDefaultItemHandler ItemBoneBlockHandler(E_BLOCK_BONE_BLOCK); +constexpr cDefaultItemHandler ItemBoneHandler(E_ITEM_BONE); +constexpr cDefaultItemHandler ItemBookAndQuillHandler(E_ITEM_BOOK_AND_QUILL); +constexpr cDefaultItemHandler ItemBookHandler(E_ITEM_BOOK); +constexpr cDefaultItemHandler ItemBookshelfHandler(E_BLOCK_BOOKCASE); +constexpr cItemBottleOEnchantingHandler ItemBottleOEnchantingHandler(E_ITEM_BOTTLE_O_ENCHANTING); +constexpr cItemBowHandler ItemBowHandler(E_ITEM_BOW); +constexpr cDefaultItemHandler ItemBowlHandler(E_ITEM_BOWL); +constexpr cItemSimpleFoodHandler ItemBreadHandler(E_ITEM_BREAD, cItemHandler::FoodInfo(5, 6)); +constexpr cDefaultItemHandler ItemBrewingStandBlockHandler(E_BLOCK_BREWING_STAND); +constexpr cSimplePlaceableItemHandler ItemBrewingStandHandler(E_ITEM_BREWING_STAND, E_BLOCK_BREWING_STAND); +constexpr cDefaultItemHandler ItemBrickHandler(E_ITEM_CLAY_BRICK); +constexpr cDefaultItemHandler ItemBricksHandler(E_BLOCK_BRICK); +constexpr cItemStairsHandler ItemBricksStairsHandler(E_BLOCK_BRICK_STAIRS); +constexpr cItemGlazedTerracottaHandler ItemBrownGlazedTerracottaHandler(E_BLOCK_BROWN_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemBrownMushroomBlockHandler(E_BLOCK_BROWN_MUSHROOM); +constexpr cDefaultItemHandler ItemBrownShulkerBoxHandler(E_BLOCK_BROWN_SHULKER_BOX); +constexpr cItemBucketHandler ItemBucketHandler(E_ITEM_BUCKET); +constexpr cDefaultItemHandler ItemCactusHandler(E_BLOCK_CACTUS); +constexpr cDefaultItemHandler ItemCakeBlockHandler(E_BLOCK_CAKE); +constexpr cSimplePlaceableItemHandler ItemCakeHandler(E_ITEM_CAKE, E_BLOCK_CAKE); +constexpr cDefaultItemHandler ItemCarpetHandler(E_BLOCK_CARPET); +constexpr cItemFoodSeedsHandler ItemCarrotHandler(E_ITEM_CARROT, cItemHandler::FoodInfo(3, 6.6)); +constexpr cDefaultItemHandler ItemCarrotOnStickHandler(E_ITEM_CARROT_ON_STICK); +constexpr cDefaultItemHandler ItemCarrotsBlockHandler(E_BLOCK_CARROTS); +constexpr cDefaultItemHandler ItemCatDiscHandler(E_ITEM_CAT_DISC); +constexpr cDefaultItemHandler ItemCauldronBlockHandler(E_BLOCK_CAULDRON); +constexpr cSimplePlaceableItemHandler ItemCauldronHandler(E_ITEM_CAULDRON, E_BLOCK_CAULDRON); +; +constexpr cItemArmorHandler ItemChainBootsHandler(E_ITEM_CHAIN_BOOTS); +constexpr cItemArmorHandler ItemChainChestplateHandler(E_ITEM_CHAIN_CHESTPLATE); +constexpr cDefaultItemHandler ItemChainCommandBlockHandler(E_BLOCK_CHAIN_COMMAND_BLOCK); +constexpr cItemArmorHandler ItemChainHelmetHandler(E_ITEM_CHAIN_HELMET); +constexpr cItemArmorHandler ItemChainLeggingsHandler(E_ITEM_CHAIN_LEGGINGS); +constexpr cItemChestHandler ItemChestHandler(E_BLOCK_CHEST); +constexpr cItemMinecartHandler ItemChestMinecartHandler(E_ITEM_CHEST_MINECART); +constexpr cDefaultItemHandler ItemChirpDiscHandler(E_ITEM_CHIRP_DISC); +constexpr cDefaultItemHandler ItemChorusFlowerHandler(E_BLOCK_CHORUS_FLOWER); +constexpr cItemChorusFruitHandler ItemChorusFruitHandler(E_ITEM_CHORUS_FRUIT); +constexpr cDefaultItemHandler ItemChorusPlantHandler(E_BLOCK_CHORUS_PLANT); +constexpr cDefaultItemHandler ItemClayBlockHandler(E_BLOCK_CLAY); +constexpr cDefaultItemHandler ItemClayHandler(E_ITEM_CLAY); +constexpr cDefaultItemHandler ItemClockHandler(E_ITEM_CLOCK); +constexpr cDefaultItemHandler ItemCoalBlockHandler(E_BLOCK_BLOCK_OF_COAL); +constexpr cDefaultItemHandler ItemCoalHandler(E_ITEM_COAL); +constexpr cDefaultItemHandler ItemCoalOreHandler(E_BLOCK_COAL_ORE); +constexpr cDefaultItemHandler ItemCobblestoneHandler(E_BLOCK_COBBLESTONE); +constexpr cItemStairsHandler ItemCobblestoneStairsHandler(E_BLOCK_COBBLESTONE_STAIRS); +constexpr cDefaultItemHandler ItemCobblestoneWallHandler(E_BLOCK_COBBLESTONE_WALL); +constexpr cDefaultItemHandler ItemCobwebHandler(E_BLOCK_COBWEB); +constexpr cDefaultItemHandler ItemCocoaPodHandler(E_BLOCK_COCOA_POD); +constexpr cDefaultItemHandler ItemCommandBlockHandler(E_BLOCK_COMMAND_BLOCK); +constexpr cItemComparatorHandler ItemComparatorHandler(E_ITEM_COMPARATOR); +constexpr cDefaultItemHandler ItemCompassHandler(E_ITEM_COMPASS); +constexpr cDefaultItemHandler ItemConcreteBlockHandler(E_BLOCK_CONCRETE); +constexpr cDefaultItemHandler ItemConcretePowderHandler(E_BLOCK_CONCRETE_POWDER); +constexpr cItemSimpleFoodHandler ItemCookedBeefHandler(E_ITEM_STEAK, cItemHandler::FoodInfo(8, 12.8)); +constexpr cItemSimpleFoodHandler ItemCookedChickenHandler(E_ITEM_COOKED_CHICKEN, cItemHandler::FoodInfo(6, 7.2)); +constexpr cItemCookedFishHandler ItemCookedFishHandler(E_ITEM_COOKED_FISH); +constexpr cItemSimpleFoodHandler ItemCookedMuttonHandler(E_ITEM_COOKED_MUTTON, cItemHandler::FoodInfo(6, 9.6)); +constexpr cItemSimpleFoodHandler ItemCookedPorkchopHandler(E_ITEM_COOKED_PORKCHOP, cItemHandler::FoodInfo(8, 12.8)); +constexpr cItemSimpleFoodHandler ItemCookedRabbitHandler(E_ITEM_COOKED_RABBIT, cItemHandler::FoodInfo(5, 6)); +constexpr cItemSimpleFoodHandler ItemCookieHandler(E_ITEM_COOKIE, cItemHandler::FoodInfo(2, 0.5)); +constexpr cItemGlazedTerracottaHandler ItemCyanGlazedTerracottaHandler(E_BLOCK_CYAN_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemCyanShulkerBoxHandler(E_BLOCK_CYAN_SHULKER_BOX); +constexpr cDefaultItemHandler ItemDandelionHandler(E_BLOCK_DANDELION); +constexpr cItemBoatHandler ItemDarkOakBoatHandler(E_ITEM_DARK_OAK_BOAT); +constexpr cDefaultItemHandler ItemDarkOakDoorBlockHandler(E_BLOCK_DARK_OAK_DOOR); +constexpr cItemDoorHandler ItemDarkOakDoorHandler(E_ITEM_DARK_OAK_DOOR); +constexpr cItemFenceGateHandler ItemDarkOakFenceGateHandler(E_BLOCK_DARK_OAK_FENCE_GATE); +constexpr cDefaultItemHandler ItemDarkOakFenceHandler(E_BLOCK_DARK_OAK_FENCE); +constexpr cItemStairsHandler ItemDarkOakStairsHandler(E_BLOCK_DARK_OAK_WOOD_STAIRS); +constexpr cDefaultItemHandler ItemDaylightSensorBlockHandler(E_BLOCK_DAYLIGHT_SENSOR); +constexpr cDefaultItemHandler ItemDeadBushHandler(E_BLOCK_DEAD_BUSH); +constexpr cItemRailHandler ItemDetectorRailHandler(E_BLOCK_DETECTOR_RAIL); +constexpr cItemAxeHandler ItemDiamondAxeHandler(E_ITEM_DIAMOND_AXE); +constexpr cDefaultItemHandler ItemDiamondBlockHandler(E_BLOCK_DIAMOND_BLOCK); +constexpr cItemArmorHandler ItemDiamondBootsHandler(E_ITEM_DIAMOND_BOOTS); +constexpr cItemArmorHandler ItemDiamondChestplateHandler(E_ITEM_DIAMOND_CHESTPLATE); +constexpr cDefaultItemHandler ItemDiamondHandler(E_ITEM_DIAMOND); +constexpr cItemArmorHandler ItemDiamondHelmetHandler(E_ITEM_DIAMOND_HELMET); +constexpr cItemHoeHandler ItemDiamondHoeHandler(E_ITEM_DIAMOND_HOE); +constexpr cDefaultItemHandler ItemDiamondHorseArmorHandler(E_ITEM_DIAMOND_HORSE_ARMOR); +constexpr cItemArmorHandler ItemDiamondLeggingsHandler(E_ITEM_DIAMOND_LEGGINGS); +constexpr cDefaultItemHandler ItemDiamondOreHandler(E_BLOCK_DIAMOND_ORE); +constexpr cItemPickaxeHandler ItemDiamondPickaxeHandler(E_ITEM_DIAMOND_PICKAXE); +constexpr cItemShovelHandler ItemDiamondShovelHandler(E_ITEM_DIAMOND_SHOVEL); +constexpr cItemSwordHandler ItemDiamondSwordHandler(E_ITEM_DIAMOND_SWORD); +constexpr cDefaultItemHandler ItemDirtHandler(E_BLOCK_DIRT); +constexpr cItemDropSpenserHandler ItemDispenserHandler(E_BLOCK_DISPENSER); +constexpr cDefaultItemHandler ItemDoubleOakSlabHandler(E_BLOCK_DOUBLE_WOODEN_SLAB); +constexpr cDefaultItemHandler ItemDoubleRedSandstoneSlabHandler(E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB); +constexpr cDefaultItemHandler ItemDoubleStoneSlabHandler(E_BLOCK_DOUBLE_STONE_SLAB); +constexpr cDefaultItemHandler ItemDragonBreathHandler(E_ITEM_DRAGON_BREATH); +constexpr cDefaultItemHandler ItemDragonEggBlockHandler(E_BLOCK_DRAGON_EGG); +constexpr cItemDropSpenserHandler ItemDropperHandler(E_BLOCK_DROPPER); +constexpr cItemDyeHandler ItemDyeHandler(E_ITEM_DYE); +constexpr cItemEggHandler ItemEggHandler(E_ITEM_EGG); +constexpr cItemArmorHandler ItemElytraHandler(E_ITEM_ELYTRA); +constexpr cDefaultItemHandler ItemEmeraldBlockHandler(E_BLOCK_EMERALD_BLOCK); +constexpr cDefaultItemHandler ItemEmeraldHandler(E_ITEM_EMERALD); +constexpr cDefaultItemHandler ItemEmeraldOreHandler(E_BLOCK_EMERALD_ORE); +constexpr cItemEmptyMapHandler ItemEmptyMapHandler(E_ITEM_EMPTY_MAP); +constexpr cDefaultItemHandler ItemEnchantedBookHandler(E_ITEM_ENCHANTED_BOOK); +constexpr cItemEnchantingTableHandler ItemEnchantingTableHandler(E_BLOCK_ENCHANTMENT_TABLE); +constexpr cDefaultItemHandler ItemEndBricksHandler(E_BLOCK_END_BRICKS); +constexpr cItemEndCrystalHandler ItemEndCrystalHandler(E_ITEM_END_CRYSTAL); +constexpr cItemEnderChestHandler ItemEnderChestHandler(E_BLOCK_ENDER_CHEST); +constexpr cItemEnderPearlHandler ItemEnderPearlHandler(E_ITEM_ENDER_PEARL); +constexpr cDefaultItemHandler ItemEndGatewayHandler(E_BLOCK_END_GATEWAY); +constexpr cDefaultItemHandler ItemEndPortalBlockHandler(E_BLOCK_END_PORTAL); +constexpr cItemEndPortalFrameHandler ItemEndPortalFrameHandler(E_BLOCK_END_PORTAL_FRAME); +constexpr cDefaultItemHandler ItemEndRodHandler(E_BLOCK_END_ROD); +constexpr cDefaultItemHandler ItemEndStoneBlockHandler(E_BLOCK_END_STONE); +constexpr cItemEyeOfEnderHandler ItemEyeOfEnderHandler(E_ITEM_EYE_OF_ENDER); +constexpr cDefaultItemHandler ItemFarDiscHandler(E_ITEM_FAR_DISC); +constexpr cDefaultItemHandler ItemFarmlandHandler(E_BLOCK_FARMLAND); +constexpr cDefaultItemHandler ItemFeatherHandler(E_ITEM_FEATHER); +constexpr cDefaultItemHandler ItemFermentedSpiderEyeHandler(E_ITEM_FERMENTED_SPIDER_EYE); +constexpr cDefaultItemHandler ItemFireBlockHandler(E_BLOCK_FIRE); +constexpr cItemLighterHandler ItemFireChargeHandler(E_ITEM_FIRE_CHARGE); +constexpr cItemFireworkHandler ItemFireworkRocketHandler(E_ITEM_FIREWORK_ROCKET); +constexpr cDefaultItemHandler ItemFireworkStarHandler(E_ITEM_FIREWORK_STAR); +constexpr cItemFishingRodHandler ItemFishingRodHandler(E_ITEM_FISHING_ROD); +constexpr cItemLighterHandler ItemFlintAndSteelHandler(E_ITEM_FLINT_AND_STEEL); +constexpr cDefaultItemHandler ItemFlintHandler(E_ITEM_FLINT); +constexpr cDefaultItemHandler ItemFlowerPotBlockHandler(E_BLOCK_FLOWER_POT); +constexpr cSimplePlaceableItemHandler ItemFlowerPotHandler(E_ITEM_FLOWER_POT, E_BLOCK_FLOWER_POT); +constexpr cDefaultItemHandler ItemFrostedIceHandler(E_BLOCK_FROSTED_ICE); +constexpr cItemFurnaceHandler ItemFurnaceHandler(E_BLOCK_FURNACE); +constexpr cItemMinecartHandler ItemFurnaceMinecartHandler(E_ITEM_FURNACE_MINECART); +constexpr cDefaultItemHandler ItemGhastTearHandler(E_ITEM_GHAST_TEAR); +constexpr cItemBottleHandler ItemGlassBottleHandler(E_ITEM_GLASS_BOTTLE); +constexpr cDefaultItemHandler ItemGlassHandler(E_BLOCK_GLASS); +constexpr cDefaultItemHandler ItemGlassPaneHandler(E_BLOCK_GLASS_PANE); +constexpr cDefaultItemHandler ItemGlisteringMelonHandler(E_ITEM_GLISTERING_MELON); +constexpr cDefaultItemHandler ItemGlowstoneBlockHandler(E_BLOCK_GLOWSTONE); +constexpr cDefaultItemHandler ItemGlowstoneDustHandler(E_ITEM_GLOWSTONE_DUST); +constexpr cDefaultItemHandler ItemGoldBlockHandler(E_BLOCK_GOLD_BLOCK); +constexpr cItemGoldenAppleHandler ItemGoldenAppleHandler(E_ITEM_GOLDEN_APPLE); +constexpr cItemAxeHandler ItemGoldenAxeHandler(E_ITEM_GOLD_AXE); +constexpr cItemArmorHandler ItemGoldenBootsHandler(E_ITEM_GOLD_BOOTS); +constexpr cItemSimpleFoodHandler ItemGoldenCarrotHandler(E_ITEM_GOLDEN_CARROT, cItemHandler::FoodInfo(6, 14.4)); +constexpr cItemArmorHandler ItemGoldenChestplateHandler(E_ITEM_GOLD_CHESTPLATE); +constexpr cItemArmorHandler ItemGoldenHelmetHandler(E_ITEM_GOLD_HELMET); +constexpr cItemHoeHandler ItemGoldenHoeHandler(E_ITEM_GOLD_HOE); +constexpr cDefaultItemHandler ItemGoldenHorseArmorHandler(E_ITEM_GOLD_HORSE_ARMOR); +constexpr cItemArmorHandler ItemGoldenLeggingsHandler(E_ITEM_GOLD_LEGGINGS); +constexpr cItemPickaxeHandler ItemGoldenPickaxeHandler(E_ITEM_GOLD_PICKAXE); +constexpr cItemShovelHandler ItemGoldenShovelHandler(E_ITEM_GOLD_SHOVEL); +constexpr cItemSwordHandler ItemGoldenSwordHandler(E_ITEM_GOLD_SWORD); +constexpr cDefaultItemHandler ItemGoldHandler(E_ITEM_GOLD); +constexpr cDefaultItemHandler ItemGoldNuggetHandler(E_ITEM_GOLD_NUGGET); +constexpr cDefaultItemHandler ItemGoldOreHandler(E_BLOCK_GOLD_ORE); +constexpr cDefaultItemHandler ItemGrassBlockHandler(E_BLOCK_GRASS); +constexpr cDefaultItemHandler ItemGrassPathHandler(E_BLOCK_GRASS_PATH); +constexpr cDefaultItemHandler ItemGravelHandler(E_BLOCK_GRAVEL); +constexpr cItemGlazedTerracottaHandler ItemGrayGlazedTerracottaHandler(E_BLOCK_GRAY_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemGrayShulkerBoxHandler(E_BLOCK_GRAY_SHULKER_BOX); +constexpr cItemGlazedTerracottaHandler ItemGreenGlazedTerracottaHandler(E_BLOCK_GREEN_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemGreenShulkerBoxHandler(E_BLOCK_GREEN_SHULKER_BOX); +constexpr cDefaultItemHandler ItemGunpowderHandler(E_ITEM_GUNPOWDER); +constexpr cDefaultItemHandler ItemHardenedClayHandler(E_BLOCK_HARDENED_CLAY); +constexpr cItemSidewaysHandler ItemHayBaleHandler(E_BLOCK_HAY_BALE); +constexpr cDefaultItemHandler ItemHeadBlockHandler(E_BLOCK_HEAD); +constexpr cItemMobHeadHandler ItemHeadHandler(E_ITEM_HEAD); +constexpr cDefaultItemHandler ItemHeavyWeightedPressurePlateHandler(E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE); +constexpr cItemHopperHandler ItemHopperHandler(E_BLOCK_HOPPER); +constexpr cDefaultItemHandler ItemHugeBrownMushroomBlockHandler(E_BLOCK_HUGE_BROWN_MUSHROOM); +constexpr cDefaultItemHandler ItemHugeRedMushroomBlockHandler(E_BLOCK_HUGE_RED_MUSHROOM); +constexpr cDefaultItemHandler ItemIceHandler(E_BLOCK_ICE); +constexpr cDefaultItemHandler ItemInactiveComparatorHandler(E_BLOCK_INACTIVE_COMPARATOR); +constexpr cDefaultItemHandler ItemInvertedDaylightSensorHandler(E_BLOCK_INVERTED_DAYLIGHT_SENSOR); +constexpr cItemAxeHandler ItemIronAxeHandler(E_ITEM_IRON_AXE); +constexpr cDefaultItemHandler ItemIronBarsBlockHandler(E_BLOCK_IRON_BARS); +constexpr cDefaultItemHandler ItemIronBlockHandler(E_BLOCK_IRON_BLOCK); +constexpr cItemArmorHandler ItemIronBootsHandler(E_ITEM_IRON_BOOTS); +constexpr cItemArmorHandler ItemIronChestplateHandler(E_ITEM_IRON_CHESTPLATE); +constexpr cDefaultItemHandler ItemIronDoorBlockHandler(E_BLOCK_IRON_DOOR); +constexpr cItemDoorHandler ItemIronDoorHandler(E_ITEM_IRON_DOOR); +constexpr cDefaultItemHandler ItemIronHandler(E_ITEM_IRON); +constexpr cItemArmorHandler ItemIronHelmetHandler(E_ITEM_IRON_HELMET); +constexpr cItemHoeHandler ItemIronHoeHandler(E_ITEM_IRON_HOE); +constexpr cDefaultItemHandler ItemIronHorseArmorHandler(E_ITEM_IRON_HORSE_ARMOR); +constexpr cItemArmorHandler ItemIronLeggingsHandler(E_ITEM_IRON_LEGGINGS); +constexpr cDefaultItemHandler ItemIronNuggetHandler(E_ITEM_IRON_NUGGET); +constexpr cDefaultItemHandler ItemIronOreHandler(E_BLOCK_IRON_ORE); +constexpr cItemPickaxeHandler ItemIronPickaxeHandler(E_ITEM_IRON_PICKAXE); +constexpr cItemShovelHandler ItemIronShovelHandler(E_ITEM_IRON_SHOVEL); +constexpr cItemSwordHandler ItemIronSwordHandler(E_ITEM_IRON_SWORD); +constexpr cItemTrapdoorHandler ItemIronTrapdoorHandler(E_BLOCK_IRON_TRAPDOOR); +constexpr cItemItemFrameHandler ItemItemFrameHandler(E_ITEM_ITEM_FRAME); +constexpr cItemJackOLanternHandler ItemJackOLanternHandler(E_BLOCK_JACK_O_LANTERN); +constexpr cDefaultItemHandler ItemJukeboxHandler(E_BLOCK_JUKEBOX); +constexpr cItemBoatHandler ItemJungleBoatHandler(E_ITEM_JUNGLE_BOAT); +constexpr cDefaultItemHandler ItemJungleDoorBlockHandler(E_BLOCK_JUNGLE_DOOR); +constexpr cItemDoorHandler ItemJungleDoorHandler(E_ITEM_JUNGLE_DOOR); +constexpr cItemFenceGateHandler ItemJungleFenceGateHandler(E_BLOCK_JUNGLE_FENCE_GATE); +constexpr cDefaultItemHandler ItemJungleFenceHandler(E_BLOCK_JUNGLE_FENCE); +constexpr cItemStairsHandler ItemJungleStairsHandler(E_BLOCK_JUNGLE_WOOD_STAIRS); +constexpr cItemLadderHandler ItemLadderHandler(E_BLOCK_LADDER); +constexpr cDefaultItemHandler ItemLapisBlockHandler(E_BLOCK_LAPIS_BLOCK); +constexpr cDefaultItemHandler ItemLapisOreHandler(E_BLOCK_LAPIS_ORE); +constexpr cItemBucketHandler ItemLavaBucketHandler(E_ITEM_LAVA_BUCKET); +constexpr cDefaultItemHandler ItemLavaHandler(E_BLOCK_LAVA); +constexpr cDefaultItemHandler ItemLeashHandler(E_ITEM_LEAD); +constexpr cItemArmorHandler ItemLeatherBootsHandler(E_ITEM_LEATHER_BOOTS); +constexpr cItemArmorHandler ItemLeatherCapHandler(E_ITEM_LEATHER_CAP); +constexpr cDefaultItemHandler ItemLeatherHandler(E_ITEM_LEATHER); +constexpr cItemArmorHandler ItemLeatherPantsHandler(E_ITEM_LEATHER_PANTS); +constexpr cItemArmorHandler ItemLeatherTunicHandler(E_ITEM_LEATHER_TUNIC); +constexpr cItemLeavesHandler ItemLeavesHandler(E_BLOCK_LEAVES); +constexpr cItemLeverHandler ItemLeverHandler(E_BLOCK_LEVER); +constexpr cItemGlazedTerracottaHandler ItemLightBlueGlazedTerracottaHandler(E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemLightBlueShulkerBoxHandler(E_BLOCK_LIGHT_BLUE_SHULKER_BOX); +constexpr cItemGlazedTerracottaHandler ItemLightGrayGlazedTerracottaHandler(E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemLightGrayShulkerBoxHandler(E_BLOCK_LIGHT_GRAY_SHULKER_BOX); +constexpr cDefaultItemHandler ItemLightWeightedPressurePlateHandler(E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE); +constexpr cItemLilypadHandler ItemLilypadHandler(E_BLOCK_LILY_PAD); +constexpr cItemGlazedTerracottaHandler ItemLimeGlazedTerracottaHandler(E_BLOCK_LIME_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemLimeShulkerBoxHandler(E_BLOCK_LIME_SHULKER_BOX); +constexpr cItemPotionHandler ItemLingeringPotionHandler(E_ITEM_LINGERING_POTION); +constexpr cDefaultItemHandler ItemLitFurnaceHandler(E_BLOCK_LIT_FURNACE); +constexpr cItemSidewaysHandler ItemLogHandler(E_BLOCK_LOG); +constexpr cItemGlazedTerracottaHandler ItemMagentaGlazedTerracottaHandler(E_BLOCK_MAGENTA_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemMagentaShulkerBoxHandler(E_BLOCK_MAGENTA_SHULKER_BOX); +constexpr cDefaultItemHandler ItemMagmaBlockHandler(E_BLOCK_MAGMA); +constexpr cDefaultItemHandler ItemMagmaCreamHandler(E_ITEM_MAGMA_CREAM); +constexpr cDefaultItemHandler ItemMallDiscHandler(E_ITEM_MALL_DISC); +constexpr cItemMapHandler ItemMapHandler(E_ITEM_MAP); +constexpr cDefaultItemHandler ItemMellohiDiscHandler(E_ITEM_MELLOHI_DISC); +constexpr cDefaultItemHandler ItemMelonBlockHandler(E_BLOCK_MELON); +constexpr cItemSimpleSeedsHandler ItemMelonSeedsHandler(E_ITEM_MELON_SEEDS); +constexpr cItemSimpleFoodHandler ItemMelonSliceHandler(E_ITEM_MELON_SLICE, cItemHandler::FoodInfo(2, 1.2)); +constexpr cDefaultItemHandler ItemMelonStemHandler(E_BLOCK_MELON_STEM); +constexpr cItemMilkHandler ItemMilkHandler(E_ITEM_MILK); +constexpr cItemMinecartHandler ItemMinecartHandler(E_ITEM_MINECART); +constexpr cItemMinecartHandler ItemMinecartWithCommandBlockHandler(E_ITEM_MINECART_WITH_COMMAND_BLOCK); +constexpr cItemMinecartHandler ItemMinecartWithHopperHandler(E_ITEM_MINECART_WITH_HOPPER); +constexpr cItemMinecartHandler ItemMinecartWithTNTHandler(E_ITEM_MINECART_WITH_TNT); +constexpr cDefaultItemHandler ItemMobSpawnerBlockHandler(E_BLOCK_MOB_SPAWNER); +constexpr cDefaultItemHandler ItemMossyCobblestoneHandler(E_BLOCK_MOSSY_COBBLESTONE); +constexpr cItemSoupHandler ItemMushroomSoupHandler(E_ITEM_MUSHROOM_SOUP, cItemHandler::FoodInfo(6, 7.2)); +constexpr cDefaultItemHandler ItemMyceliumHandler(E_BLOCK_MYCELIUM); +constexpr cDefaultItemHandler ItemNameTagHandler(E_ITEM_NAME_TAG); +constexpr cDefaultItemHandler ItemNetherBrickFenceHandler(E_BLOCK_NETHER_BRICK_FENCE); +constexpr cDefaultItemHandler ItemNetherBrickHandler(E_ITEM_NETHER_BRICK); +constexpr cDefaultItemHandler ItemNetherBricksHandler(E_BLOCK_NETHER_BRICK); +constexpr cItemStairsHandler ItemNetherBrickStairsHandler(E_BLOCK_NETHER_BRICK_STAIRS); +constexpr cDefaultItemHandler ItemNetherPortalBlockHandler(E_BLOCK_NETHER_PORTAL); +constexpr cDefaultItemHandler ItemNetherQuartzHandler(E_ITEM_NETHER_QUARTZ); +constexpr cDefaultItemHandler ItemNetherQuartzOreHandler(E_BLOCK_NETHER_QUARTZ_ORE); +constexpr cDefaultItemHandler ItemNetherrackHandler(E_BLOCK_NETHERRACK); +constexpr cDefaultItemHandler ItemNetherStarHandler(E_ITEM_NETHER_STAR); +constexpr cDefaultItemHandler ItemNetherWartBlockHandler(E_BLOCK_NETHER_WART_BLOCK); +constexpr cItemNetherWartHandler ItemNetherWartHandler(E_ITEM_NETHER_WART); +constexpr cDefaultItemHandler ItemNetherWartTechnicalBlockHandler(E_BLOCK_NETHER_WART); +constexpr cItemLeavesHandler ItemNewLeavesHandler(E_BLOCK_NEW_LEAVES); +constexpr cItemSidewaysHandler ItemNewLogHandler(E_BLOCK_NEW_LOG); +constexpr cDefaultItemHandler ItemNoteBlockHandler(E_BLOCK_NOTE_BLOCK); +constexpr cItemBoatHandler ItemOakBoatHandler(E_ITEM_BOAT); +constexpr cItemButtonHandler ItemOakButtonHandler(E_BLOCK_WOODEN_BUTTON); +constexpr cDefaultItemHandler ItemOakDoorBlockHandler(E_BLOCK_OAK_DOOR); +constexpr cItemDoorHandler ItemOakDoorHandler(E_ITEM_WOODEN_DOOR); +constexpr cItemFenceGateHandler ItemOakFenceGateHandler(E_BLOCK_OAK_FENCE_GATE); +constexpr cDefaultItemHandler ItemOakFenceHandler(E_BLOCK_FENCE); +constexpr cItemSlabHandler ItemOakSlabHandler(E_BLOCK_WOODEN_SLAB); +constexpr cItemStairsHandler ItemOakStairsHandler(E_BLOCK_OAK_WOOD_STAIRS); +constexpr cItemTrapdoorHandler ItemOakTrapdoorHandler(E_BLOCK_TRAPDOOR); +constexpr cItemObserverHandler ItemObserverHandler(E_BLOCK_OBSERVER); +constexpr cDefaultItemHandler ItemObsidianHandler(E_BLOCK_OBSIDIAN); +constexpr cItemGlazedTerracottaHandler ItemOrangeGlazedTerracottaHandler(E_BLOCK_ORANGE_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemOrangeShulkerBoxHandler(E_BLOCK_ORANGE_SHULKER_BOX); +constexpr cDefaultItemHandler ItemPackedIceHandler(E_BLOCK_PACKED_ICE); +constexpr cItemPaintingHandler ItemPaintingHandler(E_ITEM_PAINTING); +constexpr cDefaultItemHandler ItemPaperHandler(E_ITEM_PAPER); +constexpr cItemGlazedTerracottaHandler ItemPinkGlazedTerracottaHandler(E_BLOCK_PINK_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemPinkShulkerBoxHandler(E_BLOCK_PINK_SHULKER_BOX); +constexpr cDefaultItemHandler ItemPistonExtensionHandler(E_BLOCK_PISTON_EXTENSION); +constexpr cItemPistonHandler ItemPistonHandler(E_BLOCK_PISTON); +constexpr cDefaultItemHandler ItemPistonMovedBlockHandler(E_BLOCK_PISTON_MOVED_BLOCK); +constexpr cItemPlanksHandler ItemPlanksHandler(E_BLOCK_PLANKS); +constexpr cItemPoisonousPotatoHandler ItemPoisonousPotatoHandler(E_ITEM_POISONOUS_POTATO); +constexpr cDefaultItemHandler ItemPoppedChorusFruitHandler(E_ITEM_POPPED_CHORUS_FRUIT); +constexpr cDefaultItemHandler ItemPoppyHandler(E_BLOCK_FLOWER); +constexpr cDefaultItemHandler ItemPotatoesBlockHandler(E_BLOCK_POTATOES); +constexpr cItemFoodSeedsHandler ItemPotatoHandler(E_ITEM_POTATO, cItemHandler::FoodInfo(1, 0.6)); +constexpr cItemPotionHandler ItemPotionHandler(E_ITEM_POTION); +constexpr cItemRailHandler ItemPoweredRailHandler(E_BLOCK_POWERED_RAIL); +constexpr cDefaultItemHandler ItemPrismarineBlockHandler(E_BLOCK_PRISMARINE_BLOCK); +constexpr cDefaultItemHandler ItemPrismarineCrystalsHandler(E_ITEM_PRISMARINE_CRYSTALS); +constexpr cDefaultItemHandler ItemPrismarineShardHandler(E_ITEM_PRISMARINE_SHARD); +constexpr cItemPumpkinHandler ItemPumpkinHandler(E_BLOCK_PUMPKIN); +constexpr cItemSimpleFoodHandler ItemPumpkinPieHandler(E_ITEM_PUMPKIN_PIE, cItemHandler::FoodInfo(8, 4.8)); +constexpr cItemSimpleSeedsHandler ItemPumpkinSeedsHandler(E_ITEM_PUMPKIN_SEEDS); +constexpr cDefaultItemHandler ItemPumpkinStemHandler(E_BLOCK_PUMPKIN_STEM); +constexpr cItemGlazedTerracottaHandler ItemPurpleGlazedTerracottaHandler(E_BLOCK_PURPLE_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemPurpleShulkerBoxHandler(E_BLOCK_PURPLE_SHULKER_BOX); +constexpr cDefaultItemHandler ItemPurpurBlockHandler(E_BLOCK_PURPUR_BLOCK); +constexpr cDefaultItemHandler ItemPurpurDoubleSlabHandler(E_BLOCK_PURPUR_DOUBLE_SLAB); +constexpr cDefaultItemHandler ItemPurpurPillarHandler(E_BLOCK_PURPUR_PILLAR); +constexpr cItemSlabHandler ItemPurpurSlabHandler(E_BLOCK_PURPUR_SLAB); +constexpr cItemStairsHandler ItemPurpurStairsHandler(E_BLOCK_PURPUR_STAIRS); +constexpr cItemQuartzHandler ItemQuartzBlockHandler(E_BLOCK_QUARTZ_BLOCK); +constexpr cItemStairsHandler ItemQuartzStairsHandler(E_BLOCK_QUARTZ_STAIRS); +constexpr cDefaultItemHandler ItemRabbitHideHandler(E_ITEM_RABBIT_HIDE); +constexpr cDefaultItemHandler ItemRabbitsFootHandler(E_ITEM_RABBITS_FOOT); +constexpr cItemSoupHandler ItemRabbitStewHandler(E_ITEM_RABBIT_STEW, cItemHandler::FoodInfo(10, 12)); +constexpr cItemRailHandler ItemRailHandler(E_BLOCK_RAIL); +constexpr cItemSimpleFoodHandler ItemRawBeefHandler(E_ITEM_RAW_BEEF, cItemHandler::FoodInfo(3, 1.8)); +constexpr cItemRawChickenHandler ItemRawChickenHandler(E_ITEM_RAW_CHICKEN); +constexpr cItemRawFishHandler ItemRawFishHandler(E_ITEM_RAW_FISH); +constexpr cItemSimpleFoodHandler ItemRawMuttonHandler(E_ITEM_RAW_MUTTON, cItemHandler::FoodInfo(2, 1.2)); +constexpr cItemSimpleFoodHandler ItemRawPorkchopHandler(E_ITEM_RAW_PORKCHOP, cItemHandler::FoodInfo(3, 1.8)); +constexpr cItemSimpleFoodHandler ItemRawRabbitHandler(E_ITEM_RAW_RABBIT, cItemHandler::FoodInfo(3, 1.8)); +constexpr cItemGlazedTerracottaHandler ItemRedGlazedTerracottaHandler(E_BLOCK_RED_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemRedMushroomBlockHandler(E_BLOCK_RED_MUSHROOM); +constexpr cDefaultItemHandler ItemRedNetherBricksHandler(E_BLOCK_RED_NETHER_BRICK); +constexpr cDefaultItemHandler ItemRedSandstoneHandler(E_BLOCK_RED_SANDSTONE); +constexpr cItemSlabHandler ItemRedSandstoneSlabHandler(E_BLOCK_RED_SANDSTONE_SLAB); +constexpr cItemStairsHandler ItemRedSandstoneStairsHandler(E_BLOCK_RED_SANDSTONE_STAIRS); +constexpr cDefaultItemHandler ItemRedShulkerBoxHandler(E_BLOCK_RED_SHULKER_BOX); +constexpr cDefaultItemHandler ItemRedstoneBlockHandler(E_BLOCK_BLOCK_OF_REDSTONE); +constexpr cItemRedstoneDustHandler ItemRedstoneDustHandler(E_ITEM_REDSTONE_DUST); +constexpr cDefaultItemHandler ItemRedstoneLampOffHandler(E_BLOCK_REDSTONE_LAMP_OFF); +constexpr cDefaultItemHandler ItemRedstoneLampOnHandler(E_BLOCK_REDSTONE_LAMP_ON); +constexpr cDefaultItemHandler ItemRedstoneOreGlowingHandler(E_BLOCK_REDSTONE_ORE_GLOWING); +constexpr cDefaultItemHandler ItemRedstoneOreHandler(E_BLOCK_REDSTONE_ORE); +constexpr cItemRedstoneRepeaterHandler ItemRedstoneRepeaterHandler(E_ITEM_REDSTONE_REPEATER); +constexpr cDefaultItemHandler ItemRedstoneRepeaterOffHandler(E_BLOCK_REDSTONE_REPEATER_OFF); +constexpr cDefaultItemHandler ItemRedstoneRepeaterOnHandler(E_BLOCK_REDSTONE_REPEATER_ON); +constexpr cItemTorchHandler ItemRedstoneTorchHandler(E_BLOCK_REDSTONE_TORCH_ON); +constexpr cDefaultItemHandler ItemRedstoneTorchOffBlockHandler(E_BLOCK_REDSTONE_TORCH_OFF); +constexpr cDefaultItemHandler ItemRedstoneWireHandler(E_BLOCK_REDSTONE_WIRE); +constexpr cDefaultItemHandler ItemRepeatingCommandBlockHandler(E_BLOCK_REPEATING_COMMAND_BLOCK); +constexpr cItemRottenFleshHandler ItemRottenFleshHandler(E_ITEM_ROTTEN_FLESH); +constexpr cDefaultItemHandler ItemSaddleHandler(E_ITEM_SADDLE); +constexpr cDefaultItemHandler ItemSandHandler(E_BLOCK_SAND); +constexpr cDefaultItemHandler ItemSandstoneHandler(E_BLOCK_SANDSTONE); +constexpr cItemStairsHandler ItemSandstoneStairsHandler(E_BLOCK_SANDSTONE_STAIRS); +constexpr cItemSaplingHandler ItemSaplingHandler(E_BLOCK_SAPLING); +constexpr cDefaultItemHandler ItemSeaLanternHandler(E_BLOCK_SEA_LANTERN); +constexpr cItemSimpleSeedsHandler ItemSeedsHandler(E_ITEM_SEEDS); +constexpr cItemShearsHandler ItemShearsHandler(E_ITEM_SHEARS); +constexpr cDefaultItemHandler ItemShieldHandler(E_ITEM_SHIELD); +constexpr cDefaultItemHandler ItemShulkerShellHandler(E_ITEM_SHULKER_SHELL); +constexpr cItemSignHandler ItemSignHandler(E_ITEM_SIGN); +constexpr cDefaultItemHandler ItemSignPostHandler(E_BLOCK_SIGN_POST); +constexpr cDefaultItemHandler ItemSilverfishEggBlockHandler(E_BLOCK_SILVERFISH_EGG); +constexpr cDefaultItemHandler ItemSlimeballHandler(E_ITEM_SLIMEBALL); +constexpr cDefaultItemHandler ItemSlimeBlockHandler(E_BLOCK_SLIME_BLOCK); +constexpr cItemSnowballHandler ItemSnowballHandler(E_ITEM_SNOWBALL); +constexpr cDefaultItemHandler ItemSnowBlockHandler(E_BLOCK_SNOW_BLOCK); +constexpr cItemSnowHandler ItemSnowHandler(E_BLOCK_SNOW); +constexpr cDefaultItemHandler ItemSoulsandHandler(E_BLOCK_SOULSAND); +constexpr cItemSpawnEggHandler ItemSpawnEggHandler(E_ITEM_SPAWN_EGG); +constexpr cDefaultItemHandler ItemSpectralArrowHandler(E_ITEM_SPECTRAL_ARROW); +constexpr cItemSpiderEyeHandler ItemSpiderEyeHandler(E_ITEM_SPIDER_EYE); +constexpr cItemPotionHandler ItemSplashPotionHandler(E_ITEM_SPLASH_POTION); +constexpr cDefaultItemHandler ItemSpongeHandler(E_BLOCK_SPONGE); +constexpr cItemBoatHandler ItemSpruceBoatHandler(E_ITEM_SPRUCE_BOAT); +constexpr cDefaultItemHandler ItemSpruceDoorBlockHandler(E_BLOCK_SPRUCE_DOOR); +constexpr cItemDoorHandler ItemSpruceDoorHandler(E_ITEM_SPRUCE_DOOR); +constexpr cItemFenceGateHandler ItemSpruceFenceGateHandler(E_BLOCK_SPRUCE_FENCE_GATE); +constexpr cDefaultItemHandler ItemSpruceFenceHandler(E_BLOCK_SPRUCE_FENCE); +constexpr cItemStairsHandler ItemSpruceStairsHandler(E_BLOCK_SPRUCE_WOOD_STAIRS); +constexpr cDefaultItemHandler ItemStainedGlassHandler(E_BLOCK_STAINED_GLASS); +constexpr cDefaultItemHandler ItemStainedGlassPaneHandler(E_BLOCK_STAINED_GLASS_PANE); +constexpr cDefaultItemHandler ItemStalDiscHandler(E_ITEM_STAL_DISC); +constexpr cDefaultItemHandler ItemStandingBannerHandler(E_BLOCK_STANDING_BANNER); +constexpr cDefaultItemHandler ItemStationaryLavaHandler(E_BLOCK_STATIONARY_LAVA); +constexpr cDefaultItemHandler ItemStationaryWaterHandler(E_BLOCK_STATIONARY_WATER); +constexpr cDefaultItemHandler ItemStickHandler(E_ITEM_STICK); +constexpr cItemPistonHandler ItemStickyPistonHandler(E_BLOCK_STICKY_PISTON); +constexpr cItemAxeHandler ItemStoneAxeHandler(E_ITEM_STONE_AXE); +constexpr cDefaultItemHandler ItemStoneBricksHandler(E_BLOCK_STONE_BRICKS); +constexpr cItemStairsHandler ItemStoneBrickStairsHandler(E_BLOCK_STONE_BRICK_STAIRS); +constexpr cItemButtonHandler ItemStoneButtonHandler(E_BLOCK_STONE_BUTTON); +constexpr cDefaultItemHandler ItemStoneHandler(E_BLOCK_STONE); +constexpr cItemHoeHandler ItemStoneHoeHandler(E_ITEM_STONE_HOE); +constexpr cItemPickaxeHandler ItemStonePickaxeHandler(E_ITEM_STONE_PICKAXE); +constexpr cDefaultItemHandler ItemStonePressurePlateHandler(E_BLOCK_STONE_PRESSURE_PLATE); +constexpr cItemShovelHandler ItemStoneShovelHandler(E_ITEM_STONE_SHOVEL); +constexpr cItemSlabHandler ItemStoneSlabHandler(E_BLOCK_STONE_SLAB); +constexpr cItemSwordHandler ItemStoneSwordHandler(E_ITEM_STONE_SWORD); +constexpr cDefaultItemHandler ItemStradDiscHandler(E_ITEM_STRAD_DISC); +constexpr cSimplePlaceableItemHandler ItemStringHandler(E_ITEM_STRING, E_BLOCK_TRIPWIRE); +constexpr cDefaultItemHandler ItemStructureBlockHandler(E_BLOCK_STRUCTURE_BLOCK); +constexpr cDefaultItemHandler ItemStructureVoidHandler(E_BLOCK_STRUCTURE_VOID); +constexpr cDefaultItemHandler ItemSugarCaneBlockHandler(E_BLOCK_SUGARCANE); +constexpr cSimplePlaceableItemHandler ItemSugarCaneHandler(E_ITEM_SUGARCANE, E_BLOCK_SUGARCANE); +constexpr cDefaultItemHandler ItemSugarHandler(E_ITEM_SUGAR); +constexpr cDefaultItemHandler ItemTallGrassHandler(E_BLOCK_TALL_GRASS); +constexpr cDefaultItemHandler ItemTerracottaHandler(E_BLOCK_TERRACOTTA); +constexpr cDefaultItemHandler ItemTippedArrowHandler(E_ITEM_TIPPED_ARROW); +constexpr cDefaultItemHandler ItemTNTHandler(E_BLOCK_TNT); +constexpr cItemTorchHandler ItemTorchHandler(E_BLOCK_TORCH); +constexpr cDefaultItemHandler ItemTotemOfUndyingHandler(E_ITEM_TOTEM_OF_UNDYING); +constexpr cItemChestHandler ItemTrappedChestHandler(E_BLOCK_TRAPPED_CHEST); +constexpr cDefaultItemHandler ItemTripwireHandler(E_BLOCK_TRIPWIRE); +constexpr cItemTripwireHookHandler ItemTripwireHookHandler(E_BLOCK_TRIPWIRE_HOOK); +constexpr cItemVinesHandler ItemVinesHandler(E_BLOCK_VINES); +constexpr cDefaultItemHandler ItemWaitDiscHandler(E_ITEM_WAIT_DISC); +constexpr cDefaultItemHandler ItemWallBannerHandler(E_BLOCK_WALL_BANNER); +constexpr cDefaultItemHandler ItemWallsignHandler(E_BLOCK_WALLSIGN); +constexpr cDefaultItemHandler ItemWardDiscHandler(E_ITEM_WARD_DISC); +constexpr cItemBucketHandler ItemWaterBucketHandler(E_ITEM_WATER_BUCKET); +constexpr cDefaultItemHandler ItemWaterHandler(E_BLOCK_WATER); +constexpr cDefaultItemHandler ItemWheatBlockHandler(E_BLOCK_WHEAT); +constexpr cDefaultItemHandler ItemWheatHandler(E_ITEM_WHEAT); +constexpr cItemGlazedTerracottaHandler ItemWhiteGlazedTerracottaHandler(E_BLOCK_WHITE_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemWhiteShulkerBoxHandler(E_BLOCK_WHITE_SHULKER_BOX); +constexpr cItemAxeHandler ItemWoodenAxeHandler(E_ITEM_WOODEN_AXE); +constexpr cItemHoeHandler ItemWoodenHoeHandler(E_ITEM_WOODEN_HOE); +constexpr cItemPickaxeHandler ItemWoodenPickaxeHandler(E_ITEM_WOODEN_PICKAXE); +constexpr cDefaultItemHandler ItemWoodenPressurePlateHandler(E_BLOCK_WOODEN_PRESSURE_PLATE); +constexpr cItemShovelHandler ItemWoodenShovelHandler(E_ITEM_WOODEN_SHOVEL); +constexpr cItemSwordHandler ItemWoodenSwordHandler(E_ITEM_WOODEN_SWORD); +constexpr cItemClothHandler ItemWoolHandler(E_BLOCK_WOOL); +constexpr cDefaultItemHandler ItemWorkbenchHandler(E_BLOCK_WORKBENCH); +constexpr cDefaultItemHandler ItemWrittenBookHandler(E_ITEM_WRITTEN_BOOK); +constexpr cItemGlazedTerracottaHandler ItemYellowGlazedTerracottaHandler(E_BLOCK_YELLOW_GLAZED_TERRACOTTA); +constexpr cDefaultItemHandler ItemYellowShulkerBoxHandler(E_BLOCK_YELLOW_SHULKER_BOX); +} // namespace @@ -570,469 +571,468 @@ const cItemHandler & cItemHandler::For(int a_ItemType) { switch (a_ItemType) { - case E_BLOCK_ACACIA_DOOR: return ItemAcaciaDoorBlockHandler; - case E_BLOCK_ACACIA_FENCE: return ItemAcaciaFenceHandler; - case E_BLOCK_ACACIA_FENCE_GATE: return ItemAcaciaFenceGateHandler; - case E_BLOCK_ACACIA_WOOD_STAIRS: return ItemAcaciaStairsHandler; - case E_BLOCK_ACTIVATOR_RAIL: return ItemActivatorRailHandler; - case E_BLOCK_ACTIVE_COMPARATOR: return ItemActiveComparatorHandler; - case E_BLOCK_AIR: return ItemAirHandler; - case E_BLOCK_ANVIL: return ItemAnvilHandler; - case E_BLOCK_BARRIER: return ItemBarrierHandler; - case E_BLOCK_BEACON: return ItemBeaconHandler; - case E_BLOCK_BED: return ItemBedBlockHandler; - case E_BLOCK_BEDROCK: return ItemBedrockHandler; - case E_BLOCK_BEETROOTS: return ItemBeetrootsBlockHandler; - case E_BLOCK_BIG_FLOWER: return ItemBigFlowerHandler; - case E_BLOCK_BIRCH_DOOR: return ItemBirchDoorBlockHandler; - case E_BLOCK_BIRCH_FENCE: return ItemBirchFenceHandler; - case E_BLOCK_BIRCH_FENCE_GATE: return ItemBirchFenceGateHandler; - case E_BLOCK_BIRCH_WOOD_STAIRS: return ItemBirchStairsHandler; - case E_BLOCK_BLACK_GLAZED_TERRACOTTA: return ItemBlackGlazedTerracottaHandler; - case E_BLOCK_BLACK_SHULKER_BOX: return ItemBlackShulkerBoxHandler; - case E_BLOCK_BLOCK_OF_COAL: return ItemCoalBlockHandler; - case E_BLOCK_BLOCK_OF_REDSTONE: return ItemRedstoneBlockHandler; - case E_BLOCK_BLUE_GLAZED_TERRACOTTA: return ItemBlueGlazedTerracottaHandler; - case E_BLOCK_BLUE_SHULKER_BOX: return ItemBlueShulkerBoxHandler; - case E_BLOCK_BONE_BLOCK: return ItemBoneBlockHandler; - case E_BLOCK_BOOKCASE: return ItemBookshelfHandler; - case E_BLOCK_BREWING_STAND: return ItemBrewingStandBlockHandler; - case E_BLOCK_BRICK: return ItemBrickHandler; - case E_BLOCK_BRICK_STAIRS: return ItemBricksStairsHandler; - case E_BLOCK_BROWN_GLAZED_TERRACOTTA: return ItemBrownGlazedTerracottaHandler; - case E_BLOCK_BROWN_MUSHROOM: return ItemBrownMushroomBlockHandler; - case E_BLOCK_BROWN_SHULKER_BOX: return ItemBrownShulkerBoxHandler; - case E_BLOCK_CACTUS: return ItemCactusHandler; - case E_BLOCK_CAKE: return ItemCakeBlockHandler; - case E_BLOCK_CARPET: return ItemCarpetHandler; - case E_BLOCK_CARROTS: return ItemCarrotsBlockHandler; - case E_BLOCK_CAULDRON: return ItemCauldronBlockHandler; - case E_BLOCK_CHAIN_COMMAND_BLOCK: return ItemChainCommandBlockHandler; - case E_BLOCK_CHEST: return ItemChestHandler; - case E_BLOCK_CHORUS_FLOWER: return ItemChorusFlowerHandler; - case E_BLOCK_CHORUS_PLANT: return ItemChorusPlantHandler; - case E_BLOCK_CLAY: return ItemClayBlockHandler; - case E_BLOCK_COAL_ORE: return ItemCoalOreHandler; - case E_BLOCK_COBBLESTONE: return ItemCobblestoneHandler; - case E_BLOCK_COBBLESTONE_STAIRS: return ItemCobblestoneStairsHandler; - case E_BLOCK_COBBLESTONE_WALL: return ItemCobblestoneWallHandler; - case E_BLOCK_COBWEB: return ItemCobwebHandler; - case E_BLOCK_COCOA_POD: return ItemCocoaPodHandler; - case E_BLOCK_COMMAND_BLOCK: return ItemCommandBlockHandler; - case E_BLOCK_CONCRETE: return ItemConcreteBlockHandler; - case E_BLOCK_CONCRETE_POWDER: return ItemConcretePowderHandler; - case E_BLOCK_CRAFTING_TABLE: return ItemWorkbenchHandler; - case E_BLOCK_CYAN_GLAZED_TERRACOTTA: return ItemCyanGlazedTerracottaHandler; - case E_BLOCK_CYAN_SHULKER_BOX: return ItemCyanShulkerBoxHandler; - case E_BLOCK_DANDELION: return ItemDandelionHandler; - case E_BLOCK_DARK_OAK_DOOR: return ItemDarkOakDoorBlockHandler; - case E_BLOCK_DARK_OAK_FENCE: return ItemDarkOakFenceHandler; - case E_BLOCK_DARK_OAK_FENCE_GATE: return ItemDarkOakFenceGateHandler; - case E_BLOCK_DARK_OAK_WOOD_STAIRS: return ItemDarkOakStairsHandler; - case E_BLOCK_DAYLIGHT_SENSOR: return ItemDaylightSensorBlockHandler; - case E_BLOCK_DEAD_BUSH: return ItemDeadBushHandler; - case E_BLOCK_DETECTOR_RAIL: return ItemDetectorRailHandler; - case E_BLOCK_DIAMOND_BLOCK: return ItemDiamondBlockHandler; - case E_BLOCK_DIAMOND_ORE: return ItemDiamondOreHandler; - case E_BLOCK_DIRT: return ItemDirtHandler; - case E_BLOCK_DISPENSER: return ItemDispenserHandler; - case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return ItemDoubleRedSandstoneSlabHandler; - case E_BLOCK_DOUBLE_STONE_SLAB: return ItemDoubleStoneSlabHandler; - case E_BLOCK_DOUBLE_WOODEN_SLAB: return ItemDoubleOakSlabHandler; - case E_BLOCK_DRAGON_EGG: return ItemDragonEggBlockHandler; - case E_BLOCK_DROPPER: return ItemDropperHandler; - case E_BLOCK_EMERALD_BLOCK: return ItemEmeraldBlockHandler; - case E_BLOCK_EMERALD_ORE: return ItemEmeraldOreHandler; - case E_BLOCK_ENCHANTMENT_TABLE: return ItemEnchantingTableHandler; - case E_BLOCK_ENDER_CHEST: return ItemEnderChestHandler; - case E_BLOCK_END_BRICKS: return ItemEndBricksHandler; - case E_BLOCK_END_GATEWAY: return ItemEndGatewayHandler; - case E_BLOCK_END_PORTAL: return ItemEndPortalBlockHandler; - case E_BLOCK_END_PORTAL_FRAME: return ItemEndPortalFrameHandler; - case E_BLOCK_END_ROD: return ItemEndRodHandler; - case E_BLOCK_END_STONE: return ItemEndStoneBlockHandler; - case E_BLOCK_FARMLAND: return ItemFarmlandHandler; - case E_BLOCK_FENCE: return ItemOakFenceHandler; - case E_BLOCK_FIRE: return ItemFireBlockHandler; - case E_BLOCK_FLOWER: return ItemPoppyHandler; - case E_BLOCK_FLOWER_POT: return ItemFlowerPotBlockHandler; - case E_BLOCK_FROSTED_ICE: return ItemFrostedIceHandler; - case E_BLOCK_FURNACE: return ItemFurnaceHandler; - case E_BLOCK_GLASS: return ItemGlassHandler; - case E_BLOCK_GLASS_PANE: return ItemGlassPaneHandler; - case E_BLOCK_GLOWSTONE: return ItemGlowstoneBlockHandler; - case E_BLOCK_GOLD_BLOCK: return ItemGoldBlockHandler; - case E_BLOCK_GOLD_ORE: return ItemGoldOreHandler; - case E_BLOCK_GRASS: return ItemGrassBlockHandler; - case E_BLOCK_GRASS_PATH: return ItemGrassPathHandler; - case E_BLOCK_GRAVEL: return ItemGravelHandler; - case E_BLOCK_GRAY_GLAZED_TERRACOTTA: return ItemGrayGlazedTerracottaHandler; - case E_BLOCK_GRAY_SHULKER_BOX: return ItemGrayShulkerBoxHandler; - case E_BLOCK_GREEN_GLAZED_TERRACOTTA: return ItemGreenGlazedTerracottaHandler; - case E_BLOCK_GREEN_SHULKER_BOX: return ItemGreenShulkerBoxHandler; - case E_BLOCK_HARDENED_CLAY: return ItemHardenedClayHandler; - case E_BLOCK_HAY_BALE: return ItemHayBaleHandler; - case E_BLOCK_HEAD: return ItemHeadBlockHandler; - case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: return ItemHeavyWeightedPressurePlateHandler; - case E_BLOCK_HOPPER: return ItemHopperHandler; - case E_BLOCK_HUGE_BROWN_MUSHROOM: return ItemHugeBrownMushroomBlockHandler; - case E_BLOCK_HUGE_RED_MUSHROOM: return ItemHugeRedMushroomBlockHandler; - case E_BLOCK_ICE: return ItemIceHandler; - case E_BLOCK_INACTIVE_COMPARATOR: return ItemInactiveComparatorHandler; - case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: return ItemInvertedDaylightSensorHandler; - case E_BLOCK_IRON_BARS: return ItemIronBarsBlockHandler; - case E_BLOCK_IRON_BLOCK: return ItemIronBlockHandler; - case E_BLOCK_IRON_DOOR: return ItemIronDoorBlockHandler; - case E_BLOCK_IRON_ORE: return ItemIronOreHandler; - case E_BLOCK_IRON_TRAPDOOR: return ItemIronTrapdoorHandler; - case E_BLOCK_JACK_O_LANTERN: return ItemJackOLanternHandler; - case E_BLOCK_JUKEBOX: return ItemJukeboxHandler; - case E_BLOCK_JUNGLE_DOOR: return ItemJungleDoorBlockHandler; - case E_BLOCK_JUNGLE_FENCE: return ItemJungleFenceHandler; - case E_BLOCK_JUNGLE_FENCE_GATE: return ItemJungleFenceGateHandler; - case E_BLOCK_JUNGLE_WOOD_STAIRS: return ItemJungleStairsHandler; - case E_BLOCK_LADDER: return ItemLadderHandler; - case E_BLOCK_LAPIS_BLOCK: return ItemLapisBlockHandler; - case E_BLOCK_LAPIS_ORE: return ItemLapisOreHandler; - case E_BLOCK_LAVA: return ItemLavaHandler; - case E_BLOCK_LEAVES: return ItemLeavesHandler; - case E_BLOCK_LEVER: return ItemLeverHandler; - case E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA: return ItemLightBlueGlazedTerracottaHandler; - case E_BLOCK_LIGHT_BLUE_SHULKER_BOX: return ItemLightBlueShulkerBoxHandler; - case E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA: return ItemLightGrayGlazedTerracottaHandler; - case E_BLOCK_LIGHT_GRAY_SHULKER_BOX: return ItemLightGrayShulkerBoxHandler; - case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: return ItemLightWeightedPressurePlateHandler; - case E_BLOCK_LILY_PAD: return ItemLilypadHandler; - case E_BLOCK_LIME_GLAZED_TERRACOTTA: return ItemLimeGlazedTerracottaHandler; - case E_BLOCK_LIME_SHULKER_BOX: return ItemLimeShulkerBoxHandler; - case E_BLOCK_LIT_FURNACE: return ItemLitFurnaceHandler; - case E_BLOCK_LOG: return ItemLogHandler; - case E_BLOCK_MAGENTA_GLAZED_TERRACOTTA: return ItemMagentaGlazedTerracottaHandler; - case E_BLOCK_MAGENTA_SHULKER_BOX: return ItemMagentaShulkerBoxHandler; - case E_BLOCK_MAGMA: return ItemMagmaBlockHandler; - case E_BLOCK_MELON: return ItemMelonBlockHandler; - case E_BLOCK_MELON_STEM: return ItemMelonStemHandler; - case E_BLOCK_MOB_SPAWNER: return ItemMobSpawnerBlockHandler; - case E_BLOCK_MOSSY_COBBLESTONE: return ItemMossyCobblestoneHandler; - case E_BLOCK_MYCELIUM: return ItemMyceliumHandler; - case E_BLOCK_NETHERRACK: return ItemNetherrackHandler; - case E_BLOCK_NETHER_BRICK: return ItemNetherBricksHandler; - case E_BLOCK_NETHER_BRICK_FENCE: return ItemNetherBrickFenceHandler; - case E_BLOCK_NETHER_BRICK_STAIRS: return ItemNetherBrickStairsHandler; - case E_BLOCK_NETHER_PORTAL: return ItemNetherPortalBlockHandler; - case E_BLOCK_NETHER_QUARTZ_ORE: return ItemNetherQuartzOreHandler; - case E_BLOCK_NETHER_WART: return ItemNetherWartTechnicalBlockHandler; - case E_BLOCK_NETHER_WART_BLOCK: return ItemNetherWartBlockHandler; - case E_BLOCK_NEW_LEAVES: return ItemNewLeavesHandler; - case E_BLOCK_NEW_LOG: return ItemNewLogHandler; - case E_BLOCK_NOTE_BLOCK: return ItemNoteBlockHandler; - case E_BLOCK_OAK_DOOR: return ItemOakDoorBlockHandler; - case E_BLOCK_OAK_FENCE_GATE: return ItemOakFenceGateHandler; - case E_BLOCK_OAK_WOOD_STAIRS: return ItemOakStairsHandler; - case E_BLOCK_OBSERVER: return ItemObserverHandler; - case E_BLOCK_OBSIDIAN: return ItemObsidianHandler; - case E_BLOCK_ORANGE_GLAZED_TERRACOTTA: return ItemOrangeGlazedTerracottaHandler; - case E_BLOCK_ORANGE_SHULKER_BOX: return ItemOrangeShulkerBoxHandler; - case E_BLOCK_PACKED_ICE: return ItemPackedIceHandler; - case E_BLOCK_PINK_GLAZED_TERRACOTTA: return ItemPinkGlazedTerracottaHandler; - case E_BLOCK_PINK_SHULKER_BOX: return ItemPinkShulkerBoxHandler; - case E_BLOCK_PISTON: return ItemPistonHandler; - case E_BLOCK_PISTON_EXTENSION: return ItemPistonExtensionHandler; - case E_BLOCK_PISTON_MOVED_BLOCK: return ItemPistonMovedBlockHandler; - case E_BLOCK_PLANKS: return ItemPlanksHandler; - case E_BLOCK_POTATOES: return ItemPotatoesBlockHandler; - case E_BLOCK_POWERED_RAIL: return ItemPoweredRailHandler; - case E_BLOCK_PRISMARINE_BLOCK: return ItemPrismarineBlockHandler; - case E_BLOCK_PUMPKIN: return ItemPumpkinHandler; - case E_BLOCK_PUMPKIN_STEM: return ItemPumpkinStemHandler; - case E_BLOCK_PURPLE_GLAZED_TERRACOTTA: return ItemPurpleGlazedTerracottaHandler; - case E_BLOCK_PURPLE_SHULKER_BOX: return ItemPurpleShulkerBoxHandler; - case E_BLOCK_PURPUR_BLOCK: return ItemPurpurBlockHandler; - case E_BLOCK_PURPUR_DOUBLE_SLAB: return ItemPurpurDoubleSlabHandler; - case E_BLOCK_PURPUR_PILLAR: return ItemPurpurPillarHandler; - case E_BLOCK_PURPUR_SLAB: return ItemPurpurSlabHandler; - case E_BLOCK_PURPUR_STAIRS: return ItemPurpurStairsHandler; - case E_BLOCK_QUARTZ_BLOCK: return ItemQuartzBlockHandler; - case E_BLOCK_QUARTZ_STAIRS: return ItemQuartzStairsHandler; - case E_BLOCK_RAIL: return ItemRailHandler; - case E_BLOCK_REDSTONE_LAMP_OFF: return ItemRedstoneLampOffHandler; - case E_BLOCK_REDSTONE_LAMP_ON: return ItemRedstoneLampOnHandler; - case E_BLOCK_REDSTONE_ORE: return ItemRedstoneOreHandler; - case E_BLOCK_REDSTONE_ORE_GLOWING: return ItemRedstoneOreGlowingHandler; - case E_BLOCK_REDSTONE_REPEATER_OFF: return ItemRedstoneRepeaterOffHandler; - case E_BLOCK_REDSTONE_REPEATER_ON: return ItemRedstoneRepeaterOnHandler; - case E_BLOCK_REDSTONE_TORCH_OFF: return ItemRedstoneTorchOffBlockHandler; - case E_BLOCK_REDSTONE_TORCH_ON: return ItemRedstoneTorchHandler; - case E_BLOCK_REDSTONE_WIRE: return ItemRedstoneWireHandler; - case E_BLOCK_RED_GLAZED_TERRACOTTA: return ItemRedGlazedTerracottaHandler; - case E_BLOCK_RED_MUSHROOM: return ItemRedMushroomBlockHandler; - case E_BLOCK_RED_NETHER_BRICK: return ItemRedNetherBricksHandler; - case E_BLOCK_RED_SANDSTONE: return ItemRedSandstoneHandler; - case E_BLOCK_RED_SANDSTONE_SLAB: return ItemRedSandstoneSlabHandler; - case E_BLOCK_RED_SANDSTONE_STAIRS: return ItemRedSandstoneStairsHandler; - case E_BLOCK_RED_SHULKER_BOX: return ItemRedShulkerBoxHandler; - case E_BLOCK_REPEATING_COMMAND_BLOCK: return ItemRepeatingCommandBlockHandler; - case E_BLOCK_SAND: return ItemSandHandler; - case E_BLOCK_SANDSTONE: return ItemSandstoneHandler; - case E_BLOCK_SANDSTONE_STAIRS: return ItemSandstoneStairsHandler; - case E_BLOCK_SAPLING: return ItemSaplingHandler; - case E_BLOCK_SEA_LANTERN: return ItemSeaLanternHandler; - case E_BLOCK_SIGN_POST: return ItemSignPostHandler; - case E_BLOCK_SILVERFISH_EGG: return ItemSilverfishEggBlockHandler; - case E_BLOCK_SLIME_BLOCK: return ItemSlimeBlockHandler; - case E_BLOCK_SNOW: return ItemSnowHandler; - case E_BLOCK_SNOW_BLOCK: return ItemSnowBlockHandler; - case E_BLOCK_SOULSAND: return ItemSoulsandHandler; - case E_BLOCK_SPONGE: return ItemSpongeHandler; - case E_BLOCK_SPRUCE_DOOR: return ItemSpruceDoorBlockHandler; - case E_BLOCK_SPRUCE_FENCE: return ItemSpruceFenceHandler; - case E_BLOCK_SPRUCE_FENCE_GATE: return ItemSpruceFenceGateHandler; - case E_BLOCK_SPRUCE_WOOD_STAIRS: return ItemSpruceStairsHandler; - case E_BLOCK_STAINED_GLASS: return ItemStainedGlassHandler; - case E_BLOCK_STAINED_GLASS_PANE: return ItemStainedGlassPaneHandler; - case E_BLOCK_STANDING_BANNER: return ItemStandingBannerHandler; - case E_BLOCK_STATIONARY_LAVA : return ItemStationaryLavaHandler; - case E_BLOCK_STATIONARY_WATER: return ItemStationaryWaterHandler; - case E_BLOCK_STICKY_PISTON: return ItemStickyPistonHandler; - case E_BLOCK_STONE: return ItemStoneHandler; - case E_BLOCK_STONE_BRICKS: return ItemStoneBricksHandler; - case E_BLOCK_STONE_BRICK_STAIRS: return ItemStoneBrickStairsHandler; - case E_BLOCK_STONE_BUTTON: return ItemStoneButtonHandler; - case E_BLOCK_STONE_PRESSURE_PLATE: return ItemStonePressurePlateHandler; - case E_BLOCK_STONE_SLAB: return ItemStoneSlabHandler; - case E_BLOCK_STRUCTURE_BLOCK: return ItemStructureBlockHandler; - case E_BLOCK_STRUCTURE_VOID: return ItemStructureVoidHandler; - case E_BLOCK_SUGARCANE: return ItemSugarCaneBlockHandler; - case E_BLOCK_TALL_GRASS: return ItemTallGrassHandler; - case E_BLOCK_TERRACOTTA: return ItemTerracottaHandler; - case E_BLOCK_TNT: return ItemTNTHandler; - case E_BLOCK_TORCH: return ItemTorchHandler; - case E_BLOCK_TRAPDOOR: return ItemOakTrapdoorHandler; - case E_BLOCK_TRAPPED_CHEST: return ItemTrappedChestHandler; - case E_BLOCK_TRIPWIRE: return ItemTripwireHandler; - case E_BLOCK_TRIPWIRE_HOOK: return ItemTripwireHookHandler; - case E_BLOCK_VINES: return ItemVinesHandler; - case E_BLOCK_WALLSIGN: return ItemWallsignHandler; - case E_BLOCK_WALL_BANNER: return ItemWallBannerHandler; - case E_BLOCK_WATER: return ItemWaterHandler; - case E_BLOCK_WHEAT: return ItemWheatBlockHandler; - case E_BLOCK_WHITE_GLAZED_TERRACOTTA: return ItemWhiteGlazedTerracottaHandler; - case E_BLOCK_WHITE_SHULKER_BOX: return ItemWhiteShulkerBoxHandler; - case E_BLOCK_WOODEN_BUTTON: return ItemOakButtonHandler; - case E_BLOCK_WOODEN_PRESSURE_PLATE: return ItemWoodenPressurePlateHandler; - case E_BLOCK_WOODEN_SLAB: return ItemOakSlabHandler; - case E_BLOCK_WOOL: return ItemWoolHandler; - case E_BLOCK_YELLOW_GLAZED_TERRACOTTA: return ItemYellowGlazedTerracottaHandler; - case E_BLOCK_YELLOW_SHULKER_BOX: return ItemYellowShulkerBoxHandler; - case E_ITEM_11_DISC: return Item11DiscHandler; - case E_ITEM_13_DISC: return Item13DiscHandler; - case E_ITEM_ACACIA_BOAT: return ItemAcaciaBoatHandler; - case E_ITEM_ACACIA_DOOR: return ItemAcaciaDoorHandler; - case E_ITEM_ARMOR_STAND: return ItemArmorStandHandler; - case E_ITEM_ARROW: return ItemArrowHandler; - case E_ITEM_BAKED_POTATO: return ItemBakedPotatoHandler; - case E_ITEM_BANNER: return ItemBannerHandler; - case E_ITEM_BED: return ItemBedHandler; - case E_ITEM_BEETROOT: return ItemBeetrootHandler; - case E_ITEM_BEETROOT_SEEDS: return ItemBeetrootSeedsHandler; - case E_ITEM_BEETROOT_SOUP: return ItemBeetrootSoupHandler; - case E_ITEM_BIRCH_BOAT: return ItemBirchBoatHandler; - case E_ITEM_BIRCH_DOOR: return ItemBirchDoorHandler; - case E_ITEM_BLAZE_POWDER: return ItemBlazePowderHandler; - case E_ITEM_BLAZE_ROD: return ItemBlazeRodHandler; - case E_ITEM_BLOCKS_DISC: return ItemBlocksDiscHandler; - case E_ITEM_BOAT: return ItemOakBoatHandler; - case E_ITEM_BONE: return ItemBoneHandler; - case E_ITEM_BOOK: return ItemBookHandler; - case E_ITEM_BOOK_AND_QUILL: return ItemBookAndQuillHandler; - case E_ITEM_BOTTLE_O_ENCHANTING: return ItemBottleOEnchantingHandler; - case E_ITEM_BOW: return ItemBowHandler; - case E_ITEM_BOWL: return ItemBowlHandler; - case E_ITEM_BREAD: return ItemBreadHandler; - case E_ITEM_BREWING_STAND: return ItemBrewingStandHandler; - case E_ITEM_BUCKET: return ItemBucketHandler; - case E_ITEM_CAKE: return ItemCakeHandler; - case E_ITEM_CARROT: return ItemCarrotHandler; - case E_ITEM_CARROT_ON_STICK: return ItemCarrotOnStickHandler; - case E_ITEM_CAT_DISC: return ItemCatDiscHandler; - case E_ITEM_CAULDRON: return ItemCauldronHandler; - case E_ITEM_CHAIN_BOOTS: return ItemChainBootsHandler; - case E_ITEM_CHAIN_CHESTPLATE: return ItemChainChestplateHandler; - case E_ITEM_CHAIN_HELMET: return ItemChainHelmetHandler; - case E_ITEM_CHAIN_LEGGINGS: return ItemChainLeggingsHandler; - case E_ITEM_CHEST_MINECART: return ItemChestMinecartHandler; - case E_ITEM_CHIRP_DISC: return ItemChirpDiscHandler; - case E_ITEM_CHORUS_FRUIT: return ItemChorusFruitHandler; - case E_ITEM_CLAY: return ItemClayHandler; - case E_ITEM_CLAY_BRICK: return ItemBricksHandler; - case E_ITEM_CLOCK: return ItemClockHandler; - case E_ITEM_COAL: return ItemCoalHandler; - case E_ITEM_COMPARATOR: return ItemComparatorHandler; - case E_ITEM_COMPASS: return ItemCompassHandler; - case E_ITEM_COOKED_CHICKEN: return ItemCookedChickenHandler; - case E_ITEM_COOKED_FISH: return ItemCookedFishHandler; - case E_ITEM_COOKED_MUTTON: return ItemCookedMuttonHandler; - case E_ITEM_COOKED_PORKCHOP: return ItemCookedPorkchopHandler; - case E_ITEM_COOKED_RABBIT: return ItemCookedRabbitHandler; - case E_ITEM_COOKIE: return ItemCookieHandler; - case E_ITEM_DARK_OAK_BOAT: return ItemDarkOakBoatHandler; - case E_ITEM_DARK_OAK_DOOR: return ItemDarkOakDoorHandler; - case E_ITEM_DIAMOND: return ItemDiamondHandler; - case E_ITEM_DIAMOND_AXE: return ItemDiamondAxeHandler; - case E_ITEM_DIAMOND_BOOTS: return ItemDiamondBootsHandler; - case E_ITEM_DIAMOND_CHESTPLATE: return ItemDiamondChestplateHandler; - case E_ITEM_DIAMOND_HELMET: return ItemDiamondHelmetHandler; - case E_ITEM_DIAMOND_HOE: return ItemDiamondHoeHandler; - case E_ITEM_DIAMOND_HORSE_ARMOR: return ItemDiamondHorseArmorHandler; - case E_ITEM_DIAMOND_LEGGINGS: return ItemDiamondLeggingsHandler; - case E_ITEM_DIAMOND_PICKAXE: return ItemDiamondPickaxeHandler; - case E_ITEM_DIAMOND_SHOVEL: return ItemDiamondShovelHandler; - case E_ITEM_DIAMOND_SWORD: return ItemDiamondSwordHandler; - case E_ITEM_DRAGON_BREATH: return ItemDragonBreathHandler; - case E_ITEM_DYE: return ItemDyeHandler; - case E_ITEM_EGG: return ItemEggHandler; - case E_ITEM_ELYTRA: return ItemElytraHandler; - case E_ITEM_EMERALD: return ItemEmeraldHandler; - case E_ITEM_EMPTY_MAP: return ItemEmptyMapHandler; - case E_ITEM_ENCHANTED_BOOK: return ItemEnchantedBookHandler; - case E_ITEM_ENDER_PEARL: return ItemEnderPearlHandler; - case E_ITEM_END_CRYSTAL: return ItemEndCrystalHandler; - case E_ITEM_EYE_OF_ENDER: return ItemEyeOfEnderHandler; - case E_ITEM_FAR_DISC: return ItemFarDiscHandler; - case E_ITEM_FEATHER: return ItemFeatherHandler; - case E_ITEM_FERMENTED_SPIDER_EYE: return ItemFermentedSpiderEyeHandler; - case E_ITEM_FIREWORK_ROCKET: return ItemFireworkRocketHandler; - case E_ITEM_FIREWORK_STAR: return ItemFireworkStarHandler; - case E_ITEM_FIRE_CHARGE: return ItemFireChargeHandler; - case E_ITEM_FISHING_ROD: return ItemFishingRodHandler; - case E_ITEM_FLINT: return ItemFlintHandler; - case E_ITEM_FLINT_AND_STEEL: return ItemFlintAndSteelHandler; - case E_ITEM_FLOWER_POT: return ItemFlowerPotHandler; - case E_ITEM_FURNACE_MINECART: return ItemFurnaceMinecartHandler; - case E_ITEM_GHAST_TEAR: return ItemGhastTearHandler; - case E_ITEM_GLASS_BOTTLE: return ItemGlassBottleHandler; - case E_ITEM_GLISTERING_MELON: return ItemGlisteringMelonHandler; - case E_ITEM_GLOWSTONE_DUST: return ItemGlowstoneDustHandler; - case E_ITEM_GOLD: return ItemGoldHandler; - case E_ITEM_GOLDEN_APPLE: return ItemGoldenAppleHandler; - case E_ITEM_GOLDEN_CARROT: return ItemGoldenCarrotHandler; - case E_ITEM_GOLD_AXE: return ItemGoldenAxeHandler; - case E_ITEM_GOLD_BOOTS: return ItemGoldenBootsHandler; - case E_ITEM_GOLD_CHESTPLATE: return ItemGoldenChestplateHandler; - case E_ITEM_GOLD_HELMET: return ItemGoldenHelmetHandler; - case E_ITEM_GOLD_HOE: return ItemGoldenHoeHandler; - case E_ITEM_GOLD_HORSE_ARMOR: return ItemGoldenHorseArmorHandler; - case E_ITEM_GOLD_LEGGINGS: return ItemGoldenLeggingsHandler; - case E_ITEM_GOLD_NUGGET: return ItemGoldNuggetHandler; - case E_ITEM_GOLD_PICKAXE: return ItemGoldenPickaxeHandler; - case E_ITEM_GOLD_SHOVEL: return ItemGoldenShovelHandler; - case E_ITEM_GOLD_SWORD: return ItemGoldenSwordHandler; - case E_ITEM_GUNPOWDER: return ItemGunpowderHandler; - case E_ITEM_HEAD: return ItemHeadHandler; - case E_ITEM_IRON: return ItemIronHandler; - case E_ITEM_IRON_AXE: return ItemIronAxeHandler; - case E_ITEM_IRON_BOOTS: return ItemIronBootsHandler; - case E_ITEM_IRON_CHESTPLATE: return ItemIronChestplateHandler; - case E_ITEM_IRON_DOOR: return ItemIronDoorHandler; - case E_ITEM_IRON_HELMET: return ItemIronHelmetHandler; - case E_ITEM_IRON_HOE: return ItemIronHoeHandler; - case E_ITEM_IRON_HORSE_ARMOR: return ItemIronHorseArmorHandler; - case E_ITEM_IRON_LEGGINGS: return ItemIronLeggingsHandler; - case E_ITEM_IRON_NUGGET: return ItemIronNuggetHandler; - case E_ITEM_IRON_PICKAXE: return ItemIronPickaxeHandler; - case E_ITEM_IRON_SHOVEL: return ItemIronShovelHandler; - case E_ITEM_IRON_SWORD: return ItemIronSwordHandler; - case E_ITEM_ITEM_FRAME: return ItemItemFrameHandler; - case E_ITEM_JUNGLE_BOAT: return ItemJungleBoatHandler; - case E_ITEM_JUNGLE_DOOR: return ItemJungleDoorHandler; - case E_ITEM_LAVA_BUCKET: return ItemLavaBucketHandler; - case E_ITEM_LEASH: return ItemLeashHandler; - case E_ITEM_LEATHER: return ItemLeatherHandler; - case E_ITEM_LEATHER_BOOTS: return ItemLeatherBootsHandler; - case E_ITEM_LEATHER_CAP: return ItemLeatherCapHandler; - case E_ITEM_LEATHER_PANTS: return ItemLeatherPantsHandler; - case E_ITEM_LEATHER_TUNIC: return ItemLeatherTunicHandler; - case E_ITEM_LINGERING_POTION: return ItemLingeringPotionHandler; - case E_ITEM_MAGMA_CREAM: return ItemMagmaCreamHandler; - case E_ITEM_MALL_DISC: return ItemMallDiscHandler; - case E_ITEM_MAP: return ItemMapHandler; - case E_ITEM_MELLOHI_DISC: return ItemMellohiDiscHandler; - case E_ITEM_MELON_SEEDS: return ItemMelonSeedsHandler; - case E_ITEM_MELON_SLICE: return ItemMelonSliceHandler; - case E_ITEM_MILK: return ItemMilkHandler; - case E_ITEM_MINECART: return ItemMinecartHandler; - case E_ITEM_MINECART_WITH_COMMAND_BLOCK: return ItemMinecartWithCommandBlockHandler; - case E_ITEM_MINECART_WITH_HOPPER: return ItemMinecartWithHopperHandler; - case E_ITEM_MINECART_WITH_TNT: return ItemMinecartWithTNTHandler; - case E_ITEM_MUSHROOM_SOUP: return ItemMushroomSoupHandler; - case E_ITEM_NAME_TAG: return ItemNameTagHandler; - case E_ITEM_NETHER_BRICK: return ItemNetherBrickHandler; - case E_ITEM_NETHER_QUARTZ: return ItemNetherQuartzHandler; - case E_ITEM_NETHER_STAR: return ItemNetherStarHandler; - case E_ITEM_NETHER_WART: return ItemNetherWartHandler; - case E_ITEM_PAINTING: return ItemPaintingHandler; - case E_ITEM_PAPER: return ItemPaperHandler; - case E_ITEM_POISONOUS_POTATO: return ItemPoisonousPotatoHandler; - case E_ITEM_POPPED_CHORUS_FRUIT: return ItemPoppedChorusFruitHandler; - case E_ITEM_POTATO: return ItemPotatoHandler; - case E_ITEM_POTION: return ItemPotionHandler; - case E_ITEM_PRISMARINE_CRYSTALS: return ItemPrismarineCrystalsHandler; - case E_ITEM_PRISMARINE_SHARD: return ItemPrismarineShardHandler; - case E_ITEM_PUMPKIN_PIE: return ItemPumpkinPieHandler; - case E_ITEM_PUMPKIN_SEEDS: return ItemPumpkinSeedsHandler; - case E_ITEM_RABBITS_FOOT: return ItemRabbitsFootHandler; - case E_ITEM_RABBIT_HIDE: return ItemRabbitHideHandler; - case E_ITEM_RABBIT_STEW: return ItemRabbitStewHandler; - case E_ITEM_RAW_BEEF: return ItemRawBeefHandler; - case E_ITEM_RAW_CHICKEN: return ItemRawChickenHandler; - case E_ITEM_RAW_FISH: return ItemRawFishHandler; - case E_ITEM_RAW_MUTTON: return ItemRawMuttonHandler; - case E_ITEM_RAW_PORKCHOP: return ItemRawPorkchopHandler; - case E_ITEM_RAW_RABBIT: return ItemRawRabbitHandler; - case E_ITEM_REDSTONE_DUST: return ItemRedstoneDustHandler; - case E_ITEM_REDSTONE_REPEATER: return ItemRedstoneRepeaterHandler; - case E_ITEM_RED_APPLE: return ItemAppleHandler; - case E_ITEM_ROTTEN_FLESH: return ItemRottenFleshHandler; - case E_ITEM_SADDLE: return ItemSaddleHandler; - case E_ITEM_SEEDS: return ItemSeedsHandler; - case E_ITEM_SHEARS: return ItemShearsHandler; - case E_ITEM_SHIELD: return ItemShieldHandler; - case E_ITEM_SHULKER_SHELL: return ItemShulkerShellHandler; - case E_ITEM_SIGN: return ItemSignHandler; - case E_ITEM_SLIMEBALL: return ItemSlimeballHandler; - case E_ITEM_SNOWBALL: return ItemSnowballHandler; - case E_ITEM_SPAWN_EGG: return ItemSpawnEggHandler; - case E_ITEM_SPECTRAL_ARROW: return ItemSpectralArrowHandler; - case E_ITEM_SPIDER_EYE: return ItemSpiderEyeHandler; - case E_ITEM_SPLASH_POTION: return ItemSplashPotionHandler; - case E_ITEM_SPRUCE_BOAT: return ItemSpruceBoatHandler; - case E_ITEM_SPRUCE_DOOR: return ItemSpruceDoorHandler; - case E_ITEM_STAL_DISC: return ItemStalDiscHandler; - case E_ITEM_STEAK: return ItemCookedBeefHandler; - case E_ITEM_STICK: return ItemStickHandler; - case E_ITEM_STONE_AXE: return ItemStoneAxeHandler; - case E_ITEM_STONE_HOE: return ItemStoneHoeHandler; - case E_ITEM_STONE_PICKAXE: return ItemStonePickaxeHandler; - case E_ITEM_STONE_SHOVEL: return ItemStoneShovelHandler; - case E_ITEM_STONE_SWORD: return ItemStoneSwordHandler; - case E_ITEM_STRAD_DISC: return ItemStradDiscHandler; - case E_ITEM_STRING: return ItemStringHandler; - case E_ITEM_SUGAR: return ItemSugarHandler; - case E_ITEM_SUGAR_CANE: return ItemSugarCaneHandler; - case E_ITEM_TIPPED_ARROW: return ItemTippedArrowHandler; - case E_ITEM_TOTEM_OF_UNDYING: return ItemTotemOfUndyingHandler; - case E_ITEM_WAIT_DISC: return ItemWaitDiscHandler; - case E_ITEM_WARD_DISC: return ItemWardDiscHandler; - case E_ITEM_WATER_BUCKET: return ItemWaterBucketHandler; - case E_ITEM_WHEAT: return ItemWheatHandler; - case E_ITEM_WOODEN_AXE: return ItemWoodenAxeHandler; - case E_ITEM_WOODEN_DOOR: return ItemOakDoorHandler; - case E_ITEM_WOODEN_HOE: return ItemWoodenHoeHandler; - case E_ITEM_WOODEN_PICKAXE: return ItemWoodenPickaxeHandler; - case E_ITEM_WOODEN_SHOVEL: return ItemWoodenShovelHandler; - case E_ITEM_WOODEN_SWORD: return ItemWoodenSwordHandler; - case E_ITEM_WRITTEN_BOOK: return ItemWrittenBookHandler; - + case E_BLOCK_ACACIA_DOOR: return ItemAcaciaDoorBlockHandler; + case E_BLOCK_ACACIA_FENCE: return ItemAcaciaFenceHandler; + case E_BLOCK_ACACIA_FENCE_GATE: return ItemAcaciaFenceGateHandler; + case E_BLOCK_ACACIA_WOOD_STAIRS: return ItemAcaciaStairsHandler; + case E_BLOCK_ACTIVATOR_RAIL: return ItemActivatorRailHandler; + case E_BLOCK_ACTIVE_COMPARATOR: return ItemActiveComparatorHandler; + case E_BLOCK_AIR: return ItemAirHandler; + case E_BLOCK_ANVIL: return ItemAnvilHandler; + case E_BLOCK_BARRIER: return ItemBarrierHandler; + case E_BLOCK_BEACON: return ItemBeaconHandler; + case E_BLOCK_BED: return ItemBedBlockHandler; + case E_BLOCK_BEDROCK: return ItemBedrockHandler; + case E_BLOCK_BEETROOTS: return ItemBeetrootsBlockHandler; + case E_BLOCK_BIG_FLOWER: return ItemBigFlowerHandler; + case E_BLOCK_BIRCH_DOOR: return ItemBirchDoorBlockHandler; + case E_BLOCK_BIRCH_FENCE: return ItemBirchFenceHandler; + case E_BLOCK_BIRCH_FENCE_GATE: return ItemBirchFenceGateHandler; + case E_BLOCK_BIRCH_WOOD_STAIRS: return ItemBirchStairsHandler; + case E_BLOCK_BLACK_GLAZED_TERRACOTTA: return ItemBlackGlazedTerracottaHandler; + case E_BLOCK_BLACK_SHULKER_BOX: return ItemBlackShulkerBoxHandler; + case E_BLOCK_BLOCK_OF_COAL: return ItemCoalBlockHandler; + case E_BLOCK_BLOCK_OF_REDSTONE: return ItemRedstoneBlockHandler; + case E_BLOCK_BLUE_GLAZED_TERRACOTTA: return ItemBlueGlazedTerracottaHandler; + case E_BLOCK_BLUE_SHULKER_BOX: return ItemBlueShulkerBoxHandler; + case E_BLOCK_BONE_BLOCK: return ItemBoneBlockHandler; + case E_BLOCK_BOOKCASE: return ItemBookshelfHandler; + case E_BLOCK_BREWING_STAND: return ItemBrewingStandBlockHandler; + case E_BLOCK_BRICK: return ItemBrickHandler; + case E_BLOCK_BRICK_STAIRS: return ItemBricksStairsHandler; + case E_BLOCK_BROWN_GLAZED_TERRACOTTA: return ItemBrownGlazedTerracottaHandler; + case E_BLOCK_BROWN_MUSHROOM: return ItemBrownMushroomBlockHandler; + case E_BLOCK_BROWN_SHULKER_BOX: return ItemBrownShulkerBoxHandler; + case E_BLOCK_CACTUS: return ItemCactusHandler; + case E_BLOCK_CAKE: return ItemCakeBlockHandler; + case E_BLOCK_CARPET: return ItemCarpetHandler; + case E_BLOCK_CARROTS: return ItemCarrotsBlockHandler; + case E_BLOCK_CAULDRON: return ItemCauldronBlockHandler; + case E_BLOCK_CHAIN_COMMAND_BLOCK: return ItemChainCommandBlockHandler; + case E_BLOCK_CHEST: return ItemChestHandler; + case E_BLOCK_CHORUS_FLOWER: return ItemChorusFlowerHandler; + case E_BLOCK_CHORUS_PLANT: return ItemChorusPlantHandler; + case E_BLOCK_CLAY: return ItemClayBlockHandler; + case E_BLOCK_COAL_ORE: return ItemCoalOreHandler; + case E_BLOCK_COBBLESTONE: return ItemCobblestoneHandler; + case E_BLOCK_COBBLESTONE_STAIRS: return ItemCobblestoneStairsHandler; + case E_BLOCK_COBBLESTONE_WALL: return ItemCobblestoneWallHandler; + case E_BLOCK_COBWEB: return ItemCobwebHandler; + case E_BLOCK_COCOA_POD: return ItemCocoaPodHandler; + case E_BLOCK_COMMAND_BLOCK: return ItemCommandBlockHandler; + case E_BLOCK_CONCRETE: return ItemConcreteBlockHandler; + case E_BLOCK_CONCRETE_POWDER: return ItemConcretePowderHandler; + case E_BLOCK_CRAFTING_TABLE: return ItemWorkbenchHandler; + case E_BLOCK_CYAN_GLAZED_TERRACOTTA: return ItemCyanGlazedTerracottaHandler; + case E_BLOCK_CYAN_SHULKER_BOX: return ItemCyanShulkerBoxHandler; + case E_BLOCK_DANDELION: return ItemDandelionHandler; + case E_BLOCK_DARK_OAK_DOOR: return ItemDarkOakDoorBlockHandler; + case E_BLOCK_DARK_OAK_FENCE: return ItemDarkOakFenceHandler; + case E_BLOCK_DARK_OAK_FENCE_GATE: return ItemDarkOakFenceGateHandler; + case E_BLOCK_DARK_OAK_WOOD_STAIRS: return ItemDarkOakStairsHandler; + case E_BLOCK_DAYLIGHT_SENSOR: return ItemDaylightSensorBlockHandler; + case E_BLOCK_DEAD_BUSH: return ItemDeadBushHandler; + case E_BLOCK_DETECTOR_RAIL: return ItemDetectorRailHandler; + case E_BLOCK_DIAMOND_BLOCK: return ItemDiamondBlockHandler; + case E_BLOCK_DIAMOND_ORE: return ItemDiamondOreHandler; + case E_BLOCK_DIRT: return ItemDirtHandler; + case E_BLOCK_DISPENSER: return ItemDispenserHandler; + case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return ItemDoubleRedSandstoneSlabHandler; + case E_BLOCK_DOUBLE_STONE_SLAB: return ItemDoubleStoneSlabHandler; + case E_BLOCK_DOUBLE_WOODEN_SLAB: return ItemDoubleOakSlabHandler; + case E_BLOCK_DRAGON_EGG: return ItemDragonEggBlockHandler; + case E_BLOCK_DROPPER: return ItemDropperHandler; + case E_BLOCK_EMERALD_BLOCK: return ItemEmeraldBlockHandler; + case E_BLOCK_EMERALD_ORE: return ItemEmeraldOreHandler; + case E_BLOCK_ENCHANTMENT_TABLE: return ItemEnchantingTableHandler; + case E_BLOCK_ENDER_CHEST: return ItemEnderChestHandler; + case E_BLOCK_END_BRICKS: return ItemEndBricksHandler; + case E_BLOCK_END_GATEWAY: return ItemEndGatewayHandler; + case E_BLOCK_END_PORTAL: return ItemEndPortalBlockHandler; + case E_BLOCK_END_PORTAL_FRAME: return ItemEndPortalFrameHandler; + case E_BLOCK_END_ROD: return ItemEndRodHandler; + case E_BLOCK_END_STONE: return ItemEndStoneBlockHandler; + case E_BLOCK_FARMLAND: return ItemFarmlandHandler; + case E_BLOCK_FENCE: return ItemOakFenceHandler; + case E_BLOCK_FIRE: return ItemFireBlockHandler; + case E_BLOCK_FLOWER: return ItemPoppyHandler; + case E_BLOCK_FLOWER_POT: return ItemFlowerPotBlockHandler; + case E_BLOCK_FROSTED_ICE: return ItemFrostedIceHandler; + case E_BLOCK_FURNACE: return ItemFurnaceHandler; + case E_BLOCK_GLASS: return ItemGlassHandler; + case E_BLOCK_GLASS_PANE: return ItemGlassPaneHandler; + case E_BLOCK_GLOWSTONE: return ItemGlowstoneBlockHandler; + case E_BLOCK_GOLD_BLOCK: return ItemGoldBlockHandler; + case E_BLOCK_GOLD_ORE: return ItemGoldOreHandler; + case E_BLOCK_GRASS: return ItemGrassBlockHandler; + case E_BLOCK_GRASS_PATH: return ItemGrassPathHandler; + case E_BLOCK_GRAVEL: return ItemGravelHandler; + case E_BLOCK_GRAY_GLAZED_TERRACOTTA: return ItemGrayGlazedTerracottaHandler; + case E_BLOCK_GRAY_SHULKER_BOX: return ItemGrayShulkerBoxHandler; + case E_BLOCK_GREEN_GLAZED_TERRACOTTA: return ItemGreenGlazedTerracottaHandler; + case E_BLOCK_GREEN_SHULKER_BOX: return ItemGreenShulkerBoxHandler; + case E_BLOCK_HARDENED_CLAY: return ItemHardenedClayHandler; + case E_BLOCK_HAY_BALE: return ItemHayBaleHandler; + case E_BLOCK_HEAD: return ItemHeadBlockHandler; + case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: return ItemHeavyWeightedPressurePlateHandler; + case E_BLOCK_HOPPER: return ItemHopperHandler; + case E_BLOCK_HUGE_BROWN_MUSHROOM: return ItemHugeBrownMushroomBlockHandler; + case E_BLOCK_HUGE_RED_MUSHROOM: return ItemHugeRedMushroomBlockHandler; + case E_BLOCK_ICE: return ItemIceHandler; + case E_BLOCK_INACTIVE_COMPARATOR: return ItemInactiveComparatorHandler; + case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: return ItemInvertedDaylightSensorHandler; + case E_BLOCK_IRON_BARS: return ItemIronBarsBlockHandler; + case E_BLOCK_IRON_BLOCK: return ItemIronBlockHandler; + case E_BLOCK_IRON_DOOR: return ItemIronDoorBlockHandler; + case E_BLOCK_IRON_ORE: return ItemIronOreHandler; + case E_BLOCK_IRON_TRAPDOOR: return ItemIronTrapdoorHandler; + case E_BLOCK_JACK_O_LANTERN: return ItemJackOLanternHandler; + case E_BLOCK_JUKEBOX: return ItemJukeboxHandler; + case E_BLOCK_JUNGLE_DOOR: return ItemJungleDoorBlockHandler; + case E_BLOCK_JUNGLE_FENCE: return ItemJungleFenceHandler; + case E_BLOCK_JUNGLE_FENCE_GATE: return ItemJungleFenceGateHandler; + case E_BLOCK_JUNGLE_WOOD_STAIRS: return ItemJungleStairsHandler; + case E_BLOCK_LADDER: return ItemLadderHandler; + case E_BLOCK_LAPIS_BLOCK: return ItemLapisBlockHandler; + case E_BLOCK_LAPIS_ORE: return ItemLapisOreHandler; + case E_BLOCK_LAVA: return ItemLavaHandler; + case E_BLOCK_LEAVES: return ItemLeavesHandler; + case E_BLOCK_LEVER: return ItemLeverHandler; + case E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA: return ItemLightBlueGlazedTerracottaHandler; + case E_BLOCK_LIGHT_BLUE_SHULKER_BOX: return ItemLightBlueShulkerBoxHandler; + case E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA: return ItemLightGrayGlazedTerracottaHandler; + case E_BLOCK_LIGHT_GRAY_SHULKER_BOX: return ItemLightGrayShulkerBoxHandler; + case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: return ItemLightWeightedPressurePlateHandler; + case E_BLOCK_LILY_PAD: return ItemLilypadHandler; + case E_BLOCK_LIME_GLAZED_TERRACOTTA: return ItemLimeGlazedTerracottaHandler; + case E_BLOCK_LIME_SHULKER_BOX: return ItemLimeShulkerBoxHandler; + case E_BLOCK_LIT_FURNACE: return ItemLitFurnaceHandler; + case E_BLOCK_LOG: return ItemLogHandler; + case E_BLOCK_MAGENTA_GLAZED_TERRACOTTA: return ItemMagentaGlazedTerracottaHandler; + case E_BLOCK_MAGENTA_SHULKER_BOX: return ItemMagentaShulkerBoxHandler; + case E_BLOCK_MAGMA: return ItemMagmaBlockHandler; + case E_BLOCK_MELON: return ItemMelonBlockHandler; + case E_BLOCK_MELON_STEM: return ItemMelonStemHandler; + case E_BLOCK_MOB_SPAWNER: return ItemMobSpawnerBlockHandler; + case E_BLOCK_MOSSY_COBBLESTONE: return ItemMossyCobblestoneHandler; + case E_BLOCK_MYCELIUM: return ItemMyceliumHandler; + case E_BLOCK_NETHERRACK: return ItemNetherrackHandler; + case E_BLOCK_NETHER_BRICK: return ItemNetherBricksHandler; + case E_BLOCK_NETHER_BRICK_FENCE: return ItemNetherBrickFenceHandler; + case E_BLOCK_NETHER_BRICK_STAIRS: return ItemNetherBrickStairsHandler; + case E_BLOCK_NETHER_PORTAL: return ItemNetherPortalBlockHandler; + case E_BLOCK_NETHER_QUARTZ_ORE: return ItemNetherQuartzOreHandler; + case E_BLOCK_NETHER_WART: return ItemNetherWartTechnicalBlockHandler; + case E_BLOCK_NETHER_WART_BLOCK: return ItemNetherWartBlockHandler; + case E_BLOCK_NEW_LEAVES: return ItemNewLeavesHandler; + case E_BLOCK_NEW_LOG: return ItemNewLogHandler; + case E_BLOCK_NOTE_BLOCK: return ItemNoteBlockHandler; + case E_BLOCK_OAK_DOOR: return ItemOakDoorBlockHandler; + case E_BLOCK_OAK_FENCE_GATE: return ItemOakFenceGateHandler; + case E_BLOCK_OAK_WOOD_STAIRS: return ItemOakStairsHandler; + case E_BLOCK_OBSERVER: return ItemObserverHandler; + case E_BLOCK_OBSIDIAN: return ItemObsidianHandler; + case E_BLOCK_ORANGE_GLAZED_TERRACOTTA: return ItemOrangeGlazedTerracottaHandler; + case E_BLOCK_ORANGE_SHULKER_BOX: return ItemOrangeShulkerBoxHandler; + case E_BLOCK_PACKED_ICE: return ItemPackedIceHandler; + case E_BLOCK_PINK_GLAZED_TERRACOTTA: return ItemPinkGlazedTerracottaHandler; + case E_BLOCK_PINK_SHULKER_BOX: return ItemPinkShulkerBoxHandler; + case E_BLOCK_PISTON: return ItemPistonHandler; + case E_BLOCK_PISTON_EXTENSION: return ItemPistonExtensionHandler; + case E_BLOCK_PISTON_MOVED_BLOCK: return ItemPistonMovedBlockHandler; + case E_BLOCK_PLANKS: return ItemPlanksHandler; + case E_BLOCK_POTATOES: return ItemPotatoesBlockHandler; + case E_BLOCK_POWERED_RAIL: return ItemPoweredRailHandler; + case E_BLOCK_PRISMARINE_BLOCK: return ItemPrismarineBlockHandler; + case E_BLOCK_PUMPKIN: return ItemPumpkinHandler; + case E_BLOCK_PUMPKIN_STEM: return ItemPumpkinStemHandler; + case E_BLOCK_PURPLE_GLAZED_TERRACOTTA: return ItemPurpleGlazedTerracottaHandler; + case E_BLOCK_PURPLE_SHULKER_BOX: return ItemPurpleShulkerBoxHandler; + case E_BLOCK_PURPUR_BLOCK: return ItemPurpurBlockHandler; + case E_BLOCK_PURPUR_DOUBLE_SLAB: return ItemPurpurDoubleSlabHandler; + case E_BLOCK_PURPUR_PILLAR: return ItemPurpurPillarHandler; + case E_BLOCK_PURPUR_SLAB: return ItemPurpurSlabHandler; + case E_BLOCK_PURPUR_STAIRS: return ItemPurpurStairsHandler; + case E_BLOCK_QUARTZ_BLOCK: return ItemQuartzBlockHandler; + case E_BLOCK_QUARTZ_STAIRS: return ItemQuartzStairsHandler; + case E_BLOCK_RAIL: return ItemRailHandler; + case E_BLOCK_REDSTONE_LAMP_OFF: return ItemRedstoneLampOffHandler; + case E_BLOCK_REDSTONE_LAMP_ON: return ItemRedstoneLampOnHandler; + case E_BLOCK_REDSTONE_ORE: return ItemRedstoneOreHandler; + case E_BLOCK_REDSTONE_ORE_GLOWING: return ItemRedstoneOreGlowingHandler; + case E_BLOCK_REDSTONE_REPEATER_OFF: return ItemRedstoneRepeaterOffHandler; + case E_BLOCK_REDSTONE_REPEATER_ON: return ItemRedstoneRepeaterOnHandler; + case E_BLOCK_REDSTONE_TORCH_OFF: return ItemRedstoneTorchOffBlockHandler; + case E_BLOCK_REDSTONE_TORCH_ON: return ItemRedstoneTorchHandler; + case E_BLOCK_REDSTONE_WIRE: return ItemRedstoneWireHandler; + case E_BLOCK_RED_GLAZED_TERRACOTTA: return ItemRedGlazedTerracottaHandler; + case E_BLOCK_RED_MUSHROOM: return ItemRedMushroomBlockHandler; + case E_BLOCK_RED_NETHER_BRICK: return ItemRedNetherBricksHandler; + case E_BLOCK_RED_SANDSTONE: return ItemRedSandstoneHandler; + case E_BLOCK_RED_SANDSTONE_SLAB: return ItemRedSandstoneSlabHandler; + case E_BLOCK_RED_SANDSTONE_STAIRS: return ItemRedSandstoneStairsHandler; + case E_BLOCK_RED_SHULKER_BOX: return ItemRedShulkerBoxHandler; + case E_BLOCK_REPEATING_COMMAND_BLOCK: return ItemRepeatingCommandBlockHandler; + case E_BLOCK_SAND: return ItemSandHandler; + case E_BLOCK_SANDSTONE: return ItemSandstoneHandler; + case E_BLOCK_SANDSTONE_STAIRS: return ItemSandstoneStairsHandler; + case E_BLOCK_SAPLING: return ItemSaplingHandler; + case E_BLOCK_SEA_LANTERN: return ItemSeaLanternHandler; + case E_BLOCK_SIGN_POST: return ItemSignPostHandler; + case E_BLOCK_SILVERFISH_EGG: return ItemSilverfishEggBlockHandler; + case E_BLOCK_SLIME_BLOCK: return ItemSlimeBlockHandler; + case E_BLOCK_SNOW: return ItemSnowHandler; + case E_BLOCK_SNOW_BLOCK: return ItemSnowBlockHandler; + case E_BLOCK_SOULSAND: return ItemSoulsandHandler; + case E_BLOCK_SPONGE: return ItemSpongeHandler; + case E_BLOCK_SPRUCE_DOOR: return ItemSpruceDoorBlockHandler; + case E_BLOCK_SPRUCE_FENCE: return ItemSpruceFenceHandler; + case E_BLOCK_SPRUCE_FENCE_GATE: return ItemSpruceFenceGateHandler; + case E_BLOCK_SPRUCE_WOOD_STAIRS: return ItemSpruceStairsHandler; + case E_BLOCK_STAINED_GLASS: return ItemStainedGlassHandler; + case E_BLOCK_STAINED_GLASS_PANE: return ItemStainedGlassPaneHandler; + case E_BLOCK_STANDING_BANNER: return ItemStandingBannerHandler; + case E_BLOCK_STATIONARY_LAVA: return ItemStationaryLavaHandler; + case E_BLOCK_STATIONARY_WATER: return ItemStationaryWaterHandler; + case E_BLOCK_STICKY_PISTON: return ItemStickyPistonHandler; + case E_BLOCK_STONE: return ItemStoneHandler; + case E_BLOCK_STONE_BRICKS: return ItemStoneBricksHandler; + case E_BLOCK_STONE_BRICK_STAIRS: return ItemStoneBrickStairsHandler; + case E_BLOCK_STONE_BUTTON: return ItemStoneButtonHandler; + case E_BLOCK_STONE_PRESSURE_PLATE: return ItemStonePressurePlateHandler; + case E_BLOCK_STONE_SLAB: return ItemStoneSlabHandler; + case E_BLOCK_STRUCTURE_BLOCK: return ItemStructureBlockHandler; + case E_BLOCK_STRUCTURE_VOID: return ItemStructureVoidHandler; + case E_BLOCK_SUGARCANE: return ItemSugarCaneBlockHandler; + case E_BLOCK_TALL_GRASS: return ItemTallGrassHandler; + case E_BLOCK_TERRACOTTA: return ItemTerracottaHandler; + case E_BLOCK_TNT: return ItemTNTHandler; + case E_BLOCK_TORCH: return ItemTorchHandler; + case E_BLOCK_TRAPDOOR: return ItemOakTrapdoorHandler; + case E_BLOCK_TRAPPED_CHEST: return ItemTrappedChestHandler; + case E_BLOCK_TRIPWIRE: return ItemTripwireHandler; + case E_BLOCK_TRIPWIRE_HOOK: return ItemTripwireHookHandler; + case E_BLOCK_VINES: return ItemVinesHandler; + case E_BLOCK_WALLSIGN: return ItemWallsignHandler; + case E_BLOCK_WALL_BANNER: return ItemWallBannerHandler; + case E_BLOCK_WATER: return ItemWaterHandler; + case E_BLOCK_WHEAT: return ItemWheatBlockHandler; + case E_BLOCK_WHITE_GLAZED_TERRACOTTA: return ItemWhiteGlazedTerracottaHandler; + case E_BLOCK_WHITE_SHULKER_BOX: return ItemWhiteShulkerBoxHandler; + case E_BLOCK_WOODEN_BUTTON: return ItemOakButtonHandler; + case E_BLOCK_WOODEN_PRESSURE_PLATE: return ItemWoodenPressurePlateHandler; + case E_BLOCK_WOODEN_SLAB: return ItemOakSlabHandler; + case E_BLOCK_WOOL: return ItemWoolHandler; + case E_BLOCK_YELLOW_GLAZED_TERRACOTTA: return ItemYellowGlazedTerracottaHandler; + case E_BLOCK_YELLOW_SHULKER_BOX: return ItemYellowShulkerBoxHandler; + case E_ITEM_11_DISC: return Item11DiscHandler; + case E_ITEM_13_DISC: return Item13DiscHandler; + case E_ITEM_ACACIA_BOAT: return ItemAcaciaBoatHandler; + case E_ITEM_ACACIA_DOOR: return ItemAcaciaDoorHandler; + case E_ITEM_ARMOR_STAND: return ItemArmorStandHandler; + case E_ITEM_ARROW: return ItemArrowHandler; + case E_ITEM_BAKED_POTATO: return ItemBakedPotatoHandler; + case E_ITEM_BANNER: return ItemBannerHandler; + case E_ITEM_BED: return ItemBedHandler; + case E_ITEM_BEETROOT: return ItemBeetrootHandler; + case E_ITEM_BEETROOT_SEEDS: return ItemBeetrootSeedsHandler; + case E_ITEM_BEETROOT_SOUP: return ItemBeetrootSoupHandler; + case E_ITEM_BIRCH_BOAT: return ItemBirchBoatHandler; + case E_ITEM_BIRCH_DOOR: return ItemBirchDoorHandler; + case E_ITEM_BLAZE_POWDER: return ItemBlazePowderHandler; + case E_ITEM_BLAZE_ROD: return ItemBlazeRodHandler; + case E_ITEM_BLOCKS_DISC: return ItemBlocksDiscHandler; + case E_ITEM_BOAT: return ItemOakBoatHandler; + case E_ITEM_BONE: return ItemBoneHandler; + case E_ITEM_BOOK: return ItemBookHandler; + case E_ITEM_BOOK_AND_QUILL: return ItemBookAndQuillHandler; + case E_ITEM_BOTTLE_O_ENCHANTING: return ItemBottleOEnchantingHandler; + case E_ITEM_BOW: return ItemBowHandler; + case E_ITEM_BOWL: return ItemBowlHandler; + case E_ITEM_BREAD: return ItemBreadHandler; + case E_ITEM_BREWING_STAND: return ItemBrewingStandHandler; + case E_ITEM_BUCKET: return ItemBucketHandler; + case E_ITEM_CAKE: return ItemCakeHandler; + case E_ITEM_CARROT: return ItemCarrotHandler; + case E_ITEM_CARROT_ON_STICK: return ItemCarrotOnStickHandler; + case E_ITEM_CAT_DISC: return ItemCatDiscHandler; + case E_ITEM_CAULDRON: return ItemCauldronHandler; + case E_ITEM_CHAIN_BOOTS: return ItemChainBootsHandler; + case E_ITEM_CHAIN_CHESTPLATE: return ItemChainChestplateHandler; + case E_ITEM_CHAIN_HELMET: return ItemChainHelmetHandler; + case E_ITEM_CHAIN_LEGGINGS: return ItemChainLeggingsHandler; + case E_ITEM_CHEST_MINECART: return ItemChestMinecartHandler; + case E_ITEM_CHIRP_DISC: return ItemChirpDiscHandler; + case E_ITEM_CHORUS_FRUIT: return ItemChorusFruitHandler; + case E_ITEM_CLAY: return ItemClayHandler; + case E_ITEM_CLAY_BRICK: return ItemBricksHandler; + case E_ITEM_CLOCK: return ItemClockHandler; + case E_ITEM_COAL: return ItemCoalHandler; + case E_ITEM_COMPARATOR: return ItemComparatorHandler; + case E_ITEM_COMPASS: return ItemCompassHandler; + case E_ITEM_COOKED_CHICKEN: return ItemCookedChickenHandler; + case E_ITEM_COOKED_FISH: return ItemCookedFishHandler; + case E_ITEM_COOKED_MUTTON: return ItemCookedMuttonHandler; + case E_ITEM_COOKED_PORKCHOP: return ItemCookedPorkchopHandler; + case E_ITEM_COOKED_RABBIT: return ItemCookedRabbitHandler; + case E_ITEM_COOKIE: return ItemCookieHandler; + case E_ITEM_DARK_OAK_BOAT: return ItemDarkOakBoatHandler; + case E_ITEM_DARK_OAK_DOOR: return ItemDarkOakDoorHandler; + case E_ITEM_DIAMOND: return ItemDiamondHandler; + case E_ITEM_DIAMOND_AXE: return ItemDiamondAxeHandler; + case E_ITEM_DIAMOND_BOOTS: return ItemDiamondBootsHandler; + case E_ITEM_DIAMOND_CHESTPLATE: return ItemDiamondChestplateHandler; + case E_ITEM_DIAMOND_HELMET: return ItemDiamondHelmetHandler; + case E_ITEM_DIAMOND_HOE: return ItemDiamondHoeHandler; + case E_ITEM_DIAMOND_HORSE_ARMOR: return ItemDiamondHorseArmorHandler; + case E_ITEM_DIAMOND_LEGGINGS: return ItemDiamondLeggingsHandler; + case E_ITEM_DIAMOND_PICKAXE: return ItemDiamondPickaxeHandler; + case E_ITEM_DIAMOND_SHOVEL: return ItemDiamondShovelHandler; + case E_ITEM_DIAMOND_SWORD: return ItemDiamondSwordHandler; + case E_ITEM_DRAGON_BREATH: return ItemDragonBreathHandler; + case E_ITEM_DYE: return ItemDyeHandler; + case E_ITEM_EGG: return ItemEggHandler; + case E_ITEM_ELYTRA: return ItemElytraHandler; + case E_ITEM_EMERALD: return ItemEmeraldHandler; + case E_ITEM_EMPTY_MAP: return ItemEmptyMapHandler; + case E_ITEM_ENCHANTED_BOOK: return ItemEnchantedBookHandler; + case E_ITEM_ENDER_PEARL: return ItemEnderPearlHandler; + case E_ITEM_END_CRYSTAL: return ItemEndCrystalHandler; + case E_ITEM_EYE_OF_ENDER: return ItemEyeOfEnderHandler; + case E_ITEM_FAR_DISC: return ItemFarDiscHandler; + case E_ITEM_FEATHER: return ItemFeatherHandler; + case E_ITEM_FERMENTED_SPIDER_EYE: return ItemFermentedSpiderEyeHandler; + case E_ITEM_FIREWORK_ROCKET: return ItemFireworkRocketHandler; + case E_ITEM_FIREWORK_STAR: return ItemFireworkStarHandler; + case E_ITEM_FIRE_CHARGE: return ItemFireChargeHandler; + case E_ITEM_FISHING_ROD: return ItemFishingRodHandler; + case E_ITEM_FLINT: return ItemFlintHandler; + case E_ITEM_FLINT_AND_STEEL: return ItemFlintAndSteelHandler; + case E_ITEM_FLOWER_POT: return ItemFlowerPotHandler; + case E_ITEM_FURNACE_MINECART: return ItemFurnaceMinecartHandler; + case E_ITEM_GHAST_TEAR: return ItemGhastTearHandler; + case E_ITEM_GLASS_BOTTLE: return ItemGlassBottleHandler; + case E_ITEM_GLISTERING_MELON: return ItemGlisteringMelonHandler; + case E_ITEM_GLOWSTONE_DUST: return ItemGlowstoneDustHandler; + case E_ITEM_GOLD: return ItemGoldHandler; + case E_ITEM_GOLDEN_APPLE: return ItemGoldenAppleHandler; + case E_ITEM_GOLDEN_CARROT: return ItemGoldenCarrotHandler; + case E_ITEM_GOLD_AXE: return ItemGoldenAxeHandler; + case E_ITEM_GOLD_BOOTS: return ItemGoldenBootsHandler; + case E_ITEM_GOLD_CHESTPLATE: return ItemGoldenChestplateHandler; + case E_ITEM_GOLD_HELMET: return ItemGoldenHelmetHandler; + case E_ITEM_GOLD_HOE: return ItemGoldenHoeHandler; + case E_ITEM_GOLD_HORSE_ARMOR: return ItemGoldenHorseArmorHandler; + case E_ITEM_GOLD_LEGGINGS: return ItemGoldenLeggingsHandler; + case E_ITEM_GOLD_NUGGET: return ItemGoldNuggetHandler; + case E_ITEM_GOLD_PICKAXE: return ItemGoldenPickaxeHandler; + case E_ITEM_GOLD_SHOVEL: return ItemGoldenShovelHandler; + case E_ITEM_GOLD_SWORD: return ItemGoldenSwordHandler; + case E_ITEM_GUNPOWDER: return ItemGunpowderHandler; + case E_ITEM_HEAD: return ItemHeadHandler; + case E_ITEM_IRON: return ItemIronHandler; + case E_ITEM_IRON_AXE: return ItemIronAxeHandler; + case E_ITEM_IRON_BOOTS: return ItemIronBootsHandler; + case E_ITEM_IRON_CHESTPLATE: return ItemIronChestplateHandler; + case E_ITEM_IRON_DOOR: return ItemIronDoorHandler; + case E_ITEM_IRON_HELMET: return ItemIronHelmetHandler; + case E_ITEM_IRON_HOE: return ItemIronHoeHandler; + case E_ITEM_IRON_HORSE_ARMOR: return ItemIronHorseArmorHandler; + case E_ITEM_IRON_LEGGINGS: return ItemIronLeggingsHandler; + case E_ITEM_IRON_NUGGET: return ItemIronNuggetHandler; + case E_ITEM_IRON_PICKAXE: return ItemIronPickaxeHandler; + case E_ITEM_IRON_SHOVEL: return ItemIronShovelHandler; + case E_ITEM_IRON_SWORD: return ItemIronSwordHandler; + case E_ITEM_ITEM_FRAME: return ItemItemFrameHandler; + case E_ITEM_JUNGLE_BOAT: return ItemJungleBoatHandler; + case E_ITEM_JUNGLE_DOOR: return ItemJungleDoorHandler; + case E_ITEM_LAVA_BUCKET: return ItemLavaBucketHandler; + case E_ITEM_LEASH: return ItemLeashHandler; + case E_ITEM_LEATHER: return ItemLeatherHandler; + case E_ITEM_LEATHER_BOOTS: return ItemLeatherBootsHandler; + case E_ITEM_LEATHER_CAP: return ItemLeatherCapHandler; + case E_ITEM_LEATHER_PANTS: return ItemLeatherPantsHandler; + case E_ITEM_LEATHER_TUNIC: return ItemLeatherTunicHandler; + case E_ITEM_LINGERING_POTION: return ItemLingeringPotionHandler; + case E_ITEM_MAGMA_CREAM: return ItemMagmaCreamHandler; + case E_ITEM_MALL_DISC: return ItemMallDiscHandler; + case E_ITEM_MAP: return ItemMapHandler; + case E_ITEM_MELLOHI_DISC: return ItemMellohiDiscHandler; + case E_ITEM_MELON_SEEDS: return ItemMelonSeedsHandler; + case E_ITEM_MELON_SLICE: return ItemMelonSliceHandler; + case E_ITEM_MILK: return ItemMilkHandler; + case E_ITEM_MINECART: return ItemMinecartHandler; + case E_ITEM_MINECART_WITH_COMMAND_BLOCK: return ItemMinecartWithCommandBlockHandler; + case E_ITEM_MINECART_WITH_HOPPER: return ItemMinecartWithHopperHandler; + case E_ITEM_MINECART_WITH_TNT: return ItemMinecartWithTNTHandler; + case E_ITEM_MUSHROOM_SOUP: return ItemMushroomSoupHandler; + case E_ITEM_NAME_TAG: return ItemNameTagHandler; + case E_ITEM_NETHER_BRICK: return ItemNetherBrickHandler; + case E_ITEM_NETHER_QUARTZ: return ItemNetherQuartzHandler; + case E_ITEM_NETHER_STAR: return ItemNetherStarHandler; + case E_ITEM_NETHER_WART: return ItemNetherWartHandler; + case E_ITEM_PAINTING: return ItemPaintingHandler; + case E_ITEM_PAPER: return ItemPaperHandler; + case E_ITEM_POISONOUS_POTATO: return ItemPoisonousPotatoHandler; + case E_ITEM_POPPED_CHORUS_FRUIT: return ItemPoppedChorusFruitHandler; + case E_ITEM_POTATO: return ItemPotatoHandler; + case E_ITEM_POTION: return ItemPotionHandler; + case E_ITEM_PRISMARINE_CRYSTALS: return ItemPrismarineCrystalsHandler; + case E_ITEM_PRISMARINE_SHARD: return ItemPrismarineShardHandler; + case E_ITEM_PUMPKIN_PIE: return ItemPumpkinPieHandler; + case E_ITEM_PUMPKIN_SEEDS: return ItemPumpkinSeedsHandler; + case E_ITEM_RABBITS_FOOT: return ItemRabbitsFootHandler; + case E_ITEM_RABBIT_HIDE: return ItemRabbitHideHandler; + case E_ITEM_RABBIT_STEW: return ItemRabbitStewHandler; + case E_ITEM_RAW_BEEF: return ItemRawBeefHandler; + case E_ITEM_RAW_CHICKEN: return ItemRawChickenHandler; + case E_ITEM_RAW_FISH: return ItemRawFishHandler; + case E_ITEM_RAW_MUTTON: return ItemRawMuttonHandler; + case E_ITEM_RAW_PORKCHOP: return ItemRawPorkchopHandler; + case E_ITEM_RAW_RABBIT: return ItemRawRabbitHandler; + case E_ITEM_REDSTONE_DUST: return ItemRedstoneDustHandler; + case E_ITEM_REDSTONE_REPEATER: return ItemRedstoneRepeaterHandler; + case E_ITEM_RED_APPLE: return ItemAppleHandler; + case E_ITEM_ROTTEN_FLESH: return ItemRottenFleshHandler; + case E_ITEM_SADDLE: return ItemSaddleHandler; + case E_ITEM_SEEDS: return ItemSeedsHandler; + case E_ITEM_SHEARS: return ItemShearsHandler; + case E_ITEM_SHIELD: return ItemShieldHandler; + case E_ITEM_SHULKER_SHELL: return ItemShulkerShellHandler; + case E_ITEM_SIGN: return ItemSignHandler; + case E_ITEM_SLIMEBALL: return ItemSlimeballHandler; + case E_ITEM_SNOWBALL: return ItemSnowballHandler; + case E_ITEM_SPAWN_EGG: return ItemSpawnEggHandler; + case E_ITEM_SPECTRAL_ARROW: return ItemSpectralArrowHandler; + case E_ITEM_SPIDER_EYE: return ItemSpiderEyeHandler; + case E_ITEM_SPLASH_POTION: return ItemSplashPotionHandler; + case E_ITEM_SPRUCE_BOAT: return ItemSpruceBoatHandler; + case E_ITEM_SPRUCE_DOOR: return ItemSpruceDoorHandler; + case E_ITEM_STAL_DISC: return ItemStalDiscHandler; + case E_ITEM_STEAK: return ItemCookedBeefHandler; + case E_ITEM_STICK: return ItemStickHandler; + case E_ITEM_STONE_AXE: return ItemStoneAxeHandler; + case E_ITEM_STONE_HOE: return ItemStoneHoeHandler; + case E_ITEM_STONE_PICKAXE: return ItemStonePickaxeHandler; + case E_ITEM_STONE_SHOVEL: return ItemStoneShovelHandler; + case E_ITEM_STONE_SWORD: return ItemStoneSwordHandler; + case E_ITEM_STRAD_DISC: return ItemStradDiscHandler; + case E_ITEM_STRING: return ItemStringHandler; + case E_ITEM_SUGAR: return ItemSugarHandler; + case E_ITEM_SUGAR_CANE: return ItemSugarCaneHandler; + case E_ITEM_TIPPED_ARROW: return ItemTippedArrowHandler; + case E_ITEM_TOTEM_OF_UNDYING: return ItemTotemOfUndyingHandler; + case E_ITEM_WAIT_DISC: return ItemWaitDiscHandler; + case E_ITEM_WARD_DISC: return ItemWardDiscHandler; + case E_ITEM_WATER_BUCKET: return ItemWaterBucketHandler; + case E_ITEM_WHEAT: return ItemWheatHandler; + case E_ITEM_WOODEN_AXE: return ItemWoodenAxeHandler; + case E_ITEM_WOODEN_DOOR: return ItemOakDoorHandler; + case E_ITEM_WOODEN_HOE: return ItemWoodenHoeHandler; + case E_ITEM_WOODEN_PICKAXE: return ItemWoodenPickaxeHandler; + case E_ITEM_WOODEN_SHOVEL: return ItemWoodenShovelHandler; + case E_ITEM_WOODEN_SWORD: return ItemWoodenSwordHandler; + case E_ITEM_WRITTEN_BOOK: return ItemWrittenBookHandler; } ASSERT("Unknown item type!"); return ItemAirHandler; @@ -1042,12 +1042,28 @@ const cItemHandler & cItemHandler::For(int a_ItemType) -void cItemHandler::OnPlayerPlace(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_ClickedPosition, const BLOCKTYPE a_ClickedBlockType, const NIBBLETYPE a_ClickedBlockMeta, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const +void cItemHandler::OnPlayerPlace( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_ClickedPosition, + const BLOCKTYPE a_ClickedBlockType, + const NIBBLETYPE a_ClickedBlockMeta, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition +) const { const auto & World = *a_Player.GetWorld(); // Check if the block ignores build collision (water, grass etc.): - if (cBlockHandler::For(a_ClickedBlockType).DoesIgnoreBuildCollision(World, a_HeldItem, a_ClickedPosition, a_ClickedBlockMeta, a_ClickedBlockFace, true)) + if (cBlockHandler::For(a_ClickedBlockType) + .DoesIgnoreBuildCollision( + World, + a_HeldItem, + a_ClickedPosition, + a_ClickedBlockMeta, + a_ClickedBlockFace, + true + )) { // Try to place the block at the clicked position: if (!CommitPlacement(a_Player, a_HeldItem, a_ClickedPosition, a_ClickedBlockFace, a_CursorPosition)) @@ -1069,9 +1085,10 @@ void cItemHandler::OnPlayerPlace(cPlayer & a_Player, const cItem & a_HeldItem, c return; } - // Clicked on side of block, make sure that placement won't be cancelled if there is a slab able to be double slabbed. - // No need to do combinability (dblslab) checks, client will do that here. - if (!cBlockHandler::For(PlaceBlock).DoesIgnoreBuildCollision(World, a_HeldItem, PlacePosition, PlaceMeta, a_ClickedBlockFace, false)) + // Clicked on side of block, make sure that placement won't be cancelled if there is a slab able to be double + // slabbed. No need to do combinability (dblslab) checks, client will do that here. + if (!cBlockHandler::For(PlaceBlock) + .DoesIgnoreBuildCollision(World, a_HeldItem, PlacePosition, PlaceMeta, a_ClickedBlockFace, false)) { // Tried to place a block into another? // Happens when you place a block aiming at side of block with a torch on it or stem beside it. @@ -1101,8 +1118,12 @@ void cItemHandler::OnPlayerPlace(cPlayer & a_Player, const cItem & a_HeldItem, c bool cItemHandler::OnItemUse( - cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, - const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_Item, + const Vector3i a_ClickedBlockPos, + eBlockFace a_ClickedBlockFace ) const { UNUSED(a_World); @@ -1472,7 +1493,13 @@ float cItemHandler::GetBlockBreakingStrength(BLOCKTYPE a_Block) const -bool cItemHandler::CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const +bool cItemHandler::CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition +) const { ASSERT(m_ItemType < 256); // Items with IDs above 255 should all be handled by specific handlers. diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h index 8b8c8d2d3..949582eb8 100644 --- a/src/Items/ItemHandler.h +++ b/src/Items/ItemHandler.h @@ -20,8 +20,7 @@ class cBlockPluginInterface; class cItemHandler { -public: - + public: friend class cItem; /** Actions that may cause durability of an item may be lost, where the @@ -34,7 +33,8 @@ public: dlaBreakBlockInstant, }; - constexpr cItemHandler(int a_ItemType) : m_ItemType(a_ItemType) + constexpr cItemHandler(int a_ItemType) : + m_ItemType(a_ItemType) { } @@ -44,7 +44,15 @@ public: a_ClickedBlockFace is the face has been clicked to place this item. a_CursorPosition is the position of the player's cursor within a_ClickedBlockFace. If the block placement is refused inside this call, it will automatically revert the client-side changes. */ - void OnPlayerPlace(cPlayer & a_Player, const cItem & a_HeldItem, Vector3i a_ClickedPosition, BLOCKTYPE a_ClickedBlockType, NIBBLETYPE a_ClickedBlockMeta, eBlockFace a_ClickedBlockFace, Vector3i a_CursorPosition) const; + void OnPlayerPlace( + cPlayer & a_Player, + const cItem & a_HeldItem, + Vector3i a_ClickedPosition, + BLOCKTYPE a_ClickedBlockType, + NIBBLETYPE a_ClickedBlockMeta, + eBlockFace a_ClickedBlockFace, + Vector3i a_CursorPosition + ) const; /** Called when the player tries to use the item (right mouse button). Descendants can return false to abort the usage (default behavior). */ @@ -64,7 +72,8 @@ public: UNUSED(a_BlockFace); } - /** Called every tick while the item is on the player's inventory (used by maps, for example) - For now, called only for equipped items */ + /** Called every tick while the item is on the player's inventory (used by maps, for example) - For now, called only + * for equipped items */ virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) const { UNUSED(a_World); @@ -74,7 +83,9 @@ public: /** Called while the player digs a block using this item */ virtual bool OnDiggingBlock( - cWorld * a_World, cPlayer * a_Player, const cItem & a_HeldItem, + cWorld * a_World, + cPlayer * a_Player, + const cItem & a_HeldItem, const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace ) const; @@ -83,7 +94,7 @@ public: virtual void OnEntityAttack(cPlayer * a_Attacker, cEntity * a_AttackedEntity) const; /** Called after the player has eaten this item. */ - virtual void OnFoodEaten(cWorld *a_World, cPlayer *a_Player, cItem *a_Item) const; + virtual void OnFoodEaten(cWorld * a_World, cPlayer * a_Player, cItem * a_Item) const; /** Get the durability lost which the item will get, when a specified action was performed. This is only relevant for uses where the damage taken may @@ -95,15 +106,14 @@ public: struct FoodInfo { - int FoodLevel; + int FoodLevel; double Saturation; constexpr FoodInfo(int a_FoodLevel, double a_Saturation) : - FoodLevel(a_FoodLevel), - Saturation(a_Saturation) + FoodLevel(a_FoodLevel), Saturation(a_Saturation) { } - } ; + }; /** Returns the FoodInfo for this item. (FoodRecovery and Saturation) */ virtual FoodInfo GetFoodInfo(const cItem * a_Item) const; @@ -123,8 +133,8 @@ public: /** Can the anvil repair this item, when a_Item is the second input? */ virtual bool CanRepairWithRawMaterial(short a_ItemType) const; - /** Returns whether this tool / item can harvest a specific block (e.g. iron pickaxe can harvest diamond ore, but wooden one can't). - Defaults to false unless overridden. */ + /** Returns whether this tool / item can harvest a specific block (e.g. iron pickaxe can harvest diamond ore, but + wooden one can't). Defaults to false unless overridden. */ virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) const; /** Returns the strength to break a specific block. @@ -132,8 +142,7 @@ public: virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) const; -protected: - + protected: static const cItemHandler & For(int a_ItemType); ~cItemHandler() = default; @@ -142,8 +151,14 @@ protected: /** Performs the actual placement of this placeable item. The descendant handler should call a_Player.PlaceBlock(s) supplying correct values for the newly placed block. - The default handler uses the stored block type and meta copied from the lowest 4 bits of the player's equipped item's damage value. - Handlers return what a_Player.PlaceBlock(s) returns, indicating whether the placement was successful. */ - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, Vector3i a_PlacePosition, eBlockFace a_ClickedBlockFace, Vector3i a_CursorPosition) const; + The default handler uses the stored block type and meta copied from the lowest 4 bits of the player's equipped + item's damage value. Handlers return what a_Player.PlaceBlock(s) returns, indicating whether the placement was + successful. */ + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + Vector3i a_PlacePosition, + eBlockFace a_ClickedBlockFace, + Vector3i a_CursorPosition + ) const; }; - diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index 2bca5f5ca..5b9b8f0ef 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -9,13 +9,11 @@ -class cItemHoeHandler final: - public cItemHandler +class cItemHoeHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -57,7 +55,8 @@ public: } // Transform: - auto NewBlockType = ((BlockType == E_BLOCK_DIRT) && (BlockMeta == E_META_DIRT_COARSE)) ? E_BLOCK_DIRT : E_BLOCK_FARMLAND; + auto NewBlockType = + ((BlockType == E_BLOCK_DIRT) && (BlockMeta == E_META_DIRT_COARSE)) ? E_BLOCK_DIRT : E_BLOCK_FARMLAND; a_World->SetBlock(a_ClickedBlockPos, NewBlockType, 0); a_World->BroadcastSoundEffect("item.hoe.till", a_ClickedBlockPos + Vector3d(0.5, 0.5, 0.5), 1.0f, 0.8f); a_Player->UseEquippedItem(); @@ -72,10 +71,10 @@ public: { switch (a_Action) { - case dlaAttackEntity: return 1; - case dlaBreakBlock: return 0; - case dlaBreakBlockInstant: return 0; + case dlaAttackEntity: return 1; + case dlaBreakBlock: return 0; + case dlaBreakBlockInstant: return 0; } UNREACHABLE("Unsupported durability loss action"); } -} ; +}; diff --git a/src/Items/ItemHopper.h b/src/Items/ItemHopper.h index 7b010ce5f..83f35a4bd 100644 --- a/src/Items/ItemHopper.h +++ b/src/Items/ItemHopper.h @@ -7,17 +7,14 @@ -class cItemHopperHandler final : - public cItemHandler +class cItemHopperHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { switch (a_BlockFace) @@ -28,12 +25,18 @@ private: case BLOCK_FACE_NORTH: return E_META_HOPPER_FACING_ZP; case BLOCK_FACE_SOUTH: return E_META_HOPPER_FACING_ZM; case BLOCK_FACE_WEST: return E_META_HOPPER_FACING_XP; - default: UNREACHABLE("Unsupported block face"); + default: UNREACHABLE("Unsupported block face"); } } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_HOPPER, BlockFaceToMetaData(a_ClickedBlockFace)); } diff --git a/src/Items/ItemItemFrame.h b/src/Items/ItemItemFrame.h index 70923c549..c7496ef3c 100644 --- a/src/Items/ItemItemFrame.h +++ b/src/Items/ItemItemFrame.h @@ -9,13 +9,11 @@ -class cItemItemFrameHandler final: - public cItemHandler +class cItemItemFrameHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -32,7 +30,8 @@ public: ) const override { // Can only place on a side face: - if ((a_ClickedBlockFace == BLOCK_FACE_NONE) || (a_ClickedBlockFace == BLOCK_FACE_YP) || (a_ClickedBlockFace == BLOCK_FACE_YM)) + if ((a_ClickedBlockFace == BLOCK_FACE_NONE) || (a_ClickedBlockFace == BLOCK_FACE_YP) || + (a_ClickedBlockFace == BLOCK_FACE_YM)) { return false; } @@ -67,7 +66,3 @@ public: return true; } }; - - - - diff --git a/src/Items/ItemJackOLantern.h b/src/Items/ItemJackOLantern.h index acd233701..0432b2ecc 100644 --- a/src/Items/ItemJackOLantern.h +++ b/src/Items/ItemJackOLantern.h @@ -8,20 +8,27 @@ -class cItemJackOLanternHandler final : - public cItemHandler +class cItemJackOLanternHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Re-use the pumpkin converter for lanterns: - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_JACK_O_LANTERN, cBlockPumpkinHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_JACK_O_LANTERN, + cBlockPumpkinHandler::YawToMetaData(a_Player.GetYaw()) + ); } }; diff --git a/src/Items/ItemLadder.h b/src/Items/ItemLadder.h index a778fee6c..a8e73961e 100644 --- a/src/Items/ItemLadder.h +++ b/src/Items/ItemLadder.h @@ -8,17 +8,14 @@ -class cItemLadderHandler final : - public cItemHandler +class cItemLadderHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the neighbor to which the ladder is attached to the ladder block's meta. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace) { @@ -30,12 +27,18 @@ private: case BLOCK_FACE_XP: return 0x5; case BLOCK_FACE_YM: case BLOCK_FACE_YP: return 0x2; - default: UNREACHABLE("Unsupported neighbor block face"); + default: UNREACHABLE("Unsupported neighbor block face"); } } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { const auto & World = *a_Player.GetWorld(); const auto ClickedBlockType = World.GetBlock(AddFaceDirection(a_PlacePosition, a_ClickedBlockFace, true)); @@ -60,7 +63,8 @@ private: Returns BLOCK_FACE_NONE on failure. */ static eBlockFace FindSuitableFace(const cWorld & a_World, const Vector3i a_Position) { - for (const auto Face : { BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM }) // Loop through all faces in specific order. + for (const auto Face : + {BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM}) // Loop through all faces in specific order. { // The direction of Face is relative to the direction the ladder faces. // This is the position, computed inverted, that such a ladder would attach to. diff --git a/src/Items/ItemLeaves.h b/src/Items/ItemLeaves.h index b4795bf29..060a6395a 100644 --- a/src/Items/ItemLeaves.h +++ b/src/Items/ItemLeaves.h @@ -7,29 +7,31 @@ -class cItemLeavesHandler final : - public cItemHandler +class cItemLeavesHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock( a_PlacePosition, static_cast<BLOCKTYPE>(m_ItemType), - static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage | 0x4) // 0x4 bit set means this is a player-placed leaves block, not to be decayed. + static_cast<NIBBLETYPE>( + a_HeldItem.m_ItemDamage | 0x4 + ) // 0x4 bit set means this is a player-placed leaves block, not to be decayed. ); } -} ; - - - - +}; diff --git a/src/Items/ItemLever.h b/src/Items/ItemLever.h index e3791e460..58c0acce7 100644 --- a/src/Items/ItemLever.h +++ b/src/Items/ItemLever.h @@ -7,17 +7,14 @@ -class cItemLeverHandler final : - public cItemHandler +class cItemLeverHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the neighbor to which the lever is attached to the lever block's meta. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { @@ -36,8 +33,18 @@ private: } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), BlockFaceToMetaData(a_ClickedBlockFace)); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + BlockFaceToMetaData(a_ClickedBlockFace) + ); } }; diff --git a/src/Items/ItemLighter.h b/src/Items/ItemLighter.h index 2402dd0e1..6ad1462f7 100644 --- a/src/Items/ItemLighter.h +++ b/src/Items/ItemLighter.h @@ -9,13 +9,11 @@ -class cItemLighterHandler final: - public cItemHandler +class cItemLighterHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -76,4 +74,4 @@ public: return false; } -} ; +}; diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h index f13212b07..b676b1ae6 100644 --- a/src/Items/ItemLilypad.h +++ b/src/Items/ItemLilypad.h @@ -9,17 +9,14 @@ -class cItemLilypadHandler final: - public cItemHandler +class cItemLilypadHandler final : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemLilypadHandler(int a_ItemType): + public: + constexpr cItemLilypadHandler(int a_ItemType) : Super(a_ItemType) { - } @@ -53,12 +50,8 @@ public: const auto PlacePos = AddFaceDirection(a_ClickedBlockPos, a_ClickedBlockFace); // Lilypad should not replace non air and non water blocks: - if ( - const auto BlockToReplace = a_World->GetBlock(PlacePos); - (BlockToReplace != E_BLOCK_AIR) && - (BlockToReplace != E_BLOCK_WATER) && - (BlockToReplace != E_BLOCK_STATIONARY_WATER) - ) + if (const auto BlockToReplace = a_World->GetBlock(PlacePos); (BlockToReplace != E_BLOCK_AIR) && + (BlockToReplace != E_BLOCK_WATER) && (BlockToReplace != E_BLOCK_STATIONARY_WATER)) { return false; } @@ -70,11 +63,8 @@ public: } // Lilypad should be placed only if there is a water block below: - if ( - const auto BlockBelow = a_World->GetBlock(Below); - (BlockBelow != E_BLOCK_WATER) && - (BlockBelow != E_BLOCK_STATIONARY_WATER) - ) + if (const auto BlockBelow = a_World->GetBlock(Below); + (BlockBelow != E_BLOCK_WATER) && (BlockBelow != E_BLOCK_STATIONARY_WATER)) { return false; } @@ -88,21 +78,23 @@ public: return true; } - class cCallbacks: - public cBlockTracer::cCallbacks + class cCallbacks : public cBlockTracer::cCallbacks { - public: - - virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + public: + virtual bool OnNextBlock( + Vector3i a_CBBlockPos, + BLOCKTYPE a_CBBlockType, + NIBBLETYPE a_CBBlockMeta, + eBlockFace a_CBEntryFace + ) override { - if ( - !IsBlockWater(a_CBBlockType) || - (a_CBBlockMeta != 0) // The hit block should be a source + if (!IsBlockWater(a_CBBlockType) || (a_CBBlockMeta != 0) // The hit block should be a source ) { - // TODO: Vanilla stops the trace. However, we need to continue the trace, to work around our lack of block bounding box support - // which would otherwise mean we misbehave when clicking through the voxel a (e.g.) button occupies. Now, however, we misbehave - // when clicking on a block near water... Nonetheless, the former would cause ghost blocks, so continue for now. + // TODO: Vanilla stops the trace. However, we need to continue the trace, to work around our lack of + // block bounding box support which would otherwise mean we misbehave when clicking through the + // voxel a (e.g.) button occupies. Now, however, we misbehave when clicking on a block near water... + // Nonetheless, the former would cause ghost blocks, so continue for now. // Ignore and continue trace: return false; diff --git a/src/Items/ItemMap.h b/src/Items/ItemMap.h index 83ec7cbc4..066e3fe28 100644 --- a/src/Items/ItemMap.h +++ b/src/Items/ItemMap.h @@ -7,15 +7,13 @@ -class cItemMapHandler final: - public cItemHandler +class cItemMapHandler final : public cItemHandler { using Super = cItemHandler; static const unsigned int DEFAULT_RADIUS = 128; -public: - + public: using Super::Super; virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) const override @@ -30,4 +28,4 @@ public: Map->UpdateRadius(*a_Player, DEFAULT_RADIUS); Map->UpdateClient(a_Player); } -} ; +}; diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h index fb346ec45..3c069286c 100644 --- a/src/Items/ItemMilk.h +++ b/src/Items/ItemMilk.h @@ -5,13 +5,11 @@ -class cItemMilkHandler final: - public cItemHandler +class cItemMilkHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; virtual bool IsDrinkable(short a_ItemDamage) const override diff --git a/src/Items/ItemMinecart.h b/src/Items/ItemMinecart.h index 444e9e7d4..6b7bdbf8e 100644 --- a/src/Items/ItemMinecart.h +++ b/src/Items/ItemMinecart.h @@ -5,13 +5,11 @@ -class cItemMinecartHandler final: - public cItemHandler +class cItemMinecartHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -66,5 +64,4 @@ public: } return true; } - -} ; +}; diff --git a/src/Items/ItemMobHead.h b/src/Items/ItemMobHead.h index aa4189589..76275803b 100644 --- a/src/Items/ItemMobHead.h +++ b/src/Items/ItemMobHead.h @@ -9,20 +9,24 @@ -class cItemMobHeadHandler final : - public cItemHandler +class cItemMobHeadHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Cannot place a head at "no face" and from the bottom: if ((a_ClickedBlockFace == BLOCK_FACE_NONE) || (a_ClickedBlockFace == BLOCK_FACE_BOTTOM)) @@ -55,28 +59,36 @@ public: /** Called after placing a regular head block with no mob spawning. Adjusts the mob head entity based on the equipped item's data. */ - void RegularHeadPlaced(const cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace) const + void RegularHeadPlaced( + const cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace + ) const { const auto HeadType = static_cast<eMobHeadType>(a_HeldItem.m_ItemDamage); const auto BlockMeta = static_cast<NIBBLETYPE>(a_ClickedBlockFace); // Use a callback to set the properties of the mob head block entity: - a_Player.GetWorld()->DoWithBlockEntityAt(a_PlacePosition, [&a_Player, HeadType, BlockMeta](cBlockEntity & a_BlockEntity) - { - ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_HEAD); + a_Player.GetWorld()->DoWithBlockEntityAt( + a_PlacePosition, + [&a_Player, HeadType, BlockMeta](cBlockEntity & a_BlockEntity) + { + ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_HEAD); - auto & MobHeadEntity = static_cast<cMobHeadEntity &>(a_BlockEntity); + auto & MobHeadEntity = static_cast<cMobHeadEntity &>(a_BlockEntity); - int Rotation = 0; - if (BlockMeta == 1) - { - Rotation = FloorC(a_Player.GetYaw() * 16.0f / 360.0f + 0.5f) & 0x0f; - } + int Rotation = 0; + if (BlockMeta == 1) + { + Rotation = FloorC(a_Player.GetYaw() * 16.0f / 360.0f + 0.5f) & 0x0f; + } - MobHeadEntity.SetType(HeadType); - MobHeadEntity.SetRotation(static_cast<eMobHeadRotation>(Rotation)); - return false; - }); + MobHeadEntity.SetType(HeadType); + MobHeadEntity.SetRotation(static_cast<eMobHeadRotation>(Rotation)); + return false; + } + ); } @@ -94,22 +106,17 @@ public: } // Check for all relevant wither locations: - static const Vector3i RelCoords[] = - { - { 0, 0, 0}, - { 1, 0, 0}, - {-1, 0, 0}, - { 0, 0, 1}, - { 0, 0, -1}, + static const Vector3i RelCoords[] = { + {0, 0, 0}, + {1, 0, 0}, + {-1, 0, 0}, + {0, 0, 1}, + {0, 0, -1}, }; for (auto & RelCoord : RelCoords) { - if (TrySpawnWitherAt( - *a_Player.GetWorld(), a_Player, - a_BlockPos, - RelCoord.x, RelCoord.z - )) + if (TrySpawnWitherAt(*a_Player.GetWorld(), a_Player, a_BlockPos, RelCoord.x, RelCoord.z)) { return true; } @@ -124,52 +131,39 @@ public: but assumed to be a head instead. Offset is used to shift the image around the X and Z axis. Returns true iff the wither was created successfully. */ - bool TrySpawnWitherAt( - cWorld & a_World, cPlayer & a_Player, - Vector3i a_PlacedHeadPos, - int a_OffsetX, int a_OffsetZ - ) const + bool TrySpawnWitherAt(cWorld & a_World, cPlayer & a_Player, Vector3i a_PlacedHeadPos, int a_OffsetX, int a_OffsetZ) + const { // Image for the wither at the X axis: - static const sSetBlock ImageWitherX[] = - { - {-1, 0, 0, E_BLOCK_HEAD, 0}, - { 0, 0, 0, E_BLOCK_HEAD, 0}, - { 1, 0, 0, E_BLOCK_HEAD, 0}, + static const sSetBlock ImageWitherX[] = { + {-1, 0, 0, E_BLOCK_HEAD, 0}, + {0, 0, 0, E_BLOCK_HEAD, 0}, + {1, 0, 0, E_BLOCK_HEAD, 0}, {-1, -1, 0, E_BLOCK_SOULSAND, 0}, - { 0, -1, 0, E_BLOCK_SOULSAND, 0}, - { 1, -1, 0, E_BLOCK_SOULSAND, 0}, - {-1, -2, 0, E_BLOCK_AIR, 0}, - { 0, -2, 0, E_BLOCK_SOULSAND, 0}, - { 1, -2, 0, E_BLOCK_AIR, 0}, + {0, -1, 0, E_BLOCK_SOULSAND, 0}, + {1, -1, 0, E_BLOCK_SOULSAND, 0}, + {-1, -2, 0, E_BLOCK_AIR, 0}, + {0, -2, 0, E_BLOCK_SOULSAND, 0}, + {1, -2, 0, E_BLOCK_AIR, 0}, }; // Image for the wither at the Z axis: - static const sSetBlock ImageWitherZ[] = - { - { 0, 0, -1, E_BLOCK_HEAD, 0}, - { 0, 0, 0, E_BLOCK_HEAD, 0}, - { 0, 0, 1, E_BLOCK_HEAD, 0}, - { 0, -1, -1, E_BLOCK_SOULSAND, 0}, - { 0, -1, 0, E_BLOCK_SOULSAND, 0}, - { 0, -1, 1, E_BLOCK_SOULSAND, 0}, - { 0, -2, -1, E_BLOCK_AIR, 0}, - { 0, -2, 0, E_BLOCK_SOULSAND, 0}, - { 0, -2, 1, E_BLOCK_AIR, 0}, + static const sSetBlock ImageWitherZ[] = { + {0, 0, -1, E_BLOCK_HEAD, 0}, + {0, 0, 0, E_BLOCK_HEAD, 0}, + {0, 0, 1, E_BLOCK_HEAD, 0}, + {0, -1, -1, E_BLOCK_SOULSAND, 0}, + {0, -1, 0, E_BLOCK_SOULSAND, 0}, + {0, -1, 1, E_BLOCK_SOULSAND, 0}, + {0, -2, -1, E_BLOCK_AIR, 0}, + {0, -2, 0, E_BLOCK_SOULSAND, 0}, + {0, -2, 1, E_BLOCK_AIR, 0}, }; // Try to spawn the wither from each image: return ( - TrySpawnWitherFromImage( - a_World, a_Player, ImageWitherX, - a_PlacedHeadPos, - a_OffsetX, a_OffsetZ - ) || - TrySpawnWitherFromImage( - a_World, a_Player, ImageWitherZ, - a_PlacedHeadPos, - a_OffsetX, a_OffsetZ - ) + TrySpawnWitherFromImage(a_World, a_Player, ImageWitherX, a_PlacedHeadPos, a_OffsetX, a_OffsetZ) || + TrySpawnWitherFromImage(a_World, a_Player, ImageWitherZ, a_PlacedHeadPos, a_OffsetX, a_OffsetZ) ); } @@ -183,9 +177,12 @@ public: Offset is used to shift the image around the X and Z axis. Returns true iff the wither was created successfully. */ bool TrySpawnWitherFromImage( - cWorld & a_World, cPlayer & a_Player, const sSetBlock (& a_Image)[9], + cWorld & a_World, + cPlayer & a_Player, + const sSetBlock (&a_Image)[9], Vector3i a_PlacedHeadPos, - int a_OffsetX, int a_OffsetZ + int a_OffsetX, + int a_OffsetZ ) const { std::array<Vector3i, 9> PositionsToClear; @@ -200,7 +197,8 @@ public: a_PlacedHeadPos.z + a_OffsetZ + a_Image[i].GetZ() ); - // If the query is for the head the player is about to place (remember, it hasn't been set into the world yet), short-circuit-evaluate it: + // If the query is for the head the player is about to place (remember, it hasn't been set into the world + // yet), short-circuit-evaluate it: if (Block == a_PlacedHeadPos) { if (a_Image[i].m_BlockType != E_BLOCK_HEAD) @@ -228,15 +226,16 @@ public: } // If it is a mob head, check it's a wither skull using the block entity: - if ( - (BlockType == E_BLOCK_HEAD) && - !a_World.DoWithBlockEntityAt(Block, [&](cBlockEntity & a_BlockEntity) - { - ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_HEAD); - - return static_cast<cMobHeadEntity &>(a_BlockEntity).GetType() == SKULL_TYPE_WITHER; - }) - ) + if ((BlockType == E_BLOCK_HEAD) && + !a_World.DoWithBlockEntityAt( + Block, + [&](cBlockEntity & a_BlockEntity) + { + ASSERT(a_BlockEntity.GetBlockType() == E_BLOCK_HEAD); + + return static_cast<cMobHeadEntity &>(a_BlockEntity).GetType() == SKULL_TYPE_WITHER; + } + )) { return false; } @@ -246,20 +245,17 @@ public: } // for i - a_Image // All image blocks matched, try replace the image with air blocks: - if ( - !a_Player.PlaceBlocks( - { - { PositionsToClear[0], E_BLOCK_AIR, 0 }, - { PositionsToClear[1], E_BLOCK_AIR, 0 }, - { PositionsToClear[2], E_BLOCK_AIR, 0 }, - { PositionsToClear[3], E_BLOCK_AIR, 0 }, - { PositionsToClear[4], E_BLOCK_AIR, 0 }, - { PositionsToClear[5], E_BLOCK_AIR, 0 }, - { PositionsToClear[6], E_BLOCK_AIR, 0 }, - { PositionsToClear[7], E_BLOCK_AIR, 0 }, - { PositionsToClear[8], E_BLOCK_AIR, 0 }, - }) - ) + if (!a_Player.PlaceBlocks({ + {PositionsToClear[0], E_BLOCK_AIR, 0}, + {PositionsToClear[1], E_BLOCK_AIR, 0}, + {PositionsToClear[2], E_BLOCK_AIR, 0}, + {PositionsToClear[3], E_BLOCK_AIR, 0}, + {PositionsToClear[4], E_BLOCK_AIR, 0}, + {PositionsToClear[5], E_BLOCK_AIR, 0}, + {PositionsToClear[6], E_BLOCK_AIR, 0}, + {PositionsToClear[7], E_BLOCK_AIR, 0}, + {PositionsToClear[8], E_BLOCK_AIR, 0}, + })) { return false; } @@ -267,7 +263,13 @@ public: // Spawn the wither: int BlockX = a_PlacedHeadPos.x + a_OffsetX; int BlockZ = a_PlacedHeadPos.z + a_OffsetZ; - a_World.SpawnMob(static_cast<double>(BlockX) + 0.5, a_PlacedHeadPos.y - 2, static_cast<double>(BlockZ) + 0.5, mtWither, false); + a_World.SpawnMob( + static_cast<double>(BlockX) + 0.5, + a_PlacedHeadPos.y - 2, + static_cast<double>(BlockZ) + 0.5, + mtWither, + false + ); AwardSpawnWitherAchievement(a_World, {BlockX, a_PlacedHeadPos.y - 2, BlockZ}); return true; } @@ -280,7 +282,8 @@ public: void AwardSpawnWitherAchievement(cWorld & a_World, Vector3i a_BlockPos) const { Vector3f Pos(a_BlockPos); - a_World.ForEachPlayer([=](cPlayer & a_Player) + a_World.ForEachPlayer( + [=](cPlayer & a_Player) { // If player is close, award achievement: double Dist = (a_Player.GetPosition() - Pos).Length(); @@ -320,12 +323,5 @@ public: - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; - - - - + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemNetherWart.h b/src/Items/ItemNetherWart.h index 936e93f31..4bf225f46 100644 --- a/src/Items/ItemNetherWart.h +++ b/src/Items/ItemNetherWart.h @@ -8,20 +8,24 @@ -class cItemNetherWartHandler final: - public cItemHandler +class cItemNetherWartHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Only allow planting nether wart onto the top side of the block: if (a_ClickedBlockFace != BLOCK_FACE_TOP) @@ -36,8 +40,5 @@ public: - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemObserver.h b/src/Items/ItemObserver.h index 719618410..cc7f58f94 100644 --- a/src/Items/ItemObserver.h +++ b/src/Items/ItemObserver.h @@ -8,19 +8,30 @@ -class cItemObserverHandler final : - public cItemHandler +class cItemObserverHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_OBSERVER, cBlockObserverHandler::DisplacementYawToMetaData(a_PlacePosition, a_Player.GetEyePosition(), a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_OBSERVER, + cBlockObserverHandler::DisplacementYawToMetaData( + a_PlacePosition, + a_Player.GetEyePosition(), + a_Player.GetYaw() + ) + ); } }; diff --git a/src/Items/ItemPainting.h b/src/Items/ItemPainting.h index 40e43f87e..80fbac921 100644 --- a/src/Items/ItemPainting.h +++ b/src/Items/ItemPainting.h @@ -10,13 +10,11 @@ -class cItemPaintingHandler final: - public cItemHandler +class cItemPaintingHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -33,11 +31,8 @@ public: ) const override { // Paintings can't be flatly placed: - if ( - (a_ClickedBlockFace == BLOCK_FACE_NONE) || - (a_ClickedBlockFace == BLOCK_FACE_YM) || - (a_ClickedBlockFace == BLOCK_FACE_YP) - ) + if ((a_ClickedBlockFace == BLOCK_FACE_NONE) || (a_ClickedBlockFace == BLOCK_FACE_YM) || + (a_ClickedBlockFace == BLOCK_FACE_YP)) { return false; } @@ -57,40 +52,18 @@ public: } // Define all the possible painting titles - static const AString gPaintingTitlesList[] = - { - { "Kebab" }, - { "Aztec" }, - { "Alban" }, - { "Aztec2" }, - { "Bomb" }, - { "Plant" }, - { "Wasteland" }, - { "Wanderer" }, - { "Graham" }, - { "Pool" }, - { "Courbet" }, - { "Sunset" }, - { "Sea" }, - { "Creebet" }, - { "Match" }, - { "Bust" }, - { "Stage" }, - { "Void" }, - { "SkullAndRoses" }, - { "Wither" }, - { "Fighters" }, - { "Skeleton" }, - { "DonkeyKong" }, - { "Pointer" }, - { "Pigscene" }, - { "BurningSkull" } + static const AString gPaintingTitlesList[] = { + {"Kebab"}, {"Aztec"}, {"Alban"}, {"Aztec2"}, {"Bomb"}, {"Plant"}, {"Wasteland"}, + {"Wanderer"}, {"Graham"}, {"Pool"}, {"Courbet"}, {"Sunset"}, {"Sea"}, {"Creebet"}, + {"Match"}, {"Bust"}, {"Stage"}, {"Void"}, {"SkullAndRoses"}, {"Wither"}, {"Fighters"}, + {"Skeleton"}, {"DonkeyKong"}, {"Pointer"}, {"Pigscene"}, {"BurningSkull"} }; auto PaintingTitle = gPaintingTitlesList[a_World->GetTickRandomNumber(ARRAYCOUNT(gPaintingTitlesList) - 1)]; // A painting, centred so pickups spawn nicely. - auto Painting = std::make_unique<cPainting>(PaintingTitle, a_ClickedBlockFace, Vector3d(0.5, 0.5, 0.5) + PlacePos); + auto Painting = + std::make_unique<cPainting>(PaintingTitle, a_ClickedBlockFace, Vector3d(0.5, 0.5, 0.5) + PlacePos); auto PaintingPtr = Painting.get(); if (!PaintingPtr->Initialize(std::move(Painting), *a_World)) { @@ -104,7 +77,3 @@ public: return true; } }; - - - - diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index 3c38e372f..42576f632 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -5,17 +5,14 @@ -class cItemPickaxeHandler final: - public cItemHandler +class cItemPickaxeHandler final : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemPickaxeHandler(int a_ItemType): + public: + constexpr cItemPickaxeHandler(int a_ItemType) : Super(a_ItemType) { - } @@ -24,9 +21,9 @@ public: { switch (a_Action) { - case dlaAttackEntity: return 2; - case dlaBreakBlock: return 1; - case dlaBreakBlockInstant: return 0; + case dlaAttackEntity: return 2; + case dlaBreakBlock: return 1; + case dlaBreakBlockInstant: return 0; } UNREACHABLE("Unsupported durability loss action"); } @@ -43,7 +40,7 @@ public: case E_ITEM_IRON_PICKAXE: return 3; case E_ITEM_DIAMOND_PICKAXE: return 4; - default: return 0; + default: return 0; } } @@ -189,5 +186,4 @@ public: ASSERT(!"Something is wrong here... Maybe they are pickaxes out of a new material?"); return 1.0f; } - -} ; +}; diff --git a/src/Items/ItemPiston.h b/src/Items/ItemPiston.h index 8a1611a69..a4263b515 100644 --- a/src/Items/ItemPiston.h +++ b/src/Items/ItemPiston.h @@ -8,19 +8,30 @@ -class cItemPistonHandler final: - public cItemHandler +class cItemPistonHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), cBlockPistonHandler::DisplacementYawToMetaData(a_PlacePosition, a_Player.GetEyePosition(), a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + cBlockPistonHandler::DisplacementYawToMetaData( + a_PlacePosition, + a_Player.GetEyePosition(), + a_Player.GetYaw() + ) + ); } }; diff --git a/src/Items/ItemPlanks.h b/src/Items/ItemPlanks.h index 0bc079806..28f69b62f 100644 --- a/src/Items/ItemPlanks.h +++ b/src/Items/ItemPlanks.h @@ -7,19 +7,26 @@ -class cItemPlanksHandler final : - public cItemHandler +class cItemPlanksHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage) + ); } }; diff --git a/src/Items/ItemPoisonousPotato.h b/src/Items/ItemPoisonousPotato.h index 849633b5b..7e47f1713 100644 --- a/src/Items/ItemPoisonousPotato.h +++ b/src/Items/ItemPoisonousPotato.h @@ -7,14 +7,12 @@ -class cItemPoisonousPotatoHandler final: - public cItemFoodHandler +class cItemPoisonousPotatoHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemPoisonousPotatoHandler(int a_ItemType): + public: + constexpr cItemPoisonousPotatoHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(2, 1.2)) { } @@ -33,5 +31,4 @@ public: return true; } - }; diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h index 48841652d..dfd0b5a4b 100644 --- a/src/Items/ItemPotion.h +++ b/src/Items/ItemPotion.h @@ -4,13 +4,11 @@ #include "../Entities/EntityEffect.h" -class cItemPotionHandler final: - public cItemHandler +class cItemPotionHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -50,9 +48,22 @@ public: Vector3d Speed = a_Player->GetLookVector() * 14; // Play sound - a_World->BroadcastSoundEffect("entity.arrow.shoot", a_Player->GetPosition() - Vector3d(0, a_Player->GetHeight(), 0), 0.5f, 0.4f / GetRandomProvider().RandReal(0.8f, 1.2f)); + a_World->BroadcastSoundEffect( + "entity.arrow.shoot", + a_Player->GetPosition() - Vector3d(0, a_Player->GetHeight(), 0), + 0.5f, + 0.4f / GetRandomProvider().RandReal(0.8f, 1.2f) + ); - if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, cProjectileEntity::pkSplashPotion, a_Player, &a_Player->GetEquippedItem(), &Speed) == cEntity::INVALID_ID) + if (a_World->CreateProjectile( + Pos.x, + Pos.y, + Pos.z, + cProjectileEntity::pkSplashPotion, + a_Player, + &a_Player->GetEquippedItem(), + &Speed + ) == cEntity::INVALID_ID) { return false; } @@ -92,7 +103,3 @@ public: return true; } }; - - - - diff --git a/src/Items/ItemPumpkin.h b/src/Items/ItemPumpkin.h index 2effb4989..78d53b759 100644 --- a/src/Items/ItemPumpkin.h +++ b/src/Items/ItemPumpkin.h @@ -8,18 +8,21 @@ -class cItemPumpkinHandler final: - public cItemHandler +class cItemPumpkinHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // First try spawning a snow golem or an iron golem: if (TrySpawnGolem(a_Player, a_PlacePosition)) @@ -30,15 +33,17 @@ private: } // No golem at these coords, place the block normally: - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_PUMPKIN, cBlockPumpkinHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player + .PlaceBlock(a_PlacePosition, E_BLOCK_PUMPKIN, cBlockPumpkinHandler::YawToMetaData(a_Player.GetYaw())); } - /** Spawns a snow / iron golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin. - Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. */ + /** Spawns a snow / iron golem if the shape matches the recipe, supposing that the block placed at the specified + coords is a pumpkin. Returns true if the golem blocks are removed (for spawning), false if the recipe is not + matched. */ bool TrySpawnGolem(cPlayer & a_Player, const Vector3i a_PumpkinPos) const { // A golem can't form with a pumpkin below level 2 or above level 255: @@ -66,9 +71,9 @@ private: - /** Spawns a snow golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin. - Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. - Assumes that the block below the specified block has already been checked and is a snow block. */ + /** Spawns a snow golem if the shape matches the recipe, supposing that the block placed at the specified coords is + a pumpkin. Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. Assumes + that the block below the specified block has already been checked and is a snow block. */ bool TrySpawnSnowGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos) const { ASSERT(a_PumpkinPos.y > 1); @@ -81,14 +86,11 @@ private: } // Try to place air blocks where the original recipe blocks were: - if ( - !a_Player.PlaceBlocks( - { - { a_PumpkinPos, E_BLOCK_AIR, 0 }, // Head - { a_PumpkinPos.addedY(-1), E_BLOCK_AIR, 0 }, // Torso - { a_PumpkinPos.addedY(-2), E_BLOCK_AIR, 0 } // Legs - }) - ) + if (!a_Player.PlaceBlocks({ + {a_PumpkinPos, E_BLOCK_AIR, 0}, // Head + {a_PumpkinPos.addedY(-1), E_BLOCK_AIR, 0}, // Torso + {a_PumpkinPos.addedY(-2), E_BLOCK_AIR, 0} // Legs + })) { return false; } @@ -103,9 +105,9 @@ private: - /** Spawns an iron golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin. - Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. - Assumes that the block below the specified block has already been checked and is an iron block. */ + /** Spawns an iron golem if the shape matches the recipe, supposing that the block placed at the specified coords is + a pumpkin. Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. Assumes + that the block below the specified block has already been checked and is an iron block. */ bool TrySpawnIronGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos) const { ASSERT(a_PumpkinPos.y > 1); @@ -119,33 +121,27 @@ private: // Check the two arm directions (X, Z) using a loop over two sets of offset vectors: auto BodyPos = a_PumpkinPos.addedY(-1); - static const Vector3i ArmOffsets[] = - { + static const Vector3i ArmOffsets[] = { {1, 0, 0}, {0, 0, 1}, }; for (size_t i = 0; i < ARRAYCOUNT(ArmOffsets); i++) { // If the arm blocks don't match, bail out of this loop repetition: - if ( - (a_World.GetBlock(BodyPos + ArmOffsets[i]) != E_BLOCK_IRON_BLOCK) || - (a_World.GetBlock(BodyPos - ArmOffsets[i]) != E_BLOCK_IRON_BLOCK) - ) + if ((a_World.GetBlock(BodyPos + ArmOffsets[i]) != E_BLOCK_IRON_BLOCK) || + (a_World.GetBlock(BodyPos - ArmOffsets[i]) != E_BLOCK_IRON_BLOCK)) { continue; } // Try to place air blocks where the original recipe blocks were: - if ( - !a_Player.PlaceBlocks( - { - { a_PumpkinPos, E_BLOCK_AIR, 0 }, // Head - { BodyPos, E_BLOCK_AIR, 0 }, // Torso - { BodyPos.addedY(-1), E_BLOCK_AIR, 0 }, // Legs - { BodyPos + ArmOffsets[i], E_BLOCK_AIR, 0 }, // Arm - { BodyPos - ArmOffsets[i], E_BLOCK_AIR, 0 } // Arm - }) - ) + if (!a_Player.PlaceBlocks({ + {a_PumpkinPos, E_BLOCK_AIR, 0}, // Head + {BodyPos, E_BLOCK_AIR, 0}, // Torso + {BodyPos.addedY(-1), E_BLOCK_AIR, 0}, // Legs + {BodyPos + ArmOffsets[i], E_BLOCK_AIR, 0}, // Arm + {BodyPos - ArmOffsets[i], E_BLOCK_AIR, 0} // Arm + })) { return false; } diff --git a/src/Items/ItemQuartz.h b/src/Items/ItemQuartz.h index 5f49e76dc..e32b39330 100644 --- a/src/Items/ItemQuartz.h +++ b/src/Items/ItemQuartz.h @@ -7,17 +7,14 @@ -class cItemQuartzHandler final: - public cItemHandler +class cItemQuartzHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the pillar block's "base" to the block's metadata. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { @@ -45,7 +42,13 @@ private: } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { const auto Meta = static_cast<NIBBLETYPE>(a_Player.GetEquippedItem().m_ItemDamage); diff --git a/src/Items/ItemRail.h b/src/Items/ItemRail.h index a53f620b2..24c93d7b8 100644 --- a/src/Items/ItemRail.h +++ b/src/Items/ItemRail.h @@ -8,21 +8,28 @@ -class cItemRailHandler final : - public cItemHandler +class cItemRailHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { cChunkInterface ChunkInterface(a_Player.GetWorld()->GetChunkMap()); const auto RailType = static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType); - return a_Player.PlaceBlock(a_PlacePosition, RailType, cBlockRailHandler::FindMeta(ChunkInterface, a_PlacePosition, RailType)); + return a_Player.PlaceBlock( + a_PlacePosition, + RailType, + cBlockRailHandler::FindMeta(ChunkInterface, a_PlacePosition, RailType) + ); } }; diff --git a/src/Items/ItemRawChicken.h b/src/Items/ItemRawChicken.h index f3522b449..2bf067d71 100644 --- a/src/Items/ItemRawChicken.h +++ b/src/Items/ItemRawChicken.h @@ -7,14 +7,12 @@ -class cItemRawChickenHandler final: - public cItemFoodHandler +class cItemRawChickenHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemRawChickenHandler(int a_ItemType): + public: + constexpr cItemRawChickenHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(2, 1.2)) { } @@ -33,5 +31,4 @@ public: return true; } - }; diff --git a/src/Items/ItemRawFish.h b/src/Items/ItemRawFish.h index e741aa3e0..e6022b4a1 100644 --- a/src/Items/ItemRawFish.h +++ b/src/Items/ItemRawFish.h @@ -7,22 +7,19 @@ -class cItemRawFishHandler final: - public cItemFoodHandler +class cItemRawFishHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemRawFishHandler(int a_ItemType): + public: + constexpr cItemRawFishHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(0, 0)) { } virtual FoodInfo GetFoodInfo(const cItem * a_Item) const override { - static const FoodInfo RawFishInfos[] = - { + static const FoodInfo RawFishInfos[] = { FoodInfo(2, 0.4), // Raw fish FoodInfo(2, 0.2), // Raw salmon FoodInfo(1, 0.2), // Clownfish @@ -54,5 +51,4 @@ public: return true; } - }; diff --git a/src/Items/ItemRedstoneDust.h b/src/Items/ItemRedstoneDust.h index 803dd601d..cd96de3ac 100644 --- a/src/Items/ItemRedstoneDust.h +++ b/src/Items/ItemRedstoneDust.h @@ -7,20 +7,24 @@ -class cItemRedstoneDustHandler final: - public cItemHandler +class cItemRedstoneDustHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_REDSTONE_WIRE, 0); } @@ -29,12 +33,5 @@ public: - virtual bool IsPlaceable(void) const override - { - return true; - } -} ; - - - - + virtual bool IsPlaceable(void) const override { return true; } +}; diff --git a/src/Items/ItemRedstoneRepeater.h b/src/Items/ItemRedstoneRepeater.h index 2f20d294a..3980774e1 100644 --- a/src/Items/ItemRedstoneRepeater.h +++ b/src/Items/ItemRedstoneRepeater.h @@ -8,34 +8,35 @@ -class cItemRedstoneRepeaterHandler final : - public cItemHandler +class cItemRedstoneRepeaterHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_REDSTONE_REPEATER_OFF, cBlockRedstoneRepeaterHandler::YawToMetaData(a_Player.GetYaw())); + return a_Player.PlaceBlock( + a_PlacePosition, + E_BLOCK_REDSTONE_REPEATER_OFF, + cBlockRedstoneRepeaterHandler::YawToMetaData(a_Player.GetYaw()) + ); } - virtual bool IsPlaceable() const override - { - return true; - } -} ; - - - - + virtual bool IsPlaceable() const override { return true; } +}; diff --git a/src/Items/ItemRottenFlesh.h b/src/Items/ItemRottenFlesh.h index 9eb7f2119..0ec30ecf4 100644 --- a/src/Items/ItemRottenFlesh.h +++ b/src/Items/ItemRottenFlesh.h @@ -7,14 +7,12 @@ -class cItemRottenFleshHandler final: - public cItemFoodHandler +class cItemRottenFleshHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemRottenFleshHandler(int a_ItemType): + public: + constexpr cItemRottenFleshHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(4, 0.8)) { } @@ -33,5 +31,4 @@ public: return true; } - }; diff --git a/src/Items/ItemSapling.h b/src/Items/ItemSapling.h index 59fd81350..31572dad4 100644 --- a/src/Items/ItemSapling.h +++ b/src/Items/ItemSapling.h @@ -7,22 +7,28 @@ -class cItemSaplingHandler final : - public cItemHandler +class cItemSaplingHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock( a_PlacePosition, static_cast<BLOCKTYPE>(m_ItemType), - static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage & 0x07) // Allow only the lowest 3 bits (top bit is for growth). + static_cast<NIBBLETYPE>( + a_HeldItem.m_ItemDamage & 0x07 + ) // Allow only the lowest 3 bits (top bit is for growth). ); } -} ; +}; diff --git a/src/Items/ItemSeeds.h b/src/Items/ItemSeeds.h index 821afb443..f9879764a 100644 --- a/src/Items/ItemSeeds.h +++ b/src/Items/ItemSeeds.h @@ -8,24 +8,27 @@ -class cItemSeedsHandler: - public cItemHandler +class cItemSeedsHandler : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemSeedsHandler(int a_ItemType): + public: + constexpr cItemSeedsHandler(int a_ItemType) : Super(a_ItemType) { - } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Only allow planting seeds from the top side of the block: if (a_ClickedBlockFace != BLOCK_FACE_TOP) @@ -38,12 +41,12 @@ public: // Get the produce block based on the seed item: switch (m_ItemType) { - case E_ITEM_BEETROOT_SEEDS: BlockType = E_BLOCK_BEETROOTS; break; - case E_ITEM_CARROT: BlockType = E_BLOCK_CARROTS; break; - case E_ITEM_MELON_SEEDS: BlockType = E_BLOCK_MELON_STEM; break; - case E_ITEM_POTATO: BlockType = E_BLOCK_POTATOES; break; + case E_ITEM_BEETROOT_SEEDS: BlockType = E_BLOCK_BEETROOTS; break; + case E_ITEM_CARROT: BlockType = E_BLOCK_CARROTS; break; + case E_ITEM_MELON_SEEDS: BlockType = E_BLOCK_MELON_STEM; break; + case E_ITEM_POTATO: BlockType = E_BLOCK_POTATOES; break; case E_ITEM_PUMPKIN_SEEDS: BlockType = E_BLOCK_PUMPKIN_STEM; break; - case E_ITEM_SEEDS: BlockType = E_BLOCK_CROPS; break; + case E_ITEM_SEEDS: BlockType = E_BLOCK_CROPS; break; default: UNREACHABLE("Unsupported seed type"); } @@ -54,20 +57,13 @@ public: - virtual bool IsPlaceable(void) const override - { - return true; - } + virtual bool IsPlaceable(void) const override { return true; } -protected: + protected: ~cItemSeedsHandler() = default; -} ; +}; -class cItemSimpleSeedsHandler final: - public cItemSeedsHandler +class cItemSimpleSeedsHandler final : public cItemSeedsHandler { using cItemSeedsHandler::cItemSeedsHandler; }; - - - diff --git a/src/Items/ItemShears.h b/src/Items/ItemShears.h index 5f8e9e2f1..31016b8ae 100644 --- a/src/Items/ItemShears.h +++ b/src/Items/ItemShears.h @@ -9,13 +9,11 @@ -class cItemShearsHandler final: - public cItemHandler +class cItemShearsHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; @@ -69,9 +67,9 @@ public: { switch (a_Action) { - case dlaAttackEntity: return 0; - case dlaBreakBlock: return 0; - case dlaBreakBlockInstant: return 1; + case dlaAttackEntity: return 0; + case dlaBreakBlock: return 0; + case dlaBreakBlockInstant: return 1; } UNREACHABLE("Unsupported durability loss action"); } @@ -95,4 +93,4 @@ public: return Super::GetBlockBreakingStrength(a_Block); } } -} ; +}; diff --git a/src/Items/ItemShovel.h b/src/Items/ItemShovel.h index 1be2aa6cc..e659ff892 100644 --- a/src/Items/ItemShovel.h +++ b/src/Items/ItemShovel.h @@ -12,13 +12,11 @@ -class cItemShovelHandler final: - public cItemHandler +class cItemShovelHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; diff --git a/src/Items/ItemSideways.h b/src/Items/ItemSideways.h index c1d68c1a6..d273eb93d 100644 --- a/src/Items/ItemSideways.h +++ b/src/Items/ItemSideways.h @@ -11,17 +11,14 @@ /** Handler for blocks that have 3 orientations (hay bale, log), specified by the upper 2 bits in meta. Handles setting the correct orientation on placement. Additionally supports the metadata specifying block sub-type in its lower 2 bits. */ -class cItemSidewaysHandler final : - public cItemHandler +class cItemSidewaysHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace, NIBBLETYPE a_Meta) { switch (a_BlockFace) @@ -46,8 +43,18 @@ private: } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), BlockFaceToMetaData(a_ClickedBlockFace, static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage))); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + BlockFaceToMetaData(a_ClickedBlockFace, static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)) + ); } }; diff --git a/src/Items/ItemSign.h b/src/Items/ItemSign.h index 8cda673dd..4c40a757d 100644 --- a/src/Items/ItemSign.h +++ b/src/Items/ItemSign.h @@ -9,17 +9,14 @@ -class cItemSignHandler final: - public cItemHandler +class cItemSignHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the neighbor to which the wallsign is attached to the wallsign block's meta. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace) { @@ -40,7 +37,13 @@ private: } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { if (a_ClickedBlockFace == BLOCK_FACE_TOP) { @@ -60,10 +63,7 @@ private: } - virtual bool IsPlaceable(void) const override - { - return true; - } + virtual bool IsPlaceable(void) const override { return true; } /** Converts the (player) rotation to placed-signpost block meta. */ @@ -79,8 +79,4 @@ private: return static_cast<NIBBLETYPE>(a_Rotation) % 16; } -} ; - - - - +}; diff --git a/src/Items/ItemSlab.h b/src/Items/ItemSlab.h index e0a405fe0..678106a65 100644 --- a/src/Items/ItemSlab.h +++ b/src/Items/ItemSlab.h @@ -7,25 +7,32 @@ -class cItemSlabHandler final: - public cItemHandler +class cItemSlabHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { // Confer BlockSlab.h, which we're in cahoots with to make the below logic work. // If clicking a slab, combine it into a double-slab: if (cBlockSlabHandler::IsAnySlabType(a_Player.GetWorld()->GetBlock(a_PlacePosition))) { - if (!a_Player.PlaceBlock(a_PlacePosition, GetDoubleSlabType(static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType)), static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage))) + if (!a_Player.PlaceBlock( + a_PlacePosition, + GetDoubleSlabType(static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType)), + static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage) + )) { return false; } @@ -35,7 +42,11 @@ private: } // Set the correct metadata based on player equipped item: - if (!a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), FaceToMetaData(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage), a_ClickedBlockFace, a_CursorPosition))) + if (!a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + FaceToMetaData(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage), a_ClickedBlockFace, a_CursorPosition) + )) { return false; } @@ -50,7 +61,11 @@ private: } - static NIBBLETYPE FaceToMetaData(const NIBBLETYPE a_BaseMeta, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) + static NIBBLETYPE FaceToMetaData( + const NIBBLETYPE a_BaseMeta, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) { switch (a_ClickedBlockFace) { @@ -90,10 +105,10 @@ private: { switch (a_SingleSlabBlockType) { - case E_BLOCK_STONE_SLAB: return E_BLOCK_DOUBLE_STONE_SLAB; - case E_BLOCK_WOODEN_SLAB: return E_BLOCK_DOUBLE_WOODEN_SLAB; + case E_BLOCK_STONE_SLAB: return E_BLOCK_DOUBLE_STONE_SLAB; + case E_BLOCK_WOODEN_SLAB: return E_BLOCK_DOUBLE_WOODEN_SLAB; case E_BLOCK_RED_SANDSTONE_SLAB: return E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB; - case E_BLOCK_PURPUR_SLAB: return E_BLOCK_PURPUR_DOUBLE_SLAB; + case E_BLOCK_PURPUR_SLAB: return E_BLOCK_PURPUR_DOUBLE_SLAB; } UNREACHABLE("Unhandled slab type"); } diff --git a/src/Items/ItemSnow.h b/src/Items/ItemSnow.h index 87fa71e5f..ff79b2863 100644 --- a/src/Items/ItemSnow.h +++ b/src/Items/ItemSnow.h @@ -7,18 +7,21 @@ -class cItemSnowHandler final : - public cItemHandler +class cItemSnowHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { BLOCKTYPE Block; NIBBLETYPE Meta; diff --git a/src/Items/ItemSoup.h b/src/Items/ItemSoup.h index 974a410a8..9d0f5f36f 100644 --- a/src/Items/ItemSoup.h +++ b/src/Items/ItemSoup.h @@ -8,17 +8,14 @@ -class cItemSoupHandler final: - public cItemFoodHandler +class cItemSoupHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo): + public: + constexpr cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo) : Super(a_ItemType, a_FoodInfo) { - } virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) const override @@ -36,5 +33,4 @@ public: return true; } - }; diff --git a/src/Items/ItemSpawnEgg.h b/src/Items/ItemSpawnEgg.h index 639a3e273..df5fd19fd 100644 --- a/src/Items/ItemSpawnEgg.h +++ b/src/Items/ItemSpawnEgg.h @@ -9,13 +9,11 @@ -class cItemSpawnEggHandler final: - public cItemHandler +class cItemSpawnEggHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; virtual bool OnItemUse( @@ -40,9 +38,9 @@ public: } auto MonsterType = ItemDamageToMonsterType(a_HeldItem.m_ItemDamage); - if ( - (MonsterType != mtInvalidType) && // Valid monster type - (a_World->SpawnMob(PlacementPos.x + 0.5, PlacementPos.y, PlacementPos.z + 0.5, MonsterType, false) != cEntity::INVALID_ID)) // Spawning succeeded + if ((MonsterType != mtInvalidType) && // Valid monster type + (a_World->SpawnMob(PlacementPos.x + 0.5, PlacementPos.y, PlacementPos.z + 0.5, MonsterType, false) != + cEntity::INVALID_ID)) // Spawning succeeded { if (!a_Player->IsGameModeCreative()) { @@ -94,7 +92,7 @@ public: case E_META_SPAWN_EGG_ZOMBIE: return mtZombie; case E_META_SPAWN_EGG_ZOMBIE_PIGMAN: return mtZombiePigman; case E_META_SPAWN_EGG_ZOMBIE_VILLAGER: return mtZombieVillager; - default: return mtInvalidType; + default: return mtInvalidType; } } -} ; +}; diff --git a/src/Items/ItemSpiderEye.h b/src/Items/ItemSpiderEye.h index 63631e30c..0f420d1b9 100644 --- a/src/Items/ItemSpiderEye.h +++ b/src/Items/ItemSpiderEye.h @@ -7,14 +7,12 @@ -class cItemSpiderEyeHandler final: - public cItemFoodHandler +class cItemSpiderEyeHandler final : public cItemFoodHandler { using Super = cItemFoodHandler; -public: - - constexpr cItemSpiderEyeHandler(int a_ItemType): + public: + constexpr cItemSpiderEyeHandler(int a_ItemType) : Super(a_ItemType, FoodInfo(2, 3.2)) { } @@ -30,5 +28,4 @@ public: return true; } - }; diff --git a/src/Items/ItemStairs.h b/src/Items/ItemStairs.h index 8a937ae56..745199cb9 100644 --- a/src/Items/ItemStairs.h +++ b/src/Items/ItemStairs.h @@ -8,25 +8,30 @@ -class cItemStairsHandler final : - public cItemHandler +class cItemStairsHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { NIBBLETYPE Meta = cBlockStairsHandler::YawToMetaData(a_Player.GetYaw()); switch (a_ClickedBlockFace) { - case BLOCK_FACE_TOP: break; - case BLOCK_FACE_BOTTOM: Meta |= 0x4; break; // When placing onto a bottom face, always place an upside-down stairs block. + case BLOCK_FACE_TOP: break; + case BLOCK_FACE_BOTTOM: + Meta |= 0x4; + break; // When placing onto a bottom face, always place an upside-down stairs block. case BLOCK_FACE_EAST: case BLOCK_FACE_NORTH: case BLOCK_FACE_SOUTH: diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index ddc6632e4..83ec32c19 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -8,13 +8,11 @@ -class cItemSwordHandler final : - public cItemHandler +class cItemSwordHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) const override @@ -45,9 +43,9 @@ public: { switch (a_Action) { - case dlaAttackEntity: return 1; - case dlaBreakBlock: return 2; - case dlaBreakBlockInstant: return 0; + case dlaAttackEntity: return 1; + case dlaBreakBlock: return 2; + case dlaBreakBlockInstant: return 0; } UNREACHABLE("Unsupported durability loss action"); } @@ -62,12 +60,8 @@ public: } else { - if ( - IsBlockMaterialPlants(a_Block) || - IsBlockMaterialVine(a_Block) || - IsBlockMaterialLeaves(a_Block) || - IsBlockMaterialGourd(a_Block) - ) + if (IsBlockMaterialPlants(a_Block) || IsBlockMaterialVine(a_Block) || IsBlockMaterialLeaves(a_Block) || + IsBlockMaterialGourd(a_Block)) { return 1.5f; } @@ -77,5 +71,4 @@ public: } } } - -} ; +}; diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h index 65f44c72a..06a5478ae 100644 --- a/src/Items/ItemThrowable.h +++ b/src/Items/ItemThrowable.h @@ -10,17 +10,13 @@ -class cItemThrowableHandler: - public cItemHandler +class cItemThrowableHandler : public cItemHandler { using Super = cItemHandler; -public: - - constexpr cItemThrowableHandler(int a_ItemType, cProjectileEntity::eKind a_ProjectileKind, double a_SpeedCoeff): - Super(a_ItemType), - m_ProjectileKind(a_ProjectileKind), - m_SpeedCoeff(a_SpeedCoeff) + public: + constexpr cItemThrowableHandler(int a_ItemType, cProjectileEntity::eKind a_ProjectileKind, double a_SpeedCoeff) : + Super(a_ItemType), m_ProjectileKind(a_ProjectileKind), m_SpeedCoeff(a_SpeedCoeff) { } @@ -41,13 +37,26 @@ public: auto Speed = a_Player->GetLookVector() * m_SpeedCoeff; // Create the projectile: - if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, &a_Player->GetEquippedItem(), &Speed) == cEntity::INVALID_ID) + if (a_World->CreateProjectile( + Pos.x, + Pos.y, + Pos.z, + m_ProjectileKind, + a_Player, + &a_Player->GetEquippedItem(), + &Speed + ) == cEntity::INVALID_ID) { return false; } // Play sound: - a_World->BroadcastSoundEffect("entity.arrow.shoot", a_Player->GetPosition() - Vector3d(0, a_Player->GetHeight(), 0), 0.5f, 0.4f / GetRandomProvider().RandReal(0.8f, 1.2f)); + a_World->BroadcastSoundEffect( + "entity.arrow.shoot", + a_Player->GetPosition() - Vector3d(0, a_Player->GetHeight(), 0), + 0.5f, + 0.4f / GetRandomProvider().RandReal(0.8f, 1.2f) + ); // Remove from inventory if (!a_Player->IsGameModeCreative()) @@ -58,8 +67,7 @@ public: return true; } -protected: - + protected: /** The kind of projectile to create when shooting */ cProjectileEntity::eKind m_ProjectileKind; @@ -67,70 +75,62 @@ protected: double m_SpeedCoeff; ~cItemThrowableHandler() = default; -} ; +}; -class cItemEggHandler final: - public cItemThrowableHandler +class cItemEggHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemEggHandler(int a_ItemType): + public: + constexpr cItemEggHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkEgg, 30) { } -} ; +}; -class cItemSnowballHandler final: - public cItemThrowableHandler +class cItemSnowballHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemSnowballHandler(int a_ItemType): + public: + constexpr cItemSnowballHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkSnowball, 30) { } -} ; +}; -class cItemEnderPearlHandler final: - public cItemThrowableHandler +class cItemEnderPearlHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemEnderPearlHandler(int a_ItemType): + public: + constexpr cItemEnderPearlHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkEnderPearl, 30) { } -} ; +}; -class cItemBottleOEnchantingHandler final : - public cItemThrowableHandler +class cItemBottleOEnchantingHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemBottleOEnchantingHandler(int a_ItemType): + public: + constexpr cItemBottleOEnchantingHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkExpBottle, 14) { } @@ -140,14 +140,12 @@ public: -class cItemFireworkHandler final: - public cItemThrowableHandler +class cItemFireworkHandler final : public cItemThrowableHandler { using Super = cItemThrowableHandler; -public: - - constexpr cItemFireworkHandler(int a_ItemType): + public: + constexpr cItemFireworkHandler(int a_ItemType) : Super(a_ItemType, cProjectileEntity::pkFirework, 0) { } @@ -170,7 +168,12 @@ public: return false; } - if (a_World->CreateProjectile(Vector3d(a_ClickedBlockPos) + Vector3d(0.5, 1, 0.5), m_ProjectileKind, a_Player, &a_Player->GetEquippedItem()) == 0) + if (a_World->CreateProjectile( + Vector3d(a_ClickedBlockPos) + Vector3d(0.5, 1, 0.5), + m_ProjectileKind, + a_Player, + &a_Player->GetEquippedItem() + ) == 0) { return false; } diff --git a/src/Items/ItemTorch.h b/src/Items/ItemTorch.h index 753ac09a9..ccba2a179 100644 --- a/src/Items/ItemTorch.h +++ b/src/Items/ItemTorch.h @@ -8,38 +8,45 @@ -class cItemTorchHandler final : - public cItemHandler +class cItemTorchHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: /** Converts the block face of the neighbor to which the torch is attached, to the torch block's meta. */ static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { switch (a_BlockFace) { - case BLOCK_FACE_TOP: return E_META_TORCH_FLOOR; - case BLOCK_FACE_EAST: return E_META_TORCH_EAST; - case BLOCK_FACE_WEST: return E_META_TORCH_WEST; - case BLOCK_FACE_NORTH: return E_META_TORCH_NORTH; - case BLOCK_FACE_SOUTH: return E_META_TORCH_SOUTH; - default: UNREACHABLE("Unsupported block face"); + case BLOCK_FACE_TOP: return E_META_TORCH_FLOOR; + case BLOCK_FACE_EAST: return E_META_TORCH_EAST; + case BLOCK_FACE_WEST: return E_META_TORCH_WEST; + case BLOCK_FACE_NORTH: return E_META_TORCH_NORTH; + case BLOCK_FACE_SOUTH: return E_META_TORCH_SOUTH; + default: UNREACHABLE("Unsupported block face"); } } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { const auto & World = *a_Player.GetWorld(); BLOCKTYPE ClickedBlockType; NIBBLETYPE ClickedBlockMeta; - World.GetBlockTypeMeta(AddFaceDirection(a_PlacePosition, a_ClickedBlockFace, true), ClickedBlockType, ClickedBlockMeta); + World.GetBlockTypeMeta( + AddFaceDirection(a_PlacePosition, a_ClickedBlockFace, true), + ClickedBlockType, + ClickedBlockMeta + ); // Try finding a suitable neighbor block face for the torch; start with the given one: if (!cBlockTorchHandler::CanBePlacedOn(ClickedBlockType, ClickedBlockMeta, a_ClickedBlockFace)) @@ -53,7 +60,11 @@ private: } } - return a_Player.PlaceBlock(a_PlacePosition, static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), BlockFaceToMetaData(a_ClickedBlockFace)); + return a_Player.PlaceBlock( + a_PlacePosition, + static_cast<BLOCKTYPE>(a_HeldItem.m_ItemType), + BlockFaceToMetaData(a_ClickedBlockFace) + ); } @@ -61,7 +72,9 @@ private: Returns BLOCK_FACE_NONE on failure. */ static eBlockFace FindSuitableFace(const cWorld & a_World, const Vector3i a_Position) { - for (const auto Face : { BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM, BLOCK_FACE_YP }) // Loop through all faces in specific order. + for (const auto Face : + {BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM, BLOCK_FACE_YP + }) // Loop through all faces in specific order. { // The direction of Face is relative to the direction the torch faces. // This is the position, computed inverted, that such a torch would attach to. diff --git a/src/Items/ItemTrapdoor.h b/src/Items/ItemTrapdoor.h index 337e8ea15..c5c23d036 100644 --- a/src/Items/ItemTrapdoor.h +++ b/src/Items/ItemTrapdoor.h @@ -8,17 +8,14 @@ -class cItemTrapdoorHandler final : - public cItemHandler +class cItemTrapdoorHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { switch (a_BlockFace) @@ -27,12 +24,18 @@ private: case BLOCK_FACE_ZM: return 0x0; case BLOCK_FACE_XP: return 0x3; case BLOCK_FACE_XM: return 0x2; - default: UNREACHABLE("Unsupported block face"); + default: UNREACHABLE("Unsupported block face"); } } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { NIBBLETYPE Meta; diff --git a/src/Items/ItemTripwireHook.h b/src/Items/ItemTripwireHook.h index b30f3c85c..10d26c741 100644 --- a/src/Items/ItemTripwireHook.h +++ b/src/Items/ItemTripwireHook.h @@ -7,17 +7,14 @@ -class cItemTripwireHookHandler final : - public cItemHandler +class cItemTripwireHookHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - + private: static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { switch (a_BlockFace) @@ -26,12 +23,18 @@ private: case BLOCK_FACE_XP: return 0x3; case BLOCK_FACE_ZM: return 0x2; case BLOCK_FACE_ZP: return 0x0; - default: UNREACHABLE("Unsupported block face"); + default: UNREACHABLE("Unsupported block face"); } } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { if ((a_ClickedBlockFace == BLOCK_FACE_YP) || (a_ClickedBlockFace == BLOCK_FACE_YM)) { diff --git a/src/Items/ItemVines.h b/src/Items/ItemVines.h index 07b6ec23e..d863a5e0f 100644 --- a/src/Items/ItemVines.h +++ b/src/Items/ItemVines.h @@ -7,18 +7,21 @@ -class cItemVinesHandler final : - public cItemHandler +class cItemVinesHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: using Super::Super; -private: - - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + private: + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { BLOCKTYPE Block; NIBBLETYPE Meta; @@ -31,7 +34,7 @@ private: case BLOCK_FACE_SOUTH: PlaceMeta = 0x4; break; case BLOCK_FACE_WEST: PlaceMeta = 0x8; break; case BLOCK_FACE_EAST: PlaceMeta = 0x2; break; - default: return false; + default: return false; } if (Block == E_BLOCK_VINES) diff --git a/src/Items/SimplePlaceableItemHandler.h b/src/Items/SimplePlaceableItemHandler.h index 2bfe756af..fa4eb6d8f 100644 --- a/src/Items/SimplePlaceableItemHandler.h +++ b/src/Items/SimplePlaceableItemHandler.h @@ -6,32 +6,31 @@ -class cSimplePlaceableItemHandler final: - public cItemHandler +class cSimplePlaceableItemHandler final : public cItemHandler { using Super = cItemHandler; -public: - + public: constexpr cSimplePlaceableItemHandler(int a_ItemType, BLOCKTYPE a_BlockType) : - Super(a_ItemType), - m_BlockType(a_BlockType) + Super(a_ItemType), m_BlockType(a_BlockType) { } - virtual bool IsPlaceable(void) const override - { - return true; - } + virtual bool IsPlaceable(void) const override { return true; } - virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override + virtual bool CommitPlacement( + cPlayer & a_Player, + const cItem & a_HeldItem, + const Vector3i a_PlacePosition, + const eBlockFace a_ClickedBlockFace, + const Vector3i a_CursorPosition + ) const override { return a_Player.PlaceBlock(a_PlacePosition, m_BlockType, 0); } -private: - + private: BLOCKTYPE m_BlockType; }; |