MidnightLib 0.2.6 - Code cleanup & compression

- MidnightHats is now more performant and has new types of special hats
- Compress assets
- Reduce filesize heavily
This commit is contained in:
Motschen
2021-10-01 19:56:53 +02:00
parent cedf1df78a
commit 454b8ec01d
19 changed files with 98 additions and 122 deletions

View File

@@ -1,6 +1,8 @@
package eu.midnightdust.hats.web;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.minecraft.client.MinecraftClient;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
@@ -15,13 +17,13 @@ import java.net.URL;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import static net.minecraft.datafixer.fix.BlockEntitySignTextStrictJsonFix.GSON;
public class HatLoader {
public static final Logger logger = LogManager.getLogger("MidnightLib");
private final static String HATS_URL = "https://raw.githubusercontent.com/TeamMidnightDust/MidnightHats/master/hats.json";
public static final Type HAT_TYPE = new TypeToken<Map<UUID, PlayerHatData>>(){}.getType();
public static Map<UUID, PlayerHatData> PLAYER_HATS;
private static final Gson GSON = new GsonBuilder().create();
public static void init() {
CompletableFuture.supplyAsync(() -> {