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:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user