38 lines
1.4 KiB
Java
38 lines
1.4 KiB
Java
package io.gitlab.jfronny.dynres.mixin;
|
|
|
|
import io.gitlab.jfronny.dynres.DynRes;
|
|
import net.minecraft.server.dedicated.ServerPropertiesHandler;
|
|
import net.minecraft.util.registry.DynamicRegistryManager;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
|
|
import java.util.Properties;
|
|
|
|
@Mixin(ServerPropertiesHandler.class)
|
|
public class ServerPropertiesHandlerMixin {
|
|
@Shadow public String resourcePack;
|
|
|
|
@Shadow public String resourcePackHash;
|
|
|
|
@Shadow public String resourcePackSha1;
|
|
|
|
@Inject(at = @At("RETURN"), method = "<init>(Ljava/util/Properties;Lnet/minecraft/util/registry/DynamicRegistryManager;)V")
|
|
public void init(Properties properties, DynamicRegistryManager dynamicRegistryManager, CallbackInfo info) {
|
|
System.err.println(resourcePack);
|
|
System.err.println(resourcePackHash);
|
|
System.err.println(resourcePackSha1);
|
|
|
|
resourcePack = DynRes.removePort(DynRes.simplifyElement(DynRes.baseLink)) + ":" + DynRes.getPort() + "/" + DynRes.simplifyElement(DynRes.resFile);
|
|
//TODO hash the pack
|
|
resourcePackSha1 = "";
|
|
resourcePackHash = resourcePackSha1;
|
|
|
|
System.err.println(resourcePack);
|
|
System.err.println(resourcePackHash);
|
|
System.err.println(resourcePackSha1);
|
|
}
|
|
}
|