mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Some quality of life adjustments
This commit is contained in:
parent
b4663b4881
commit
68cbb4b57b
5 changed files with 36 additions and 15 deletions
14
build.gradle
14
build.gradle
|
@ -54,9 +54,23 @@ repositories {
|
|||
flatDir {
|
||||
dir 'lib'
|
||||
}
|
||||
maven {
|
||||
// location of the maven that hosts JEI files
|
||||
name = "Progwml6 maven"
|
||||
url = "http://dvs1.progwml6.com/files/maven"
|
||||
}
|
||||
maven {
|
||||
// location of a maven mirror for JEI files, as a fallback
|
||||
name = "ModMaven"
|
||||
url = "modmaven.k-4u.nl"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
deobfCompile('com.minelittlepony:jumpingcastle:1.12.2.1.0.0:universal')
|
||||
// compile against the JEI API but do not include it at runtime
|
||||
deobfProvided "mezz.jei:jei_${project.mcVersion}:${project.jeiVersion}:api"
|
||||
// at runtime, use the full JEI jar
|
||||
runtime "mezz.jei:jei_${project.mcVersion}:${project.jeiVersion}"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
@ -8,6 +8,7 @@ buildVersion=2
|
|||
buildRevision=6
|
||||
mcVersion=1.12.2
|
||||
mcfVersion=14.23.2.2654
|
||||
jeiVersion=4.15.0.268
|
||||
mcMappings=stable_39
|
||||
refCore=mixins.unicopia.refmap.json
|
||||
forgeGradleVersion=2.3-SNAPSHOT
|
||||
|
|
|
@ -57,7 +57,16 @@ public class Unicopia implements IGuiHandler {
|
|||
|
||||
private static IChannel channel;
|
||||
|
||||
private static CraftingManager craftingManager;
|
||||
private static CraftingManager craftingManager = new CraftingManager(MODID, "enchanting") {
|
||||
@Override
|
||||
protected void registerRecipeTypes(Map<String, Function<JsonObject, IRecipe>> types) {
|
||||
super.registerRecipeTypes(types);
|
||||
|
||||
types.put("unicopia:crafting_spell", SpellRecipe::deserialize);
|
||||
|
||||
AffineIngredients.instance().load();
|
||||
}
|
||||
};
|
||||
|
||||
public static CraftingManager getCraftingManager() {
|
||||
return craftingManager;
|
||||
|
@ -106,16 +115,7 @@ public class Unicopia implements IGuiHandler {
|
|||
|
||||
@EventHandler
|
||||
public void posInit(FMLPostInitializationEvent event) {
|
||||
craftingManager = new CraftingManager(MODID, "enchanting") {
|
||||
@Override
|
||||
protected void registerRecipeTypes(Map<String, Function<JsonObject, IRecipe>> types) {
|
||||
super.registerRecipeTypes(types);
|
||||
|
||||
types.put("unicopia:crafting_spell", SpellRecipe::deserialize);
|
||||
|
||||
AffineIngredients.instance().load();
|
||||
}
|
||||
};
|
||||
craftingManager.load();
|
||||
|
||||
Pages.instance().load();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class GuiSpellBook extends GuiContainer implements IPageUnlockListener {
|
|||
|
||||
private static IPage currentIPage;
|
||||
|
||||
private static final ResourceLocation spellBookGuiTextures = new ResourceLocation("unicopia", "textures/gui/container/book.png");
|
||||
public static final ResourceLocation spellBookGuiTextures = new ResourceLocation("unicopia", "textures/gui/container/book.png");
|
||||
|
||||
private IPlayer playerExtension;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.unicopia.util.crafting;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
@ -40,8 +41,6 @@ public class CraftingManager {
|
|||
public CraftingManager(@Nonnull ResourceLocation id) {
|
||||
crafting_id = id;
|
||||
assets = new AssetWalker(id, this::handleJson);
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
protected void handleJson(ResourceLocation id, JsonObject json) throws JsonParseException {
|
||||
|
@ -87,7 +86,7 @@ public class CraftingManager {
|
|||
public IRecipe findMatchingRecipe(InventoryCrafting craftMatrix, World worldIn) {
|
||||
load();
|
||||
|
||||
for (IRecipe irecipe : REGISTRY.values()) {
|
||||
for (IRecipe irecipe : getRecipes()) {
|
||||
if (irecipe.matches(craftMatrix, worldIn)) {
|
||||
return irecipe;
|
||||
}
|
||||
|
@ -96,6 +95,13 @@ public class CraftingManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
public Collection<IRecipe> getRecipes() {
|
||||
if (REGISTRY.isEmpty()) {
|
||||
load();
|
||||
}
|
||||
return REGISTRY.values();
|
||||
}
|
||||
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting craftMatrix, World worldIn) {
|
||||
IRecipe recipe = findMatchingRecipe(craftMatrix, worldIn);
|
||||
|
||||
|
|
Loading…
Reference in a new issue