Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
khjxiaogu committed Dec 16, 2024
1 parent 7c17994 commit 831da1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ sourceSets {
srcDirs = [
"$rootDir/src/main/resources",
]
exclude 'assets/frostedheart/lang/**'
}
}
noDatagen{java{srcDirs=[]} resources{srcDirs=[]}}
Expand All @@ -43,7 +42,6 @@ sourceSets {
srcDirs = [
"$rootDir/src/datagen/resources",
]
exclude 'assets/frostedheart/lang/**'
}
}
}
Expand Down Expand Up @@ -307,12 +305,14 @@ import groovy.json.JsonSlurper
import groovy.json.JsonOutput
tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.WARN
exclude 'assets/frostedheart/lang/**'
new File("$rootDir/src/main/resources/assets/frostedheart/lang").listFiles({ f -> f.isDirectory() } as FileFilter).each(t->outputs.file(t.getAbsolutePath()+".json"))
// automatically join lang files
doLast{
def resourcesDir = sourceSets.main.output.resourcesDir
resourcesDir.mkdirs()
def langDir=new File(resourcesDir,"assets/frostedheart/lang/")
langDir.mkdirs()

def langList=new File("$rootDir/src/main/resources/assets/frostedheart/lang").listFiles({ f -> f.isDirectory() } as FileFilter)
langList.each{fn->

Expand All @@ -326,6 +326,7 @@ tasks.processResources {
new JsonSlurper().parse(childFile).each{key,value->langFile.put(key,value)}
}
//write to output
langDir.mkdirs()
new File(langDir,fn.name+".json").text=JsonOutput.prettyPrint(JsonOutput.toJson(langFile))

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import com.teammoeg.frostedheart.content.incubator.IncubatorT2Screen;
import com.teammoeg.frostedheart.content.climate.recipe.CampfireDefrostRecipe;
import com.teammoeg.frostedheart.content.climate.recipe.InstallInnerRecipe;
import com.teammoeg.frostedheart.content.tips.TipRenderer;
import com.teammoeg.frostedheart.content.utility.recipe.ModifyDamageRecipe;
import com.teammoeg.frostedheart.content.climate.recipe.SmokingDefrostRecipe;
import com.teammoeg.frostedheart.content.research.FHResearch;
Expand All @@ -85,7 +84,6 @@
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.RecipeTypes;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.handlers.IGlobalGuiHandler;
import mezz.jei.api.gui.handlers.IGuiClickableArea;
import mezz.jei.api.gui.handlers.IGuiContainerHandler;
import mezz.jei.api.helpers.IGuiHelper;
Expand All @@ -101,7 +99,6 @@
import mezz.jei.api.runtime.IJeiRuntime;
import mezz.jei.library.ingredients.IngredientInfoRecipe;
import mezz.jei.library.util.RecipeUtil;
import net.minecraft.client.renderer.Rect2i;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
Expand All @@ -112,7 +109,6 @@
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;

@JeiPlugin
public class JEICompat implements IModPlugin {
Expand Down Expand Up @@ -312,15 +308,9 @@ public Collection<IGuiClickableArea> getGuiClickableAreas(GeneratorScreen<?,?> c
return col;
}
});

registry.addRecipeClickArea(IncubatorT1Screen.class, 80, 28, 32, 29, IncubatorCategory.UID);
registry.addRecipeClickArea(IncubatorT2Screen.class, 107, 28, 14, 29, IncubatorCategory.UID);

registry.addGlobalGuiHandler(new IGlobalGuiHandler() {
@Override
public @NotNull Collection<Rect2i> getGuiExtraAreas() {
return Collections.singletonList(TipRenderer.TIP_WIDGET.getRect());
}
});
}

@Override
Expand Down

0 comments on commit 831da1a

Please sign in to comment.