Merge branch 'master-MC1.10' into master-MC1.11

This commit is contained in:
payonel 2019-08-19 13:53:02 -07:00
commit 2ead42ee72
3 changed files with 15 additions and 13 deletions

View File

@ -34,7 +34,7 @@ function print(...)
local stdout = io.stdout
local pre = ""
for i = 1, args.n do
stdout:write(pre, tostring(args[i]))
stdout:write(pre, (assert(tostring(args[i]), "'tostring' must return a string to 'print'")))
pre = "\t"
end
stdout:write("\n")

View File

@ -35,8 +35,16 @@ end
-- [Line;ColumnH Move cursor to screen location v,h
-- [Line;Columnf ^ same
rules[{"%[", "%d+", ";", "%d+", "[Hf]"}] = function(window, _, y, _, x)
set_cursor(window, tonumber(x), tonumber(y))
-- [;H Move cursor to upper left corner
-- [;f ^ same
rules[{"%[", "%d*", ";", "%d*", "[Hf]"}] = function(window, _, y, _, x)
set_cursor(window, tonumber(x) or 1, tonumber(y) or 1)
end
-- [H move cursor to upper left corner
-- [f ^ same
rules[{"%[[Hf]"}] = function(window)
set_cursor(window, 1, 1)
end
-- [K clear line from cursor right
@ -63,14 +71,6 @@ rules[{"%[", "[012]?", "J"}] = function(window, _, n)
window.gpu.fill(1 + window.dx, y + window.dy, window.width, rep, " ")
end
-- [H move cursor to upper left corner
-- [;H ^ same
-- [f ^ same
-- [;f ^ same
rules[{"%[;?", "[Hf]"}] = function(window)
set_cursor(window, 1, 1)
end
-- [6n get the cursor position [ EscLine;ColumnR Response: cursor is at v,h ]
rules[{"%[", "6", "n"}] = function(window)
-- this solution puts the response on stdin, but it isn't echo'd

View File

@ -256,8 +256,10 @@ object PacketSender {
val x = (xz >> 8).toByte
val z = xz.toByte
pb.writeShort(xz)
pb.writeInt(t.volume(x + z * t.width))
pb.writeInt(t.volume(x + z * t.width + t.width * t.width))
val rangeStart: Int = x + z * t.width
val rangeFinal: Int = x + z * t.width + t.width * t.width
pb.writeInt(t.volume(rangeStart max 0 min t.volume.length - 1))
pb.writeInt(t.volume(rangeFinal max 0 min t.volume.length - 1))
}
pb.sendToPlayersNearTileEntity(t)