Skip to content

Commit

Permalink
Fix incompatibilities with CustomMainMenu and ReplayMod
Browse files Browse the repository at this point in the history
- Fixes #90
- Fixes #91
  • Loading branch information
Runemoro committed Jul 1, 2018
1 parent be4406c commit 5ce2aef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ dependencies {
compileOnly "2568:0:TConstruct-1.12.2-2.10.1.84@jar"
compileOnly "2511:625:Avaritia-1.12-3.2.0.13-universal@jar"
compileOnly "codechicken:CodeChickenLib:1.12.2-3.1.9.344:deobf"
compileOnly "2482:584:CustomMainMenu-MC1.12.2-2.0.8@jar"
}

def travisBuildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
def versionSuffix = travisBuildNumber != null ? travisBuildNumber : "SNAPSHOT"

version "1.0.9-$versionSuffix"
version "1.0.10-$versionSuffix"
group "org.dimdev.vanillafix"
archivesBaseName = "VanillaFix"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(NetHandlerPlayClient.class)
@Mixin(value = NetHandlerPlayClient.class, priority = 500)
public abstract class MixinNetHandlerPlayClient implements INetHandlerPlayClient {
@Shadow private boolean doneLoadingTerrain;
@Shadow(aliases = "clientWorldController") private WorldClient world;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public void getSectionsInStringBuilder(StringBuilder builder) {

private String getVanillaFixComment() {
try {
if (Math.random() < 0.5 && !suspectedMods.isEmpty()) {
if (Math.random() < 0.01 && !suspectedMods.isEmpty()) {
ModContainer mod = suspectedMods.iterator().next();
String author = mod.getMetadata().authorList.get((int) (Math.random() * mod.getMetadata().authorList.size()));
return "I blame " + author + ", author of " + mod.getName() + ".";
String author = mod.getMetadata().authorList.get(0);
return "I blame " + author + ".";
}
} catch (Throwable ignored) {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.dimdev.vanillafix.crashes.mixins.client;

import com.google.common.util.concurrent.ListenableFutureTask;
import lumien.custommainmenu.gui.GuiCustom;
import net.minecraft.client.LoadingScreenRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.SoundHandler;
Expand All @@ -26,6 +27,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fml.client.SplashProgress;
import net.minecraftforge.fml.common.Loader;
import org.apache.logging.log4j.Logger;
import org.dimdev.utils.GlUtil;
import org.dimdev.vanillafix.ModConfig;
Expand Down Expand Up @@ -205,7 +207,7 @@ public void displayInitErrorScreen(CrashReport report) {

private void runGUILoop(GuiScreen screen) throws IOException {
displayGuiScreen(screen);
while (running && currentScreen != null && !(currentScreen instanceof GuiMainMenu)) {
while (running && currentScreen != null && !(currentScreen instanceof GuiMainMenu) && !(Loader.isModLoaded("custommainmenu") && currentScreen instanceof GuiCustom)) {
if (Display.isCreated() && Display.isCloseRequested()) System.exit(0);
leftClickCounter = 10000;
currentScreen.handleInput();
Expand Down

0 comments on commit 5ce2aef

Please sign in to comment.