1
0

Use pitch lookup in noteblock block entity (#4826)

- Removed the calculation in the noteblock block entity

I did the calculation in python if anyone is interested where the numbers are from

Co-authored-by: 12xx12 <12xx12100@gmail.com>
This commit is contained in:
12xx12
2020-09-05 17:07:01 +02:00
committed by GitHub
parent 040380321c
commit 2d197e147e
6 changed files with 220 additions and 50 deletions

View File

@@ -1415,14 +1415,43 @@ World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(),
cNoteEntity =
{
Desc = [[
This class represents a note block entity in the world. It takes care of the note block's pitch,
This class represents a note block entity in the world. It takes care of the note block's note,
and also can play the sound, either when the {{cPlayer|player}} right-clicks it, redstone activates
it, or upon a plugin's request.</p>
<p>
The pitch is stored as an integer between 0 and 24.
The note is stored as an integer between 0 and 24.
]],
Functions =
{
GetNote =
{
Returns =
{
{
Type = "number",
},
},
Notes = "Returns the current note set for the block",
},
IncrementNote =
{
Notes = "Adds 1 to the current note. Wraps around to 0 when the note cannot go any higher.",
},
MakeSound =
{
Notes = "Plays the sound for all {{cClientHandle|clients}} near this block.",
},
SetNote =
{
Params =
{
{
Name = "Note",
Type = "number",
},
},
Notes = "Sets a new note for the block.",
},
GetPitch =
{
Returns =
@@ -1450,7 +1479,7 @@ World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(),
Type = "number",
},
},
Notes = "Sets a new pitch for the block.",
Notes = "Sets a new note for the block.",
},
},
Inherits = "cBlockEntity",