Jump to content

Armeleon

Members
  • Posts

    27
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Armeleon's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Hey all. I'm trying to edit cocoa behavior by adding a new type of wood it can be planted on. I don't want to overwrite the base classes if possible, and would like to just change where it checks for blocks type by overwriting. In the code, cocoa is placed when the if statement 'if (block == Blocks.log && BlockLog.func_150165_c(i1) == 3)' is met. I want to add my own wood to the code. Any ideas?
  2. Ah cool. Thanks for that. I've been trying to update from 1.5 and I keep missing things.
  3. I'm having a really odd issue with adding a new recipe. When I try and add a shapeless recipe using my blocks, it won't work. When I try and do it using my items, it works fine. Here are my shapeless recipe adds. The one with asterisks doesn't work. Anyone know why? //Recipe Stuff ItemStack bowl = new ItemStack(Item.getItemById(281)); //bowl ItemStack redMush = new ItemStack(Block.getBlockById(40)); //red ItemStack brownMush = new ItemStack(Block.getBlockById(39)); //brown ItemStack yellowMush = new ItemStack(lemoncup); ItemStack orangeMush = new ItemStack(orangecap); ItemStack mushroomStew = new ItemStack(Item.getItemById(282)); //mushroomstew GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, orangeMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, redMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, brownMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, redMush, orangeMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, brownMush, orangeMush}); **GameRegistry.addShapelessRecipe(new ItemStack(this.lemoncupPlanks), new ItemStack(this.lemoncupTrunk));** GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Blocks.acacia_stairs)); EDIT: Solved it! Finally. Like was said below, you have to use the accessor classes Blocks and Items to call vanilla items and blocks to ItemStacks going forward. For some reason, I had to set up my own accessor class to get my blocks to work in ItemStacks as well. I can reference item instances just fine, but I have to reference blocks through my own personal Blocks class (I called it ModBlocks) which included nothing but a bunch of variables for each block (public static block Name = (Block)BlockRegistry.Name;). It somehow changes the accessibility of the block. Don't know why.
  4. That works! Thank you. But now it seems like I've got to give it its own texture and everything. I've never done an entity before, can you point me in the right direction? I don't need anything fancy. Like I said in my first post, I want it to look and act exactly like an item frame, just without the ability to drop items.
  5. That would be it. How would I register an entity?
  6. Hello! I have a small issue with registering a new Item Frame. I want to make it so that breaking an item frame doesn't drop any items. I figured the easiest way to do this was to copy the EntityItemFrame class into my mod, change the name and extend it from the original EntityItemFrame class. That way, I could change the ItemDropChance variable to 0. It works great, but it doesn't register properly with the world, and when I quit and come back in, my customized frames are gone. I've posted my new class, CheatingItemFrame, here. Can anyone help?
  7. Perfect! You've been more than helpful
  8. Oh, so you have to place it from the Entity side, cool, thanks. While I have you here, is there an accessor method in the Entity class for placing items in the frame? I can check when I get back to my computer, but are there any tricks I should know there?
  9. Basically what the title says. How do I place Item Frames in world gen? I can make a dozen or so blocks to get around the issue, but I'd rather just place Item Frame entities on the wall. Is there a way to do this?
  10. Well. I solved it. And you will never guess how. For some reason, with a mac, it will not work as a zipped folder. It just won't. I accidentally left it unzipped before starting, and it worked. Textures and all. Thank you for everything, again.
  11. Not to get off topic, but that difference doesn't work for some reason. Do I have to place it outside the class? It doesn't like the 'new' declaration. Deleting it (so it reads 'Flora instance;' instead of 'new Flora instance;') gives me no errors. But thank you. Thank you so much for all your help. Hopefully I will find the answer somewhere.
  12. I agree with that guy ^^. THe first opaque block from the top of the sky. However, I want to add that if you gen your stuff too early, trees might not be in place yet. I had that problem once.
  13. My bad. I was experimenting with a couple things. Basically, I just got rid of the mod folder and made it simply spelunking. So it says package spelunking; Here's the code: package spelunking; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = Flora.modid, name = "spelunking", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = "spelunking", packetHandler = FloraPacketHandler.class) public class Flora { @Instance public static Flora instance = new Flora(); public static final String modid = "spelunking"; //Plant list public static Block caveWheatBlock; public static Block lemoncupBlock; public static Block orangecapBlock; public static Item caveWheatSeeds; public static Item caveWheat; public static Item caveWheatBread; public static Item lemoncup; public static Item orangecap; BonemealHandler bonemealHandler = new BonemealHandler(); @PreInit public void PreInit(FMLPreInitializationEvent event) { //Plant Init caveWheatBlock = new BlockCaveWheat(900).setUnlocalizedName("cavewheat").setLightValue(0.4F); lemoncupBlock = new BlockLemoncup(901).setUnlocalizedName("lemoncups").setLightValue(0.4F); orangecapBlock = new BlockOrangecap(902).setUnlocalizedName("orangecaps").setLightValue(0.4F) ; //Item Init caveWheatSeeds = (new ItemCaveWheatSeeds(910, caveWheatBlock.blockID, Block.gravel.blockID)).setUnlocalizedName("cavewheatseeds"); caveWheat = (new ItemCaveWheat(911)).setUnlocalizedName("cavewheat").setCreativeTab(CreativeTabs.tabMaterials); caveWheatBread = (new ItemCaveBread(912, 5, 0.6F, false)).setUnlocalizedName("cavebread"); lemoncup = (new ItemLemoncup(913, 2, 0.8F, lemoncupBlock.blockID, Block.gravel.blockID)).setUnlocalizedName("lemoncup"); orangecap = (new ItemOrangecap(914, 2, 0.8F, orangecapBlock.blockID, Block.gravel.blockID)).setUnlocalizedName("orangecap"); //Recipe Stuff ItemStack bowl = new ItemStack(Item.bowlEmpty); ItemStack redMush = new ItemStack(Block.mushroomRed); ItemStack brownMush = new ItemStack(Block.mushroomBrown); ItemStack yellowMush = new ItemStack(lemoncup); ItemStack orangeMush = new ItemStack(orangecap); GameRegistry.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{bowl, yellowMush, orangeMush}); GameRegistry.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{bowl, yellowMush, redMush}); GameRegistry.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{bowl, yellowMush, brownMush}); GameRegistry.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{bowl, redMush, orangeMush}); GameRegistry.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{bowl, brownMush, orangeMush}); GameRegistry.addRecipe(new ItemStack(caveWheatBread), new Object[]{" ", "www", "www", 'w', new ItemStack(caveWheat)}); //Game Registry stuff GameRegistry.registerBlock(caveWheatBlock, modid + (caveWheatBlock).getUnlocalizedName()); GameRegistry.registerBlock(lemoncupBlock, modid + (lemoncupBlock).getUnlocalizedName()); GameRegistry.registerBlock(orangecapBlock, modid + (orangecapBlock).getUnlocalizedName()); //Language Registry Stuff LanguageRegistry.addName(caveWheatBlock, "Cave Wheat"); LanguageRegistry.addName(lemoncupBlock, "Lemoncup"); LanguageRegistry.addName(orangecapBlock, "Orangecap"); LanguageRegistry.addName(caveWheatSeeds, "Cave Wheat Seeds"); LanguageRegistry.addName(caveWheat, "Cave Wheat"); LanguageRegistry.addName(caveWheatBread, "Cave Bread"); LanguageRegistry.addName(lemoncup, "Lemoncup"); LanguageRegistry.addName(orangecap, "Orangecap"); MinecraftForge.EVENT_BUS.register(bonemealHandler); } }
  14. You understood me. However, forge does't like that structure. Here are the screenshots. This is my mod structure: Notice that my package directory is on the same level as assets. (And yes, I changed the space to an underscore, oops) This is the error I am getting: More detail: I know how to fix it. I just have to move my package structure up one level, and make spelunking the name of the zip. But then I can't get assets to be on the same level. What am I doing wrong?
  15. Excellent. I think I understand. I need a zip folder, and in that zip folder I need to have an assets folder and a directory that matches the package structure in eclipse. However, when I run Minecraft on it, it crashes because it can't find the main class file. According to forge, the package root needs to be the name of the zip folder. But then I can't connect it to assets. Does that make sense?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.