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

update versions and suppress warnings that can be suppressed #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx8G

minecraft_version=1.8.9
yarn_mappings=1.8.9+build.202004210309
loader_version=0.8.2+build.202006122116
yarn_mappings=1.8.9+build.202011050955
loader_version=0.9.3+build.202009100647

fabric_asm_version=v2.0
zt_zip_version=1.14
slf4j_version=1.7.30

mod_version = 1.0.0
mod_version = 1.0.1
maven_group = me.modmuss50
archives_base_name = optifabric
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class MixinOptifineConfig {
@Shadow
private static GameOptions gameSettings;

@SuppressWarnings({"InvalidMemberReference", "UnresolvedMixinReference"})
@Inject(method = {"isAnimatedTerrain", "isAnimatedTextures", "isSwampColors", "isRandomEntities", "isSmoothBiome", "isCustomColors", "isCustomSky", "isCustomFonts", "isShowCapes", "isConnectedTextures", "isNaturalTextures", "isEmissiveTextures", "isConnectedTexturesFancy", "isFastRender", "isTranslucentBlocksFancy", "isSmoothWorld", "isLazyChunkLoading", "isDynamicFov", "isAlternateBlocks", "isCustomItems", "isDynamicLights", "isDynamicLightsFast", "isCustomEntityModels", "isCustomGuis", "isSmoothFps", "isShowGlErrors"},
at = @At("HEAD"), cancellable = true, remap = false)
private static void isRandomEntities(CallbackInfoReturnable<Boolean> returnable) {
Expand Down
20 changes: 7 additions & 13 deletions src/main/java/me/modmuss50/optifabric/mixin/MixinTitleScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@
import me.modmuss50.optifabric.mod.Optifabric;
import me.modmuss50.optifabric.mod.OptifabricError;
import me.modmuss50.optifabric.mod.OptifineVersion;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(TitleScreen.class)
public abstract class MixinTitleScreen extends Screen {
public class MixinTitleScreen extends Screen {

protected MixinTitleScreen() {
super();
}

@Inject(method = "init", at = @At("RETURN"))
@Inject(method = "init", at = @At("TAIL"))
private void init(CallbackInfo info) {
Optifabric.checkForErrors();
}

@Inject(method = "render", at = @At("RETURN"))
private void render(int int_1, int int_2, float float_1, CallbackInfo info) {
@Inject(method = "render", at = @At("TAIL"))
private void render(CallbackInfo info) {
if (!OptifabricError.hasError()) {
this.drawString(MinecraftClient.getInstance().textRenderer, OptifineVersion.version, 2, this.height - 20, 0xFFFFFFFF);
this.textRenderer.draw(OptifineVersion.version, 2, this.height - 20, 0xFFFFFFFF);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public abstract class MixinTypeFilterableList<T> {

/**
* @author hydos
* @reason optifabric for 1.8.9
*/
@Overwrite
public <S> Iterable<S> method_6408(final Class<S> var1) {
Expand All @@ -40,6 +41,7 @@ public <S> Iterable<S> method_6408(final Class<S> var1) {

/**
* @author hydos
* @reason optifabric for 1.8.9
*/
@Overwrite
public Iterator<T> iterator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class OptifineInstaller {
public static void extract(File installer, File output, File minecraftJar) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, MalformedURLException {
System.out.println("Running optifine patcher");
ClassLoader classLoader = new URLClassLoader(new URL[]{installer.toURI().toURL()}, OptifineInstaller.class.getClassLoader());
Class clazz = classLoader.loadClass("optifine.Patcher");
Class<?> clazz = classLoader.loadClass("optifine.Patcher");
Method method = clazz.getDeclaredMethod("process", File.class, File.class, File.class);
method.invoke(null, minecraftJar, installer, output);
}
Expand Down