summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2020-04-13 18:38:06 +0200
committerAlexander Harkness <me@bearbin.net>2020-04-16 22:07:48 +0200
commit9ee47e59995f858ec531b3ee467f131594e4ba1f (patch)
treef005d8af4a0362d7eab8a96a71aca0d73275f8e1 /src/Items
parentPrevent crash when breeding (diff)
downloadcuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.gz
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.bz2
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.lz
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.xz
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.zst
cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.zip
Diffstat (limited to 'src/Items')
-rw-r--r--src/Items/ItemAxe.h12
-rw-r--r--src/Items/ItemBigFlower.h5
-rw-r--r--src/Items/ItemBoat.h9
-rw-r--r--src/Items/ItemBow.h9
-rw-r--r--src/Items/ItemChest.h6
-rw-r--r--src/Items/ItemCookedFish.h9
-rw-r--r--src/Items/ItemDye.h4
-rw-r--r--src/Items/ItemEmptyMap.h9
-rw-r--r--src/Items/ItemFishingRod.h9
-rw-r--r--src/Items/ItemFood.h11
-rw-r--r--src/Items/ItemFoodSeeds.h11
-rw-r--r--src/Items/ItemGoldenApple.h9
-rw-r--r--src/Items/ItemLeaves.h11
-rw-r--r--src/Items/ItemLilypad.h7
-rw-r--r--src/Items/ItemMap.h9
-rw-r--r--src/Items/ItemMilk.h6
-rw-r--r--src/Items/ItemMinecart.h9
-rw-r--r--src/Items/ItemMobHead.h11
-rw-r--r--src/Items/ItemPickaxe.h14
-rw-r--r--src/Items/ItemPoisonousPotato.h11
-rw-r--r--src/Items/ItemPotion.h4
-rw-r--r--src/Items/ItemPumpkin.h9
-rw-r--r--src/Items/ItemRawChicken.h11
-rw-r--r--src/Items/ItemRawFish.h11
-rw-r--r--src/Items/ItemRottenFlesh.h11
-rw-r--r--src/Items/ItemSapling.h12
-rw-r--r--src/Items/ItemShears.h14
-rw-r--r--src/Items/ItemShovel.h15
-rw-r--r--src/Items/ItemSign.h12
-rw-r--r--src/Items/ItemSlab.h6
-rw-r--r--src/Items/ItemSoup.h9
-rw-r--r--src/Items/ItemSpiderEye.h11
-rw-r--r--src/Items/ItemSword.h10
-rw-r--r--src/Items/ItemThrowable.h58
34 files changed, 212 insertions, 162 deletions
diff --git a/src/Items/ItemAxe.h b/src/Items/ItemAxe.h
index 3b981ef7c..cee41989d 100644
--- a/src/Items/ItemAxe.h
+++ b/src/Items/ItemAxe.h
@@ -8,13 +8,15 @@
-class cItemAxeHandler :
+class cItemAxeHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemAxeHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+
+ cItemAxeHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -37,7 +39,7 @@ public:
{
if (!IsBlockMaterialWood(a_Block) && !IsBlockMaterialPlants(a_Block) && !IsBlockMaterialVine(a_Block))
{
- return super::GetBlockBreakingStrength(a_Block);
+ return Super::GetBlockBreakingStrength(a_Block);
}
else
{
diff --git a/src/Items/ItemBigFlower.h b/src/Items/ItemBigFlower.h
index 8e96ad602..81a9d3818 100644
--- a/src/Items/ItemBigFlower.h
+++ b/src/Items/ItemBigFlower.h
@@ -11,11 +11,12 @@
class cItemBigFlowerHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
+
cItemBigFlowerHandler(void):
- super(E_BLOCK_BIG_FLOWER)
+ Super(E_BLOCK_BIG_FLOWER)
{
}
diff --git a/src/Items/ItemBoat.h b/src/Items/ItemBoat.h
index ea95e6a47..682b68ff2 100644
--- a/src/Items/ItemBoat.h
+++ b/src/Items/ItemBoat.h
@@ -8,14 +8,15 @@
-class cItemBoatHandler :
+class cItemBoatHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemBoatHandler(int a_ItemType) :
- super(a_ItemType)
+
+ cItemBoatHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h
index 53a1373b7..81f012c7c 100644
--- a/src/Items/ItemBow.h
+++ b/src/Items/ItemBow.h
@@ -8,14 +8,15 @@
-class cItemBowHandler :
+class cItemBowHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemBowHandler(void) :
- super(E_ITEM_BOW)
+
+ cItemBowHandler(void):
+ Super(E_ITEM_BOW)
{
}
diff --git a/src/Items/ItemChest.h b/src/Items/ItemChest.h
index ac4e4b471..b8807e5d8 100644
--- a/src/Items/ItemChest.h
+++ b/src/Items/ItemChest.h
@@ -12,10 +12,12 @@
class cItemChestHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
+
cItemChestHandler(int a_ItemType):
- super(a_ItemType)
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemCookedFish.h b/src/Items/ItemCookedFish.h
index 8a819c6f6..d0edc2d6a 100644
--- a/src/Items/ItemCookedFish.h
+++ b/src/Items/ItemCookedFish.h
@@ -7,14 +7,15 @@
-class cItemCookedFishHandler :
+class cItemCookedFishHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemCookedFishHandler()
- : super(E_ITEM_COOKED_FISH, FoodInfo(0, 0))
+
+ cItemCookedFishHandler():
+ Super(E_ITEM_COOKED_FISH, FoodInfo(0, 0))
{
}
diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h
index 839982d74..890fcc9db 100644
--- a/src/Items/ItemDye.h
+++ b/src/Items/ItemDye.h
@@ -13,11 +13,11 @@
class cItemDyeHandler :
public cItemHandler
{
- using super = cItemHandler;
+ using Super = cItemHandler;
public:
cItemDyeHandler(int a_ItemType):
- super(a_ItemType)
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemEmptyMap.h b/src/Items/ItemEmptyMap.h
index bb796d892..fe7b03e23 100644
--- a/src/Items/ItemEmptyMap.h
+++ b/src/Items/ItemEmptyMap.h
@@ -7,16 +7,17 @@
-class cItemEmptyMapHandler :
+class cItemEmptyMapHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
static const unsigned int DEFAULT_SCALE = 0;
public:
- cItemEmptyMapHandler() :
- super(E_ITEM_EMPTY_MAP)
+
+ cItemEmptyMapHandler():
+ Super(E_ITEM_EMPTY_MAP)
{
}
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h
index 8c2be3ad3..48568ed69 100644
--- a/src/Items/ItemFishingRod.h
+++ b/src/Items/ItemFishingRod.h
@@ -49,14 +49,15 @@ protected:
-class cItemFishingRodHandler :
+class cItemFishingRodHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemFishingRodHandler(int a_ItemType) :
- super(a_ItemType)
+
+ cItemFishingRodHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h
index f8137ab6f..29d733cab 100644
--- a/src/Items/ItemFood.h
+++ b/src/Items/ItemFood.h
@@ -7,14 +7,15 @@
-class cItemFoodHandler :
+class cItemFoodHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemFoodHandler(int a_ItemType, FoodInfo a_FoodInfo)
- : super(a_ItemType),
+
+ cItemFoodHandler(int a_ItemType, FoodInfo a_FoodInfo):
+ Super(a_ItemType),
m_FoodInfo(a_FoodInfo)
{
}
@@ -33,7 +34,7 @@ public:
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemFoodSeeds.h b/src/Items/ItemFoodSeeds.h
index 802397375..89d05287d 100644
--- a/src/Items/ItemFoodSeeds.h
+++ b/src/Items/ItemFoodSeeds.h
@@ -8,14 +8,15 @@
-class cItemFoodSeedsHandler :
+class cItemFoodSeedsHandler:
public cItemSeedsHandler
{
- typedef cItemSeedsHandler super;
+ using Super = cItemSeedsHandler;
public:
- cItemFoodSeedsHandler(int a_ItemType, FoodInfo a_FoodInfo) :
- cItemSeedsHandler(a_ItemType),
+
+ cItemFoodSeedsHandler(int a_ItemType, FoodInfo a_FoodInfo):
+ Super(a_ItemType),
m_FoodInfo(a_FoodInfo)
{
@@ -35,7 +36,7 @@ public:
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h
index cece9a54a..e01335dd4 100644
--- a/src/Items/ItemGoldenApple.h
+++ b/src/Items/ItemGoldenApple.h
@@ -7,14 +7,15 @@
-class cItemGoldenAppleHandler :
+class cItemGoldenAppleHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemGoldenAppleHandler()
- : super(E_ITEM_GOLDEN_APPLE, FoodInfo(4, 9.6))
+
+ cItemGoldenAppleHandler():
+ Super(E_ITEM_GOLDEN_APPLE, FoodInfo(4, 9.6))
{
}
diff --git a/src/Items/ItemLeaves.h b/src/Items/ItemLeaves.h
index 57f1fa365..59cc1429d 100644
--- a/src/Items/ItemLeaves.h
+++ b/src/Items/ItemLeaves.h
@@ -7,14 +7,15 @@
-class cItemLeavesHandler :
+class cItemLeavesHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemLeavesHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+
+ cItemLeavesHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -25,7 +26,7 @@ public:
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) override
{
- bool res = super::GetPlacementBlockTypeMeta(
+ bool res = Super::GetPlacementBlockTypeMeta(
a_World, a_Player,
a_BlockX, a_BlockY, a_BlockZ, a_BlockFace,
a_CursorX, a_CursorY, a_CursorZ,
diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h
index 7f3b85a70..985da3ed5 100644
--- a/src/Items/ItemLilypad.h
+++ b/src/Items/ItemLilypad.h
@@ -9,14 +9,15 @@
-class cItemLilypadHandler :
+class cItemLilypadHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
+
cItemLilypadHandler(int a_ItemType):
- super(a_ItemType)
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemMap.h b/src/Items/ItemMap.h
index 203e11fbb..2d939676a 100644
--- a/src/Items/ItemMap.h
+++ b/src/Items/ItemMap.h
@@ -7,16 +7,17 @@
-class cItemMapHandler :
+class cItemMapHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
static const unsigned int DEFAULT_RADIUS = 128;
public:
- cItemMapHandler() :
- super(E_ITEM_MAP)
+
+ cItemMapHandler():
+ Super(E_ITEM_MAP)
{
}
diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h
index 94fa51d09..e34efbc0f 100644
--- a/src/Items/ItemMilk.h
+++ b/src/Items/ItemMilk.h
@@ -8,10 +8,12 @@
class cItemMilkHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
+
cItemMilkHandler():
- super(E_ITEM_MILK)
+ Super(E_ITEM_MILK)
{
}
diff --git a/src/Items/ItemMinecart.h b/src/Items/ItemMinecart.h
index 55a39c5ce..603d3f9c5 100644
--- a/src/Items/ItemMinecart.h
+++ b/src/Items/ItemMinecart.h
@@ -7,14 +7,15 @@
-class cItemMinecartHandler :
+class cItemMinecartHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemMinecartHandler(int a_ItemType) :
- super(a_ItemType)
+
+ cItemMinecartHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
diff --git a/src/Items/ItemMobHead.h b/src/Items/ItemMobHead.h
index 747492402..d732327a5 100644
--- a/src/Items/ItemMobHead.h
+++ b/src/Items/ItemMobHead.h
@@ -9,14 +9,15 @@
-class cItemMobHeadHandler :
+class cItemMobHeadHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemMobHeadHandler(int a_ItemType) :
- super(a_ItemType)
+
+ cItemMobHeadHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -46,7 +47,7 @@ public:
}
cItem itemCopy(a_EquippedItem); // Make a copy in case this is the player's last head item and OnPlayerPlace removes it
- if (!super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
+ if (!Super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
{
return false;
}
diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h
index fd3532729..9172146b7 100644
--- a/src/Items/ItemPickaxe.h
+++ b/src/Items/ItemPickaxe.h
@@ -5,13 +5,15 @@
-class cItemPickaxeHandler :
+class cItemPickaxeHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemPickaxeHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+
+ cItemPickaxeHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -150,7 +152,7 @@ public:
return PickaxeLevel() >= 1;
}
}
- return super::CanHarvestBlock(a_BlockType);
+ return Super::CanHarvestBlock(a_BlockType);
}
virtual bool CanRepairWithRawMaterial(short a_ItemType) override
@@ -171,7 +173,7 @@ public:
{
if (!IsBlockMaterialIron(a_Block) && (a_Block != E_BLOCK_ANVIL) && !IsBlockMaterialRock(a_Block))
{
- return super::GetBlockBreakingStrength(a_Block);
+ return Super::GetBlockBreakingStrength(a_Block);
}
else
{
diff --git a/src/Items/ItemPoisonousPotato.h b/src/Items/ItemPoisonousPotato.h
index 8d2dd93e7..1950db90e 100644
--- a/src/Items/ItemPoisonousPotato.h
+++ b/src/Items/ItemPoisonousPotato.h
@@ -7,20 +7,21 @@
-class cItemPoisonousPotatoHandler :
+class cItemPoisonousPotatoHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemPoisonousPotatoHandler()
- : super(E_ITEM_POISONOUS_POTATO, FoodInfo(2, 1.2))
+
+ cItemPoisonousPotatoHandler():
+ Super(E_ITEM_POISONOUS_POTATO, FoodInfo(2, 1.2))
{
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h
index 86330d1c0..49fbfa0dd 100644
--- a/src/Items/ItemPotion.h
+++ b/src/Items/ItemPotion.h
@@ -7,12 +7,12 @@
class cItemPotionHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
cItemPotionHandler():
- super(E_ITEM_POTION)
+ Super(E_ITEM_POTION)
{
}
diff --git a/src/Items/ItemPumpkin.h b/src/Items/ItemPumpkin.h
index d124265c7..b8038093c 100644
--- a/src/Items/ItemPumpkin.h
+++ b/src/Items/ItemPumpkin.h
@@ -10,11 +10,12 @@
class cItemPumpkinHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemPumpkinHandler(void):
- super(E_BLOCK_PUMPKIN)
+
+ cItemPumpkinHandler():
+ Super(E_BLOCK_PUMPKIN)
{
}
@@ -38,7 +39,7 @@ public:
}
// No golem at these coords, place the block normally:
- return super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ);
+ return Super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ);
}
diff --git a/src/Items/ItemRawChicken.h b/src/Items/ItemRawChicken.h
index e1a6d4870..95acd3194 100644
--- a/src/Items/ItemRawChicken.h
+++ b/src/Items/ItemRawChicken.h
@@ -7,20 +7,21 @@
-class cItemRawChickenHandler :
+class cItemRawChickenHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemRawChickenHandler()
- : super(E_ITEM_RAW_CHICKEN, FoodInfo(2, 1.2))
+
+ cItemRawChickenHandler():
+ Super(E_ITEM_RAW_CHICKEN, FoodInfo(2, 1.2))
{
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemRawFish.h b/src/Items/ItemRawFish.h
index 7f9f49e2a..22836272f 100644
--- a/src/Items/ItemRawFish.h
+++ b/src/Items/ItemRawFish.h
@@ -7,14 +7,15 @@
-class cItemRawFishHandler :
+class cItemRawFishHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemRawFishHandler()
- : super(E_ITEM_RAW_FISH, FoodInfo(0, 0))
+
+ cItemRawFishHandler():
+ Super(E_ITEM_RAW_FISH, FoodInfo(0, 0))
{
}
@@ -38,7 +39,7 @@ public:
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemRottenFlesh.h b/src/Items/ItemRottenFlesh.h
index a4b34e8bc..bd7f67382 100644
--- a/src/Items/ItemRottenFlesh.h
+++ b/src/Items/ItemRottenFlesh.h
@@ -7,20 +7,21 @@
-class cItemRottenFleshHandler :
+class cItemRottenFleshHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemRottenFleshHandler()
- : super(E_ITEM_ROTTEN_FLESH, FoodInfo(4, 0.8))
+
+ cItemRottenFleshHandler():
+ Super(E_ITEM_ROTTEN_FLESH, FoodInfo(4, 0.8))
{
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemSapling.h b/src/Items/ItemSapling.h
index dbcb12be5..e8deb37a9 100644
--- a/src/Items/ItemSapling.h
+++ b/src/Items/ItemSapling.h
@@ -7,13 +7,15 @@
-class cItemSaplingHandler : public cItemHandler
+class cItemSaplingHandler:
+ public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
- cItemSaplingHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+
+ cItemSaplingHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -25,7 +27,7 @@ public:
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) override
{
- bool res = super::GetPlacementBlockTypeMeta(
+ bool res = Super::GetPlacementBlockTypeMeta(
a_World, a_Player,
a_BlockX, a_BlockY, a_BlockZ, a_BlockFace,
a_CursorX, a_CursorY, a_CursorZ,
diff --git a/src/Items/ItemShears.h b/src/Items/ItemShears.h
index 2ceb371f4..a100a52a3 100644
--- a/src/Items/ItemShears.h
+++ b/src/Items/ItemShears.h
@@ -9,13 +9,15 @@
-class cItemShearsHandler :
+class cItemShearsHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemShearsHandler(int a_ItemType) :
- cItemHandler(a_ItemType)
+
+ cItemShearsHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -57,7 +59,7 @@ public:
return true;
}
}
- return super::CanHarvestBlock(a_BlockType);
+ return Super::CanHarvestBlock(a_BlockType);
}
@@ -88,7 +90,7 @@ public:
}
else
{
- return super::GetBlockBreakingStrength(a_Block);
+ return Super::GetBlockBreakingStrength(a_Block);
}
}
diff --git a/src/Items/ItemShovel.h b/src/Items/ItemShovel.h
index 0715f8d99..1459a14ac 100644
--- a/src/Items/ItemShovel.h
+++ b/src/Items/ItemShovel.h
@@ -12,12 +12,15 @@
-class cItemShovelHandler : public cItemHandler
+class cItemShovelHandler:
+ public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemShovelHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+
+ cItemShovelHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -44,7 +47,7 @@ public:
{
return true;
}
- return super::CanHarvestBlock(a_BlockType);
+ return Super::CanHarvestBlock(a_BlockType);
}
@@ -96,6 +99,6 @@ public:
break;
}
}
- return super::GetBlockBreakingStrength(a_Block);
+ return Super::GetBlockBreakingStrength(a_Block);
}
};
diff --git a/src/Items/ItemSign.h b/src/Items/ItemSign.h
index 37ad4967b..21acd81ae 100644
--- a/src/Items/ItemSign.h
+++ b/src/Items/ItemSign.h
@@ -11,13 +11,15 @@
-class cItemSignHandler :
+class cItemSignHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemSignHandler(int a_ItemType) :
- super(a_ItemType)
+
+ cItemSignHandler(int a_ItemType):
+ Super(a_ItemType)
{
}
@@ -36,7 +38,7 @@ public:
bool isReplacingClickedBlock = BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision(ChunkInterface, { a_BlockX, a_BlockY, a_BlockZ }, a_Player, ClickedBlockMeta);
// If the regular placement doesn't work, do no further processing:
- if (!super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
+ if (!Super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
{
return false;
}
diff --git a/src/Items/ItemSlab.h b/src/Items/ItemSlab.h
index ff83c0367..0c7654113 100644
--- a/src/Items/ItemSlab.h
+++ b/src/Items/ItemSlab.h
@@ -10,14 +10,14 @@
class cItemSlabHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
public:
/** Creates a new handler for the specified slab item type.
Sets the handler to use the specified doubleslab block type for combining self into doubleslabs. */
cItemSlabHandler(int a_ItemType, BLOCKTYPE a_DoubleSlabBlockType):
- super(a_ItemType),
+ Super(a_ItemType),
m_DoubleSlabBlockType(a_DoubleSlabBlockType)
{
}
@@ -99,7 +99,7 @@ public:
// The slabs didn't combine, use the default handler to place the slab:
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, true);
- bool res = super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ);
+ bool res = Super::OnPlayerPlace(a_World, a_Player, a_EquippedItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ);
/*
The client has a bug when a slab replaces snow and there's a slab above it.
diff --git a/src/Items/ItemSoup.h b/src/Items/ItemSoup.h
index 958c0e0ea..60a2f8d76 100644
--- a/src/Items/ItemSoup.h
+++ b/src/Items/ItemSoup.h
@@ -8,14 +8,15 @@
-class cItemSoupHandler :
+class cItemSoupHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo) :
- super(a_ItemType, a_FoodInfo)
+
+ cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo):
+ Super(a_ItemType, a_FoodInfo)
{
}
diff --git a/src/Items/ItemSpiderEye.h b/src/Items/ItemSpiderEye.h
index 901f5d3d0..df371a010 100644
--- a/src/Items/ItemSpiderEye.h
+++ b/src/Items/ItemSpiderEye.h
@@ -7,20 +7,21 @@
-class cItemSpiderEyeHandler :
+class cItemSpiderEyeHandler:
public cItemFoodHandler
{
- typedef cItemFoodHandler super;
+ using Super = cItemFoodHandler;
public:
- cItemSpiderEyeHandler()
- : super(E_ITEM_SPIDER_EYE, FoodInfo(2, 3.2))
+
+ cItemSpiderEyeHandler():
+ Super(E_ITEM_SPIDER_EYE, FoodInfo(2, 3.2))
{
}
virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
{
- if (!super::EatItem(a_Player, a_Item))
+ if (!Super::EatItem(a_Player, a_Item))
{
return false;
}
diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h
index cdb85727c..cb2e63c87 100644
--- a/src/Items/ItemSword.h
+++ b/src/Items/ItemSword.h
@@ -8,13 +8,15 @@
-class cItemSwordHandler :
+class cItemSwordHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
+
cItemSwordHandler(int a_ItemType):
- cItemHandler(a_ItemType)
+ Super(a_ItemType)
{
}
@@ -25,7 +27,7 @@ public:
{
return true;
}
- return super::CanHarvestBlock(a_BlockType);
+ return Super::CanHarvestBlock(a_BlockType);
}
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h
index 528799630..daae7658c 100644
--- a/src/Items/ItemThrowable.h
+++ b/src/Items/ItemThrowable.h
@@ -7,13 +7,15 @@
-class cItemThrowableHandler :
+class cItemThrowableHandler:
public cItemHandler
{
- typedef cItemHandler super;
+ using Super = cItemHandler;
+
public:
- cItemThrowableHandler(int a_ItemType, cProjectileEntity::eKind a_ProjectileKind, double a_SpeedCoeff) :
- super(a_ItemType),
+
+ cItemThrowableHandler(int a_ItemType, cProjectileEntity::eKind a_ProjectileKind, double a_SpeedCoeff):
+ Super(a_ItemType),
m_ProjectileKind(a_ProjectileKind),
m_SpeedCoeff(a_SpeedCoeff)
{
@@ -54,13 +56,15 @@ protected:
-class cItemEggHandler :
+class cItemEggHandler:
public cItemThrowableHandler
{
- typedef cItemThrowableHandler super;
+ using Super = cItemThrowableHandler;
+
public:
- cItemEggHandler(void) :
- super(E_ITEM_EGG, cProjectileEntity::pkEgg, 30)
+
+ cItemEggHandler():
+ Super(E_ITEM_EGG, cProjectileEntity::pkEgg, 30)
{
}
} ;
@@ -68,14 +72,15 @@ public:
-class cItemSnowballHandler :
+class cItemSnowballHandler:
public cItemThrowableHandler
{
- typedef cItemThrowableHandler super;
+ using Super = cItemThrowableHandler;
public:
- cItemSnowballHandler(void) :
- super(E_ITEM_SNOWBALL, cProjectileEntity::pkSnowball, 30)
+
+ cItemSnowballHandler():
+ Super(E_ITEM_SNOWBALL, cProjectileEntity::pkSnowball, 30)
{
}
} ;
@@ -84,14 +89,15 @@ public:
-class cItemEnderPearlHandler :
+class cItemEnderPearlHandler:
public cItemThrowableHandler
{
- typedef cItemThrowableHandler super;
+ using Super = cItemThrowableHandler;
public:
- cItemEnderPearlHandler(void) :
- super(E_ITEM_ENDER_PEARL, cProjectileEntity::pkEnderPearl, 30)
+
+ cItemEnderPearlHandler():
+ Super(E_ITEM_ENDER_PEARL, cProjectileEntity::pkEnderPearl, 30)
{
}
} ;
@@ -100,13 +106,15 @@ public:
-class cItemBottleOEnchantingHandler :
+class cItemBottleOEnchantingHandler:
public cItemThrowableHandler
{
- typedef cItemThrowableHandler super;
+ using Super = cItemThrowableHandler;
+
public:
- cItemBottleOEnchantingHandler(void) :
- super(E_ITEM_BOTTLE_O_ENCHANTING, cProjectileEntity::pkExpBottle, 14)
+
+ cItemBottleOEnchantingHandler():
+ Super(E_ITEM_BOTTLE_O_ENCHANTING, cProjectileEntity::pkExpBottle, 14)
{
}
};
@@ -115,13 +123,15 @@ public:
-class cItemFireworkHandler :
+class cItemFireworkHandler:
public cItemThrowableHandler
{
- typedef cItemThrowableHandler super;
+ using Super = cItemThrowableHandler;
+
public:
- cItemFireworkHandler(void) :
- super(E_ITEM_FIREWORK_ROCKET, cProjectileEntity::pkFirework, 0)
+
+ cItemFireworkHandler():
+ Super(E_ITEM_FIREWORK_ROCKET, cProjectileEntity::pkFirework, 0)
{
}