User Tools

Site Tools


tutorial:resource

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorial:resource [2019/06/30 07:21] – created liachtutorial:resource [2019/09/26 01:42] (current) – Notes on getAllResources liach
Line 81: Line 81:
 Synchronizer: Offers a completeable future that is completed when all prepare tasks are done. Generally synchronizes the reloading and prevents synchronous tasks from running async. Synchronizer: Offers a completeable future that is completed when all prepare tasks are done. Generally synchronizes the reloading and prevents synchronous tasks from running async.
  
 +==== Example Usage ====
 Example of efficient resource reloading: Example of efficient resource reloading:
 <code java> <code java>
Line 124: Line 125:
 Just be careful when you call these two methods in ResourceManager: Just be careful when you call these two methods in ResourceManager:
 <code java> <code java>
-Resource getResource(Identifier var1) throws IOException; // Use try-with-resources can help you a lot +// Use try-with-resources can help you a lot 
-List<Resource> getAllResources(Identifier var1) throws IOException; // Warning: You must close all resource in this list!+Resource getResource(Identifier var1) throws IOException; 
 + 
 +// Low priority resources are earlier in this list! 
 +// Warning: You must close all resource in this! Not just closing the input stream, there is another input stream for the mcmeta file! 
 +List<Resource> getAllResources(Identifier var1) throws IOException;  list!
 </code> </code>
  
tutorial/resource.txt · Last modified: 2019/09/26 01:42 by liach