Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • crops 1.14
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
DrMDGG

crops 1.14

By DrMDGG, October 8 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • 3
  • 4
  • Next
  • Page 1 of 4  

Recommended Posts

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 8

hello,

 

i have having trouble figuring out this crop thing in 1.14. i have these two classes:

seed: https://pastebin.com/h989SBxw

plant: https://pastebin.com/bjBGfWyx

 

and this is how i register my plant in my main class:

BlockInit.mplant = new MPlant(Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.CROP).tickRandomly()).setRegistryName(location("mplant"));
 

the problem is the "IBlockAccess" in "seed" which i'm sure isn't correct

and also the seed wont get planted.

what am i missing here?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 8 (edited)
25 minutes ago, DrMDGG said:

BlockInit.mplant = new

Don't use static initializers. If this isn't static, then don't assign the field yourself, use an @ObjectHolder annotation.

 

25 minutes ago, DrMDGG said:

the problem is the "IBlockAccess" in "seed" which i'm sure isn't correct

Your seed class does not have any references to IBlockAccess, it does however have to references to IBlockReader, is that what you meant? Either way, you haven't said what "the problem" is with those lines, only that you suspect that something's wrong. Other than having wrapped it in <>...

 

25 minutes ago, DrMDGG said:

and also the seed wont get planted.

Your "seed" is a CropsBlock, so its not even an item.

You have also implemented IPlantable, which is completely unnecessary.

 

Here's an example seed:

public class WinterSeedsItem extends BlockNamedItem {

	public WinterSeedsItem(Block cropBlockIn) {
		super(cropBlockIn, new Properties().group(ItemGroup.MATERIALS));
	}

	@Override
	@OnlyIn(Dist.CLIENT)
	public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
		super.addInformation(stack, worldIn, tooltip, flagIn);
		tooltip.add(new TranslationTextComponent("tooltip.harderfarming:growsColdWeather"));
	}
}

And the only reason I need an entire class for it is because I wanted to add information to the item's tooltip. If you're not doing that, then new BlockNamedItem(...) is sufficient.

 

And example crop:

public class CropWinterWheatBlock extends CropsBlock {

	public CropWinterWheatBlock() {
		super(Properties.create(Material.PLANTS).tickRandomly().hardnessAndResistance(0.0F).doesNotBlockMovement().sound(SoundType.CROP));
	}

	protected IItemProvider getSeedsItem() {
		return HarderFarming.ModItems.winter_wheat_seeds;
	}
}

 

Edited October 8 by Draco18s
  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 8
45 minutes ago, Draco18s said:

Don't use static initializers. If this isn't static, then don't assign the field yourself, use an @ObjectHolder annotation.

 

Your seed class does not have any references to IBlockAccess, it does however have to references to IBlockReader, is that what you meant? Either way, you haven't said what "the problem" is with those lines, only that you suspect that something's wrong. Other than having wrapped it in <>...

 

Your "seed" is a CropsBlock, so its not even an item.

You have also implemented IPlantable, which is completely unnecessary.

 

Here's an example seed:


public class WinterSeedsItem extends BlockNamedItem {

	public WinterSeedsItem(Block cropBlockIn) {
		super(cropBlockIn, new Properties().group(ItemGroup.MATERIALS));
	}

	@Override
	@OnlyIn(Dist.CLIENT)
	public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
		super.addInformation(stack, worldIn, tooltip, flagIn);
		tooltip.add(new TranslationTextComponent("tooltip.harderfarming:growsColdWeather"));
	}
}

And the only reason I need an entire class for it is because I wanted to add information to the item's tooltip. If you're not doing that, then new BlockNamedItem(...) is sufficient.

 

And example crop:


public class CropWinterWheatBlock extends CropsBlock {

	public CropWinterWheatBlock() {
		super(Properties.create(Material.PLANTS).tickRandomly().hardnessAndResistance(0.0F).doesNotBlockMovement().sound(SoundType.CROP));
	}

	protected IItemProvider getSeedsItem() {
		return HarderFarming.ModItems.winter_wheat_seeds;
	}
}

 

the main problem, I'm sure, is that i followed at 1.12 tutorial with high hopes.

i tried to add this alone, and with my previous code, still they do not plant

where do i place the @ObjectHolder after removing the static initializer?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 8
20 minutes ago, DrMDGG said:

where do i place the @ObjectHolder after removing the static initializer?

Refer to the documentation, but as an example:

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L174

23 minutes ago, DrMDGG said:

still they do not plant

More information is required. It would be best if you posted your project as a working git repository.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 8
1 hour ago, Draco18s said:

Refer to the documentation, but as an example:

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L174

More information is required. It would be best if you posted your project as a working git repository.

here is my git repository:  https://github.com/drmdgg/mcraft

 

looking forward to more help this way

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 8

All of this, use @ObjectHolder. 

This should be BlockNamedItem or BlockItem as you want the item to place a block, which a regular Item can't do. In either case, it is not pointing to the class you originally said was your seed's class (MSeed), nor is that class referenced at all.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 8
27 minutes ago, Draco18s said:

All of this, use @ObjectHolder. 

This should be BlockNamedItem or BlockItem as you want the item to place a block, which a regular Item can't do. In either case, it is not pointing to the class you originally said was your seed's class (MSeed), nor is that class referenced at all.

like this? : ItemList.marijuana_seed = new BlockNamedItem(null, new Item.Properties().group(marijuanaitems)).setRegistryName(location("marijuana_seed")),

 

what do i replace null with? do i reference my mseed class there, or where do i reference it?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 8
1 hour ago, DrMDGG said:

like this? : ItemList.marijuana_seed = new BlockNamedItem(null, new Item.Properties().group(marijuanaitems)).setRegistryName(location("marijuana_seed")),

You see this bolded underlined part?

Remove it. Use annotations.

 

As for the null, you need a block there. That block would be your crop block that the seed plants.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9 (edited)
1 hour ago, Draco18s said:

You see this bolded underlined part?

Remove it. Use annotations.

 

As for the null, you need a block there. That block would be your crop block that the seed plants.

okay, I added the @objectholder, but I don't get how to remove that without errors. what do I add before the "="?

 

also, the block was placed with the seed after doing this:

ItemList.marijuana_seed = new BlockNamedItem(BlockInit.mplant, new Item.Properties().group(marijuanaitems)).setRegistryName(location("marijuana_seed")),
however, the block spwans the "no texture" texture and doesn't break like it should, it just disappears

Edited October 9 by DrMDGG
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 9 (edited)
12 hours ago, DrMDGG said:

what do I add before the "="?

Nothing. Literally nothing. Remove the =, I underlined and bolded it too.

 

12 hours ago, DrMDGG said:

however, the block spwans the "no texture" texture and doesn't break like it should, it just disappears

That's a separate issue for which you have no provided any log files.

Edited October 9 by Draco18s
  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
16 minutes ago, Draco18s said:

Nothing. Literally nothing. Remove the =, I underlined and bolded it too.

 

That's a separate issue for which you have no provided any log files.

okay, i did everything you told me to do. 

 

the log files though...what do you need to see?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 9

The thing to search for is any lines containing "Exception" or "Caused By" (note that there will always be one about failing to verify the account, as the dev environment has to be configured to use a real account).

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
41 minutes ago, Draco18s said:

The thing to search for is any lines containing "Exception" or "Caused By" (note that there will always be one about failing to verify the account, as the dev environment has to be configured to use a real account).

log: https://pastebin.com/gLUi9bhy

 

i see the "caused by" in there due to the mplant. i'm assuming its the lack of references in my classes?

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted October 9
27 minutes ago, DrMDGG said:

i see the "caused by" in there due to the mplant. i'm assuming its the lack of references in my classes?

What the heck is going on on this line?

Quote

at drmdgg.marijuanacraft.MarijuanaCraft$RegistryEvents.registerBlocks(MarijuanaCraft.java:155)

 

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
3 minutes ago, Animefan8888 said:

What the heck is going on on this line?

 

BlockInit.clone = new Clone(new PotPlant(),Block.Properties.create(Material.PLANTS).hardnessAndResistance(0, 0).sound(SoundType.PLANT).harvestTool(null).harvestLevel(0)).setRegistryName(location("clone")),

 

its for my trees, why?

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted October 9
1 minute ago, DrMDGG said:

its for my trees, why?

Because there is an error on that line. Do you not know how to read a crash report?

 

2 minutes ago, DrMDGG said:

.harvestTool(null)

I don't believe you are allowed to pass null here. There is no reason for you to call it at all either.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
Just now, Animefan8888 said:

Because there is an error on that line. Do you not know how to read a crash report?

 

I don't believe you are allowed to pass null here. There is no reason for you to call it at all either.

yeah. i havent finished that section (havent added the tooltype yet)

 

thats not what im trying to accomplish here

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted October 9
1 minute ago, DrMDGG said:

thats not what im trying to accomplish here

It looks like from the crash report it's not allowing your mod to load all the way.

Quote

[09Oct2019 09:40:54.291] [Server-Worker-1/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.

 

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
2 minutes ago, Animefan8888 said:

It looks like from the crash report it's not allowing your mod to load all the way.

 

ill change it. but the mod loads fine. its my crops im working on

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted October 9
2 minutes ago, DrMDGG said:

ill change it. but the mod loads fine. its my crops im working on

Then I'd like to ask two questions.

Why aren't your textures showing up and why isnt there an error in the log file about them?

 

3 minutes ago, DrMDGG said:

its my crops im working on

You shouldn't partially work on something then before it's done move onto another thing. Its bound to cause errors like this.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
6 minutes ago, Animefan8888 said:

Then I'd like to ask two questions.

Why aren't your textures showing up and why isnt there an error in the log file about them?

 

You shouldn't partially work on something then before it's done move onto another thing. Its bound to cause errors like this.

aside from that change (which didn't change anything to do with the textures (and all my other items and blocks are loading)) the only thing I'm still yet to work on it getting the leaves to spawn properly. which wasn't holding back anything.

 

 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted October 9
45 minutes ago, DrMDGG said:

aside from that change (which didn't change anything to do with the textures (and all my other items and blocks are loading)) the only thing I'm still yet to work on it getting the leaves to spawn properly. which wasn't holding back anything.

Post new log.

  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9
7 minutes ago, Animefan8888 said:

Post new log.

uhm, well i added the tooltype, and now all of a sudden, none of my recipes are working

 

https://pastebin.com/LDsSanur

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted October 9 (edited)
3 hours ago, DrMDGG said:

none of my recipes are working

Yes, because:

Quote
  1. [09Oct2019 11:56:44.520] [Server thread/ERROR] [net.minecraft.item.crafting.RecipeManager/]: Parsing error loading recipe marijuanacraft:alcmix2recipesmelting
  2. com.google.gson.JsonSyntaxException: Unknown item tag 'marijuanacraft:alcmix1'

And you've got ten more like it.

 

When data pack loading fails, it often causes all data packs to not be loaded (I had a bad advancement once that made vanilla recipes not work).

Edited October 9 by Draco18s
  • Quote

Share this post


Link to post
Share on other sites

DrMDGG    0

DrMDGG

DrMDGG    0

  • Creeper Killer
  • DrMDGG
  • Members
  • 0
  • 207 posts
Posted October 9 (edited)
7 minutes ago, Draco18s said:

Yes, because:

 

i don't get it. i didn't touch that and it was working before i was told to fix the "null" for harvest tool in my trees registry

 

alcmix1 : 

{
    "type": "minecraft:smelting",
    "ingredient": { "tag": "marijuanacraft:alcmix1" },
    "result": "marijuanacraft:alcmix2",
    "experience": 2.3,
    "cookingtime": 150
}

 

alcmix2:

 

{
    "type": "minecraft:crafting_shaped",
    
    "pattern":
    [
        " f ",
        " w ",
        " e "
    ],    
    
    "key":
    {
        "f": { "item": "marijuanacraft:fermp" },
        "w": { "item": "minecraft:water_bucket" },
        "e": { "item": "minecraft:bottle" }
        },
    
    "result": { "item": "marijuanacraft:alcmix1" },
    "count": 1
}

Edited October 9 by DrMDGG
  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • 3
  • 4
  • Next
  • Page 1 of 4  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      [1.14.4] [Solved] Trouble With Packets

      By diesieben07 · Posted 40 minutes ago

      If you do this, then there is no point having the capability. Just store it in the stack's NBT tag directly at that point...
    • Cerandior
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior · Posted 47 minutes ago

      Yeah, I registered the entity and everything is fine now.
    • Cerandior
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior · Posted 1 hour ago

      I have no idea man. I tried setting the breakpoints at different parts of the class because intelliJ displays a tree of all the methods called at that point and I never found any of the shareTags methods where I expected them to be. And I know, what I did doesn't really make too much sense because the stack should call the readShareTag and getShareTag automatically (I did look into a lot of methods related to itemstacks), but for some reason nothing was working as expected for me. I just tried that and everything works fine now, if I get rid of that line of code nothing works again.   As for the entity, that is probably caused by the "unique" type of zombie that my staff spawns. I forgot to register that in my registry events. I am surprised the entity was spawning considering I haven't registered them actually. I will register them right now, and check if the error will persist. Thank you for your help.
    • diesieben07
      on/off button for custom furnace

      By diesieben07 · Posted 1 hour ago

      Any GUI that has a button on it. MainMenuScreen for example.
    • plugsmustard
      on/off button for custom furnace

      By plugsmustard · Posted 1 hour ago

      alright. where in vanilla are there those examples you mentioned?
  • Topics

    • Cerandior
      10
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior
      Started 23 hours ago

    • plugsmustard
      18
      on/off button for custom furnace

      By plugsmustard
      Started 23 hours ago

    • AkosM
      3
      Increase target's damage via usable item

      By AkosM
      Started 17 hours ago

    • leesj
      3
      How to Give potion effect to entity

      By leesj
      Started 23 hours ago

    • thedarkcolour
      10
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour
      Started 8 hours ago

  • Who's Online (See full list)

    • Eonasdan
    • Cerandior
    • Maraea21
    • diesieben07
    • Zimphire
    • Draco18s
    • loordgek
    • imacatlolol
    • jgfarrell
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • crops 1.14
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community