Jump to content

how does the FlowerPotBlock-class know, wich block to show, if put a plant?


Recommended Posts

Posted

Hello

 

I decided to play around with colors for flowerpots.

 

So i opened a new mod-project and added two new mlocks:

black_flower_pot (an empty flowerpot with black concrete-texture and it´s BlockItem)

black_potted_acacia_sapling (an acatia-sapling, placed in a black flowerpot)

 

Than i made a testrun and i was surprised:

If i place my modded black pot and then put the acacia-sapling, it correctly appears in the black pot.

that means it uses my modded one here.

 

How does the FlowerPotBlock-class know, that it has to place my modded acacia in the black pot here

instead of the the vanilla one in the brown terracotta-pot?

 

I want to add more flowerpot colors (to compleete the 16 minecraft colors).

Does it still choose the plants in the matching colored pots then?

Posted

This you could google

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Posted (edited)

Now, with some more google, i found it.

 

at first, i had the simpler constructor-call, so i wonder, why it used the correct variant of the potted sapling in this case.

 

11 hours ago, diesieben07 said:

And then you call addPlant on the empty pot to register your full pots...

In my case, i think, it should look like this:

BLACK_FLOWER_POT.get().addPlant(Blocks.ACACIA_SAPLING.getRegistryName(), BLACK_POTTED_ACACIA_SAPLING_SUPPLIER);

but where in my mod should i place this line.

 

Edit:

Now i made it so:

        DeferredWorkQueue.runLater(() ->
        {
                    ColoredFlowerPotsBlocks.BLACK_FLOWER_POT.get().addPlant(Blocks.ACACIA_SAPLING.getRegistryName(), ColoredFlowerPotsBlocks.BLACK_POTTED_ACACIA_SAPLING_SUPPLIER);
        }
        );

In the common setup like the biome-stuff in the tulips-mod.

This works.

Other things i tryed before, made "object not present" errors.

 

Now i think, i should collect all theese calls for the different plants and pot-colors here.

Edited by Drachenbauer
Posted (edited)

While i collected the different plants, that can be placed in a flowerpot, i saw, that the model of the cactus is made a very complicated way.

I think, to make it look like it looks ingame, just two model-boxes are needed: a 6x6x6 cube for the pot and a taller 4x4 base box for the cactus itself,

And a dirt-texture is not needed here, because the cactus fills the whoole hole of the pot.

 

Why did they make it so complicated?

 

Now i made separeted handler-classes for the addPlant-lines and the cutout-rendering of the plant-textures.

So the main-mod-class is short and clean.

In the handler-classes i simply placed all theese method-calls in a method, that i now call in the main-class.

Edited by Drachenbauer
Posted

Now i have a huge stack of RegistryObjects in my blocks class.

Every possible combination of plant-type (25 different plants) and pot-color (16 color) appears as it´s own registered block.

 

The same for the method-calls for adding the plants to the pots and render them in cutout-style (the render-thing is not needed for the cactus) in their handler-classes.

 

Is there any way to shorten the code, maybe with this for-loop:

ArrayList<String> colors = new ArrayList<String>(Arrays.asList(black, blue, brown, cyan, gray, green, light_blue, light_gray,
                                                               lime, magenta, orange, pink, purple, red, white, yellow));

for (String color : colors)
{
     //do stuff
}

But i don´t know how to create RegistryObjects in a for-loop...

Posted
4 hours ago, Drachenbauer said:

But i don´t know how to create RegistryObjects in a for-loop...

All I have to say is, "Wow dude, do you Java?"

  • Haha 1

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.

Posted (edited)

Is there no way to reduce this code while still using deferred register?

 

actually i have about 400 RegistryObject-fields in this class, to have all combinations of plants and potcolors.

 

I just heared, that for-loops are often used to shorten code without changing what it should do.

Edited by Drachenbauer
Posted
42 minutes ago, Drachenbauer said:

I just heared, that for-loops are often used to shorten code without changing what it should do.

https://www.w3schools.com/java/java_for_loop.asp

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.

Posted (edited)

Now i try to work with an Arraylist<RegistryObject<FlowerPotBlock>> instead of alot of single fields.

Or an Arraylist<FlowerPotBlock>.

But no matter, what i try, i get an Registry Object not present error.

Does it matter, that i try to work in a

static
{

}

in the class, because i need to use for-loops to fill the list

The last thing, i tried, is, that i tried to register a block in a variable inside the for-loop and than add the content of the RegistryObject into an Arraylist<FlowerPotBlock>.

 

Why this also gives the error?

Is

public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, Reference.MOD_ID);

unable to handle things in the static thing or a for-loop

 

If yes, how can i register stuff with code inside there?

 

Or is it impossible to register blocks in an Arraylist<RegistryObject<FlowerPotBlock>> ?

Edited by Drachenbauer
Posted (edited)

Now i have this:

    public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, Reference.MOD_ID);
    
    private static final Supplier<Block> AIR_SUPPLIER = () -> Blocks.AIR;
    
    public static final ArrayList<Supplier<Block>> PLANT_SUPPLIERS = new ArrayList<Supplier<Block>>(Arrays.asList(() -> Blocks.ACACIA_SAPLING,
                                                                                                                  () -> Blocks.ALLIUM,
                                                                                                                  () -> Blocks.AZURE_BLUET,
                                                                                                                  () -> Blocks.BAMBOO,
                                                                                                                  () -> Blocks.BIRCH_SAPLING,
                                                                                                                  () -> Blocks.BLUE_ORCHID,
                                                                                                                  () -> Blocks.BROWN_MUSHROOM,
                                                                                                                  () -> Blocks.CACTUS,
                                                                                                                  () -> Blocks.CORNFLOWER,
                                                                                                                  () -> Blocks.DANDELION,
                                                                                                                  () -> Blocks.DARK_OAK_SAPLING,
                                                                                                                  () -> Blocks.DEAD_BUSH,
                                                                                                                  () -> Blocks.FERN,
                                                                                                                  () -> Blocks.JUNGLE_SAPLING,
                                                                                                                  () -> Blocks.LILY_OF_THE_VALLEY,
                                                                                                                  () -> Blocks.OAK_SAPLING,
                                                                                                                  () -> Blocks.ORANGE_TULIP,
                                                                                                                  () -> Blocks.OXEYE_DAISY,
                                                                                                                  () -> Blocks.PINK_TULIP,
                                                                                                                  () -> Blocks.POPPY,
                                                                                                                  () -> Blocks.RED_MUSHROOM,
                                                                                                                  () -> Blocks.RED_TULIP,
                                                                                                                  () -> Blocks.SPRUCE_SAPLING,
                                                                                                                  () -> Blocks.WHITE_TULIP,
                                                                                                                  () -> Blocks.WITHER_ROSE));
    
    public static final ArrayList<String> COLORS = new ArrayList<String>(Arrays.asList("black",
                                                                                       "blue",
                                                                                       "brown",
                                                                                       "cyan",
                                                                                       "gray",
                                                                                       "green",
                                                                                       "light_blue",
                                                                                       "light_gray",
                                                                                       "lime",
                                                                                       "magenta",
                                                                                       "orange",
                                                                                       "pink",
                                                                                       "purple",
                                                                                       "red",
                                                                                       "white",
                                                                                       "yellow"));
    
    public static final ArrayList<RegistryObject<FlowerPotBlock>> EMPTY_FLOWER_POT_REGISTRIES = new ArrayList<RegistryObject<FlowerPotBlock>>();
    public static final ArrayList<Supplier<FlowerPotBlock>> EMPTY_FLOWER_POT_SUPPLIERS = new ArrayList<Supplier<FlowerPotBlock>>();
    public static final ArrayList<FlowerPotBlock> EMPTY_FLOWER_POTS = new ArrayList<FlowerPotBlock>();
    public static final ArrayList<RegistryObject<FlowerPotBlock>> FULL_FLOWER_POT_REGISTRIES = new ArrayList<RegistryObject<FlowerPotBlock>>();
    public static final ArrayList<Supplier<FlowerPotBlock>> FULL_FLOWER_POT_SUPPLIERS = new ArrayList<Supplier<FlowerPotBlock>>();
    public static final ArrayList<FlowerPotBlock> FULL_FLOWER_POTS = new ArrayList<FlowerPotBlock>();
    
    private static int i;
    private static int j;
    
    static
    {
        i = 0;
        
        for(String color : COLORS)
        {
            EMPTY_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_flower_pot", () -> new FlowerPotBlock(null, AIR_SUPPLIER,
                                            Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid())));
            EMPTY_FLOWER_POT_SUPPLIERS.add(() -> EMPTY_FLOWER_POT_REGISTRIES.get(i).get());
            
            j = 0;
            
            for(Supplier<Block> plant_supplier : PLANT_SUPPLIERS)
            {
                String plant = plant_supplier.get().getRegistryName().getPath();
                FULL_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_potted_" + plant, () -> new FlowerPotBlock(EMPTY_FLOWER_POT_SUPPLIERS.get(i), plant_supplier,
                                               Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid())));
                FULL_FLOWER_POT_SUPPLIERS.add(() -> FULL_FLOWER_POT_REGISTRIES.get(j).get());
                j++;
            }
            
            i++;
        }
    }

Why this makes a "RegistryObject not present" error, if i want to access the blocks anywhere in the code?

Only the lines, wich fill the Supplier-Lists, don´t make the error.

 

Why i cannot access theese blocks, or does the registry process not work at list-contents?

Edited by Drachenbauer
Posted

The whole point of registry objects is that they are initialised in the correct event (The DeferredRegister does that too).

Until the registry events have run, the registry objects will be "not present".

 

As all you are after is the id, use RegistryObject#getId() instead of trying to get the object first.

Posted (edited)

Again, you CANNOT access the blocks until after the event has fired. They simply don't exist.

 

Use the ID, or the RegistryObject itself, it is an instance of Supplier<T>.

I use the following 3 methods to register my blocks:

/**
 * Register a block and a default ItemBlock with the Item group set to my Item group.
 */
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> block) {
    return register(name, block, (b) -> () -> new BlockItem(b.get(), new Item.Properties().group(AAItems.ITEM_GROUP)));
}
/**
 * Register a block and an Item using a custom Item supplier.
 * @param itemCreator type is (block) -> Supplier<Item>. (block passed in so you could use the same function to define multiple block items).
 */
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> block, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) {
    RegistryObject<T> ret = registerBlockOnly(name, block);
    ITEMS.register(name, itemCreator.apply(ret));
    return ret;
}
/**
 * Register a block with no item (could be used for door/bed halves etc.).
 */
private static <T extends Block> RegistryObject<T> registerBlockOnly(String name, Supplier<? extends T> sup) {
    return BLOCKS.register(name, sup);
}

The reason why you have to pass in suppliers to the DeferredRegister#register methods is so that they can call them in the registry events, i.e. at the correct time.

 

Note that using the block/item objects .get() in suppliers ONLY WORKS FOR GETTING BLOCKS AND ITEMS. This is because those 2 registry events are fired in that order, before any others, and until the event has fired, the object doesn't exist, so cannot be used in other events. (The order of other registries is random, so it might work sometimes and not others.) If you need to access other registry objects, you need to use a supplier (as in pass the actual RegistryObject into the constructor) and get the object when it is needed.

Edited by Alpvax
  • Like 1
Posted (edited)

as i registered my Blocks this way:

public static final RegistryObject<FlowerPotBlock> BLACK_FLOWER_POT = BLOCKS.register("black_flower_pot", () -> new FlowerPotBlock(
                        null, AIR_SUPPLIER,Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid()));

 

i was able to register the blockitem this way:

public static final RegistryObject<Item> BLACK_FLOWER_POT = ITEMS.register("black_flower_pot", () -> new BlockItem(ColoredFlowerPotsBlocks.BLACK_FLOWER_POT.get(),
                        new Item.Properties().defaultMaxDamage(0).group(ColoredFlowerPots.COLORED_FLOWERPOTS).maxStackSize(64).rarity(Rarity.COMMON).setNoRepair()));

 

Do you mean, that i try to access the block for generating the item-registryname at using the variant with list and for-loop?

 

But once i also had the error, where i called the method addPlant of the FlowerPotBlock, and tried to access the blocks there-

Edited by Drachenbauer
Posted (edited)
12 minutes ago, Drachenbauer said:

Do you mean, that i try to access the block for generating the item-registryname at using the variant with list and for-loop?

I'm not quite sure what you mean by this.

 

I would use this as your loop. You have no use for the ..._SUPPLIERS variables, as RegistryObjects ARE Suppliers. And again, the ArrayList<FlowerPotBlock> is useless, because the blocks do not exist yet, so there is nothing to fill the list with.

i = 0;
for(String color : COLORS)
{
    EMPTY_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_flower_pot", () -> new FlowerPotBlock(null, AIR_SUPPLIER,
    Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid())));

	j = 0;

	for(Supplier<Block> plant_supplier : PLANT_SUPPLIERS)
	{
		String plant = plant_supplier.getId().getPath();
		FULL_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_potted_" + plant, () -> new FlowerPotBlock(EMPTY_FLOWER_POT_SUPPLIERS.get(i), plant_supplier,
								Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid())));
  		j++;
	}

	i++;
}

 

Edited by Alpvax
Code formatting
Posted (edited)

But how do i fill the supplyer-thing for the full pots where the need to know their emptx pots?

 

Edit:

 

I noticed, i can put the RegistryObject of the empty pot there.

Edited by Drachenbauer
Posted
18 minutes ago, Drachenbauer said:

If i try to use getId from the block-RegistryObject to generate the registryname for the blockitem-registry, i get a NullPointerException...

What's the exception? With stacktrace preferably.

Is your code on github? It would be easier for me to see if it was.

Posted (edited)

Code:

public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, Reference.MOD_ID);
    
    @SuppressWarnings("unchecked")
    public static final RegistryObject<BlockItem>[] EMPTY_FLOWER_POTS = new RegistryObject[ColoredFlowerPotsBlocks.COLORS.size() + 1];
    
    private static int i;
    
    static
    {
        i = 0;
        
        for (RegistryObject<FlowerPotBlock> empty_pot_register : ColoredFlowerPotsBlocks.EMPTY_FLOWER_POTS)
        {
            String empty_pot = empty_pot_register.getId().getPath();
            
            EMPTY_FLOWER_POTS[i] = ITEMS.register(empty_pot, () -> new BlockItem(empty_pot_register.get(),
                                   new Item.Properties().defaultMaxDamage(0).group(ColoredFlowerPots.COLORED_FLOWERPOTS).maxStackSize(64).rarity(Rarity.COMMON).setNoRepair()));
            
            i++;
        }
    }

 

I tried to use Arrays instead of ArrayLists now.

console:

Spoiler

[m[1;31m[16:54:12] [modloading-worker-1/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: coloredflowerpotsmod, class drachenbauer32.coloredflowerpotsmod.ColoredFlowerPots
java.lang.ExceptionInInitializerError: null
    at drachenbauer32.coloredflowerpotsmod.ColoredFlowerPots.<init>(ColoredFlowerPots.java:39) ~[?:?] {re:classloading}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_241] {}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241] {}
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_241] {}
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_241] {}
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_241] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:131) ~[?:31.1] {re:classloading}
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_241] {}
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?] {re:classloading}
    at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:134) ~[?:?] {re:classloading}
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.doInvoke(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.invoke(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_241] {}
    at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:1.8.0_241] {}
    at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:134) ~[?:?] {re:classloading}
    at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_241] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_241] {}
Caused by: java.lang.NullPointerException
    at drachenbauer32.coloredflowerpotsmod.init.ColoredFlowerPotsItems.<clinit>(ColoredFlowerPotsItems.java:65) ~[?:?] {re:classloading}
    ... 30 more

i don´t know, how to display the "30 more" lines at the end, if they include helpful infos

 

 

Edited by Drachenbauer
Posted
23 minutes ago, Drachenbauer said:

at drachenbauer32.coloredflowerpotsmod.init.ColoredFlowerPotsItems.<clinit>(ColoredFlowerPotsItems.java:65)

 

16 minutes ago, Alpvax said:

Please create a github repository, it is very hard to debug when we only have tiny snapshots of your code.

@Alpvax I know this is basic IDE and Java, but i never work with Debugging, so i am asking me what you do want to make… @Drachenbauer, hope it help you (see that i quoted, it was into drachenbauer32.coloredflowerpotsmod.init.ColoredFlowerPotsItems the line 65)

New in Modding? == Still learning!

Posted (edited)

i know, where it is, but i don´t know, what´s wrong with that line...

 

I´m sure, it should get the id of the RegistryObject(that´s similar to the RegistryName of the block.)

 

But i don´t know, why it finds no registryname to use...

Edited by Drachenbauer

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

    • i tested without the mod and now i get this    ---- Minecraft Crash Report ---- WARNING: coremods are present:   IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   AdvancedRocketryPlugin (AdvancedRocketry-1.12.2-2.0.0-17.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.11.jar)   MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   SuperMartijn642's Core Lib Plugin (_supermartijn642corelib-1.1.17a-forge-mc1.12.jar)   AppleCore (AppleCore-mc1.12.2-3.4.0.jar)   MaterialTweakerPlugin (MaterialTweaker-1.1.1.jar)   CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   MixinLoader (LootTweaker-0.4.1+MC1.12.2.jar) Contact their authors BEFORE contacting forge // Surprise! Haha. Well, this is awkward. Time: 11/29/24 5:39 PM Description: Initializing game java.lang.NoClassDefFoundError: com/supermartijn642/rechiseled/registration/data/RegistrationFusionModelProvider     at com.supermartijn642.rechiseled.api.registration.RechiseledRegistration.get(RechiseledRegistration.java:26)     at com.supermartijn642.rechiseled.Rechiseled.<clinit>(Rechiseled.java:37)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: com.supermartijn642.rechiseled.registration.data.RegistrationFusionModelProvider     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 40 more Caused by: java.lang.NoClassDefFoundError: com/supermartijn642/fusion/api/provider/FusionModelProvider     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:756)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)     ... 42 more Caused by: java.lang.ClassNotFoundException: com.supermartijn642.fusion.api.provider.FusionModelProvider     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 46 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at com.supermartijn642.rechiseled.api.registration.RechiseledRegistration.get(RechiseledRegistration.java:26)     at com.supermartijn642.rechiseled.Rechiseled.<clinit>(Rechiseled.java:37)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Linux (amd64) version 6.6.54-05528-gdd4efe62d86b     Java Version: 1.8.0_432, Temurin     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Temurin     Memory: 261355088 bytes (249 MB) / 671088640 bytes (640 MB) up to 1073741824 bytes (1024 MB)     JVM Flags: 7 total; -Xmx1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2859 59 mods loaded, 58 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                        | Version                      | Source                                           | Signature                                |     |:----- |:------------------------- |:---------------------------- |:------------------------------------------------ |:---------------------------------------- |     | LC    | minecraft                 | 1.12.2                       | minecraft.jar                                    | None                                     |     | LC    | mcp                       | 9.42                         | minecraft.jar                                    | None                                     |     | LC    | FML                       | 8.0.99.99                    | forge-1.12.2-14.23.5.2859.jar                    | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | forge                     | 14.23.5.2859                 | forge-1.12.2-14.23.5.2859.jar                    | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | securitycraft             | v1.9.11                      | [1.12.2] SecurityCraft v1.9.11.jar               | None                                     |     | LC    | supermartijn642corelib    | 1.1.17a                      | _supermartijn642corelib-1.1.17a-forge-mc1.12.jar | None                                     |     | LC    | ic2                       | 2.8.170-ex112                | industrialcraft-2-2.8.170-ex112.jar              | de041f9f6187debbc77034a344134053277aa3b0 |     | LC    | immersiveengineering      | 0.12-98                      | ImmersiveEngineering-0.12-98.jar                 | None                                     |     | LC    | libvulpes                 | 0.4.2.-25                    | LibVulpes-1.12.2-0.4.2-25-universal.jar          | None                                     |     | LC    | advancedrocketry          | 1.12.2-2.0.0-17              | AdvancedRocketry-1.12.2-2.0.0-17.jar             | None                                     |     | LC    | crafttweaker              | 4.1.20                       | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | advancedtweakery          | 1.2                          | AdvancedTweakery-1.2.jar                         | None                                     |     | LC    | applecore                 | 3.4.0                        | AppleCore-mc1.12.2-3.4.0.jar                     | None                                     |     | LC    | base                      | 3.14.0                       | base-1.12.2-3.14.0.jar                           | None                                     |     | LC    | biometweaker              | 3.2.369                      | BiomeTweaker-1.12.2-3.2.369.jar                  | 631f326344f7f5fd7df7eb940760ebd52b7c9c17 |     | LC    | bookshelf                 | 2.3.590                      | Bookshelf-1.12.2-2.3.590.jar                     | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | buildinggadgets           | 2.8.4                        | BuildingGadgets-2.8.4.jar                        | None                                     |     | LC    | ctm                       | MC1.12.2-1.0.2.31            | CTM-MC1.12.2-1.0.2.31.jar                        | None                                     |     | LC    | chisel                    | MC1.12.2-1.0.2.45            | Chisel-MC1.12.2-1.0.2.45.jar                     | None                                     |     | LC    | cyclopscore               | 1.6.7                        | CyclopsCore-1.12.2-1.6.7.jar                     | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | commoncapabilities        | 2.4.8                        | CommonCapabilities-1.12.2-2.4.8.jar              | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | simplecore                | 1.7.3.4                      | simplecore-1.12.2-1.7.3.4.jar                    | None                                     |     | LC    | fusion                    | 2.4.1.11                     | fusion-1.12.2-2.4.1.11.jar                       | None                                     |     | LC    | connectedglass            | 1.1.12                       | connectedglass-1.1.12-forge-mc1.12.jar           | None                                     |     | LC    | contenttweaker            | 1.12.2-4.10.0                | ContentTweaker-1.12.2-4.10.0.jar                 | None                                     |     | LC    | controlling               | 3.0.10                       | Controlling-3.0.12.4.jar                         | None                                     |     | LC    | cotro                     | @VERSION@                    | CoTRO-1.12.2-1.0.1.jar                           | None                                     |     | LC    | ctgui                     | 1.0.0                        | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | crafttweakerjei           | 2.0.3                        | CraftTweaker2-1.12-4.1.20.699.jar                | None                                     |     | LC    | crafttweakerutils         | 0.6                          | crafttweakerutils-0.6.jar                        | None                                     |     | LC    | ctintegration             | 1.7.2                        | ctintegration-1.7.2.jar                          | None                                     |     | LC    | darkutils                 | 1.8.230                      | DarkUtils-1.12.2-1.8.230.jar                     | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | elevatorid                | 1.3.12                       | ElevatorMod-1.12.2-1.3.12.jar                    | None                                     |     | LC    | zerocore                  | 1.12.2-0.1.2.9               | zerocore-1.12.2-0.1.2.9.jar                      | None                                     |     | LC    | bigreactors               | 1.12.2-0.4.5.68              | ExtremeReactors-1.12.2-0.4.5.68.jar              | None                                     |     | LC    | havook                    | 1.0.0                        | havook.jar                                       | None                                     |     | LC    | hungertweaker             | 1.3.0                        | HungerTweaker-1.12.2-1.3.0.jar                   | None                                     |     | LC    | integrateddynamics        | 1.1.11                       | IntegratedDynamics-1.12.2-1.1.11.jar             | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedcrafting        | 1.0.10                       | IntegratedCrafting-1.12.2-1.0.10.jar             | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integrateddynamicscompat  | 1.0.0                        | IntegratedDynamics-1.12.2-1.1.11.jar             | None                                     |     | LC    | integratedterminals       | 1.0.14                       | IntegratedTerminals-1.12.2-1.0.14.jar            | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedterminalscompat | 1.0.0                        | IntegratedTerminals-1.12.2-1.0.14.jar            | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedtunnels         | 1.6.14                       | IntegratedTunnels-1.12.2-1.6.14.jar              | bd0353b3e8a2810d60dd584e256e364bc3bedd44 |     | LC    | integratedtunnelscompat   | 1.0.0                        | IntegratedTunnels-1.12.2-1.6.14.jar              | None                                     |     | LC    | loottweaker               | 0.4.1                        | LootTweaker-0.4.1+MC1.12.2.jar                   | None                                     |     | LC    | materialtweaker           | 1.1.1                        | MaterialTweaker-1.1.1.jar                        | None                                     |     | LC    | mekanism                  | 1.12.2-9.8.3.390             | Mekanism-1.12.2-9.8.3.390.jar                    | None                                     |     | LC    | mekatweaker               | 1.2.0                        | mekatweaker-1.12-1.2.0.jar                       | None                                     |     | LC    | mtlib                     | 3.0.7                        | MTLib-3.0.7.jar                                  | None                                     |     | LC    | modtweaker                | 4.0.19                       | modtweaker-4.0.20.11.jar                         | None                                     |     | LC    | refinedstorage            | 2.3.2                        | morerefinedstorage-2.3.2.jar                     | None                                     |     | L     | rechiseled                | 1.1.6                        | rechiseled-1.1.6-forge-mc1.12.jar                | None                                     |     | L     | refinedstorageaddons      | 0.4.5                        | refinedstorageaddons-0.4.5.jar                   | None                                     |     | L     | supermartijn642configlib  | 1.1.6                        | supermartijn642configlib-1.1.8-forge-mc1.12.jar  | None                                     |     | L     | gircredstone              | ${version}                   | TC-Redstone-1.12.2-3.2.3.jar                     | None                                     |     | L     | worldedit                 | 6.1.10-SNAPSHOT              | WorldEdit-1.12.2.jar                             | None                                     |     | L     | worldeditcuife2           | 2.2.0-mf-1.12.2-14.23.5.2768 | WorldEdit-CUI-Forge-Edition-Mod-1.12.2.jar       | None                                     |     | L     | ic2_tweaker               | 0.2.1+build.4                | ic2-tweaker-0.2.1+build.4.jar                    | None                                     |     | UD    | advancedrocketrycore      | 1                            | minecraft.jar                                    | None                                     |     Loaded coremods (and transformers):  IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   blusunrize.immersiveengineering.common.asm.IEClassTransformer AdvancedRocketryPlugin (AdvancedRocketry-1.12.2-2.0.0-17.jar)   zmaster587.advancedRocketry.asm.ClassTransformer SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.11.jar)    MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   mekanism.coremod.KeybindingMigrationHelper SuperMartijn642's Core Lib Plugin (_supermartijn642corelib-1.1.17a-forge-mc1.12.jar)    AppleCore (AppleCore-mc1.12.2-3.4.0.jar)   squeek.applecore.asm.TransformerModuleHandler MaterialTweakerPlugin (MaterialTweaker-1.1.1.jar)    CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   team.chisel.ctm.client.asm.CTMTransformer MixinLoader (LootTweaker-0.4.1+MC1.12.2.jar)        GL info: ' Vendor: 'Mesa/X.org' Version: '4.3 (Compatibility Profile) Mesa 22.3.6' Renderer: 'virgl (Mesa Intel(R) UHD Graphics 600 (GLK 2))'     Launched Version: 1.12.2-forge-14.23.5.2859     LWJGL: 2.9.4     OpenGL: virgl (Mesa Intel(R) UHD Graphics 600 (GLK 2)) GL version 4.3 (Compatibility Profile) Mesa 22.3.6, Mesa/X.org     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs:      Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 2x Intel(R) Celeron(R) N4020 CPU @ 1.10GHz
    • Also check the worldsave / serverconfig folder If there is no such file, make a test without this mod  
    • Hi, I've been having trouble trying to use forge as it shows a black screen when I open the game, but I can still interact with it and hear the music.  I've done all of the step by steps and most common fixes like updating drivers, keeping up to date with Java, deleting and reinstalling minecraft, restarting my computer MANY times, even smaller things like splash.properties (I didn't have that file so I added it and set it to false thinking it would do something, definitely not) and making sure to prioritize my rtx 3070 in the settings but with no luck. Minecraft works as intended when I uninstall forge and I also don't have any mods currently, it just gives me this issue when I install forge. I also increased the ram usage, made sure my hardware isn't full or anything, and even changed the resolution in hopes it would fix things. I checked my antivirus and firewall but that isn't the issue either. Trust me, I've done everything I can think of. For some reason the black screen does flicker a little into the main menu, but obviously unplayable. I couldn't even make my way to the settings with how little it flickered. I'm not sure if it flickered randomly or if it was because I was messing around moving and clicking a bunch, I didn't really test it that much.  
  • Topics

×
×
  • Create New...

Important Information

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