From 2d197e147e4ede9b2b38692a88f620e78feba437 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Sat, 5 Sep 2020 17:07:01 +0200 Subject: 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> --- Server/Plugins/APIDump/Classes/BlockEntities.lua | 35 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'Server/Plugins/APIDump') diff --git a/Server/Plugins/APIDump/Classes/BlockEntities.lua b/Server/Plugins/APIDump/Classes/BlockEntities.lua index f4486c6d3..b5e4cdf3b 100644 --- a/Server/Plugins/APIDump/Classes/BlockEntities.lua +++ b/Server/Plugins/APIDump/Classes/BlockEntities.lua @@ -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.

- 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", -- cgit v1.2.3