diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2022-01-02 12:56:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-02 12:56:36 +0100 |
commit | c52f299e724bf893944553ac3aeedf7bf0a58241 (patch) | |
tree | 071ed4a45a7054231f60a9dd705dc4d69d10e6c6 | |
parent | WriteBlockEntity: don't write position multiple times (#5373) (diff) | |
download | cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar.gz cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar.bz2 cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar.lz cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar.xz cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.tar.zst cuberite-c52f299e724bf893944553ac3aeedf7bf0a58241.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockEnderChest.h (renamed from src/Blocks/BlockEnderchest.h) | 6 | ||||
-rw-r--r-- | src/Blocks/BlockHandler.cpp | 42 | ||||
-rw-r--r-- | src/Blocks/BlockRedstoneWire.h (renamed from src/Blocks/BlockRedstone.h) | 2 | ||||
-rw-r--r-- | src/Blocks/BlockSugarCane.h (renamed from src/Blocks/BlockSugarcane.h) | 2 | ||||
-rw-r--r-- | src/Blocks/BlockVines.h (renamed from src/Blocks/BlockVine.h) | 2 | ||||
-rw-r--r-- | src/Blocks/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/Items/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Items/ItemComparator.h | 15 | ||||
-rw-r--r-- | src/Items/ItemDefaultItem.h | 7 | ||||
-rw-r--r-- | src/Items/ItemEnderChest.h (renamed from src/Items/ItemEnderchest.h) | 6 | ||||
-rw-r--r-- | src/Items/ItemHandler.cpp | 74 | ||||
-rw-r--r-- | src/Items/ItemVines.h (renamed from src/Items/ItemVine.h) | 2 |
12 files changed, 81 insertions, 89 deletions
diff --git a/src/Blocks/BlockEnderchest.h b/src/Blocks/BlockEnderChest.h index aae16ccec..2e0da0f17 100644 --- a/src/Blocks/BlockEnderchest.h +++ b/src/Blocks/BlockEnderChest.h @@ -6,7 +6,7 @@ -class cBlockEnderchestHandler final : +class cBlockEnderChestHandler final : public cYawRotator<cBlockEntityHandler, 0x07, 0x03, 0x04, 0x02, 0x05> { using Super = cYawRotator<cBlockEntityHandler, 0x07, 0x03, 0x04, 0x02, 0x05>; @@ -38,7 +38,3 @@ private: } }; - - - - diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index 2ce7904ab..937f800fd 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -33,7 +33,7 @@ #include "BlockDropSpenser.h" #include "BlockEnchantingTable.h" #include "BlockEndPortalFrame.h" -#include "BlockEnderchest.h" +#include "BlockEnderChest.h" #include "BlockEntity.h" #include "BlockFarmland.h" #include "BlockFence.h" @@ -75,7 +75,7 @@ #include "BlockPumpkin.h" #include "BlockQuartz.h" #include "BlockRail.h" -#include "BlockRedstone.h" +#include "BlockRedstoneWire.h" #include "BlockRedstoneLamp.h" #include "BlockRedstoneOre.h" #include "BlockRedstoneRepeater.h" @@ -91,14 +91,14 @@ #include "BlockStairs.h" #include "BlockStems.h" #include "BlockStone.h" -#include "BlockSugarcane.h" +#include "BlockSugarCane.h" #include "BlockTNT.h" #include "BlockTallGrass.h" #include "BlockTorch.h" #include "BlockTrapdoor.h" #include "BlockTripwire.h" #include "BlockTripwireHook.h" -#include "BlockVine.h" +#include "BlockVines.h" #include "BlockWallSign.h" #include "BlockWorkbench.h" @@ -215,14 +215,14 @@ namespace constexpr cBlockStairsHandler BlockBirchWoodStairsHandler (E_BLOCK_BIRCH_WOOD_STAIRS); constexpr cBlockGlazedTerracottaHandler BlockBlackGlazedTerracottaHandler (E_BLOCK_BLACK_GLAZED_TERRACOTTA); constexpr cDefaultBlockHandler BlockBlackShulkerBoxHandler (E_BLOCK_BLACK_SHULKER_BOX); - constexpr cDefaultBlockHandler BlockBlockOfCoalHandler (E_BLOCK_BLOCK_OF_COAL); - constexpr cDefaultBlockHandler BlockBlockOfRedstoneHandler (E_BLOCK_BLOCK_OF_REDSTONE); + constexpr cDefaultBlockHandler BlockCoalBlockHandler (E_BLOCK_BLOCK_OF_COAL); + constexpr cDefaultBlockHandler BlockRedstoneBlockHandler (E_BLOCK_BLOCK_OF_REDSTONE); constexpr cBlockGlazedTerracottaHandler BlockBlueGlazedTerracottaHandler (E_BLOCK_BLUE_GLAZED_TERRACOTTA); constexpr cDefaultBlockHandler BlockBlueShulkerBoxHandler (E_BLOCK_BLUE_SHULKER_BOX); constexpr cDefaultBlockHandler BlockBoneBlockHandler (E_BLOCK_BONE_BLOCK); constexpr cBlockBookShelfHandler BlockBookcaseHandler (E_BLOCK_BOOKCASE); constexpr cBlockBrewingStandHandler BlockBrewingStandHandler (E_BLOCK_BREWING_STAND); - constexpr cDefaultBlockHandler BlockBrickHandler (E_BLOCK_BRICK); + constexpr cDefaultBlockHandler BlockBricksHandler (E_BLOCK_BRICK); constexpr cBlockStairsHandler BlockBrickStairsHandler (E_BLOCK_BRICK_STAIRS); constexpr cBlockGlazedTerracottaHandler BlockBrownGlazedTerracottaHandler (E_BLOCK_BROWN_GLAZED_TERRACOTTA); constexpr cBlockMushroomHandler BlockBrownMushroomHandler (E_BLOCK_BROWN_MUSHROOM); @@ -274,7 +274,7 @@ namespace constexpr cDefaultBlockHandler BlockEndPortalHandler (E_BLOCK_END_PORTAL); constexpr cDefaultBlockHandler BlockEndRodHandler (E_BLOCK_END_ROD); constexpr cDefaultBlockHandler BlockEndStoneHandler (E_BLOCK_END_STONE); - constexpr cBlockEnderchestHandler BlockEnderChestHandler (E_BLOCK_ENDER_CHEST); + constexpr cBlockEnderChestHandler BlockEnderChestHandler (E_BLOCK_ENDER_CHEST); constexpr cBlockFarmlandHandler BlockFarmlandHandler (E_BLOCK_FARMLAND); constexpr cBlockFenceHandler BlockFenceHandler (E_BLOCK_FENCE); constexpr cBlockFireHandler BlockFireHandler (E_BLOCK_FIRE); @@ -339,7 +339,7 @@ namespace constexpr cDefaultBlockHandler BlockMossyCobblestoneHandler (E_BLOCK_MOSSY_COBBLESTONE); constexpr cBlockMyceliumHandler BlockMyceliumHandler (E_BLOCK_MYCELIUM); constexpr cBlockFenceHandler BlockNetherBrickFenceHandler (E_BLOCK_NETHER_BRICK_FENCE); - constexpr cDefaultBlockHandler BlockNetherBrickHandler (E_BLOCK_NETHER_BRICK); + constexpr cDefaultBlockHandler BlockNetherBricksHandler (E_BLOCK_NETHER_BRICK); constexpr cBlockStairsHandler BlockNetherBrickStairsHandler (E_BLOCK_NETHER_BRICK_STAIRS); constexpr cBlockPortalHandler BlockNetherPortalHandler (E_BLOCK_NETHER_PORTAL); constexpr cDefaultOreHandler BlockNetherQuartzOreHandler (E_BLOCK_NETHER_QUARTZ_ORE); @@ -380,7 +380,7 @@ namespace constexpr cBlockRailHandler BlockRailHandler (E_BLOCK_RAIL); constexpr cBlockGlazedTerracottaHandler BlockRedGlazedTerracottaHandler (E_BLOCK_RED_GLAZED_TERRACOTTA); constexpr cBlockMushroomHandler BlockRedMushroomHandler (E_BLOCK_RED_MUSHROOM); - constexpr cDefaultBlockHandler BlockRedNetherBrickHandler (E_BLOCK_RED_NETHER_BRICK); + constexpr cDefaultBlockHandler BlockRedNetherBricksHandler (E_BLOCK_RED_NETHER_BRICK); constexpr cBlockFlowerHandler BlockRedRoseHandler (E_BLOCK_RED_ROSE); constexpr cDefaultBlockHandler BlockRedSandstoneHandler (E_BLOCK_RED_SANDSTONE); constexpr cBlockSlabHandler BlockRedSandstoneSlabHandler (E_BLOCK_RED_SANDSTONE_SLAB); @@ -393,7 +393,7 @@ namespace constexpr cBlockRedstoneRepeaterHandler BlockRedstoneRepeaterOnHandler (E_BLOCK_REDSTONE_REPEATER_ON); constexpr cBlockRedstoneTorchHandler BlockRedstoneTorchOffHandler (E_BLOCK_REDSTONE_TORCH_OFF); constexpr cBlockRedstoneTorchHandler BlockRedstoneTorchOnHandler (E_BLOCK_REDSTONE_TORCH_ON); - constexpr cBlockRedstoneHandler BlockRedstoneWireHandler (E_BLOCK_REDSTONE_WIRE); + constexpr cBlockRedstoneWireHandler BlockRedstoneWireHandler (E_BLOCK_REDSTONE_WIRE); constexpr cBlockCommandBlockHandler BlockRepeatingCommandBlockHandler (E_BLOCK_REPEATING_COMMAND_BLOCK); constexpr cBlockSandHandler BlockSandHandler (E_BLOCK_SAND); constexpr cDefaultBlockHandler BlockSandstoneHandler (E_BLOCK_SANDSTONE); @@ -425,15 +425,15 @@ namespace constexpr cBlockSlabHandler BlockStoneSlabHandler (E_BLOCK_STONE_SLAB); constexpr cDefaultBlockHandler BlockStructureBlockHandler (E_BLOCK_STRUCTURE_BLOCK); constexpr cDefaultBlockHandler BlockStructureVoidHandler (E_BLOCK_STRUCTURE_VOID); - constexpr cBlockSugarcaneHandler BlockSugarcaneHandler (E_BLOCK_SUGARCANE); + constexpr cBlockSugarCaneHandler BlockSugarCaneHandler (E_BLOCK_SUGARCANE); constexpr cBlockTallGrassHandler BlockTallGrassHandler (E_BLOCK_TALL_GRASS); - constexpr cBlockTNTHandler BlockTntHandler (E_BLOCK_TNT); + constexpr cBlockTNTHandler BlockTNTHandler (E_BLOCK_TNT); constexpr cBlockTorchHandler BlockTorchHandler (E_BLOCK_TORCH); constexpr cBlockTrapdoorHandler BlockTrapdoorHandler (E_BLOCK_TRAPDOOR); constexpr cBlockChestHandler BlockTrappedChestHandler (E_BLOCK_TRAPPED_CHEST); constexpr cBlockTripwireHandler BlockTripwireHandler (E_BLOCK_TRIPWIRE); constexpr cBlockTripwireHookHandler BlockTripwireHookHandler (E_BLOCK_TRIPWIRE_HOOK); - constexpr cBlockVineHandler BlockVinesHandler (E_BLOCK_VINES); + constexpr cBlockVinesHandler BlockVinesHandler (E_BLOCK_VINES); constexpr cBlockBannerHandler BlockWallBannerHandler (E_BLOCK_WALL_BANNER); constexpr cBlockWallSignHandler BlockWallsignHandler (E_BLOCK_WALLSIGN); constexpr cBlockWaterHandler BlockWaterHandler (E_BLOCK_WATER); @@ -655,14 +655,14 @@ const cBlockHandler & cBlockHandler::For(BLOCKTYPE a_BlockType) case E_BLOCK_BIRCH_WOOD_STAIRS: return BlockBirchWoodStairsHandler; case E_BLOCK_BLACK_GLAZED_TERRACOTTA: return BlockBlackGlazedTerracottaHandler; case E_BLOCK_BLACK_SHULKER_BOX: return BlockBlackShulkerBoxHandler; - case E_BLOCK_BLOCK_OF_COAL: return BlockBlockOfCoalHandler; - case E_BLOCK_BLOCK_OF_REDSTONE: return BlockBlockOfRedstoneHandler; + case E_BLOCK_BLOCK_OF_COAL: return BlockCoalBlockHandler; + case E_BLOCK_BLOCK_OF_REDSTONE: return BlockRedstoneBlockHandler; case E_BLOCK_BLUE_GLAZED_TERRACOTTA: return BlockBlueGlazedTerracottaHandler; case E_BLOCK_BLUE_SHULKER_BOX: return BlockBlueShulkerBoxHandler; case E_BLOCK_BONE_BLOCK: return BlockBoneBlockHandler; case E_BLOCK_BOOKCASE: return BlockBookcaseHandler; case E_BLOCK_BREWING_STAND: return BlockBrewingStandHandler; - case E_BLOCK_BRICK: return BlockBrickHandler; + case E_BLOCK_BRICK: return BlockBricksHandler; case E_BLOCK_BRICK_STAIRS: return BlockBrickStairsHandler; case E_BLOCK_BROWN_GLAZED_TERRACOTTA: return BlockBrownGlazedTerracottaHandler; case E_BLOCK_BROWN_MUSHROOM: return BlockBrownMushroomHandler; @@ -779,7 +779,7 @@ const cBlockHandler & cBlockHandler::For(BLOCKTYPE a_BlockType) case E_BLOCK_MOSSY_COBBLESTONE: return BlockMossyCobblestoneHandler; case E_BLOCK_MYCELIUM: return BlockMyceliumHandler; case E_BLOCK_NETHERRACK: return BlockNetherrackHandler; - case E_BLOCK_NETHER_BRICK: return BlockNetherBrickHandler; + case E_BLOCK_NETHER_BRICK: return BlockNetherBricksHandler; case E_BLOCK_NETHER_BRICK_FENCE: return BlockNetherBrickFenceHandler; case E_BLOCK_NETHER_BRICK_STAIRS: return BlockNetherBrickStairsHandler; case E_BLOCK_NETHER_PORTAL: return BlockNetherPortalHandler; @@ -829,7 +829,7 @@ const cBlockHandler & cBlockHandler::For(BLOCKTYPE a_BlockType) case E_BLOCK_REDSTONE_WIRE: return BlockRedstoneWireHandler; case E_BLOCK_RED_GLAZED_TERRACOTTA: return BlockRedGlazedTerracottaHandler; case E_BLOCK_RED_MUSHROOM: return BlockRedMushroomHandler; - case E_BLOCK_RED_NETHER_BRICK: return BlockRedNetherBrickHandler; + case E_BLOCK_RED_NETHER_BRICK: return BlockRedNetherBricksHandler; case E_BLOCK_RED_ROSE: return BlockRedRoseHandler; case E_BLOCK_RED_SANDSTONE: return BlockRedSandstoneHandler; case E_BLOCK_RED_SANDSTONE_SLAB: return BlockRedSandstoneSlabHandler; @@ -867,9 +867,9 @@ const cBlockHandler & cBlockHandler::For(BLOCKTYPE a_BlockType) case E_BLOCK_STONE_SLAB: return BlockStoneSlabHandler; case E_BLOCK_STRUCTURE_BLOCK: return BlockStructureBlockHandler; case E_BLOCK_STRUCTURE_VOID: return BlockStructureVoidHandler; - case E_BLOCK_SUGARCANE: return BlockSugarcaneHandler; + case E_BLOCK_SUGARCANE: return BlockSugarCaneHandler; case E_BLOCK_TALL_GRASS: return BlockTallGrassHandler; - case E_BLOCK_TNT: return BlockTntHandler; + case E_BLOCK_TNT: return BlockTNTHandler; case E_BLOCK_TORCH: return BlockTorchHandler; case E_BLOCK_TRAPDOOR: return BlockTrapdoorHandler; case E_BLOCK_TRAPPED_CHEST: return BlockTrappedChestHandler; diff --git a/src/Blocks/BlockRedstone.h b/src/Blocks/BlockRedstoneWire.h index d77ff151a..3976afa90 100644 --- a/src/Blocks/BlockRedstone.h +++ b/src/Blocks/BlockRedstoneWire.h @@ -8,7 +8,7 @@ -class cBlockRedstoneHandler final : +class cBlockRedstoneWireHandler final : public cBlockHandler { using Super = cBlockHandler; diff --git a/src/Blocks/BlockSugarcane.h b/src/Blocks/BlockSugarCane.h index bf5ae5e73..cffe667e5 100644 --- a/src/Blocks/BlockSugarcane.h +++ b/src/Blocks/BlockSugarCane.h @@ -7,7 +7,7 @@ -class cBlockSugarcaneHandler final : +class cBlockSugarCaneHandler final : public cBlockPlant<false> { using Super = cBlockPlant<false>; diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVines.h index da4d6dfc3..d6eccd552 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVines.h @@ -6,7 +6,7 @@ -class cBlockVineHandler final : +class cBlockVinesHandler final : public cBlockHandler { using Super = cBlockHandler; diff --git a/src/Blocks/CMakeLists.txt b/src/Blocks/CMakeLists.txt index f69350c30..a7dd7b675 100644 --- a/src/Blocks/CMakeLists.txt +++ b/src/Blocks/CMakeLists.txt @@ -34,7 +34,7 @@ target_sources( BlockDoor.h BlockDropSpenser.h BlockEnchantingTable.h - BlockEnderchest.h + BlockEnderChest.h BlockEndPortalFrame.h BlockEntity.h BlockFarmland.h @@ -80,7 +80,7 @@ target_sources( BlockPumpkin.h BlockQuartz.h BlockRail.h - BlockRedstone.h + BlockRedstoneWire.h BlockRedstoneLamp.h BlockRedstoneOre.h BlockRedstoneRepeater.h @@ -96,14 +96,14 @@ target_sources( BlockStairs.h BlockStems.h BlockStone.h - BlockSugarcane.h + BlockSugarCane.h BlockTNT.h BlockTallGrass.h BlockTorch.h BlockTrapdoor.h BlockTripwire.h BlockTripwireHook.h - BlockVine.h + BlockVines.h BlockWallSign.h BlockWorkbench.h BroadcastInterface.h diff --git a/src/Items/CMakeLists.txt b/src/Items/CMakeLists.txt index 1e3a05bd0..7b327e486 100644 --- a/src/Items/CMakeLists.txt +++ b/src/Items/CMakeLists.txt @@ -27,7 +27,7 @@ target_sources( ItemEnchantingTable.h ItemEndCrystal.h ItemEndPortalFrame.h - ItemEnderchest.h + ItemEnderChest.h ItemEyeOfEnder.h ItemFenceGate.h ItemFishingRod.h @@ -83,6 +83,6 @@ target_sources( ItemTorch.h ItemTrapdoor.h ItemTripwireHook.h - ItemVine.h + ItemVines.h SimplePlaceableItemHandler.h ) diff --git a/src/Items/ItemComparator.h b/src/Items/ItemComparator.h index a8caa2431..48db85959 100644 --- a/src/Items/ItemComparator.h +++ b/src/Items/ItemComparator.h @@ -15,13 +15,7 @@ class cItemComparatorHandler final: public: - cItemComparatorHandler(int a_ItemType): - cItemHandler(a_ItemType) - { - } - - - + 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 @@ -30,15 +24,8 @@ public: } - - - virtual bool IsPlaceable(void) const override { return true; } } ; - - - - diff --git a/src/Items/ItemDefaultItem.h b/src/Items/ItemDefaultItem.h index f455257aa..afd5ab126 100644 --- a/src/Items/ItemDefaultItem.h +++ b/src/Items/ItemDefaultItem.h @@ -1,9 +1,16 @@ +#pragma once + #include "ItemHandler.h" + + + + class cDefaultItemHandler final : public cItemHandler { public: + using cItemHandler::cItemHandler; }; diff --git a/src/Items/ItemEnderchest.h b/src/Items/ItemEnderChest.h index bd8487b11..120abb8e6 100644 --- a/src/Items/ItemEnderchest.h +++ b/src/Items/ItemEnderChest.h @@ -2,13 +2,13 @@ #pragma once #include "ItemHandler.h" -#include "Blocks/BlockEnderchest.h" +#include "Blocks/BlockEnderChest.h" -class cItemEnderchestHandler final : +class cItemEnderChestHandler final : public cItemHandler { using Super = cItemHandler; @@ -21,6 +21,6 @@ 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/ItemHandler.cpp b/src/Items/ItemHandler.cpp index c8994fada..fa518da20 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -31,7 +31,7 @@ #include "ItemEmptyMap.h" #include "ItemEnchantingTable.h" #include "ItemEndCrystal.h" -#include "ItemEnderchest.h" +#include "ItemEnderChest.h" #include "ItemEndPortalFrame.h" #include "ItemEyeOfEnder.h" #include "ItemFenceGate.h" @@ -87,7 +87,7 @@ #include "ItemTorch.h" #include "ItemTrapdoor.h" #include "ItemTripwireHook.h" -#include "ItemVine.h" +#include "ItemVines.h" #include "../Blocks/BlockHandler.h" #include "SimplePlaceableItemHandler.h" @@ -117,7 +117,7 @@ namespace constexpr cItemBannerHandler ItemBannerHandler (E_ITEM_BANNER); constexpr cDefaultItemHandler ItemBarrierHandler (E_BLOCK_BARRIER); constexpr cDefaultItemHandler ItemBeaconHandler (E_BLOCK_BEACON); - constexpr cItemBedHandler ItemBedBlockHandler (E_BLOCK_BED); + 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)); @@ -170,7 +170,7 @@ namespace constexpr cDefaultItemHandler ItemChainCommandBlockHandler (E_BLOCK_CHAIN_COMMAND_BLOCK); constexpr cItemArmorHandler ItemChainHelmetHandler (E_ITEM_CHAIN_HELMET); constexpr cItemArmorHandler ItemChainLeggingsHandler (E_ITEM_CHAIN_LEGGINGS); - constexpr cDefaultItemHandler ItemChestBlockHandler (E_BLOCK_CHEST); + 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); @@ -188,7 +188,7 @@ namespace constexpr cDefaultItemHandler ItemCobwebHandler (E_BLOCK_COBWEB); constexpr cDefaultItemHandler ItemCocoaPodHandler (E_BLOCK_COCOA_POD); constexpr cDefaultItemHandler ItemCommandBlockHandler (E_BLOCK_COMMAND_BLOCK); - constexpr cDefaultItemHandler ItemComparatorHandler (E_ITEM_COMPARATOR); + 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); @@ -250,7 +250,7 @@ namespace constexpr cDefaultItemHandler ItemEndRodHandler (E_BLOCK_END_ROD); constexpr cDefaultItemHandler ItemEndStoneBlockHandler (E_BLOCK_END_STONE); constexpr cItemEnderPearlHandler ItemEnderPearlHandler (E_ITEM_ENDER_PEARL); - constexpr cItemEnderchestHandler ItemEnderchestHandler (E_BLOCK_ENDER_CHEST); + constexpr cItemEnderChestHandler ItemEnderChestHandler (E_BLOCK_ENDER_CHEST); constexpr cItemEyeOfEnderHandler ItemEyeOfEnderHandler (E_ITEM_EYE_OF_ENDER); constexpr cDefaultItemHandler ItemFarDiscHandler (E_ITEM_FAR_DISC); constexpr cDefaultItemHandler ItemFarmlandHandler (E_BLOCK_FARMLAND); @@ -272,7 +272,7 @@ namespace constexpr cDefaultItemHandler ItemGhastTearHandler (E_ITEM_GHAST_TEAR); constexpr cItemBottleHandler ItemGlassBottleHandler (E_ITEM_GLASS_BOTTLE); constexpr cDefaultItemHandler ItemGlassHandler (E_BLOCK_GLASS); - constexpr cDefaultItemHandler ItemGlassPaneBlockHandler (E_BLOCK_GLASS_PANE); + 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); @@ -302,9 +302,9 @@ namespace constexpr cDefaultItemHandler ItemGunpowderHandler (E_ITEM_GUNPOWDER); constexpr cDefaultItemHandler ItemHardenedClayHandler (E_BLOCK_HARDENED_CLAY); constexpr cItemSidewaysHandler ItemHayBaleHandler (E_BLOCK_HAY_BALE); - constexpr cItemMobHeadHandler ItemHeadBlockHandler (E_BLOCK_HEAD); + constexpr cDefaultItemHandler ItemHeadBlockHandler (E_BLOCK_HEAD); constexpr cItemMobHeadHandler ItemHeadHandler (E_ITEM_HEAD); - constexpr cDefaultItemHandler ItemHeavyWeightedPressurePlateBlockHandler (E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE); + 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); @@ -355,7 +355,7 @@ namespace 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 ItemLightWeightedPressurePlateBlockHandler (E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE); + 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); @@ -383,16 +383,16 @@ namespace 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 ItemNetherBrickBlockHandler (E_BLOCK_NETHER_BRICK); - constexpr cDefaultItemHandler ItemNetherBrickFenceBlockHandler (E_BLOCK_NETHER_BRICK_FENCE); + constexpr cDefaultItemHandler ItemNetherBricksHandler (E_BLOCK_NETHER_BRICK); + constexpr cDefaultItemHandler ItemNetherBrickFenceHandler (E_BLOCK_NETHER_BRICK_FENCE); constexpr cDefaultItemHandler ItemNetherBrickHandler (E_ITEM_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 ItemNetherStarHandler (E_ITEM_NETHER_STAR); - constexpr cDefaultItemHandler ItemNetherWartBlockBlockHandler (E_BLOCK_NETHER_WART_BLOCK); - constexpr cDefaultItemHandler ItemNetherWartBlockHandler (E_BLOCK_NETHER_WART); + constexpr cDefaultItemHandler ItemNetherWartBlockHandler (E_BLOCK_NETHER_WART_BLOCK); + constexpr cDefaultItemHandler ItemNetherWartTechnicalBlockHandler (E_BLOCK_NETHER_WART); constexpr cItemNetherWartHandler ItemNetherWartHandler (E_ITEM_NETHER_WART); constexpr cDefaultItemHandler ItemNetherrackHandler (E_BLOCK_NETHERRACK); constexpr cItemLeavesHandler ItemNewLeavesHandler (E_BLOCK_NEW_LEAVES); @@ -519,26 +519,26 @@ namespace constexpr cDefaultItemHandler ItemStoneHandler (E_BLOCK_STONE); constexpr cItemHoeHandler ItemStoneHoeHandler (E_ITEM_STONE_HOE); constexpr cItemPickaxeHandler ItemStonePickaxeHandler (E_ITEM_STONE_PICKAXE); - constexpr cDefaultItemHandler ItemStonePressurePlateBlockHandler (E_BLOCK_STONE_PRESSURE_PLATE); + 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 cDefaultItemHandler ItemStructureBlockHandler (E_BLOCK_STRUCTURE_BLOCK); constexpr cDefaultItemHandler ItemStructureVoidHandler (E_BLOCK_STRUCTURE_VOID); - constexpr cSimplePlaceableItemHandler ItemSugarCaneHandler (E_BLOCK_SUGARCANE, E_BLOCK_SUGARCANE); + constexpr cDefaultItemHandler ItemSugarCaneBlockHandler (E_BLOCK_SUGARCANE); + constexpr cSimplePlaceableItemHandler ItemSugarCaneHandler (E_ITEM_SUGARCANE, E_BLOCK_SUGARCANE); constexpr cDefaultItemHandler ItemSugarHandler (E_ITEM_SUGAR); - constexpr cSimplePlaceableItemHandler ItemSugarcaneHandler (E_ITEM_SUGARCANE, E_BLOCK_SUGARCANE); - constexpr cDefaultItemHandler ItemTNTBlockHandler (E_BLOCK_TNT); + constexpr cDefaultItemHandler ItemTNTHandler (E_BLOCK_TNT); constexpr cDefaultItemHandler ItemTallGrassHandler (E_BLOCK_TALL_GRASS); constexpr cDefaultItemHandler ItemTerracottaHandler (E_BLOCK_TERRACOTTA); constexpr cDefaultItemHandler ItemTippedArrowHandler (E_ITEM_TIPPED_ARROW); - constexpr cItemTorchHandler ItemTorchBlockHandler (E_BLOCK_TORCH); + constexpr cDefaultItemHandler ItemTorchBlockHandler (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 cItemVineHandler ItemVineHandler (E_BLOCK_VINES); + 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); @@ -552,7 +552,7 @@ namespace constexpr cItemAxeHandler ItemWoodenAxeHandler (E_ITEM_WOODEN_AXE); constexpr cItemHoeHandler ItemWoodenHoeHandler (E_ITEM_WOODEN_HOE); constexpr cItemPickaxeHandler ItemWoodenPickaxeHandler (E_ITEM_WOODEN_PICKAXE); - constexpr cDefaultItemHandler ItemWoodenPressurePlateBlockHandler (E_BLOCK_WOODEN_PRESSURE_PLATE); + 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); @@ -608,7 +608,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemChestBlockHandler; + 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; @@ -644,7 +644,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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_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; @@ -659,7 +659,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemGlassPaneBlockHandler; + 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; @@ -673,7 +673,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemHeavyWeightedPressurePlateBlockHandler; + 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; @@ -701,7 +701,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemLightWeightedPressurePlateBlockHandler; + 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; @@ -716,13 +716,13 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemNetherBrickBlockHandler; - case E_BLOCK_NETHER_BRICK_FENCE: return ItemNetherBrickFenceBlockHandler; + 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 ItemNetherWartBlockHandler; - case E_BLOCK_NETHER_WART_BLOCK: return ItemNetherWartBlockBlockHandler; + 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; @@ -798,20 +798,20 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemStonePressurePlateBlockHandler; + 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 ItemSugarcaneHandler; + case E_BLOCK_SUGARCANE: return ItemSugarCaneBlockHandler; case E_BLOCK_TALL_GRASS: return ItemTallGrassHandler; case E_BLOCK_TERRACOTTA: return ItemTerracottaHandler; - case E_BLOCK_TNT: return ItemTNTBlockHandler; + case E_BLOCK_TNT: return ItemTNTHandler; case E_BLOCK_TORCH: return ItemTorchBlockHandler; 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 ItemVineHandler; + 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; @@ -819,7 +819,7 @@ const cItemHandler & cItemHandler::For(int a_ItemType) 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 ItemWoodenPressurePlateBlockHandler; + 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; @@ -1091,7 +1091,9 @@ void cItemHandler::OnPlayerPlace(cPlayer & a_Player, const cItem & a_HeldItem, c if (!cBlockHandler::For(PlaceBlock).DoesIgnoreBuildCollision(World, a_HeldItem, PlacedPosition, 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 + // Happens when you place a block aiming at side of block with a torch on it or stem beside it. + a_Player.SendBlocksAround(PlacedPosition.x, PlacedPosition.y, PlacedPosition.z, 2); + a_Player.GetInventory().SendEquippedSlot(); return; } diff --git a/src/Items/ItemVine.h b/src/Items/ItemVines.h index be5cf4588..07b6ec23e 100644 --- a/src/Items/ItemVine.h +++ b/src/Items/ItemVines.h @@ -7,7 +7,7 @@ -class cItemVineHandler final : +class cItemVinesHandler final : public cItemHandler { using Super = cItemHandler; |