Skip to content

Commit

Permalink
Fix clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffyloafie committed Dec 9, 2023
1 parent 908cc7e commit f7a350d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cubic-server/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include "events/CancelEvents.hpp"
#include "items/UsableItem.hpp"
#include "items/foodItems.hpp"
#include "items/usable-items/Hoe.hpp"
#include "items/toolsDamage.hpp"
#include "items/usable-items/Hoe.hpp"
#include "logging/logging.hpp"
#include "nbt.h"
#include "protocol/ClientPackets.hpp"
Expand Down Expand Up @@ -1174,7 +1174,7 @@ void Player::_onUseItemOn(protocol::UseItemOn &pck)
auto item = this->_inventory->hotbar().at(this->_heldItem).getUsableItemFromSlot();
if (Items::Hoe *usedItem = std::get_if<Items::Hoe>(&item)) {
if (usedItem->_usabilityType == Items::UsabilityType::RightMouseClickUsable || usedItem->_usabilityType == Items::UsabilityType::BothMouseClicksUsable) {
usedItem->onUse(this->getDimension(), pck.location, Items::UsabilityType::RightMouseClickUsable, (int32_t)pck.face);
usedItem->onUse(this->getDimension(), pck.location, Items::UsabilityType::RightMouseClickUsable, (int32_t) pck.face);
if (usedItem->canUpdateDamage) {
this->_inventory->hotbar().at(this->_heldItem).updateDamage();
}
Expand Down
4 changes: 2 additions & 2 deletions cubic-server/items/usable-items/Hoe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void Items::Hoe::onUse(std::shared_ptr<Dimension> dim, Position &pos, UsabilityT
}

try {
auto Topblock = dim->getBlock(pos);
auto block = dim->getBlock(blockPos);
auto Topblock = dim->getBlock(pos);
auto block = dim->getBlock(blockPos);
if (usage == UsabilityType::RightMouseClickUsable) {
if (Topblock == Blocks::Air::toProtocol() &&
(block == Blocks::Dirt::toProtocol() || block == Blocks::GrassBlock::toProtocol(Blocks::GrassBlock::Properties::Snowy::FALSE) ||
Expand Down
3 changes: 1 addition & 2 deletions cubic-server/items/usable-items/Hoe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ const std::array<std::string, 16> breakableWithHoe {
"minecraft:leaves",
"minecraft:sculk",
"minecraft:sculk_vein",
"minecraft:moss_block"
};
"minecraft:moss_block"};

} // namespace Items

Expand Down
3 changes: 2 additions & 1 deletion cubic-server/protocol/Structures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace protocol {

#define SET_VALUE_INT(dst, src, root) SET_VALUE(NBT_TYPE_INT, tag_int, dst, src, root)

typedef std::variant<Items::UsableItem, Items::FlintAndSteel, Items::Hoe> ItemType; /**< Used to get the right type of Usable item, to be able to use the right functions afterwards */
typedef std::variant<Items::UsableItem, Items::FlintAndSteel, Items::Hoe>
ItemType; /**< Used to get the right type of Usable item, to be able to use the right functions afterwards */
struct Slot {
constexpr ~Slot()
{
Expand Down

0 comments on commit f7a350d

Please sign in to comment.