Skip to content

Commit 27e1a17

Browse files
authored
Fix block texture replacing
1 parent 9090bd2 commit 27e1a17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/handling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ def open(self, path: str | Path, atlas_type: str):
3333
def addElement(self, position: tuple | list, new_texture: Image.Image):
3434
new_texture = new_texture.convert("RGBA")
3535

36-
# Define las variables de posición
37-
x_atlas = position[0]
38-
y_atlas = position[1]
39-
4036
if self.atlas_type == "Items":
37+
x_atlas = position[0]
38+
y_atlas = position[1]
4139
# Reemplazar la textura original por la nueva
4240
print("Replacing texture...")
4341
x = 0
@@ -50,6 +48,8 @@ def addElement(self, position: tuple | list, new_texture: Image.Image):
5048
x_atlas -= 16
5149
y_atlas += 1
5250
elif self.atlas_type == "Blocks":
51+
x_atlas = position[0] - 2
52+
y_atlas = position[1] - 2
5353
# Reemplazar la textura original por la nueva
5454
print("Replacing texture...")
5555
x = -2
@@ -145,4 +145,4 @@ def calculateGrid(value: int, grid_width: int, grid_height: int, cube_lenght: in
145145
x = x_grid * cube_lenght
146146
y = y_grid * cube_lenght
147147

148-
return (x, y)
148+
return (x, y)

0 commit comments

Comments
 (0)