Giter VIP home page Giter VIP logo

regolith-filters's People

Contributors

cda94581 avatar chibimango avatar evilguy50 avatar hippokleides avatar lucienhh avatar majestikbutter avatar medicaljewel105 avatar nusiq avatar sirlich avatar stirante avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

regolith-filters's Issues

[Name Ninja] Crashes with error when identifier missing or has no namespace instead of gracefully stopping

Description

When identifier field is missing in entity, the filter crashes with error:

[ERROR] [Filter] Traceback (most recent call last):
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 90, in <module>
[ERROR] [Filter]     main()
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 69, in main
[ERROR] [Filter]     translations.extend(gather_translations(behavior_pack.entities, settings.get("entities", {}), "minecraft:entity/description/name", "entity.identifier.name", False))
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 31, in gather_translations
[ERROR] [Filter]     identifier = asset.identifier
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\reticulator.py", line 1108, in identifier
[ERROR] [Filter]     return self.get_value_at("minecraft:entity/description/identifier")
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\reticulator.py", line 326, in get_value_at
[ERROR] [Filter]     return dpath.util.get(self.data, json_path)
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\venvs\0\lib\site-packages\dpath\util.py", line 178, in get
[ERROR] [Filter]     raise KeyError(glob)
[ERROR] [Filter] KeyError: 'minecraft:entity/description/identifier'
[ERROR] name_ninja failed

When identifier field has no namespace e.g. minecraft_pig, it also crashes with a different error:

[ERROR] [Filter] Traceback (most recent call last):
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 38, in gather_translations
[ERROR] [Filter]     name = asset.get_value_at(name_jsonpath)
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\reticulator.py", line 326, in get_value_at
[ERROR] [Filter]     return dpath.util.get(self.data, json_path)
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\venvs\0\lib\site-packages\dpath\util.py", line 178, in get
[ERROR] [Filter]     raise KeyError(glob)
[ERROR] [Filter] KeyError: 'minecraft:entity/description/name'
[ERROR] [Filter]
[ERROR] [Filter] During handling of the above exception, another exception occurred:
[ERROR] [Filter]
[ERROR] [Filter] Traceback (most recent call last):
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 90, in <module>
[ERROR] [Filter]     main()
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 69, in main
[ERROR] [Filter]     translations.extend(gather_translations(behavior_pack.entities, settings.get("entities", {}), "minecraft:entity/description/name", "entity.identifier.name", False))
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 41, in gather_translations
[ERROR] [Filter]     name = prefix + format_name(identifier) + postfix
[ERROR] [Filter]   File "D:\Dokumenty\GitHub\bedrock\<omitted>\.regolith\cache\filters\github.com\Bedrock-OSS\regolith-filters\name_ninja\name_ninja.py", line 17, in format_name
[ERROR] [Filter]     return name.split(":")[1].replace("_", " ").title()
[ERROR] [Filter] IndexError: list index out of range
[ERROR] name_ninja failed

Expected Behavior

I'd like to see an error type message along the lines of

[ERROR] [Filter] File x.json has invalid identifier! The namespace is missing.
[ERROR] [Filter] File y.json has missing identifier!

[name_ninja] Fails is no .lang file

Please have it create the lang file if it does not exist or add to the read.me that it needs to exist (along with needed python installed)

Finish implementation of bump_manifest

  • Switch to array-based version
  • Check which manifests need to be bumped
  • Gracefully handle missing RP/BP manifest
  • Two independent versions needed?
  • Detect in RP/BP to seed the version file, or can we just use that?

Write readme.md

Explain in light-terms what regolith is, and how the standard-library works, in relationship to regolith. Include links back to regolith.

Then, provide the json for each filter, with a small explanation, and then a link to each filters readme.md.

[texture_list] Update to support subpacks

Needs clarification. Atm it's not clear whether every subpack folder should get their own texture_list.json file, or whether the main texture_list.json file should simply include subpack textures inside.

Package filter

Should use settings to pick packaging details.

settings:

  • export location
  • package type (mcpack, mcaddon?)
  • path to world to package it with
  • option to clear data from world like player data?
  • what else do we need for packaging?

`xcf` converter

Write new filter to convert xcf files into PNG. xcf is a file format used by Gimp.

[json_cleaner] Use UTF-8 encoding by default and better error handling

I encountered an error, that was caused by json_cleaner using system encoding for opening files (cp1252) and files being encoded in UTF-8.

[INFO]  Running filter json_cleaner
[ERROR] [json_cleaner] Traceback (most recent call last):
[ERROR] [json_cleaner]   File "<project>\.regolith\cache\filters\json_cleaner\json_cleaner.py", line 32, in <mod
ule>
[ERROR] [json_cleaner]     main()
[ERROR] [json_cleaner]   File "<project>\.regolith\cache\filters\json_cleaner\json_cleaner.py", line 27, in main
[ERROR] [json_cleaner]     json_data = get_json_from_file(fh.read())
[ERROR] [json_cleaner]   File "C:\Python310\lib\encodings\cp1252.py", line 23, i
n decode
[ERROR] [json_cleaner]     return codecs.charmap_decode(input,self.errors,decodi
ng_table)[0]
[ERROR] [json_cleaner] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8
1 in position 567: character maps to <undefined>
[ERROR] Failed to run profile "dev"
[+]: Failed to run filter.
[+]: Failed to run the 1st subfilter of "json_cleaner" filter.
[+]: Failed to run Python script.
[+]: exit status 1

I think it should use utf-8 by default (maybe add an option to change that?). Also it should report which file caused the error.

[Gametests] A few errors

I had a couple of problems trying to use the gametests filter.

  1. I found that the outfile has to be specified in my settings as "out": "scripts/main.js" instead of the readme that specifies a default of "outfile": "scripts/main.js", as otherwise it will save to the file BP/undefined instead of BP/scripts/main.js due to the line settings.buildOptions.outfile = "../../BP/" + settings.out;
    reproducible by just not specifying any settings in the profiles.dev.filters, or specifying an outfile

  2. the readme says in the changelog "customizing buildOptions will now overwrite each individual property, rather than overwriting buildOptions as a whole", however this isn't true as the const settings = ... line will replace any options in the defSettings, so the following line that should be merging them does nothing as they are the same, so you do have to specify all the buildOptions
    reproducible by just specifying in the settings "buildOptions": {}; this throws an error when trying to push to buildOptions.external as it doesn't exist

not sure if I explained those well or if this is the correct channel for this, I tried to work out why they happened as best I could, I can give some example configs and errors if you want

[gametests] Filter doesn't work with the use_project_app_data_storage setting

When the user has the regolith config use_project_app_data_storage true setting enabled. The gametest filter won't be able to build the files. This is most likely because it uses a relative path to access regolith's config.json file.

This is most likely the source of the problem:

const rootPath = path.resolve(__dirname, "../../../../");

It should use the ROOT_DIR environment variable to get the path instead:

https://bedrock-oss.github.io/regolith/guide/custom-filters.html#filter-environment-variables

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.