diff --git a/build.gradle b/build.gradle index 7732da8..65ff520 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ buildscript { repositories { jcenter() - mavenCentral() maven { name = "forge" url = "https://files.minecraftforge.net/maven" @@ -17,7 +16,7 @@ plugins { id "com.github.hierynomus.license" version "0.14.0" id "com.matthewprenger.cursegradle" version "1.0.10" } -apply plugin: "net.minecraftforge.gradle.forge" +apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'com.selesse.git.changelog' apply plugin: 'java' @@ -114,7 +113,7 @@ changelog { title = "Thaumic JEI" fileName = "CHANGELOG.md" outputDirectory = file("$projectDir") - since = 'last_tag' + since = '1.4.0' commitFormat = '%s (%an)' markdown { commitFormat = '* %s (%an)' diff --git a/gradle.properties b/gradle.properties index 847b51a..11940f6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ modGroup=com.buuz135.thaumicjei.ThaumicJEI -modVersion=1.5.0 +modVersion=1.5.1 minecraftVersion=1.12.2 modBaseName=ThaumicJEI forgeVersion=1.12.2-14.23.4.2747 -mcpVersion=snapshot_20180410 +mcpVersion=snapshot_20171003 jei_version=4.10.0.198 diff --git a/src/main/java/com/buuz135/thaumicjei/event/ResearchManager.java b/src/main/java/com/buuz135/thaumicjei/event/ResearchManager.java index d81d9fd..cc2bad6 100644 --- a/src/main/java/com/buuz135/thaumicjei/event/ResearchManager.java +++ b/src/main/java/com/buuz135/thaumicjei/event/ResearchManager.java @@ -1,3 +1,24 @@ +/* + * This file is part of Hot or Not. + * + * Copyright 2018, Buuz135 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the + * Software without restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies + * or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ package com.buuz135.thaumicjei.event; import com.buuz135.thaumicjei.ThaumcraftJEIPlugin; @@ -19,7 +40,7 @@ @Mod.EventBusSubscriber(modid = ThaumicJEI.MOD_ID, value = Side.CLIENT) public class ResearchManager { - private static int needSync = -1; + private static int timeToSync = -1; @SubscribeEvent public static void onResearch(ResearchEvent.Research event) { @@ -29,20 +50,24 @@ public static void onResearch(ResearchEvent.Research event) { @SubscribeEvent public static void onJoin(WorldEvent.Load event) { if (event.getWorld() instanceof WorldClient) { - needSync = 20; + timeToSync = 20; } } @SubscribeEvent public static void onTick(TickEvent.ClientTickEvent event) { - if (needSync >= 0 && event.phase == TickEvent.Phase.END) { - if (needSync == 0) sync(""); - needSync--; + if (timeToSync >= 0 && event.phase == TickEvent.Phase.END) { + if (timeToSync == 0) sync(""); + timeToSync--; } } private static void sync(String current) { if (!ThaumicConfig.hideRecipesIfMissingResearch) return; + if (Minecraft.getMinecraft().player == null) { + timeToSync = 20; + return; + } if (Minecraft.getMinecraft().player.hasCapability(ThaumcraftCapabilities.KNOWLEDGE, null)) { for (String uuid : new String[]{ThaumcraftJEIPlugin.arcaneWorkbenchCategory.getUid(), ThaumcraftJEIPlugin.crucibleCategory.getUid(), ThaumcraftJEIPlugin.infusionCategory.getUid()}) { ThaumcraftJEIPlugin.runtime.getRecipeRegistry().getRecipeWrappers(ThaumcraftJEIPlugin.runtime.getRecipeRegistry().getRecipeCategory(uuid)).forEach(o -> ThaumcraftJEIPlugin.runtime.getRecipeRegistry().hideRecipe((IRecipeWrapper) o, uuid));