Jump to content

crops 1.14


Guest

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

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 by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

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 by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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 by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.




×
×
  • Create New...

Important Information

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