Skip to content

Commit

Permalink
Refactor NEU Repo (#364)
Browse files Browse the repository at this point in the history
Add RepoParser
Fix Golden Dragon stats leveling
Add wiki option
Fix recipe output count
  • Loading branch information
kevinthegreat1 authored Oct 17, 2023
1 parent e5679e0 commit 00340f5
Show file tree
Hide file tree
Showing 21 changed files with 436 additions and 408 deletions.
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
id 'com.modrinth.minotaur' version '2.+'
}

import com.modrinth.minotaur.dependencies.ModDependency

version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group

Expand Down Expand Up @@ -59,7 +57,7 @@ dependencies {

// EMI
modCompileOnly "dev.emi:emi-fabric:${project.emi_version}:api"
// modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" TODO uncomment when EMI is updated
modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}"

// Renderer (https://github.com/0x3C50/Renderer)
include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") {
Expand All @@ -80,8 +78,8 @@ dependencies {
// Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling)
include implementation("com.logisticscraft:occlusionculling:${project.occlusionculling_version}")

// neu repoparser | implement it if this is being used
// include implementation("moe.nea:neurepoparser:${project.repoparser_version}")
// NEU RepoParser
include implementation("moe.nea:neurepoparser:${project.repoparser_version}")
}

loom {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ yacl_version=3.2.1+1.20.2
## Mod Menu (https://modrinth.com/mod/modmenu/versions)
mod_menu_version = 8.0.0
## REI (https://modrinth.com/mod/rei/versions?l=fabric)
rei_version = 13.0.661
rei_version = 13.0.666
## EMI (https://modrinth.com/mod/emi/versions)
emi_version = 1.0.19+1.20.1
emi_version = 1.0.22+1.20.2
## Renderer (https://github.com/0x3C50/Renderer)
renderer_version = master-SNAPSHOT

## Mixin Extras (https://github.com/LlamaLad7/MixinExtras)
mixin_extras_version = 0.2.0-rc.5
mixin_extras_version = 0.2.0
## Better Inject (https://github.com/caoimhebyrne/BetterInject)
betterinject_version=0.1.3
## Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling)
occlusionculling_version = 0.0.7-SNAPSHOT
## neu repoparser (https://repo.nea.moe/#/releases/moe/nea/neurepoparser/)
repoparser_version = 1.3.2
repoparser_version = 1.4.0

# Mod Properties
mod_version = 1.14.0
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/de/hysky/skyblocker/SkyblockerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
import de.hysky.skyblocker.skyblock.tabhud.screenbuilder.ScreenMaster;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud;
import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.skyblock.quicknav.QuickNav;
import de.hysky.skyblocker.skyblock.rift.TheRift;
import de.hysky.skyblocker.skyblock.shortcut.Shortcuts;
import de.hysky.skyblocker.skyblock.special.SpecialEffects;
import de.hysky.skyblocker.skyblock.spidersden.Relics;
import de.hysky.skyblocker.skyblock.tabhud.TabHud;
import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr;
import de.hysky.skyblocker.utils.NEURepo;
import de.hysky.skyblocker.utils.NEURepoManager;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.chat.ChatMessageListener;
import de.hysky.skyblocker.utils.discord.DiscordRPCManager;
Expand Down Expand Up @@ -68,12 +68,12 @@ public static SkyblockerMod getInstance() {
public void onInitializeClient() {
ClientTickEvents.END_CLIENT_TICK.register(this::tick);
Utils.init();
HotbarSlotLock.init();
SkyblockerConfigManager.init();
NEURepoManager.init();
ItemRepository.init();
HotbarSlotLock.init();
PriceInfoTooltip.init();
WikiLookup.init();
ItemRegistry.init();
NEURepo.init();
FairySouls.init();
Relics.init();
BackpackPreview.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SkyblockEmiRecipe extends EmiCraftingRecipe {
private final String craftText;

public SkyblockEmiRecipe(SkyblockCraftingRecipe recipe) {
super(recipe.getGrid().stream().map(EmiStack::of).map(EmiIngredient.class::cast).toList(), EmiStack.of(recipe.getResult()).comparison(Comparison.compareNbt()), Identifier.of("skyblock", ItemUtils.getItemId(recipe.getResult()).toLowerCase().replace(';', '_')));
super(recipe.getGrid().stream().map(EmiStack::of).map(EmiIngredient.class::cast).toList(), EmiStack.of(recipe.getResult()).comparison(Comparison.compareNbt()), Identifier.of("skyblock", ItemUtils.getItemId(recipe.getResult()).toLowerCase().replace(';', '_') + "_" + recipe.getResult().getCount()));
this.craftText = recipe.getCraftText();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.compatibility.emi;

import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.utils.ItemUtils;
import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
Expand All @@ -21,9 +21,9 @@ public class SkyblockerEMIPlugin implements EmiPlugin {

@Override
public void register(EmiRegistry registry) {
ItemRegistry.getItemsStream().map(EmiStack::of).forEach(registry::addEmiStack);
ItemRepository.getItemsStream().map(EmiStack::of).forEach(registry::addEmiStack);
registry.addCategory(SKYBLOCK);
registry.addWorkstation(SKYBLOCK, EmiStack.of(Items.CRAFTING_TABLE));
ItemRegistry.getRecipesStream().map(SkyblockEmiRecipe::new).forEach(registry::addRecipe);
ItemRepository.getRecipesStream().map(SkyblockEmiRecipe::new).forEach(registry::addRecipe);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.hysky.skyblocker.compatibility.rei;

import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import de.hysky.skyblocker.skyblock.itemlist.SkyblockCraftingRecipe;
import de.hysky.skyblocker.utils.ItemUtils;
import me.shedaniel.rei.api.client.registry.display.DynamicDisplayGenerator;
Expand All @@ -19,7 +19,7 @@ public class SkyblockCraftingDisplayGenerator implements DynamicDisplayGenerator
public Optional<List<SkyblockCraftingDisplay>> getRecipeFor(EntryStack<?> entry) {
if (!(entry.getValue() instanceof ItemStack)) return Optional.empty();
EntryStack<ItemStack> inputItem = EntryStacks.of((ItemStack) entry.getValue());
List<SkyblockCraftingRecipe> filteredRecipes = ItemRegistry.getRecipesStream()
List<SkyblockCraftingRecipe> filteredRecipes = ItemRepository.getRecipesStream()
.filter(recipe -> {
ItemStack itemStack = inputItem.getValue();
ItemStack itemStack1 = recipe.getResult();
Expand All @@ -34,7 +34,7 @@ public Optional<List<SkyblockCraftingDisplay>> getRecipeFor(EntryStack<?> entry)
public Optional<List<SkyblockCraftingDisplay>> getUsageFor(EntryStack<?> entry) {
if (!(entry.getValue() instanceof ItemStack)) return Optional.empty();
EntryStack<ItemStack> inputItem = EntryStacks.of((ItemStack) entry.getValue());
List<SkyblockCraftingRecipe> filteredRecipes = ItemRegistry.getRecipesStream()
List<SkyblockCraftingRecipe> filteredRecipes = ItemRepository.getRecipesStream()
.filter(recipe -> {
for (ItemStack item : recipe.getGrid()) {
if(!ItemUtils.getItemId(item).isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.compatibility.rei;

import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.skyblock.itemlist.ItemRegistry;
import de.hysky.skyblocker.skyblock.itemlist.ItemRepository;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
Expand Down Expand Up @@ -29,6 +29,6 @@ public void registerDisplays(DisplayRegistry displayRegistry) {

@Override
public void registerEntries(EntryRegistry entryRegistry) {
entryRegistry.addEntries(ItemRegistry.getItemsStream().map(EntryStacks::of).toList());
entryRegistry.addEntries(ItemRepository.getItemsStream().map(EntryStacks::of).toList());
}
}
Loading

0 comments on commit 00340f5

Please sign in to comment.