Jump to content

LKloosterman

Members
  • Posts

    24
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I KNOW JAVA. STOP ASKING IF I KNOW JAVA!

LKloosterman's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. The solution? Make sure you're in survival mode. ? I was in Creative mode for testing and forgot to switch over to survival mode which means no drops when destroying blocks!
  2. So, we can go ahead and close or remove this thread, it turns out the "issue" had nothing to do with Forge or modding, and mostly just my stupidity...
  3. About that, isn't the method called by MC/Forge when the plant is broken? Edit: To clear things up, I'm not really sure where to put the breakpoints/check things out because if my function isn't even being called then it won't do much to put it there.
  4. Is there any more information I can provide? I've been trying to figure this out for like an hour aha.
  5. Nope, I used it to check but it never gets printed, which means to me that the function itself isn't used which is... strange.
  6. Hi there. I'm exploring custom crops in modding and I thought I had things figured out but my crop never drops anything: no seeds, no custom crops no matter what the crop's age is. I also tried changing the items in getSeed() and getCrop() to Items.WHEAT_SEEDS and Items.WHEAT respectively, just in case it was an issue with initialization of my custom items but it doesn't change anything. Below is my code for the crop class, am I doing something wrong? public class BlockCustomCropBottom extends BlockCrops { // Blocks's registry name private static final String REGISTRY_NAME = "custom_crop_bottom"; // Blocks's unlocalized name private static final String UNLOCALIZED_NAME = TestMod.MOD_ID + "." + REGISTRY_NAME; public BlockCustomCropBottom() { // Set registry and unlocalized name of the block this.setRegistryName(REGISTRY_NAME); this.setUnlocalizedName(UNLOCALIZED_NAME); } // Returns the seed belonging to this crop @Override protected Item getSeed() { System.out.println("\n\nSeeds\n"); return Items.WHEAT_SEEDS; } // Returns the crop item gained when this crop is harvested @Override protected Item getCrop() { return Items.WHEAT; } } Thanks in advance.
  7. For now I'm going to sleep, but tomorrow I will try out TheMasterGabriel and Draco18s's idea with the custom IRecipe class. Thanks everyone, will update tomorrow. (I hate unfinished/solved forum topics when I'm searching for a solution to a problem...)
  8. Forgive me if I'm wrong, but would that not be the same as doing GameRegistry.addShapelessRecipe(new ItemStack(ModItems.silver_coin), ModItems.copper_coin, ModItems.copper_coin, ModItems.copper_coin, ModItems.copper_coin, ModItems.copper_coin); Just trying to wrap my head around what you did.
  9. No problem, thanks for trying to help in any case. I guess I can serve as some faith restored to you for people asking questions on here.
  10. Thanks, this is the type of answer I can use. And I am well-versed in Java, I just didn't know about the listing quirk. Thanks.
  11. Yeah, I know that, obviously I took the quotations out and put GameRegistry.addShapelessRecipe(new ItemStack(ModItems.copper_coin, 5), new ItemStack(ModItems.silver_coin)); I didn't just copy what you wrote I know a moderate amount of Java, I've taken two HS Computer Science Courses and going to college for Software Development in 3 days, on top of this I've made several Java applications and mods before. I'm using Eclipse.
  12. Nope, as mentioned before, the Silver Coin works perfectly, it's the copper coin that's the problem.
  13. I add the Recipes in my ModRecipes Class: package com.currencymod.init; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModRecipes { public static void registerRecipes() { addCraftingRecipes(); } private static void addCraftingRecipes() { //Shapeless recipes GameRegistry.addShapelessRecipe(new ItemStack(ModItems.copper_coin, 5), ModItems.silver_coin); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.silver_coin, 1), new ItemStack(ModItems.copper_coin, 5)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.silver_coin , 5), ModItems.gold_coin); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.gold_coin), new ItemStack(ModItems.silver_coin, 5)); } } And I initialize the items in my ModItems class: package com.currencymod.init; import com.currencymod.item.ItemCurrency; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModItems { //Items public static ItemCurrency copper_coin; public static ItemCurrency silver_coin; public static ItemCurrency gold_coin; static { copper_coin = registerItem(new ItemCurrency("copper_coin")); silver_coin = registerItem(new ItemCurrency("silver_coin")); gold_coin = registerItem(new ItemCurrency("gold_coin")); } private static <T extends Item> T registerItem(T item) { GameRegistry.register(item); return item; } } And here's my Main class, although I don't think it'll be too helpful: package com.currencymod.main; import com.currencymod.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Main.MOD_ID, name = Main.MOD_NAME, version = Main.MOD_VERSION) public class Main { public static final String MOD_ID = "currencymod"; public static final String MOD_NAME = "Lars's Currency Mod"; public static final String MOD_VERSION = "1.0.0"; @SidedProxy(clientSide = "com.currencymod.proxy.ClientProxy", serverSide = "com.currencymod.proxy.ServerProxy") public static CommonProxy proxy; @Instance(MOD_ID) public static Main instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } }
×
×
  • Create New...

Important Information

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