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

@@ -40,13 +40,12 @@ public: // tolua_export
/** Creates a new note entity. a_World may be nullptr */
cNoteEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
virtual ~cNoteEntity() override {}
// tolua_begin
char GetPitch(void);
void SetPitch(char a_Pitch);
void IncrementPitch(void);
unsigned char GetNote(void);
void SetNote(unsigned char a_Note);
void IncrementNote(void);
void MakeSound(void);
// tolua_end
@@ -56,10 +55,11 @@ public: // tolua_export
virtual bool UsedBy(cPlayer * a_Player) override;
virtual void SendTo(cClientHandle &) override {}
/** Returns the relative pitch (used in the protocol)
from a note value between 0 and 24 (used in m_Note). */
static float PitchFromNote(unsigned char a_Note);
private:
char m_Pitch;
unsigned char m_Note;
} ; // tolua_export