Skip to content

Commit

Permalink
Merge pull request #34 from GTNewHorizons/fix/server-nei-crash
Browse files Browse the repository at this point in the history
Fix server causing error with NEI
  • Loading branch information
Dream-Master authored Jun 12, 2023
2 parents 5acd289 + 5322691 commit f42e2d2
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 47 deletions.
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1684218858
//version: 1685785062
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -1276,12 +1276,14 @@ tasks.register('faq') {
description = 'Prints frequently asked questions about building a project'

doLast {
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " +
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" +
"The links can be found in repositories.gradle and build.gradle:repositories, " +
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" +
print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
"Or you can manually check if the versions are still on the distributing sites - " +
"the links can be found in repositories.gradle and build.gradle:repositories, " +
"but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" +
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties.")
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " +
"However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " +
"Java 9 or later.")
}
}

Expand Down
9 changes: 0 additions & 9 deletions src/main/java/fox/spiteful/avaritia/compat/Compat.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import fox.spiteful.avaritia.compat.botania.Tsundere;
import fox.spiteful.avaritia.compat.forestry.Ranger;
import fox.spiteful.avaritia.compat.minetweaker.Tweak;
import fox.spiteful.avaritia.compat.nei.NotEnough;
import fox.spiteful.avaritia.compat.tails.InfiniteFoxes;
import fox.spiteful.avaritia.compat.thaumcraft.Lucrum;
import fox.spiteful.avaritia.compat.ticon.Tonkers;
Expand Down Expand Up @@ -64,14 +63,6 @@ public static void census() {
}

public static void compatify() {
if (nei) {
try {
NotEnough.items();
} catch (Throwable e) {
Lumberjack.log(Level.INFO, e, "Avaritia had Too Many Items.");
}
}

if (tweak) {
try {
Tweak.registrate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class ItemInfinitatoCostume extends Item {

private static final String[] types = new String[] { "armstrong", "moon", "egbert", "francis" };
public static final String[] types = new String[] { "armstrong", "moon", "egbert", "francis" };

@SideOnly(Side.CLIENT)
public IIcon[] icons;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
import fox.spiteful.avaritia.compat.Compat;
import fox.spiteful.avaritia.compat.nei.NotEnough;
import fox.spiteful.avaritia.crafting.ExtremeCraftingManager;
import fox.spiteful.avaritia.crafting.ExtremeShapedRecipe;
import fox.spiteful.avaritia.items.LudicrousItems;
Expand Down Expand Up @@ -71,11 +69,6 @@ public static void baka() throws Compat.ItemNotFoundException {
GameRegistry.registerTileEntity(TileInfinitato.class, "Avaritia_Infinitato");
costumes = new ItemInfinitatoCostume();
GameRegistry.registerItem(costumes, "costumes");
if (Compat.nei) {
try {
NotEnough.hide(new ItemStack(costumes, 1, OreDictionary.WILDCARD_VALUE));
} catch (Throwable e) {}
}

Block potato = Compat.getBlock("Botania", "tinyPotato");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package fox.spiteful.avaritia.compat.nei;

import net.minecraft.item.ItemStack;

import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import fox.spiteful.avaritia.compat.botania.ItemInfinitatoCostume;
import fox.spiteful.avaritia.compat.botania.Tsundere;

@SuppressWarnings("unused")
public class NEIAvaritiaConfig implements IConfigureNEI {

@Override
public void loadConfig() {
ExtremeShapedRecipeHandler shaped = new ExtremeShapedRecipeHandler();
ExtremeShapelessRecipeHandler shapeless = new ExtremeShapelessRecipeHandler();
CompressionHandler compress = new CompressionHandler();
API.registerRecipeHandler(shaped);
API.registerRecipeHandler(shapeless);
API.registerRecipeHandler(compress);
API.registerUsageHandler(shaped);
API.registerUsageHandler(shapeless);
API.registerUsageHandler(compress);

if (Tsundere.costumes != null) {
for (int i = 0; i < ItemInfinitatoCostume.types.length; i++) {
API.hideItem(new ItemStack(Tsundere.costumes, 1, i));
}
}
}

@Override
public String getName() {
return "Avaritia NEI plugin";
}

@Override
public String getVersion() {
return "";
}
}
24 changes: 0 additions & 24 deletions src/main/java/fox/spiteful/avaritia/compat/nei/NotEnough.java

This file was deleted.

0 comments on commit f42e2d2

Please sign in to comment.