[1.5.2] UsefulRecipes - Adds some useful recipes to the game!

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

OmegaPython

New Member
Jul 29, 2019
800
0
0
Bedrock and Dragon eggs?
Yeah uh... NO

Anyone know how to link into a mod but not rely on it? I'm trying to add a recipe for the new BC plugs that doesn't require the assembly table. I'm probably just really noob, but can anyone help?
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
Yeah uh... NO

Anyone know how to link into a mod but not rely on it? I'm trying to add a recipe for the new BC plugs that doesn't require the assembly table. I'm probably just really noob, but can anyone help?
couldn't you do an if statement?
Like if ____ mod is installed then gameregistry.addrecipe(itemname) or something like that
Although I don't really know. I myself am working on making an addon but can't figure out how to get the ic2 api decompiled so yea if anyone could help :p
 

OmegaPython

New Member
Jul 29, 2019
800
0
0
couldn't you do an if statement?
Like if ____ mod is installed then gameregistry.addrecipe(itemname) or something like that
Although I don't really know. I myself am working on making an addon but can't figure out how to get the ic2 api decompiled so yea if anyone could help :p
That bit isn't a problem though. FML is getting stuck on my import:
Code:
import buildcraft.BuildCraftTransport;
And I can't run anything at the import stage can I?
 

OmegaPython

New Member
Jul 29, 2019
800
0
0
OK I'm just completely confused now xD
Clearly you are more advanced at programming and I can't understand what you are talking about :p
Sorry :/ I tried
I highly doubt I am more advanced than you. Do you not have something like this at the beginning of your code?
Code:
import buildcraft.BuildCraftTransport;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
What I am saying is, FML is crashing when it tries to import the Buildcraft Transport class I need and doesn't find it, so I need a way to stop that if Buildcraft isn't installed.
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
I highly doubt I am more advanced than you. Do you not have something like this at the beginning of your code?
Code:
import buildcraft.BuildCraftTransport;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
What I am saying is, FML is crashing when it tries to import the Buildcraft Transport class I need and doesn't find it, so I need a way to stop that if Buildcraft isn't installed.
Yes I have something like that...
As to why it's crashing maybe you didn't import it correctly? Did you type it out or Ctrl shift o?
Maybe you don't have the API installed correctly
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
All the imports have to happen at the beginning of the program.

No. You might want to look into Java classloading. Import doesn't actually do anything; it just tells the VM what you mean with you say "new MyClass" when you instantiate a new object.

The name 'import' is a rather poor choice (in hindsight). It's only a namespace reference. packages are namespaces and import just tells that you are referencing "mymod.somepackagename.MyClass" instead of "someothermod.otherpackagename.MyClass". This is because class names don't have to be unique but packagenames do have to be.

To see if another mod is available all you need to do is use reflection to try to load a class from that mod. If it works it means the mod is there (it might not have loaded but you know it's in the classpath). If it fails to reference the name you know for sure that the mod isn't loaded.

How do you load a class? You use the class object, like this (by heart):
Class.forName("buildcraftpackage.someotherpackage.BuildCraftPipe");

It will throw a ClassNotFoundException if that class does not exist within the classpath. If it succeeds you know it's there. This is the easiest way to discover if other mods are there and act accordingly.

Like I said, the example is by heart, look at the Java docs for more info.[DOUBLEPOST=1368443324][/DOUBLEPOST]
I highly doubt I am more advanced than you. Do you not have something like this at the beginning of your code?
What I am saying is, FML is crashing when it tries to import the Buildcraft Transport class I need and doesn't find it, so I need a way to stop that if Buildcraft isn't installed.

That's why you don't reference class that might not be there. Ever. For this kind of stuff you need reflection.
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
Yo trying to add recipes to spawn eggs but for the life of me can't find the name for it. Looked in blocks and items and still couldn't find it...
Also do these recipes seem fair? By fair meaning hard enough. No I won't make them easier only harder
>: D
Code:
GameRegistry.addRecipe(new ItemStack(Item.record13, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockGold});
GameRegistry.addRecipe(new ItemStack(Item.recordCat, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#',Block.blockEmerald});
GameRegistry.addRecipe(new ItemStack(Item.recordBlocks, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.brick});
GameRegistry.addRecipe(new ItemStack(Item.recordChirp, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockRedstone});
GameRegistry.addRecipe(new ItemStack(Item.recordFar, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockIron});
GameRegistry.addRecipe(new ItemStack(Item.recordMall, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockDiamond});
GameRegistry.addRecipe(new ItemStack(Item.recordMellohi, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.beacon});
GameRegistry.addRecipe(new ItemStack(Item.recordStal, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.dragonEgg});
GameRegistry.addRecipe(new ItemStack(Item.recordStrad, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockNetherQuartz});
GameRegistry.addRecipe(new ItemStack(Item.recordWard, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Item.record11, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.netherStar});
GameRegistry.addRecipe(new ItemStack(Item.recordWait, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockLapis});
 

OmegaPython

New Member
Jul 29, 2019
800
0
0
Yo trying to add recipes to spawn eggs but for the life of me can't find the name for it. Looked in blocks and items and still couldn't find it...
Also do these recipes seem fair? By fair meaning hard enough. No I won't make them easier only harder
>: D
Spawn eggs: Item.monsterPlacer (I think)
If you won't make them easier, then don't change them. I think I might have to make non-GT versions of some of your recipes XD.
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
Yo trying to add recipes to spawn eggs but for the life of me can't find the name for it. Looked in blocks and items and still couldn't find it...
Also do these recipes seem fair? By fair meaning hard enough. No I won't make them easier only harder

Those recipies should not be in a game. The whole point of some stuff is that it's rare or has to be found. None of the items you use aren't easy to get. You're basically providing creative mode to players. Bit like the rediculous dragon egg recipy Xeno's gives.
 
  • Like
Reactions: OmegaPython

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
Those recipies should not be in a game. The whole point of some stuff is that it's rare or has to be found. None of the items you use aren't easy to get. You're basically providing creative mode to players. Bit like the rediculous dragon egg recipy Xeno's gives.
What's the problem with having more than one dragon egg? Oh, I guess there's the GT energy thing but I don't use GT so its only use to me would be to Feed The Bees. I agree that there's no need for survival players to get hold of spawn eggs.[DOUBLEPOST=1368520981][/DOUBLEPOST]
Also do these recipes seem fair? By fair meaning hard enough. No I won't make them easier only harder
One of the records needs a brick, another needs an Enderdragon Egg? The Enderdragon Egg, for a record? Sure, it can be duplicated with Xeno's (if you have that mod), but still, the records are pretty trivial to collect with careful placing of a Skeleton spawner and a Creeper spawner. I got a full set of records by accident on Skyblock.
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
What's the problem with having more than one dragon egg? Oh, I guess there's the GT energy thing but I don't use GT so its only use to me would be to Feed The Bees. I agree that there's no need for survival players to get hold of spawn eggs.

That's one major issue: you're basically giving people 128 mj/t for the price of 8 diamond blocks. Completely rediculous. There's stuff in vanilla that is more or less endless (like diamonds), there's stuff that's in theory limitless but quite some work to get (nether stars) and then there's stuff that's supposed to be 100% unique like the dragon egg. It's completely idiotic to allow players to simply dupe that kind of stuff because it completely throws any sense of what's rare and what's not out of the window.

EE2 did this, EE3 does this and hey what a surprise, so does Xeno's.

Finding / getting stuff like the dragon egg or the records is fun BECAUSE you can't craft them. What's the point of mods like Thaumcraft that add dungeons if every single item in those dungeons can be easily crafted? Recipies like these (no matter what mod they're from) tend to make the hard work of a lot of other mod authors completely pointless.