Skip to content

Replace item #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Replace item #4

wants to merge 10 commits into from

Conversation

paul07iq
Copy link

No description provided.

paul07iq added 10 commits May 19, 2024 14:49
Added slots to _types.py
Improved replaceItem
Added replaceItem
fixed pos in world.py
Removed mistake
Removed mistakes
Removed mistakes
Removed mistakes
Fixed imports
Fixed coordinates
Copy link
Owner

@icezyclon icezyclon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sehr gut, hab alles getestet (Blocks und Entities) und es scheint mir alles gut zu funktionieren. Besonders die SLOT Variable finde ich sehr hilfreich, da mir mein autocomplete direkt vorschläg was ich brauche 👍

@@ -23,3 +23,156 @@
"red",
"black",
]

SLOTS: TypeAlias = Literal[
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte Einzahl verwenden, also SLOT statt SLOTS.

@@ -97,6 +98,12 @@ def setBlockCube(self, blocktype: str, pos1: Vec3, pos2: Vec3) -> None:
)
)
raise_on_error(response)

def replaceItem(self, pos: Vec3, slot: SLOTS, item: str, amount: int = 1, nbt: NBT | None = None) -> None:
if nbt is None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte hier nur kurz die position abrunden, falls jemand keine Ganzzahlige Position hineinreicht.
(also, vor dem if ein pos = pos.floor() oder so, sollte meistens keine Rolle spielen, aber war eine Idee, die ich gerade hatte

@icezyclon
Copy link
Owner

Bitte siehe meinen Kommentar in #5 wo ich pre-commit erkläre, das wäre noch super, wenn du das einfach automatisch bei jedem Commit machst 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants