Even Gods Can Bleed Shapeless Ore Dicts

This commit is contained in:
Jeremy Diamond committed 2015-07-17 17:02:32 -07:00
1 parent f27ba20a97
commit dd001097d4
9 files changed
+76 -23

No files matched your search

@@ -4,6 +4,8 @@ import cpw.mods.fml.common.FMLCommonHandler;
import fox.spiteful.avaritia.blocks.LudicrousBlocks;
import fox.spiteful.avaritia.compat.Compat;
import fox.spiteful.avaritia.items.LudicrousItems;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraftforge.common.AchievementPage;
@@ -21,6 +23,8 @@ public class Achievements {
public static Achievement infinity;
public static Achievement armok;
public static Achievement creative_kill;
public static void achieve(){
crystal_matrix = new LudicrousAchievement("crystal_matrix", 0, 0, new ItemStack(LudicrousItems.resource, 1, 1), null);
dire_crafting = new LudicrousAchievement("dire_crafting", 1, 1, new ItemStack(LudicrousBlocks.dire_crafting), crystal_matrix);
@@ -29,6 +33,7 @@ public class Achievements {
singularity = new LudicrousAchievement("singularity", 6, 3, new ItemStack(LudicrousItems.singularity, 1, 0), neutronium);
catalyst = new LudicrousAchievement("catalyst", 6, -3, new ItemStack(LudicrousItems.resource, 1, 5), singularity).setSpecial();
infinity = new LudicrousAchievement("infinity", 4, -6, new ItemStack(LudicrousItems.resource, 1, 6), neutronium).setSpecial();
creative_kill = new LudicrousAchievement("creative_kill", -6, -6, new ItemStack(Items.skull, 1, 3), null).setSpecial();
if(Compat.blood)
armok = new LudicrousAchievement("armok", 2, -5, LudicrousItems.armok_orb, infinity);
@@ -78,7 +78,7 @@ public class Compat {
try {
Block resource = getBlock("StevesCarts", "BlockMetalStorage");
ItemStack galg = new ItemStack(resource, 1, 2);
Grinder.catalyst.recipeItems.add(galg);
Grinder.catalyst.getInput().add(galg);
}
catch(Throwable e){
Lumberjack.log(Level.INFO, "Avaritia died of old age while trying to craft the Galgadorian Drill.");
@@ -92,8 +92,8 @@ public class Compat {
Item resource = getItem("appliedenergistics2", "item.ItemMultiMaterial");
ItemStack cell = new ItemStack(resource, 1, 38);
ItemStack singularity = new ItemStack(resource, 1, 47);
Grinder.catalyst.recipeItems.add(cell);
Grinder.catalyst.recipeItems.add(singularity);
Grinder.catalyst.getInput().add(cell);
Grinder.catalyst.getInput().add(singularity);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia couldn't figure out how channels work.");
@@ -108,8 +108,8 @@ public class Compat {
Block deco = getBlock("ExtraUtilities", "decorativeBlock1");
ItemStack bed = new ItemStack(bedrockium, 1, 0);
ItemStack unstable = new ItemStack(deco, 1, 5);
Grinder.catalyst.recipeItems.add(bed);
Grinder.catalyst.recipeItems.add(unstable);
Grinder.catalyst.getInput().add(bed);
Grinder.catalyst.getInput().add(unstable);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia was unable to stop Lavos.");
@@ -124,7 +124,7 @@ public class Compat {
try {
Block resource = getBlock("gregtech", "gt.meta.storage.ingot");
ItemStack osmir = new ItemStack(resource, 1, 8682);
Grinder.catalyst.recipeItems.add(osmir);
Grinder.catalyst.getInput().add(osmir);
}
catch(Throwable e){
Lumberjack.log(Level.INFO, "Avaritia got sick of only getting 2 planks per log.");
@@ -136,7 +136,7 @@ public class Compat {
if(!gt){
Item iridium = getItem("IC2", "itemPartIridium");
ItemStack plate = new ItemStack(iridium, 1, 0);
Grinder.catalyst.recipeItems.add(plate);
Grinder.catalyst.getInput().add(plate);
}
}
catch (Throwable e){
@@ -172,7 +172,7 @@ public class Compat {
try {
Block dargon = getBlock("DraconicEvolution", "draconicBlock");
ItemStack lol = new ItemStack(dargon, 1, 0);
Grinder.catalyst.recipeItems.add(lol);
Grinder.catalyst.getInput().add(lol);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia was distracted by a giant glowing sphere.");
@@ -185,7 +185,7 @@ public class Compat {
try {
Item ingot = getItem("BigReactors", "BRIngot");
ItemStack ludicrite = new ItemStack(ingot, 1, 8);
Grinder.catalyst.recipeItems.add(ludicrite);
Grinder.catalyst.getInput().add(ludicrite);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia decided it just didn't need all that RF.");
@@ -198,7 +198,7 @@ public class Compat {
try {
Block metal = getBlock("TConstruct", "MetalBlock");
ItemStack menomena = new ItemStack(metal, 1, 2);
Grinder.catalyst.recipeItems.add(menomena);
Grinder.catalyst.getInput().add(menomena);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia fell in the smeltery.");
@@ -211,7 +211,7 @@ public class Compat {
try {
Item matter = getItem("ProjectE", "item.pe_matter");
ItemStack red = new ItemStack(matter, 1, 1);
Grinder.catalyst.recipeItems.add(red);
Grinder.catalyst.getInput().add(red);
}
catch (Throwable e){
Lumberjack.log(Level.INFO, "Avaritia got tired of abusing the blaze rod exploit.");
@@ -14,6 +14,7 @@ import net.minecraft.item.crafting.IRecipe;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.lwjgl.opengl.GL11;
import java.awt.*;
@@ -90,6 +91,8 @@ public class ExtremeShapelessRecipeHandler extends ShapelessRecipeHandler{
CachedExtremeShapelessRecipe recipe = null;
if (irecipe instanceof ExtremeShapelessRecipe)
recipe = shapelessRecipe((ExtremeShapelessRecipe) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeExtremeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
@@ -109,6 +112,8 @@ public class ExtremeShapelessRecipeHandler extends ShapelessRecipeHandler{
CachedExtremeShapelessRecipe recipe = null;
if (irecipe instanceof ExtremeShapelessRecipe)
recipe = shapelessRecipe((ExtremeShapelessRecipe) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeExtremeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
@@ -125,6 +130,8 @@ public class ExtremeShapelessRecipeHandler extends ShapelessRecipeHandler{
CachedExtremeShapelessRecipe recipe = null;
if (irecipe instanceof ExtremeShapelessRecipe)
recipe = shapelessRecipe((ExtremeShapelessRecipe) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeExtremeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
@@ -143,6 +150,16 @@ public class ExtremeShapelessRecipeHandler extends ShapelessRecipeHandler{
return new CachedExtremeShapelessRecipe(recipe.recipeItems, recipe.getRecipeOutput());
}
public CachedExtremeShapelessRecipe forgeExtremeShapelessRecipe(ShapelessOreRecipe recipe) {
ArrayList<Object> items = recipe.getInput();
for (Object item : items)
if (item instanceof List && ((List<?>) item).isEmpty())//ore handler, no ores
return null;
return new CachedExtremeShapelessRecipe(items, recipe.getRecipeOutput());
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(166, 74, 24, 18), "extreme"));
@@ -14,7 +14,7 @@ public class Bloody {
public static void bloodlett() throws Compat.ItemNotFoundException {
Block crystal = Compat.getBlock("AWWayofTime", "blockCrystal");
ItemStack cluster = new ItemStack(crystal, 1, 0);
Grinder.catalyst.recipeItems.add(cluster);
Grinder.catalyst.getInput().add(cluster);
LudicrousItems.armok_orb = new ItemOrbArmok();
GameRegistry.registerItem(LudicrousItems.armok_orb, "Orb_Armok");
@@ -21,8 +21,8 @@ public class Tsundere {
ItemStack terra = new ItemStack(storage, 1, 1);
ItemStack gaia = new ItemStack(resource, 1, 5);
Grinder.catalyst.recipeItems.add(terra);
Grinder.catalyst.recipeItems.add(gaia);
Grinder.catalyst.getInput().add(terra);
Grinder.catalyst.getInput().add(gaia);
BotaniaAPI.registerSubTile("asgardandelion", SubTileCheaty.class);
BotaniaAPI.registerSubTileSignature(SubTileCheaty.class, new Signature("asgardandelion"));
@@ -10,6 +10,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import java.util.*;
@@ -173,6 +174,12 @@ public class ExtremeCraftingManager {
return recipe;
}
public ShapelessOreRecipe addShapelessOreRecipe(ItemStack result, Object ... ingredients){
ShapelessOreRecipe recipe = new ShapelessOreRecipe(result, ingredients);
recipes.add(recipe);
return recipe;
}
public ItemStack findMatchingRecipe(InventoryCrafting matrix, World world)
{
int i = 0;
@@ -8,10 +8,11 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class Grinder {
public static ExtremeShapelessRecipe catalyst;
public static ShapelessOreRecipe catalyst;
public static void artsAndCrafts(){
@@ -55,7 +56,7 @@ public class Grinder {
'N', new ItemStack(LudicrousItems.resource, 1, 4),
'X', new ItemStack(LudicrousItems.resource, 1, 5)});
catalyst = ExtremeCraftingManager.getInstance().addShapelessRecipe(new ItemStack(LudicrousItems.resource, 2, 5), new Object[]{
catalyst = ExtremeCraftingManager.getInstance().addShapelessOreRecipe(new ItemStack(LudicrousItems.resource, 2, 5), new Object[]{
new ItemStack(Blocks.emerald_block, 1),
new ItemStack(LudicrousItems.singularity, 1, 0), new ItemStack(LudicrousItems.singularity, 1, 1),
new ItemStack(LudicrousItems.singularity, 1, 2), new ItemStack(LudicrousItems.singularity, 1, 3),
@@ -115,19 +116,22 @@ public class Grinder {
if(!OreDictionary.getOres("blockCopper").isEmpty()){
ExtremeCraftingManager.getInstance().addOreSingularityRecipe(new ItemStack(LudicrousItems.singularity, 1, 5), "blockCopper");
catalyst.recipeItems.add(new ItemStack(LudicrousItems.singularity, 1, 5));
catalyst.getInput().add(new ItemStack(LudicrousItems.singularity, 1, 5));
}
if(!OreDictionary.getOres("blockTin").isEmpty()){
ExtremeCraftingManager.getInstance().addOreSingularityRecipe(new ItemStack(LudicrousItems.singularity, 1, 6), "blockTin");
catalyst.recipeItems.add(new ItemStack(LudicrousItems.singularity, 1, 6));
catalyst.getInput().add(new ItemStack(LudicrousItems.singularity, 1, 6));
}
if(!OreDictionary.getOres("blockLead").isEmpty()){
ExtremeCraftingManager.getInstance().addOreSingularityRecipe(new ItemStack(LudicrousItems.singularity, 1, 7), "blockLead");
catalyst.recipeItems.add(new ItemStack(LudicrousItems.singularity, 1, 7));
catalyst.getInput().add(new ItemStack(LudicrousItems.singularity, 1, 7));
}
if(!OreDictionary.getOres("blockSilver").isEmpty()){
ExtremeCraftingManager.getInstance().addOreSingularityRecipe(new ItemStack(LudicrousItems.singularity, 1, 8), "blockSilver");
catalyst.recipeItems.add(new ItemStack(LudicrousItems.singularity, 1, 8));
catalyst.getInput().add(new ItemStack(LudicrousItems.singularity, 1, 8));
}
if(!OreDictionary.getOres("blockPlatinum").isEmpty()){
catalyst.getInput().add(OreDictionary.getOres("blockPlatinum"));
}
}
}
@@ -4,9 +4,11 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fox.spiteful.avaritia.Avaritia;
import fox.spiteful.avaritia.DamageSourceInfinitySword;
import fox.spiteful.avaritia.achievements.Achievements;
import fox.spiteful.avaritia.items.LudicrousItems;
import fox.spiteful.avaritia.render.ICosmicRenderItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -41,6 +43,22 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem {
return true;
}
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
if(!entity.worldObj.isRemote && entity instanceof EntityPlayer) {
EntityPlayer victim = (EntityPlayer)entity;
if(victim.capabilities.isCreativeMode && !victim.isDead && victim.getHealth() > 0){
victim.func_110142_aN().func_94547_a(new DamageSourceInfinitySword(player), victim.getHealth(), victim.getHealth());
victim.setHealth(0);
victim.onDeath(new EntityDamageSource("infinity", player));
player.addStat(Achievements.creative_kill, 1);
return true;
}
}
return false;
}
@Override
public EnumRarity getRarity(ItemStack stack)
{
@@ -65,15 +83,15 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem {
this.cosmicMask = ir.registerIcon("avaritia:infinity_sword_mask");
this.pommel = ir.registerIcon("avaritia:infinity_sword_pommel");
}
@Override
public IIcon getIcon(ItemStack stack, int pass)
{
if (pass == 1) { return this.pommel; }
return super.getIcon(stack, pass);
}
@SideOnly(Side.CLIENT)
@Override
public boolean requiresMultipleRenderPasses()