Jump to content

crops 1.14


Guest

Recommended Posts

6 minutes ago, Animefan8888 said:

It exists in the Block class. You need to override it in your Block class I believe is called MPlant.

there's only two things that don't have an @Override already:

 

    public MPlant(Properties builder)
    {
        super(builder);
        this.setDefaultState(this.stateContainer.getBaseState().with(this.getAgeProperty(), Integer.valueOf(0)));
    }

_____________________________________________________________________________________________________________

and this one: 

 

 @OnlyIn(Dist.CLIENT)
    public ItemStack getItem(IBlockReader worldIn, BlockPos pos, BlockState state)
    {
       return new ItemStack(this.getSeedsItem());
    }

 

 

 

I assume its the first one?

 

 

edit: nevermind. its not the first one

Edited by Guest
Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

Just now, DrMDGG said:

I assume its the first one?

No. You don't know Java do you? First the @Override annotation doesn't actually do anything. It just lets you know that you are overriding a method from a parent class(hurray for inheritance). Secondly the method is a new one you have to add to your class. If it doesn't exist with the name fillStateContainer then it's likely that you are using an outdated version of forge. I'm only on 28.1.19

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

38 minutes ago, Animefan8888 said:

No. You don't know Java do you? First the @Override annotation doesn't actually do anything. It just lets you know that you are overriding a method from a parent class(hurray for inheritance). Secondly the method is a new one you have to add to your class. If it doesn't exist with the name fillStateContainer then it's likely that you are using an outdated version of forge. I'm only on 28.1.19

yeah. I updated forge, and low and behold, it came up.

https://github.com/drmdgg/marijuanacraft/blob/master/src/main/java/drmdgg/marijuanacraft/init/blocks/plants/MPlant.java

 

so I added that and changed getAge to getCropAge

 

what did I do wrong?

Link to comment
Share on other sites

2 minutes ago, DrMDGG said:

what did I do wrong?

I assume the same "error" is happening?

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

On 10/13/2019 at 9:11 AM, Animefan8888 said:

I assume the same "error" is happening?

is this error happening due to the lack of references to my plant seed not being in my seed class and the mplant class not referencing my mplant?

Link to comment
Share on other sites

You only need two references:

 

  1. The block instance is passed to the seed item's constructor
  2. The item instance is returned in the block's getSeedsItem method via a ModItems (ItemList) reference.

That's it.

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

4 minutes ago, Draco18s said:

You only need two references:

 

  1. The block instance is passed to the seed item's constructor
  2. The item instance is returned in the block's getSeedsItem method via a ModItems (ItemList) reference.

That's it.

okay, well it has all that...so what's the problem. at one point I get this in my runclient:

[16:51:03] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'marijuanacraft:blockstates/mplant.json' in resourcepack: 'main' for variant: 'age=5': Unknown blockstate property: 'age'

 

 

Link to comment
Share on other sites

56 minutes ago, DrMDGG said:

Exception loading blockstate definition: 'marijuanacraft:blockstates/mplant.json' in resourcepack: 'main' for variant: 'age=5': Unknown blockstate property: 'age'

For some reason it isnt recognizing that your block has an age property and when it is reading the blockstate json its seeing this and going "HUH?!?!"

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:

For some reason it isnt recognizing that your block has an age property and when it is reading the blockstate json its seeing this and going "HUH?!?!"

any guesses on how to fix that? I've checked that json file and the others a billion times against the carrots and the wheat (which are obviously the same)

Link to comment
Share on other sites

4 minutes ago, DrMDGG said:

any guesses on how to fix that? I've checked that json file and the others a billion times against the carrots and the wheat (which are obviously the same)

The problem doesnt lie within the json. The problem lies within the code. Specifically why your block isnt getting the age property. Have you looked at the f3 screen while looking at your block to see if it has the age property on the right hand side of the screen?

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

10 minutes ago, Animefan8888 said:

The problem doesnt lie within the json. The problem lies within the code. Specifically why your block isnt getting the age property. Have you looked at the f3 screen while looking at your block to see if it has the age property on the right hand side of the screen?

it definitely does not

mcraftf3.png

Link to comment
Share on other sites

6 minutes ago, DrMDGG said:

it definitely does not

Double check that in your fillStateContainer method you add your age property to the Builder parameter.

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

15 minutes ago, Animefan8888 said:

Double check that in your fillStateContainer method you add your age property to the Builder parameter.

like this?

 

    @Override
    protected void fillStateContainer(Builder<Block, BlockState> builder) {
        
        builder.add(CROP_AGE);
        
        

Link to comment
Share on other sites

2 hours ago, Animefan8888 said:

Double check that in your fillStateContainer method you add your age property to the Builder parameter.

okay, so I triple...or maybe quadruple checked the cropsblock class and the code there is "builder.add(AGE);"

but if i'm extending CropsBlock then shouldn't all the age stuff be automatically added and unnecessary for me to add?

Link to comment
Share on other sites

1 minute ago, DrMDGG said:

but if i'm extending CropsBlock then shouldn't all the age stuff be automatically added and unnecessary for me to add?

Exactly make sure your fillStateContainer is being called though. I'm curious if something is broken.

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

12 hours ago, Animefan8888 said:

Exactly make sure your fillStateContainer is being called though. I'm curious if something is broken.

i also noticed that it will spawn on any block, not just farmland

Link to comment
Share on other sites

I suspect that the block being used by your seed item is not actually your crop block. But with the code you have, I'm not sure why that is.

My guess is that the item you're holding is not the one that we've been talking about, but another item entirely.

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:

I suspect that the block being used by your seed item is not actually your crop block. But with the code you have, I'm not sure why that is.

My guess is that the item you're holding is not the one that we've been talking about, but another item entirely.

I've gone through all my code. i must have missed something. 

 

you've seen my code in full. what item or block could possibly be doing this?

Link to comment
Share on other sites

58 minutes ago, DrMDGG said:

you've seen my code in full. what item or block could possibly be doing this?

*Shrug*

From my point of view, you created a bunch of stuff all at once (maybe copy-pasted from an old version?) without checking any of it to make sure it worked before going for more.

 

Always work on one block or item or system at a time, make sure its working 100%* before moving on to another.

 

*Sure, there are things that interleave sometimes, such as a crop and its seed, those can be worked on as a single operational group. And sometimes you need to break a thing down into smaller pieces and work on them and they won't be 100% until the larger structure is done, but you can handle that with placeholders and TODOs, but there you know what part isn't complete when you test it (for example, my ore system relies heavily on Custom Ore Gen and several ore generation events that don't exist, but that doesn't mean I can't make the blocks, items, loot tables, recipes, and enchantments, I just know I can't test the ore gen and prospecting systems until those events exist).

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

9 minutes ago, Draco18s said:

*Shrug*

From my point of view, you created a bunch of stuff all at once (maybe copy-pasted from an old version?) without checking any of it to make sure it worked before going for more.

 

Always work on one block or item or system at a time, make sure its working 100%* before moving on to another.

 

*Sure, there are things that interleave sometimes, such as a crop and its seed, those can be worked on as a single operational group. And sometimes you need to break a thing down into smaller pieces and work on them and they won't be 100% until the larger structure is done, but you can handle that with placeholders and TODOs, but there you know what part isn't complete when you test it (for example, my ore system relies heavily on Custom Ore Gen and several ore generation events that don't exist, but that doesn't mean I can't make the blocks, items, loot tables, recipes, and enchantments, I just know I can't test the ore gen and prospecting systems until those events exist). 

the original mod I made was for 1.8.9 so I couldn't copy anything.
but now everything is working order except for these damn crops thanks to you guys. I guess I'll just have to figure this out on my own if you can't help me further. thanks for the help. you'll be in my credits lol

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.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Minecraft Version: 1.8-1.20.X Forge Version: All (Tested on 49.0.27, 11.14.4.1577 and some others) Steps to Reproduce: Setup a server with IPV6 only Setup a docker container with forge Try to connect to the Forge Server Description of issue: Hello, I am reaching out to seek your expertise within this forum to clarify a technical situation I am encountering, suspecting a potential issue related to Forge in a Docker environment, specifically in an IPv6 context. Initial Configuration: Debian 12 server, configured exclusively for IPv6, with Docker installed. Using the Docker image ghcr.io/pterodactyl/yolks:java_17, launching a Minecraft Vanilla server version 1.20.4 proceeds without any issues. Problem: The issue arises when deploying a Minecraft Forge server version 1.20.4 with the same Docker image (ghcr.io/pterodactyl/yolks:java_17), where connecting to the server becomes impossible. Notably, this issue does not occur when launching outside of Docker, where the server functions as expected. Hypothesis: This situation leads me to question the interaction between Forge and Docker, particularly in an IPv6-only configuration, despite several resolution attempts (testing with different versions of Forge, adjusting container network configurations (0.0.0.0, ::/0, and the server's ipv6), trials with various network settings, and modifications of Java options). Further testing was conducted with and without the use of the Pterodactyl game panel, unsuccessfully. The parameter -Djava.net.preferIPv4Stack=false also did not provide a solution. I tried to do the same things on multiple Minecraft server (include vanilla,spigot,fabric,sponge) and this work fine. The problem only happend with Forge. This issue seem to happend on all forge versions.   I appreciate your time and assistance in advance.
    • The game crashed whilst exception ticking world Error: java.lang.NullPointerException: Cannot invoke "net.minecraft.resources.ResourceLocation.equals(Object)" because "this.lootTableId" is null Error given is above. I was already playing for around 15 minutes and wasn't doing anything specific or even breaking anything when the crashed happened. This is update 1.19.2 forge: 43.2.23 Mod list: ESSENTIAL Mod (by SparkUniverse_) Traveler's Titles (Forge) (by YUNGNICKYOUNG) Resourceful Config (by ThatGravyBoat) Dynamic Lights (by atomicstrykergrumpy) TenzinLib (by CommodoreThrawn) Nature's Compass (by Chaosyr) Library Ferret - Forge (by jtl_elisa) Cold Sweat (by Mikul) Simple Voice Chat (by henkelmax) Waystones (by BlayTheNinth) Carry On (by Tschipp) [Let's Do] Meadow (by satisfy) Creeper Overhaul (by joosh_7889) AutoRegLib (by Vazkii) Moonlight Lib (by MehVahdJukaar) AppleSkin (by squeek502) Xaero's World Map (by xaero96) Rotten Creatures (by fusionstudiomc) YUNG's API (Forge) (by YUNGNICKYOUNG) Village Artifacts (by Lothrazar) Right Click, Get Crops (by TeamCoFH) Supplementaries (by MehVahdJukaar) Automatic Tool Swap (by MelanX) Better Third Person (by Socolio) Supplementaries Squared (by plantspookable) Traveler's Backpack (by Tiviacz1337) Caelus API (Forge/NeoForge) (by TheIllusiveC4) Creatures and Beasts (by joosh_7889) Architectury API (Fabric/Forge/NeoForge) (by shedaniel) Quark Oddities (by Vazkii) Origins (Forge) (by EdwinMindcraft) Villager Names (by Serilum) GeckoLib (by Gecko) Realistic Bees (by Serilum) Illuminations Forge 🔥 (by dimadencep) Serene Seasons (by TheAdubbz) Critters and Companions (by joosh_7889) [Let's Do] Bakery (by satisfy) Falling Leaves (Forge) (by Cheaterpaul) Jade 🔍 (by Snownee) Collective (by Serilum) TerraBlender (Forge) (by TheAdubbz) [Let's Do] API (by Cristelknight) Towns and Towers (by Biban_Auriu) More Villagers (by SameDifferent) Biomes O' Plenty (by Forstride) Goblin Traders (by MrCrayfish) Corpse (by henkelmax) Tree Harvester (by Serilum) Balm (Forge Edition) (by BlayTheNinth) Mouse Tweaks (by YaLTeR) Sound Physics Remastered (by henkelmax) Xaero's Minimap (by xaero96) Just Enough Items (JEI) (by mezz) Terralith (by Starmute) Quark (by Vazkii) [Let's Do] Vinery (by satisfy) [Let's Do] Candlelight (by satisfy) Repurposed Structures (Neoforge/Forge) (by telepathicgrunt) Dusty Decorations (by flint_mischiff) Immersive Armors [Fabric/Forge] (by Conczin) Serene Seasons Fix (by Or_OS) Shutup Experimental Settings! (by Corgi_Taco) Skin Layers 3D (Fabric/Forge) (by tr7zw)
    • Make sure Java is running via Nvidia GPU https://windowsreport.com/minecraft-not-using-gpu/  
    • Also make a test with other Custom Launchers like AT Launcher, MultiMC or Technic Launcher
    • Embeddium and valkyrienskies are not working together - remove one of these mods With removing Embeddium, also remove Oculus, TexTrue's Embeddium Options and Embeddium Extras Or use Rubidium instead
  • Topics

×
×
  • Create New...

Important Information

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