generated from jaredlll08/MultiLoader-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44d7e3f
commit ff39e65
Showing
31 changed files
with
814 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
common/src/main/java/org/sinytra/assetexport/ProgressTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.sinytra.assetexport; | ||
|
||
import org.sinytra.assetexport.dumper.Identifiable; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
public class ProgressTracker { | ||
public static long start; | ||
public static Identifiable<?> currentRender; | ||
public static Counter generated; | ||
public static Counter dumped; | ||
|
||
public record Counter(AtomicInteger done, int target) { | ||
public Counter(int target) { | ||
this(new AtomicInteger(), target); | ||
} | ||
|
||
public void increment() { | ||
done.incrementAndGet(); | ||
} | ||
|
||
public float get() { | ||
return (float)done.get() / target; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
common/src/main/java/org/sinytra/assetexport/dumper/Identifiable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package org.sinytra.assetexport.dumper; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
public interface Identifiable<T extends Identifiable<T>> { | ||
default IdentifiableType<T> getIdentifiableType() { | ||
return null; | ||
} | ||
|
||
public interface Identifiable { | ||
// TODO - we're injecting this interface and it could conflict... but it's just in dev so maybe not | ||
default ResourceLocation getId() { | ||
default String representAsString() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
common/src/main/java/org/sinytra/assetexport/dumper/IdentifiableType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.sinytra.assetexport.dumper; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public interface IdentifiableType<T extends Identifiable<T>> { | ||
// TODO - we're injecting this interface and it could conflict... but it's just in dev so maybe not | ||
default ResourceLocation getId() { | ||
return null; | ||
} | ||
|
||
default T defaultIdentifiable() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.