tutorial:custom_resources
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:custom_resources [2021/03/04 16:06] – Remove distracting and unprofessional error message jummit | tutorial:custom_resources [2023/06/27 14:05] (current) – mineblock11 | ||
---|---|---|---|
Line 40: | Line 40: | ||
@Override | @Override | ||
- | public void apply(ResourceManager manager) { | + | public void reload(ResourceManager manager) { |
[...] | [...] | ||
} | } | ||
Line 46: | Line 46: | ||
</ | </ | ||
- | What you are seeing here is the actual resource reload listener (technically //a// resource reload listener, this is not the only type, however, it is the easiest to implement) that will be registered through '' | + | What you are seeing here is the actual resource reload listener (technically //a// resource reload listener, this is not the only type, however, it is the easiest to implement) that will be registered through '' |
- | The '' | + | The '' |
Firstly, you are going to want to clear or otherwise prepare to update anything that is storing the info you are going to be fetching through the manager, otherwise, your mod will likely break whenever ''/ | Firstly, you are going to want to clear or otherwise prepare to update anything that is storing the info you are going to be fetching through the manager, otherwise, your mod will likely break whenever ''/ | ||
Line 54: | Line 54: | ||
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
- | public void apply(ResourceManager manager) { | + | public void reload(ResourceManager manager) { |
// Clear caches here | // Clear caches here | ||
for(Identifier id : manager.findResources(" | for(Identifier id : manager.findResources(" | ||
- | try(IntputStream | + | try(InputStream |
// Consume the stream however you want, medium, rare, or well done. | // Consume the stream however you want, medium, rare, or well done. | ||
- | } catch(Exception e) ( | + | } catch(Exception e) { |
TUTORIAL_LOG.error(" | TUTORIAL_LOG.error(" | ||
} | } | ||
Line 83: | Line 83: | ||
@Override | @Override | ||
- | public void apply(ResourceManager manager) { | + | public void reload(ResourceManager manager) { |
// Clear Caches Here | // Clear Caches Here | ||
for(Identifier id : manager.findResources(" | for(Identifier id : manager.findResources(" | ||
- | try(IntputStream | + | try(InputStream |
// Consume the stream however you want, medium, rare, or well done. | // Consume the stream however you want, medium, rare, or well done. | ||
- | } catch(Exception e) ( | + | } catch(Exception e) { |
- | TUTORIAL_LOG.error(" | + | TUTORIAL_LOG.error(" |
} | } | ||
} | } |
tutorial/custom_resources.1614873989.txt.gz · Last modified: 2021/03/04 16:06 by jummit