mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-21 04:32:29 +00:00
My hands are typing words!
NEI, Thaumcraft aspects
This commit is contained in:
1 parent
846d2036e0
commit
746c16cbb3
12 files changed
+255
-19
No files matched your search
@@ -1,14 +1,15 @@
|
||||
package fox.spiteful.avaritia;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
|
||||
import fox.spiteful.avaritia.compat.Compat;
|
||||
import fox.spiteful.avaritia.crafting.Grinder;
|
||||
import fox.spiteful.avaritia.gui.GooeyHandler;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
@@ -18,14 +19,15 @@ public class Avaritia {
|
||||
@Instance
|
||||
public static Avaritia instance;
|
||||
|
||||
@SidedProxy(serverSide="fox.spiteful.avaritia.CommonProxy", clientSide="fox.spiteful.avaritia.ClientProxy")
|
||||
@SidedProxy(serverSide = "fox.spiteful.avaritia.CommonProxy", clientSide = "fox.spiteful.avaritia.ClientProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void earlyGame(FMLPreInitializationEvent event){
|
||||
instance = this;
|
||||
LudicrousItems.grind();
|
||||
LudicrousBlocks.voxelize();
|
||||
Compat.census();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -37,5 +39,6 @@ public class Avaritia {
|
||||
|
||||
@EventHandler
|
||||
public void endGame(FMLPostInitializationEvent event){
|
||||
Compat.compatify();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package fox.spiteful.avaritia;
|
||||
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import fox.spiteful.avaritia.pretties.FancyHaloRenderer;
|
||||
import fox.spiteful.avaritia.render.FancyHaloRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
public class Lumberjack {
|
||||
|
||||
public static final Logger logger = LogManager.getLogger("Magic Trees");
|
||||
public static final Logger logger = LogManager.getLogger("Avaritia");
|
||||
|
||||
public static void log(Level level, Throwable e, String message) {
|
||||
log(level, message);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package fox.spiteful.avaritia.compat;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class Compat {
|
||||
|
||||
public static boolean nei = false;
|
||||
public static boolean thaumic = false;
|
||||
|
||||
public static void census(){
|
||||
nei = Loader.isModLoaded("NotEnoughItems");
|
||||
thaumic = Loader.isModLoaded("Thaumcraft");
|
||||
}
|
||||
|
||||
public static void compatify(){
|
||||
if(nei){
|
||||
try
|
||||
{
|
||||
Class<?> handler = Class.forName("fox.spiteful.avaritia.compat.ExtremeShapedRecipeHandler");
|
||||
Class<?> api = Class.forName("codechicken.nei.api.API");
|
||||
api.getMethod("registerRecipeHandler", Class.forName("codechicken.nei.recipe.ICraftingHandler")).invoke(null, handler.newInstance());
|
||||
api.getMethod("registerUsageHandler", Class.forName("codechicken.nei.recipe.IUsageHandler")).invoke(null, handler.newInstance());
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(thaumic){
|
||||
try
|
||||
{
|
||||
Lucrum.abracadabra();
|
||||
}
|
||||
catch(Throwable e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
package fox.spiteful.avaritia.compat;
|
||||
|
||||
import fox.spiteful.avaritia.crafting.ExtremeCraftingManager;
|
||||
import fox.spiteful.avaritia.crafting.ExtremeShapedRecipe;
|
||||
import fox.spiteful.avaritia.gui.GUIExtremeCrafting;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.ShapedRecipeHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ExtremeShapedRecipeHandler extends ShapedRecipeHandler
|
||||
{
|
||||
public class CachedExtremeRecipe extends CachedRecipe
|
||||
{
|
||||
public CachedExtremeRecipe(ExtremeShapedRecipe recipe)
|
||||
{
|
||||
this(recipe.recipeWidth, recipe.recipeHeight, recipe.recipeItems, recipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
public CachedExtremeRecipe(int width, int height, Object[] items, ItemStack out)
|
||||
{
|
||||
this.result = new PositionedStack(out, 201, 75);
|
||||
this.ingredients = new ArrayList<PositionedStack>();
|
||||
setIngredients(width, height, items);
|
||||
}
|
||||
|
||||
public void setIngredients(int width, int height, Object[] items)
|
||||
{
|
||||
for(int x = 0; x < width; x++)
|
||||
{
|
||||
for(int y = 0; y < height; y++)
|
||||
{
|
||||
if(items[y * width + x] == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PositionedStack stack = new PositionedStack(items[y * width + x], 3 + x * 18, 3 + y * 18);
|
||||
stack.setMaxSize(1);
|
||||
this.ingredients.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<PositionedStack> getIngredients()
|
||||
{
|
||||
return (ArrayList<PositionedStack>) getCycledIngredients(ExtremeShapedRecipeHandler.this.cycleticks / 20, this.ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public ArrayList<PositionedStack> ingredients;
|
||||
public PositionedStack result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass()
|
||||
{
|
||||
return GUIExtremeCrafting.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
return "Xtreme Crafting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results)
|
||||
{
|
||||
if(outputId.equals("extended") && getClass() == ExtremeShapedRecipeHandler.class)
|
||||
{
|
||||
List<IRecipe> allrecipes = ExtremeCraftingManager.getInstance().getRecipeList();
|
||||
for(IRecipe irecipe : allrecipes)
|
||||
{
|
||||
CachedRecipe recipe = null;
|
||||
if(irecipe instanceof ExtremeShapedRecipe)
|
||||
recipe = new CachedExtremeRecipe((ExtremeShapedRecipe)irecipe);
|
||||
|
||||
if(recipe == null)
|
||||
continue;
|
||||
|
||||
this.arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result)
|
||||
{
|
||||
List<IRecipe> allrecipes = ExtremeCraftingManager.getInstance().getRecipeList();
|
||||
for(IRecipe irecipe : allrecipes)
|
||||
{
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(irecipe.getRecipeOutput(), result))
|
||||
{
|
||||
CachedRecipe recipe = null;
|
||||
if(irecipe instanceof ExtremeShapedRecipe)
|
||||
recipe = new CachedExtremeRecipe((ExtremeShapedRecipe)irecipe);
|
||||
|
||||
if(recipe == null)
|
||||
continue;
|
||||
|
||||
this.arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient)
|
||||
{
|
||||
List<IRecipe> allrecipes = ExtremeCraftingManager.getInstance().getRecipeList();
|
||||
for(IRecipe irecipe : allrecipes)
|
||||
{
|
||||
if(irecipe instanceof ExtremeShapedRecipe)
|
||||
{
|
||||
CachedExtremeRecipe recipe = new CachedExtremeRecipe((ExtremeShapedRecipe)irecipe);
|
||||
if(recipe.contains(recipe.ingredients, ingredient))
|
||||
{
|
||||
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
||||
if(!this.arecipes.contains(recipe))
|
||||
this.arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "avaritia:textures/gui/dire_crafting_gui.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlay(GuiContainer gui, Container container, int recipe)
|
||||
{
|
||||
return RecipeInfo.hasDefaultOverlay(gui, "extreme");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipe)
|
||||
{
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 9, 5, 223, 166);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package fox.spiteful.avaritia.compat;
|
||||
|
||||
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class Lucrum {
|
||||
|
||||
public static Aspect ULTRA_DEATH;
|
||||
|
||||
public static void abracadabra(){
|
||||
ULTRA_DEATH = new Aspect("terminus", 0xb90000, new Aspect[] { Aspect.GREED, Aspect.ELDRITCH }, new ResourceLocation("avaritia", "textures/misc/terminus.png"), 771);
|
||||
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(LudicrousItems.resource, 1, 1), new AspectList().add(ULTRA_DEATH, 1).add(Aspect.ENERGY, 8).add(Aspect.CRYSTAL, 32));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(LudicrousItems.resource, 1, 4), new AspectList().add(ULTRA_DEATH, 2).add(Aspect.METAL, 12).add(Aspect.ENERGY, 12));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(LudicrousBlocks.neutron_collector, 1, OreDictionary.WILDCARD_VALUE), new AspectList().add(ULTRA_DEATH, 5).add(Aspect.METAL, 64).add(Aspect.ENERGY, 64).add(Aspect.MECHANISM, 64));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class Grinder {
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 1, 0), new Object[]{"X X", " X ", "X X", 'X', new ItemStack(Items.diamond)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousItems.resource, 1, 1), new Object[]{"DSD", "DSD", 'D', new ItemStack(LudicrousItems.resource, 1, 0), 'S', new ItemStack(Items.nether_star)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.double_craft, 1), new Object[]{"CCC", "CCC", "CCC", 'C', new ItemStack(Blocks.crafting_table)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.triple_craft, 1), new Object[]{"CCC", "CCC", "CCC", 'C', new ItemStack(Blocks.crafting_table)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.triple_craft, 1), new Object[]{"CCC", "CCC", "CCC", 'C', new ItemStack(LudicrousBlocks.double_craft)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(Blocks.crafting_table, 9), new Object[]{"C", 'C', new ItemStack(LudicrousBlocks.double_craft)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.double_craft, 9), new Object[]{"C", 'C', new ItemStack(LudicrousBlocks.triple_craft)});
|
||||
GameRegistry.addShapedRecipe(new ItemStack(LudicrousBlocks.crystal_matrix, 1, 0), new Object[]{"CCC", "CCC", "CCC", 'C', new ItemStack(LudicrousItems.resource, 1, 1)});
|
||||
@@ -28,12 +28,12 @@ public class Grinder {
|
||||
|
||||
ExtremeCraftingManager.getInstance().addRecipe(new ItemStack(LudicrousBlocks.neutron_collector, 1), new Object[]{
|
||||
"IIQQQQQII",
|
||||
"I RRRRR I",
|
||||
"I R I",
|
||||
"X RRR X",
|
||||
"I RXR I",
|
||||
"X RRR X",
|
||||
"I I",
|
||||
"I QQQQQ I",
|
||||
"I RRR I",
|
||||
"X RRRRR X",
|
||||
"I RRXRR I",
|
||||
"X RRRRR X",
|
||||
"I RRR I",
|
||||
"I I",
|
||||
"IIIXIXIII",
|
||||
'X', new ItemStack(LudicrousItems.resource, 1, 1),
|
||||
|
||||
@@ -13,12 +13,10 @@ import org.lwjgl.opengl.GL11;
|
||||
public class GUINeutron extends GuiContainer
|
||||
{
|
||||
private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("avaritia", "textures/gui/neutron_collector_gui.png");
|
||||
private TileEntityNeutron tileNeutron;
|
||||
|
||||
public GUINeutron(InventoryPlayer player, TileEntityNeutron machine)
|
||||
{
|
||||
super(new ContainerNeutron(player, machine));
|
||||
this.tileNeutron = machine;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,7 +24,8 @@ public class GUINeutron extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.neutron_collector"), 28, 6, 4210752);
|
||||
String s = StatCollector.translateToLocal("container.neutron_collector");
|
||||
this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ public class ItemResource extends Item {
|
||||
for (int x = 0; x < types.length; x++) {
|
||||
icons[x] = ir.registerIcon("avaritia:" + "resource_" + types[x]);
|
||||
}
|
||||
|
||||
halo = new IIcon[2];
|
||||
|
||||
halo = new IIcon[2];
|
||||
halo[0] = ir.registerIcon("avaritia:halo");
|
||||
halo[1] = ir.registerIcon("avaritia:halonoise");
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fox.spiteful.avaritia.pretties;
|
||||
package fox.spiteful.avaritia.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
Reference in new issue
Block a user