From 848394de9f1a58c1ad94f23a2ef3d1a144b0d4d4 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sat, 18 May 2024 20:39:22 +0200 Subject: [PATCH 01/28] show_title added "show_title" function for player --- mcproto/player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mcproto/player.py b/mcproto/player.py index b3bc22a..4e6fdc2 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -118,6 +118,10 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool, italic: bool, strikethrough: bool, underlined: bool, obfuscated: bool, duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') + HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + # properties that have different stub entpoints than entity @property def pos(self) -> Vec3: From 9df09bc74f74890317e9f128e541d205608a4097 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sat, 18 May 2024 23:46:11 +0200 Subject: [PATCH 02/28] Added reset_title/clear_title Added reset_title/clear_title --- mcproto/player.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mcproto/player.py b/mcproto/player.py index 4e6fdc2..dd526b4 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -121,7 +121,13 @@ def deop(self) -> None: def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool, italic: bool, strikethrough: bool, underlined: bool, obfuscated: bool, duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + + def reset_title(): + HasStub.runCommand(self, f'title {self.name} reset') + def clear_title(): + HasStub.runCommand(self, f'title {self.name} clear') + # properties that have different stub entpoints than entity @property def pos(self) -> Vec3: From af28fa709e1de4e1f303488466312369bf7b88da Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sat, 18 May 2024 23:49:05 +0200 Subject: [PATCH 03/28] Added show_title, clear_title, reset_title Added show_title, clear_title, reset_title --- mcproto/minecraft.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 150e9c9..4b34181 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -54,3 +54,13 @@ def port(self) -> int: def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) + + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool, italic: bool, strikethrough: bool, underlined: bool, obfuscated: bool, duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + HasStub.runCommand(self, f'title @a times {fade_in*20} {duration*20} {fade_out*20}') + HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + + def reset_title(): + HasStub.runCommand(self, f'title @a reset') + + def clear_title(): + HasStub.runCommand(self, f'title @a clear') From 83e5a0fcc6f39bc1c7e2639959200ab81f7fbf32 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:03:50 +0200 Subject: [PATCH 04/28] fixed show_title fixed show_title --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index dd526b4..694f28c 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -118,7 +118,7 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool, italic: bool, strikethrough: bool, underlined: bool, obfuscated: bool, duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') From 9f1e716ce6a79220218a0755d16d0543cc95fe80 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:05:09 +0200 Subject: [PATCH 05/28] fixed show_title fixed show_title --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 4b34181..1743865 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -55,7 +55,7 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool, italic: bool, strikethrough: bool, underlined: bool, obfuscated: bool, duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') From 3f0abfeb751728bdfcbefc298a9967efeb64e574 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:16:56 +0200 Subject: [PATCH 06/28] fixed color at show_title fixed color at show_title --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 1743865..ff95334 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -55,7 +55,7 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') From 03200427101b58c5f2209b362c4cec0ea314522d Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:17:39 +0200 Subject: [PATCH 07/28] fixed color at show_title fixed color at show_title --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index 694f28c..e26faea 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -118,7 +118,7 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"], bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') From c00610623a3043ca547dd91f68e7123c932d754c Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:24:28 +0200 Subject: [PATCH 08/28] fixed show_title fixed show_title --- mcproto/player.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcproto/player.py b/mcproto/player.py index e26faea..b5c42ee 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -118,14 +118,14 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') - def reset_title(): + def reset_title(self): HasStub.runCommand(self, f'title {self.name} reset') - def clear_title(): + def clear_title(self): HasStub.runCommand(self, f'title {self.name} clear') # properties that have different stub entpoints than entity From 7d65a180de45384c8b405955b31bda25d8e759e0 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:25:09 +0200 Subject: [PATCH 09/28] fixed show_title fixed show_title --- mcproto/minecraft.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index ff95334..62dc0ac 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -1,4 +1,4 @@ -from __future__ import annotations +ffrom __future__ import annotations import atexit import logging @@ -55,12 +55,12 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def show_title(text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in*20} {duration*20} {fade_out*20}') HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') - def reset_title(): + def reset_title(self): HasStub.runCommand(self, f'title @a reset') - def clear_title(): + def clear_title(self): HasStub.runCommand(self, f'title @a clear') From 5047735f054b6049322d7f83c87d0ba499c88b8e Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:28:09 +0200 Subject: [PATCH 10/28] fixed import fixed import --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 62dc0ac..178697e 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -1,4 +1,4 @@ -ffrom __future__ import annotations +from __future__ import annotations import atexit import logging From c84c2b84772c557bea62f7dc1c7c043c71be4b2c Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:37:35 +0200 Subject: [PATCH 11/28] fixed time fixed time --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 178697e..7ac5e60 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -56,7 +56,7 @@ def postToChat(self, *args, sep: str = " ") -> None: raise_on_error(response) def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: - HasStub.runCommand(self, f'title @a times {fade_in*20} {duration*20} {fade_out*20}') + HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') def reset_title(self): From 2d8664bb49585f26c3d415e38ac556c47b8e4569 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:37:59 +0200 Subject: [PATCH 12/28] fixed time fixed time --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index b5c42ee..cdd5011 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -119,7 +119,7 @@ def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: - HasStub.runCommand(self, f'title {self.name} times {fade_in*20} {duration*20} {fade_out*20}') + HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') def reset_title(self): From 7151c1b5959b007dd9cb210820920220856799cb Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:47:58 +0200 Subject: [PATCH 13/28] fixed show_title fixed show_title --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 7ac5e60..cccd6fb 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -57,7 +57,7 @@ def postToChat(self, *args, sep: str = " ") -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title @a {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + HasStub.runCommand(self, f'title @a {typ} {' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') def reset_title(self): HasStub.runCommand(self, f'title @a reset') From e9c5eb61014de2e20dc063e8ef2787770241e5ac Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:48:48 +0200 Subject: [PATCH 14/28] fixed show_title fixed show_title --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index cdd5011..31ba076 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -120,7 +120,7 @@ def deop(self) -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title {self.name} {typ} {"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + HasStub.runCommand(self, f'title {self.name} {typ} {' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') def reset_title(self): HasStub.runCommand(self, f'title {self.name} reset') From 1762f3a77abede7d471d3daf3bb0d1a2320f08c8 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:51:54 +0200 Subject: [PATCH 15/28] fixed show_title fixed show_title --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index cccd6fb..9663b0b 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -57,7 +57,7 @@ def postToChat(self, *args, sep: str = " ") -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title @a {typ} {' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def reset_title(self): HasStub.runCommand(self, f'title @a reset') From d9e683de55151ffa8408f5c30794cc8484f1ffd3 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:52:40 +0200 Subject: [PATCH 16/28] fixed show_title fixed show_title --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index 31ba076..21ba970 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -120,7 +120,7 @@ def deop(self) -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title {self.name} {typ} {' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}}') + HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def reset_title(self): HasStub.runCommand(self, f'title {self.name} reset') From 6df6394bc345ce47107ba161e27ff61ebbac2373 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:55:58 +0200 Subject: [PATCH 17/28] fixed color at show_title fixed color at show_title --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 9663b0b..da81a2a 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -57,7 +57,7 @@ def postToChat(self, *args, sep: str = " ") -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') + HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":{color},"bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def reset_title(self): HasStub.runCommand(self, f'title @a reset') From c2f91751676d57abc8cad84ddb33c2c37af905ab Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:57:27 +0200 Subject: [PATCH 18/28] fixed color at show_title fixed color at show_title --- mcproto/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index 21ba970..3ac9ef6 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -120,7 +120,7 @@ def deop(self) -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"red","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') + HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def reset_title(self): HasStub.runCommand(self, f'title {self.name} reset') From 36540068f345894a19d2185dd013d050c97e4679 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 10:58:30 +0200 Subject: [PATCH 19/28] fixed color at show_title fixed color at show_title --- mcproto/minecraft.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index da81a2a..f12cf4b 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -49,7 +49,7 @@ def host(self) -> str: @property def port(self) -> int: - return self._addr[1] + return self._addr[1]minecraft def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) @@ -57,7 +57,7 @@ def postToChat(self, *args, sep: str = " ") -> None: def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":{color},"bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') + HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def reset_title(self): HasStub.runCommand(self, f'title @a reset') From d0a37a2483c7cee0e41be432bea7695e16b60a03 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 11:02:01 +0200 Subject: [PATCH 20/28] fixed port fixed port --- mcproto/minecraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index f12cf4b..36985a0 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -49,7 +49,7 @@ def host(self) -> str: @property def port(self) -> int: - return self._addr[1]minecraft + return self._addr[1] def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) From 692413c30eb4b59f6c661a5570a941727209ea57 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 11:23:59 +0200 Subject: [PATCH 21/28] Improved Color at show_title Improved Color at show_title --- mcproto/minecraft.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 36985a0..edb9286 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -5,6 +5,7 @@ import grpc +from ._types import COLOR from ._base import HasStub from .entity import _EntityCache from .events import _EventHandler @@ -55,7 +56,7 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') From 69d92ae225fcd4e1bcba7fc8f6619d571d149d21 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 11:26:30 +0200 Subject: [PATCH 22/28] Improved Color at show_title Improved Color at show_title --- mcproto/player.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcproto/player.py b/mcproto/player.py index 3ac9ef6..99ba439 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -4,6 +4,7 @@ from functools import partial from typing import Literal +from ._types import COLOR from ._base import HasStub, _PlayerProvider from ._util import ThreadSafeCachedKeyBasedFactory from .entity import Entity @@ -118,7 +119,7 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: Literal["black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"] = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') From bf61f675d0c83deb527a6d579671414fc6ce2534 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 14:46:29 +0200 Subject: [PATCH 23/28] Added slots to _types.py Added slots to _types.py --- mcproto/_types.py | 153 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/mcproto/_types.py b/mcproto/_types.py index 12c7836..d441411 100644 --- a/mcproto/_types.py +++ b/mcproto/_types.py @@ -23,3 +23,156 @@ "red", "black", ] + +SLOTS: TypeAlias = Literal[ + "armor.head", + "armor.chest", + "armor.legs", + "armor.feet", + "container.0", + "container.1", + "container.2", + "container.3", + "container.4", + "container.5", + "container.6", + "container.7", + "container.8", + "container.9", + "container.10", + "container.11", + "container.12", + "container.13", + "container.14", + "container.15", + "container.16", + "container.17", + "container.18", + "container.19", + "container.20", + "container.21", + "container.22", + "container.23", + "container.24", + "container.25", + "container.26", + "container.27", + "container.28", + "container.29", + "container.30", + "container.31", + "container.32", + "container.33", + "container.34", + "container.35", + "container.36", + "container.37", + "container.38", + "container.39", + "container.40", + "container.41", + "container.42", + "container.43", + "container.44", + "container.45", + "container.46", + "container.47", + "container.48", + "container.49", + "container.50", + "container.51", + "container.52", + "container.53", + "enderchest.0", + "enderchest.1", + "enderchest.2", + "enderchest.3", + "enderchest.4", + "enderchest.5", + "enderchest.6", + "enderchest.7", + "enderchest.8", + "enderchest.9", + "enderchest.10", + "enderchest.11", + "enderchest.12", + "enderchest.13", + "enderchest.14", + "enderchest.15", + "enderchest.16", + "enderchest.17", + "enderchest.18", + "enderchest.19", + "enderchest.20", + "enderchest.21", + "enderchest.22", + "enderchest.23", + "enderchest.24", + "enderchest.25", + "enderchest.26", + "horse.0", + "horse.1", + "horse.2", + "horse.3", + "horse.4", + "horse.5", + "horse.6", + "horse.7", + "horse.8", + "horse.9", + "horse.10", + "horse.11", + "horse.12", + "horse.13", + "horse.14", + "horse.armor", + "horse.chest", + "horse.saddle", + "hotbar.0", + "hotbar.1", + "hotbar.2", + "hotbar.3", + "hotbar.4", + "hotbar.5", + "hotbar.6", + "hotbar.7", + "hotbar.8", + "inventory.0", + "inventory.1", + "inventory.2", + "inventory.3", + "inventory.4", + "inventory.5", + "inventory.6", + "inventory.7", + "inventory.8", + "inventory.9", + "inventory.10", + "inventory.11", + "inventory.12", + "inventory.13", + "inventory.14", + "inventory.15", + "inventory.16", + "inventory.17", + "inventory.18", + "inventory.19", + "inventory.20", + "inventory.21", + "inventory.22", + "inventory.23", + "inventory.24", + "inventory.25", + "inventory.26", + "villager.0", + "villager.1", + "villager.2", + "villager.3", + "villager.4", + "villager.5", + "villager.6", + "villager.7", + "weapon", + "weapon.mainhand", + "weapon.offhand" +] From 5a11490945cce98c82825ce11c27564f2ef91180 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Sun, 19 May 2024 14:48:57 +0200 Subject: [PATCH 24/28] Removed slots Removed slots --- mcproto/_types.py | 153 ---------------------------------------------- 1 file changed, 153 deletions(-) diff --git a/mcproto/_types.py b/mcproto/_types.py index d441411..12c7836 100644 --- a/mcproto/_types.py +++ b/mcproto/_types.py @@ -23,156 +23,3 @@ "red", "black", ] - -SLOTS: TypeAlias = Literal[ - "armor.head", - "armor.chest", - "armor.legs", - "armor.feet", - "container.0", - "container.1", - "container.2", - "container.3", - "container.4", - "container.5", - "container.6", - "container.7", - "container.8", - "container.9", - "container.10", - "container.11", - "container.12", - "container.13", - "container.14", - "container.15", - "container.16", - "container.17", - "container.18", - "container.19", - "container.20", - "container.21", - "container.22", - "container.23", - "container.24", - "container.25", - "container.26", - "container.27", - "container.28", - "container.29", - "container.30", - "container.31", - "container.32", - "container.33", - "container.34", - "container.35", - "container.36", - "container.37", - "container.38", - "container.39", - "container.40", - "container.41", - "container.42", - "container.43", - "container.44", - "container.45", - "container.46", - "container.47", - "container.48", - "container.49", - "container.50", - "container.51", - "container.52", - "container.53", - "enderchest.0", - "enderchest.1", - "enderchest.2", - "enderchest.3", - "enderchest.4", - "enderchest.5", - "enderchest.6", - "enderchest.7", - "enderchest.8", - "enderchest.9", - "enderchest.10", - "enderchest.11", - "enderchest.12", - "enderchest.13", - "enderchest.14", - "enderchest.15", - "enderchest.16", - "enderchest.17", - "enderchest.18", - "enderchest.19", - "enderchest.20", - "enderchest.21", - "enderchest.22", - "enderchest.23", - "enderchest.24", - "enderchest.25", - "enderchest.26", - "horse.0", - "horse.1", - "horse.2", - "horse.3", - "horse.4", - "horse.5", - "horse.6", - "horse.7", - "horse.8", - "horse.9", - "horse.10", - "horse.11", - "horse.12", - "horse.13", - "horse.14", - "horse.armor", - "horse.chest", - "horse.saddle", - "hotbar.0", - "hotbar.1", - "hotbar.2", - "hotbar.3", - "hotbar.4", - "hotbar.5", - "hotbar.6", - "hotbar.7", - "hotbar.8", - "inventory.0", - "inventory.1", - "inventory.2", - "inventory.3", - "inventory.4", - "inventory.5", - "inventory.6", - "inventory.7", - "inventory.8", - "inventory.9", - "inventory.10", - "inventory.11", - "inventory.12", - "inventory.13", - "inventory.14", - "inventory.15", - "inventory.16", - "inventory.17", - "inventory.18", - "inventory.19", - "inventory.20", - "inventory.21", - "inventory.22", - "inventory.23", - "inventory.24", - "inventory.25", - "inventory.26", - "villager.0", - "villager.1", - "villager.2", - "villager.3", - "villager.4", - "villager.5", - "villager.6", - "villager.7", - "weapon", - "weapon.mainhand", - "weapon.offhand" -] From 058a791511bf946d0bac2d6dd08ffc6a01a4d3ca Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Tue, 21 May 2024 12:40:37 +0200 Subject: [PATCH 25/28] Update minecraft.py - Used camelCase - Removed reset_title - Change default values - Imported Literal --- mcproto/minecraft.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index edb9286..2bbd5d2 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -14,6 +14,7 @@ from .mcpb import minecraft_pb2 as pb from .player import _PlayerCache from .world import _DefaultWorld, _WorldHub +from typing import Literal __all__ = ["Minecraft"] @@ -56,12 +57,9 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 3, fade_in: int = 1, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') - - def reset_title(self): - HasStub.runCommand(self, f'title @a reset') - def clear_title(self): - HasStub.runCommand(self, f'title @a clear') + def clearTitle(self): + HasStub.runCommand(self, 'title @a clear') From 944ecfb50d6cbae6cb8077c4f2c5ec16c6c83f37 Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Tue, 21 May 2024 12:50:34 +0200 Subject: [PATCH 26/28] Update player.py - Used camelCase - Removed reset_title - Change default values --- mcproto/player.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mcproto/player.py b/mcproto/player.py index 99ba439..a9ee0a2 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -119,15 +119,12 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def show_title(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 1, fade_in: int = 5, fade_out: int = 1) -> None: + def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 3, fade_in: int = 1, fade_out: int = 1) -> None: HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') - def reset_title(self): - HasStub.runCommand(self, f'title {self.name} reset') - - def clear_title(self): - HasStub.runCommand(self, f'title {self.name} clear') + def clearTitle(self): + self.runCommand("title @s clear") # properties that have different stub entpoints than entity @property From d895a0ae9f6e1b96660df80ef99642d28b0434cc Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Tue, 19 Aug 2025 10:13:45 +0200 Subject: [PATCH 27/28] Update minecraft.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Duration Standartwert auf 5s erhöht - HasStub.runCommand durch self.runCommand ersetzt --- mcproto/minecraft.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mcproto/minecraft.py b/mcproto/minecraft.py index 2bbd5d2..7ac48f8 100644 --- a/mcproto/minecraft.py +++ b/mcproto/minecraft.py @@ -57,9 +57,9 @@ def postToChat(self, *args, sep: str = " ") -> None: response = self._stub.postToChat(pb.ChatPostRequest(message=sep.join(map(str, args)))) raise_on_error(response) - def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 3, fade_in: int = 1, fade_out: int = 1) -> None: - HasStub.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') + def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = False, italic: bool = False, strikethrough: bool = False, underlined: bool = False, obfuscated: bool = False, duration: int = 5, fade_in: int = 1, fade_out: int = 1) -> None: + self.runCommand(self, f'title @a times {fade_in}s {duration}s {fade_out}s') + self.runCommand(self, f'title @a {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def clearTitle(self): - HasStub.runCommand(self, 'title @a clear') + self.runCommand(self, 'title @a clear') From 4f80ab417c618f239e53a28c6c00f5526cd2d10f Mon Sep 17 00:00:00 2001 From: paul07iq <127239640+paul07iq@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:07:24 +0200 Subject: [PATCH 28/28] Update player.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Duration Standartwert auf 5s erhöht --- mcproto/player.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcproto/player.py b/mcproto/player.py index a9ee0a2..4e23c83 100644 --- a/mcproto/player.py +++ b/mcproto/player.py @@ -119,9 +119,9 @@ def op(self) -> None: def deop(self) -> None: HasStub.runCommand(self, f"deop {self.name}") - def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = "false", italic: bool = "false", strikethrough: bool = "false", underlined: bool = "false", obfuscated: bool = "false", duration: int = 3, fade_in: int = 1, fade_out: int = 1) -> None: - HasStub.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') - HasStub.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') + def showTitle(self, text: str, typ: Literal["actionbar", "subtitle", "title"] = "title", color: COLOR = "gray", bold: bool = False, italic: bool = False, strikethrough: bool = False, underlined: bool = False, obfuscated: bool = False, duration: int = 5, fade_in: int = 1, fade_out: int = 1) -> None: + self.runCommand(self, f'title {self.name} times {fade_in}s {duration}s {fade_out}s') + self.runCommand(self, f'title {self.name} {typ} ' + '{' + f'"text":"{text}","color":"{color}","bold":{bold},"italic":{italic},"strikethrough":{strikethrough},"underlined":{underlined},"obfuscated":{obfuscated}' + '}') def clearTitle(self): self.runCommand("title @s clear")