Skip to content

Commit 5149b65

Browse files
committed
Fixed can't set own 'minecraft_textures_atlas_blocks.png_0.png', or 'minecraft_textures_atlas_blocks.png.txt'
1 parent fa0b2e3 commit 5149b65

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ class Launch:
5050
def __init__(self, filter: List[str] = None,
5151
scale_factor: int = 0,
5252
method: Literal["abs_diff", "euclidean"] = "euclidean",
53-
png_atlas_filename: str="minecraft_textures_atlas_blocks.png_0.png",
54-
txt_atlas_filename:str="minecraft_textures_atlas_blocks.png.txt") -> None:
53+
png_atlas_filename: str=resource_path("minecraft_textures_atlas_blocks.png_0.png"),
54+
txt_atlas_filename:str=resource_path("minecraft_textures_atlas_blocks.png.txt")) -> None:
5555

5656
self.PNG_ATLAS_FILENAME = png_atlas_filename
5757
self.TXT_ATLAS_FILENAME = txt_atlas_filename
5858
self.CACHE_FILENAME = "blocks.json"
5959
self.method = method
6060
self.scale_factor = scale_factor
61-
self.blocks_image = Image.open(resource_path(self.PNG_ATLAS_FILENAME), "r")
61+
self.blocks_image = Image.open(self.PNG_ATLAS_FILENAME, "r")
6262
self.caching = dict()
6363

6464
blocks = self._get_blocks_cached()
@@ -79,7 +79,7 @@ def _get_blocks_cached(self) -> List[Tuple[str, int, int, Tuple[int, int, int]]]
7979
with open(os.path.join(get_execution_folder(), self.CACHE_FILENAME), "r") as f:
8080
blocks = json.load(f)
8181
else:
82-
valid_client = download.ValidBlocksClient(resource_path(self.TXT_ATLAS_FILENAME))
82+
valid_client = download.ValidBlocksClient(self.TXT_ATLAS_FILENAME)
8383
blocks = valid_client.exclude_invalid_blocks()
8484

8585
calculate_median = calculate_minecraft_blocks_median.CalculateMinecraftBlocksMedian(blocks, self.PNG_ATLAS_FILENAME)
@@ -195,8 +195,8 @@ def main():
195195
parser.add_argument('--filter', nargs='+', help='Filter options')
196196
parser.add_argument('--scale_factor', type=int, help='Scale factor', default=0)
197197
parser.add_argument('--method', type=str, choices=["abs_diff", "euclidean"], help='Method of finding the closest color to block', default="euclidean", required=False)
198-
parser.add_argument('--png_atlas_filename', type=str, default='minecraft_textures_atlas_blocks.png_0.png', help='PNG atlas filename')
199-
parser.add_argument('--txt_atlas_filename', type=str, default='minecraft_textures_atlas_blocks.png.txt', help='TXT atlas filename')
198+
parser.add_argument('--png_atlas_filename', type=str, default=resource_path('minecraft_textures_atlas_blocks.png_0.png'), help='PNG atlas filename')
199+
parser.add_argument('--txt_atlas_filename', type=str, default=resource_path('minecraft_textures_atlas_blocks.png.txt'), help='TXT atlas filename')
200200

201201
args = parser.parse_args()
202202

0 commit comments

Comments
 (0)