Jump to content

GUI Help


knoxi

Recommended Posts

So I'm making a gui and I've found you need:

-The ACtual Block

-BlockEntity

-Container

-Client side rendering

But when I try to make the block entities (here is my code):

public class ModBlockEntities {
    public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES = DeferredRegister.create(
            ForgeRegistries.BLOCK_ENTITY_TYPES, KnoxiItems.MOD_ID);

    public static final RegistryObject<BlockEntityType<MagicalWorkBenchBE>> MAGICAL_WORKBENCH_BE = BLOCK_ENTITIES.register("magical_workbench",
            () -> BlockEntityType.Builder.of(MagicalWorkBenchBE::new, ModBlocks.MAGICAL_WORKBENCH).build(null));//here
}

on the line with

MagicalWorkBenchBE::new

it says

Quote

Cannot resolve method 'of(<method reference>, net.minecraftforge.registries.RegistryObject<net.minecraft.world.level.block.Block>)'

I've seen other people do it but creating a supplier by ::new just never works for me

Link to comment
Share on other sites

Look at the signature of the BlockEntityType.Builder.of() method.

The 2nd parameter is a Block, but you are trying to pass it a RegistryObject<Block>

You get the block by using: ModBlocks.MAGICAL_WORKBENCH.get()

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Oh yeah, ty but the MagicalWorkBenchBE::new still throws an error

    public static final RegistryObject<BlockEntityType<MagicalWorkBenchBE>> MAGICAL_WORKBENCH_BE = BLOCK_ENTITIES.register("magical_workbench",
            () -> BlockEntityType.Builder.of(MagicalWorkBenchBE::new, ModBlocks.MAGICAL_WORKBENCH.get()).build(null));

 

Edited by knoxi
Link to comment
Share on other sites

  • 1 year later...

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

    • KLIK DISINI UNTUK DAFTAR       WsoSlot88 Situs Bandar Togel Terpercaya dengan Hadiah 4D Tertinggi yaitu 10 juta WsoSlot88 adalah BO Agen Togel Terpercaya yang sudah berdiri sejak tahun 2016 yang terkenal dengan proses transaksi deposit dan withdraw yang super cepat serta jaminan pembayaran untuk berapa pun kemenangan yang didapat oleh para member nya. Jadi anda para pecinta game Togel Online dan Slot Gacor tidak perlu takut atau ragu bermain di BO WsoSlot88, karena jika anda Jackpot Paus berapapun, pasti akan dibayar lunas oleh WsoSlot88.   67 Pasaran Togel yang paling dicari oleh para pecinta Togel Online yaitu : - Pasaran Togel Hongkong (HK) - Pasaran Togel Sydney (SDY) - Pasaran Togel Singapore (SGP) - Pasaran Togel Cambodia (CM) - Pasaran Togel Taiwan (TW) - Pasaran Togel Jepang (JPN) - Pasaran Togel China (CN) - Pasaran Togel Chicago - Pasaran Togel Malaysia - Pasaran Togel Vegas - Pasaran Togel Miami - Pasaran Togel Vietnam - Pasaran Togel Carolina - Pasaran Togel Bullseye - Dan masih banyak pasaran togel terkenal lainnya
    • I can play my server & others can connect to it but it cannot load certain chunks & times out because it's bottlenecked by the default 4GB. I know this to be the case because when copy+pastaing the exact server world into curseforge singleplayer with 8G+, all the heavy chunks load in fine.  I have JavaSDK 17.0.9 x64-bit & reinstalled twice already as well as trying with Java 8 also installed & without.  I tried using: java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.2.0/win_args.txt %* pause but all that gives me is: Error: Could not find or load main class java Caused by: java.lang.ClassNotFoundException: java  Any ideas or help would be appreciate. 
    • KLIK DISINI UNTUK DAFTAR     Situs Slot Thailand Terpercaya adalah situs yang menyediakan permainan slot online dengan tema dan layanan yang sesuai dengan kebutuhan dan preferensi pemain asal Thailand. Situs-situs ini biasanya menawarkan permainan slot dengan server khusus yang berasal dari Thailand, yang diklaim memiliki tingkat kemenangan yang tinggi dan mudah mendapatkan jackpot. Beberapa situs juga menyediakan permainan slot dengan server dari negara lain, seperti Rusia dan Singapura, yang juga populer di kalangan pemain Thailand.  
    • I was trying to use viaforge (latest version) on forge 1.20.2 and then it crashed showing exit code 1 heres the log : 04Dec2023 11:40:52.058] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Goldenretriver, --version, 1.16.5-forge-36.2.34, --gameDir, C:\Users\rashr\AppData\Roaming\.minecraft, --assetsDir, C:\Users\rashr\AppData\Roaming\.minecraft\assets, --assetIndex, 1.16, --uuid, a688ba406e4f4635a428d7555a467474, --accessToken, ????????, --userType, msa, --versionType, release, --launchTarget, fmlclient, --fml.forgeVersion, 36.2.34, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210115.111550] [04Dec2023 11:40:52.061] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 8.1.3+8.1.3+main-8.1.x.c94d18ec starting: java version 1.8.0_51 by Oracle Corporation [04Dec2023 11:40:52.071] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [minecraft,testharness,fmlclient,fmlserver] [04Dec2023 11:40:52.075] [main/WARN] [cpw.mods.modlauncher.SecureJarHandler/]: LEGACY JDK DETECTED, SECURED JAR HANDLING DISABLED [04Dec2023 11:40:52.082] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [] [04Dec2023 11:40:52.118] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,object_holder_definalize,runtime_enum_extender,accesstransformer,capability_inject_definalize,runtimedistcleaner] [04Dec2023 11:40:52.125] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [04Dec2023 11:40:52.132] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: [C:\Users\rashr\AppData\Roaming\.minecraft\mods\viaforge-1.12.2-3.4.3.jar]
  • Topics

×
×
  • Create New...

Important Information

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