6 #include "json/value.h"
7 #include "../Entities/Player.h"
14 Super(a_BlockType, a_BlockMeta, a_Pos, a_World),
27 auto & src =
static_cast<const cNoteEntity &
>(a_Src);
101 SampleName =
"block.note.bass";
110 SampleName =
"block.note.snare";
123 SampleName =
"block.note.hat";
200 SampleName =
"block.note.basedrum";
207 SampleName =
"block.note.flute";
214 SampleName =
"block.note.bell";
221 SampleName =
"block.note.guitar";
228 SampleName =
"block.note.chime";
235 SampleName =
"block.note.xylophone";
242 SampleName =
"block.note.harp";
296 case 1:
return 0.5297315471796477f;
297 case 2:
return 0.5612310241546865f;
298 case 3:
return 0.5946035575013605f;
299 case 4:
return 0.6299605249474366f;
300 case 5:
return 0.6674199270850172f;
301 case 6:
return 0.7071067811865476f;
302 case 7:
return 0.7491535384383408f;
303 case 8:
return 0.7937005259840998f;
304 case 9:
return 0.8408964152537145f;
305 case 10:
return 0.8908987181403393f;
306 case 11:
return 0.9438743126816935f;
307 case 12:
return 1.0f;
308 case 13:
return 1.0594630943592953f;
309 case 14:
return 1.122462048309373f;
310 case 15:
return 1.189207115002721f;
311 case 16:
return 1.2599210498948732f;
312 case 17:
return 1.3348398541700344f;
313 case 18:
return 1.4142135623730951f;
314 case 19:
return 1.4983070768766815f;
315 case 20:
return 1.5874010519681994f;
316 case 21:
return 1.681792830507429f;
317 case 22:
return 1.7817974362806785f;
318 case 23:
return 1.887748625363387f;
319 case 24:
return 2.0f;
@ E_BLOCK_WHITE_SHULKER_BOX
@ E_BLOCK_NETHER_BRICK_STAIRS
@ E_BLOCK_PINK_SHULKER_BOX
@ E_BLOCK_STONE_PRESSURE_PLATE
@ E_BLOCK_BLUE_SHULKER_BOX
@ E_BLOCK_OAK_WOOD_STAIRS
@ E_BLOCK_STANDING_BANNER
@ E_BLOCK_DAYLIGHT_SENSOR
@ E_BLOCK_BROWN_SHULKER_BOX
@ E_BLOCK_DOUBLE_WOODEN_SLAB
@ E_BLOCK_COBBLESTONE_STAIRS
@ E_BLOCK_LIGHT_BLUE_SHULKER_BOX
@ E_BLOCK_BIRCH_FENCE_GATE
@ E_BLOCK_DARK_OAK_WOOD_STAIRS
@ E_BLOCK_ACACIA_FENCE_GATE
@ E_BLOCK_STONE_BRICK_STAIRS
@ E_BLOCK_ENCHANTMENT_TABLE
@ E_BLOCK_END_PORTAL_FRAME
@ E_BLOCK_PRISMARINE_BLOCK
@ E_BLOCK_RED_NETHER_BRICK
@ E_BLOCK_MOSSY_COBBLESTONE
@ E_BLOCK_STAINED_GLASS_PANE
@ E_BLOCK_MAGENTA_SHULKER_BOX
@ E_BLOCK_REDSTONE_ORE_GLOWING
@ E_BLOCK_BIRCH_WOOD_STAIRS
@ E_BLOCK_CYAN_SHULKER_BOX
@ E_BLOCK_LIME_SHULKER_BOX
@ E_BLOCK_PURPLE_SHULKER_BOX
@ E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB
@ E_BLOCK_JUNGLE_WOOD_STAIRS
@ E_BLOCK_ACACIA_WOOD_STAIRS
@ E_BLOCK_ORANGE_SHULKER_BOX
@ E_BLOCK_DOUBLE_STONE_SLAB
@ E_BLOCK_RED_SANDSTONE_STAIRS
@ E_BLOCK_SPRUCE_FENCE_GATE
@ E_BLOCK_GRAY_SHULKER_BOX
@ E_BLOCK_SPRUCE_WOOD_STAIRS
@ E_BLOCK_YELLOW_SHULKER_BOX
@ E_BLOCK_DARK_OAK_FENCE_GATE
@ E_BLOCK_JUNGLE_FENCE_GATE
@ E_BLOCK_HUGE_BROWN_MUSHROOM
@ E_BLOCK_WOODEN_PRESSURE_PLATE
@ E_BLOCK_HUGE_RED_MUSHROOM
@ E_BLOCK_GREEN_SHULKER_BOX
@ E_BLOCK_BLACK_SHULKER_BOX
@ E_BLOCK_NETHER_QUARTZ_ORE
@ E_BLOCK_LIGHT_GRAY_SHULKER_BOX
@ E_BLOCK_SANDSTONE_STAIRS
@ E_BLOCK_PURPUR_DOUBLE_SLAB
@ E_BLOCK_INVERTED_DAYLIGHT_SENSOR
@ E_BLOCK_COBBLESTONE_WALL
@ E_BLOCK_NETHER_BRICK_FENCE
@ E_BLOCK_RED_SANDSTONE_SLAB
@ E_BLOCK_RED_SHULKER_BOX
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
Vector3i m_Pos
Position in absolute block coordinates.
virtual void CopyFrom(const cBlockEntity &a_Src)
Copies all properties of a_Src into this entity, except for its m_World and location.
void SetNote(unsigned char a_Note)
unsigned char GetNote(void)
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
cNoteEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Creates a new note entity.
static float PitchFromNote(unsigned char a_Note)
Returns the relative pitch (used in the protocol) from a note value between 0 and 24 (used in m_Note)...
StatisticsManager & GetStatistics()
Return the associated statistic and achievement manager.
std::unordered_map< CustomStatistic, StatValue > Custom
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
BLOCKTYPE GetBlock(Vector3i a_BlockPos) const
Returns the block type at the specified position.
virtual void BroadcastBlockAction(Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override