Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic port to 1.19.2 #467

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.1.+" apply false
id "me.shedaniel.unified-publishing" version "0.1.+"
id "maven-publish"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import hunternif.mc.impl.atlas.core.GlobalTileDataHandler;
import hunternif.mc.impl.atlas.core.PlayerEventHandler;
import hunternif.mc.impl.atlas.core.TileDataHandler;
import hunternif.mc.impl.atlas.core.scaning.TileDetectorBase;
import hunternif.mc.impl.atlas.core.scaning.WorldScanner;
import hunternif.mc.impl.atlas.core.scanning.WorldScanner;
import hunternif.mc.impl.atlas.event.RecipeCraftedCallback;
import hunternif.mc.impl.atlas.event.RecipeCraftedHandler;
import hunternif.mc.impl.atlas.item.AntiqueAtlasItems;
Expand Down Expand Up @@ -55,8 +54,6 @@ public static AtlasIdData getAtlasIdData(World world) {
}

public static void init() {
TileDetectorBase.scanBiomeTypes();

AutoConfig.register(AntiqueAtlasConfig.class, JanksonConfigSerializer::new);
CONFIG = AutoConfig.getConfigHolder(AntiqueAtlasConfig.class).getConfig();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public CompletableFuture<Map<Identifier, ITexture>> load(ResourceManager manager
return CompletableFuture.supplyAsync(() -> {
Map<Identifier, ITexture> textures = new HashMap<>();

for (Identifier id : manager.findResources("textures/gui/tiles", (s) -> s.endsWith(".png"))) {
for (Identifier id : manager.findResources("textures/gui/tiles", id -> id.toString().endsWith(".png")).keySet()) {
// id now contains the physical file path of the texture
try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.profiler.Profiler;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
Expand Down Expand Up @@ -40,14 +41,14 @@ public CompletableFuture<Collection<TextureSet>> load(ResourceManager manager, P
Map<Identifier, TextureSet> sets = new HashMap<>();

try {
for (Identifier id : manager.findResources("atlas/texture_sets", (s) -> s.endsWith(".json"))) {
for (Identifier id : manager.findResources("atlas/texture_sets", id -> id.toString().endsWith(".json")).keySet()) {
Identifier texture_id = new Identifier(
id.getNamespace(),
id.getPath().replace("atlas/texture_sets/", "").replace(".json", "")
);

try {
Resource resource = manager.getResource(id);
Resource resource = manager.getResource(id).orElseThrow(IOException::new);
try (
InputStream stream = resource.getInputStream();
InputStreamReader reader = new InputStreamReader(stream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import hunternif.mc.impl.atlas.AntiqueAtlasMod;
import hunternif.mc.impl.atlas.core.scaning.TileHeightType;
import hunternif.mc.impl.atlas.core.scanning.TileHeightType;
import hunternif.mc.impl.atlas.resource.ResourceReloadListener;
import hunternif.mc.impl.atlas.util.Log;
import net.fabricmc.api.EnvType;
Expand All @@ -13,6 +13,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.profiler.Profiler;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Collection;
Expand Down Expand Up @@ -45,11 +46,11 @@ public CompletableFuture<Map<Identifier, Identifier>> load(ResourceManager manag
Map<Identifier, Identifier> map = new HashMap<>();

try {
for (Identifier id : manager.findResources("atlas/tiles", (s) -> s.endsWith(".json"))) {
for (Identifier id : manager.findResources("atlas/tiles", id -> id.toString().endsWith(".json")).keySet()) {
Identifier tile_id = new Identifier(id.getNamespace(), id.getPath().replace("atlas/tiles/", "").replace(".json", ""));

try {
Resource resource = manager.getResource(id);
Resource resource = manager.getResource(id).orElseThrow(IOException::new);
try (InputStream stream = resource.getInputStream(); InputStreamReader reader = new InputStreamReader(stream)) {
JsonObject object = JsonParser.parseReader(reader).getAsJsonObject();

Expand Down
Loading
Loading