Skip to content

Commit

Permalink
Minor cosmetic fixes in protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
adepierre committed May 5, 2024
1 parent 2f0577d commit 51856b1
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions protocolCraft/include/protocolCraft/NetworkType.hpp
@@ -1,7 +1,5 @@
#pragma once

#include <vector>

#include "protocolCraft/BinaryReadWrite.hpp"
#include "protocolCraft/Utilities/Json.hpp"

Expand Down
Expand Up @@ -2,10 +2,11 @@

#if PROTOCOL_VERSION > 344 /* > 1.12.2 */
#include <memory>
#include <string>

#include "protocolCraft/NetworkType.hpp"
#if PROTOCOL_VERSION < 759 /* < 1.19 */
#include "protocolCraft/Types/Identifier.hpp"
#endif

namespace ProtocolCraft
{
Expand Down
Expand Up @@ -2,6 +2,7 @@

#if PROTOCOL_VERSION > 344 /* > 1.12.2 */
#include "protocolCraft/Types/CommandNode/BrigadierProperty.hpp"
#include "protocolCraft/Types/Identifier.hpp"

namespace ProtocolCraft
{
Expand Down
2 changes: 0 additions & 2 deletions protocolCraft/include/protocolCraft/Types/GlobalPos.hpp
@@ -1,8 +1,6 @@
#if PROTOCOL_VERSION > 758 /* > 1.18.2 */
#pragma once

#include <string>

#include "protocolCraft/NetworkType.hpp"
#include "protocolCraft/Types/NetworkPosition.hpp"

Expand Down
Expand Up @@ -23,7 +23,7 @@ namespace ProtocolCraft
id_ = id__;
}

void SetNamespace(const std::optional<NBT::Value>& data_)
void SetData(const std::optional<NBT::Value>& data_)
{
data = data_;
}
Expand Down
Expand Up @@ -263,7 +263,7 @@ namespace ProtocolCraft
Particle();
virtual ~Particle();
std::string_view GetName() const;
ParticleType GetType() const;
ParticleType GetParticleType() const;
std::shared_ptr<ParticleOptions> GetOptions() const;

void SetParticleType(const ParticleType particle_type_);
Expand Down
4 changes: 2 additions & 2 deletions protocolCraft/src/Types/Particles/Particle.cpp
Expand Up @@ -282,14 +282,14 @@ namespace ProtocolCraft
"spit",
};
#endif
if (particle_type == ParticleType::None)
if (particle_type <= ParticleType::None || particle_type >= ParticleType::NUM_PARTICLE_TYPES)
{
return "";
}
return names[static_cast<size_t>(particle_type)];
}

ParticleType Particle::GetType() const
ParticleType Particle::GetParticleType() const
{
return particle_type;
}
Expand Down

0 comments on commit 51856b1

Please sign in to comment.