Merge 1.19.4 into 1.20
This commit is contained in:
commit
6198f0c9d3
22
CONTRIBUTING.md
Normal file
22
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
ModernFix is a standard Minecraft-style Gradle project powered by Architectury Loom. To build the mod for all platforms,
|
||||||
|
run the `build` task (e.g. via `./gradlew build`). You can also use `./gradlew forge:build` or `./gradlew fabric:build`
|
||||||
|
to build for just one loader (e.g. when debugging and wanting to rebuild quickly).
|
||||||
|
|
||||||
|
You must use Java 17 to develop ModernFix as the toolchain requires it. Nonetheless, the 1.16 mod JARs will work on
|
||||||
|
a Minecraft instance with Java 8.
|
||||||
|
|
||||||
|
## Submitting pull requests
|
||||||
|
|
||||||
|
Code or documentation contributions are welcome. Please keep the following points in mind:
|
||||||
|
|
||||||
|
* This project supports many Minecraft versions. Ideally, contributions should be made to the oldest relevant MC version.
|
||||||
|
For instance, a PR optimizing new worldgen should be made to 1.18 (not 1.19 or 1.20) while a PR optimizing something
|
||||||
|
like recipes should be made to 1.16 (the oldest supported version).
|
||||||
|
|
||||||
|
This somewhat unconventional policy ensures that all supported versions are treated equal when it comes to development,
|
||||||
|
rather than the onus being on other modders and players to backport changes that are needed. Changes to older versions are
|
||||||
|
quickly ported up to the latest one as part of the regular development cycle. You are still welcome to open PRs against
|
||||||
|
a newer branch if desired - but the change will likely be applied manually and not merged as a regular PR.
|
||||||
|
|
||||||
|
* Please ensure your code is reasonably neat and sufficiently documented. Remember that self-documenting code is always
|
||||||
|
better.
|
||||||
|
|
@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -43,8 +44,8 @@ public class ModelManagerMixin {
|
||||||
|
|
||||||
private BlockModel loadSingleBlockModel(ResourceManager manager, ResourceLocation location) {
|
private BlockModel loadSingleBlockModel(ResourceManager manager, ResourceLocation location) {
|
||||||
return manager.getResource(location).map(resource -> {
|
return manager.getResource(location).map(resource -> {
|
||||||
try {
|
try (BufferedReader reader = resource.openAsReader()) {
|
||||||
return BlockModel.fromStream(resource.openAsReader());
|
return BlockModel.fromStream(reader);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
ModernFix.LOGGER.error("Couldn't load model", e);
|
ModernFix.LOGGER.error("Couldn't load model", e);
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -54,8 +55,8 @@ public class ModelManagerMixin {
|
||||||
|
|
||||||
private List<ModelBakery.LoadedJson> loadSingleBlockState(ResourceManager manager, ResourceLocation location) {
|
private List<ModelBakery.LoadedJson> loadSingleBlockState(ResourceManager manager, ResourceLocation location) {
|
||||||
return manager.getResourceStack(location).stream().map(resource -> {
|
return manager.getResourceStack(location).stream().map(resource -> {
|
||||||
try {
|
try (BufferedReader reader = resource.openAsReader()) {
|
||||||
return new ModelBakery.LoadedJson(resource.sourcePackId(), GsonHelper.parse(resource.openAsReader()));
|
return new ModelBakery.LoadedJson(resource.sourcePackId(), GsonHelper.parse(reader));
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
ModernFix.LOGGER.error("Couldn't load blockstate", e);
|
ModernFix.LOGGER.error("Couldn't load blockstate", e);
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -41,8 +44,8 @@ public class ModelManagerMixin {
|
||||||
|
|
||||||
private BlockModel loadSingleBlockModel(ResourceManager manager, ResourceLocation location) {
|
private BlockModel loadSingleBlockModel(ResourceManager manager, ResourceLocation location) {
|
||||||
return manager.getResource(location).map(resource -> {
|
return manager.getResource(location).map(resource -> {
|
||||||
try {
|
try (BufferedReader reader = resource.openAsReader()) {
|
||||||
return BlockModel.fromStream(resource.openAsReader());
|
return BlockModel.fromStream(reader);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
ModernFix.LOGGER.error("Couldn't load model", e);
|
ModernFix.LOGGER.error("Couldn't load model", e);
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -52,8 +55,8 @@ public class ModelManagerMixin {
|
||||||
|
|
||||||
private List<ModelBakery.LoadedJson> loadSingleBlockState(ResourceManager manager, ResourceLocation location) {
|
private List<ModelBakery.LoadedJson> loadSingleBlockState(ResourceManager manager, ResourceLocation location) {
|
||||||
return manager.getResourceStack(location).stream().map(resource -> {
|
return manager.getResourceStack(location).stream().map(resource -> {
|
||||||
try {
|
try (BufferedReader reader = resource.openAsReader()) {
|
||||||
return new ModelBakery.LoadedJson(resource.sourcePackId(), GsonHelper.parse(resource.openAsReader()));
|
return new ModelBakery.LoadedJson(resource.sourcePackId(), GsonHelper.parse(reader));
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
ModernFix.LOGGER.error("Couldn't load blockstate", e);
|
ModernFix.LOGGER.error("Couldn't load blockstate", e);
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user