Jump to content

Recommended Posts

Posted

Hello

 

I noticed, that a brewing-stand fit´s perfectly onto a square-shaped block, if it had four plates for bottles.

I can create souch a block-model and it´s bottle-parts, based on the vanilla-brewing-stand and i can draw it´s inventory-window with four little squares, where the normal one has three.

But how do i tell the game to place item-slots in theese new positions?

And how do i make it use normal brewing recipes and have four bottles of potion as output instead of three?.

 

Posted
  On 2/9/2020 at 9:14 PM, Drachenbauer said:

But how do i tell the game to place item-slots in theese new positions?

Expand  

Inside your container. Containers control what slots are where and handle syncing everything.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

That would depend on how recipes are already implemented. I would start off by finding out how normal brewing stands make 3

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • 1 month later...
Posted (edited)

In the BrewingStandBloch i find "BlockStateProperties.HAS_BOTTLE_0" and the same with 1 and 2.

It seems like BlockStateProperties is a vanilla-class

How do i add one more for the fourth bottle?

 

And for the TileEntity:

I extend LockableTileEntity, because if i extend BrewingStandTileEntity, i cannot pass my TileEntityType to the constructor.

So i copied the whoole code of BrewingStandTileEntity into my one.

But i´m not sure, where i have to do some changes to add one more inventory-slot

 

Edit

I had to change the position of the bubbles and the arrow on the brewingstand-window a bit to fit four slots.

Wich values on my screen-class (copy of the brewingstand´s screen-class) must i change to change the positions for the white overlays?

Edited by Drachenbauer
Posted

If you look at the class, you can tell that blit draws the binded texture to the screen. It would make sense that the first blit renders the entire screen since it is the gui and background layer to be rendered. This would mean that all other blits are used the render the overlays (arrow, bubbles, blaze input). Deconstructing that further, the integer l seems to clamp down a value divided by 20 between 0 and 18. It also has a integer of k which, if you search what it equals to, is the fuel or blaze input. This means that the blit that is handled by integer l is the blaze input. This means that the last two blits handles either the arrow or the bubbles. Since the second blit of the last two clearly handles the bubbles (it says bubblelengths), then the first blit of the last two must handle the arrow overlay.

Posted (edited)

I mean, i don´t know, wich numbers instde theese blits are the position for displaying the graphics.

Is the blaze input the little horizontal bar below the bubbles?

If yes, i moved it together with the bubbles.

 

And i wonder, why there is a longer spiral-wire at the right side of the graphic, where the overlays are?

Edited by Drachenbauer
Posted
this.blit(screen_xpos, screen_ypos, texture_xpos, texture_ypos, texture_xsize, texture_ysize);

The first two render the x and y position on your screen. The second two get the top left corner of the texture to use. The final two get the size of that texture.

Posted (edited)

How do i register the container with DeferredRegister?

 

I have this in my main-calss constructor:

FourBottlesBrewingStandContainers.CONTAINER_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());

 

and this in my container-register-class:

public static final DeferredRegister<ContainerType<?>> CONTAINER_TYPES = new DeferredRegister<>(ForgeRegistries.CONTAINERS, Reference.MOD_ID);

 

But i cannot find a way to create the RegistryObject without any red errors in the code...

 

In the vanilla ContainerType-class i found this:

public static final ContainerType<BrewingStandContainer> BREWING_STAND = register("brewing_stand", BrewingStandContainer::new);

 

at other stuff (blocks, items, entities,...), i was able to put the part behind the registryname into the RegistryObject behind the id-name.

But here it is "BrewingStandContainer::new" and it does not work...

 

 This:

public static final RegistryObject<ContainerType<FourBottlesBrewingStandContainer>> FOUR_BOTTLES_BREWING_STAND = CONTAINER_TYPES.register("four_bottles_brewing_stand", () -> FourBottlesBrewingStandContainer::new);

 

gives two errors:

  Quote

The target type of this expression must be a functional interface


Type mismatch: cannot convert from RegistryObject<ContainerType<?>> to RegistryObject<ContainerType<FourBottlesBrewingStandContainer>>

Expand  

 

What else must i place behind the arrow-operator in that line to register a container?

Edited by Drachenbauer
Posted (edited)

Push

 

I still don´t know, how to register an inventory-container with DeferredRegister.

 

If i try to use IForgeContainerType like this:

public static final RegistryObject<ContainerType<FourBottlesBrewingStandContainer>> FOUR_BOTTLES_BREWING_STAND = CONTAINER_TYPES.register("four_bottles_brewing_stand", () -> IForgeContainerType.create(FourBottlesBrewingStandContainer::new));

 

i get theese three errors:

  Quote

The method create(IContainerFactory<T>) in the type IForgeContainerType is not applicable for the arguments (FourBottlesBrewingStandContainer::new)


The method register(String, Supplier<? extends I>) in the type DeferredRegister<ContainerType<?>> is not applicable for the arguments (String, () -> {})


The type FourBottlesBrewingStandContainer does not define FourBottlesBrewingStandContainer(int, PlayerInventory, PacketBuffer) that is applicable here

Expand  

 

How do i add a PacketBuffer to the constructor of my container?

 

Edit:

Now i added "PacketBuffer buffer" to the constructor input.

The errors disappeared, but no window opens, if i click on my brewingstand and an error appears in the console:

  Quote

[m[33m[15:32:57] [Render thread/WARN] [minecraft/ScreenManager]: Failed to create screen for menu type: fourbottlesbrewingstandmod:four_bottles_brewing_stand

Expand  

Edit:

Now i placed this in my client-setup:

ScreenManager.registerFactory(FourBottlesBrewingStandContainers.FOUR_BOTTLES_BREWING_STAND.get(), FourBottlesBrewingStandScreen::new);

And it works.

Edited by Drachenbauer
Posted (edited)

Now my brewing screen appears and i can place matching items into all the slots.

And the model also shows bottles on the matching positions (view from south matches perfect with the slots on the brewing-window).

 

But as i tested a brewing process, the fourth bottle disappeared at the finish.

 

Edit:

i had to increase some InventorySlot values in the TileEntity and the Container by 1.

Now everything works fine.

 

Edit again:

As i used it in the actual game, i noticed, that at placing it, for a short moment a bottle appears on one of the filling arms.

Seams like a boolean for one of them is true for a short moment after placing.

 

Edit fixed:

The constructor of the Block has aline, that sets the states for the filling arms in the model to false at first.

It included only three of theese parts.

So i added

with(HAS_BOTTLE[3], Boolean.valueOf(false))

as the fourth part into that line.

I´m sure, that no more bottle will appear at placing the brewing stand now.

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

    • Hello All,  Relatively new to this and after playing for a few hours whenever someone enters the nether the entire server will crash and my friend and I are at a bit of a loss. Deleting player data solves the issues but it still persists whenever someone enters even after deleting the DIM-1 folder. Paste: https://pastebin.com/REbpJVqe Thanks!   -Mitchell
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • Cracked Launchers are not supported
    • Hi, I have a problem in minecraft java (only in forge 1.20.1), When I start the game after a moment the game crashed with code 1 this only in forge 1.20.1 , I tried to reinstall java, Upgrade java to 17, update the drivers to the latest version, downgrade the drivers to the pervious version, deleting .minecraft and reinstall it , but none of these ways working.   here is the log:   [Launcher] Launching Minecraft... I'm hiding! mods after C:\Users\Windows\AppData\Roaming\.minecraft\mods\tl_skin_cape_forge_1.20_1.20.1-1.32.jar [InnerMinecraftServersImpl]  search changers of the servers read servers from servers.dat [] [InnerMinecraftServersImpl]  prepare inner servers save servers to servers.dat [Launcher] Game skin type: TLAUNCHER [Launcher] Starting Minecraft Forge 1.20.1... [Launcher] Launching in: C:\Users\Windows\AppData\Roaming\.minecraft Starting garbage collector: 96 / 227 MB Garbage collector completed: 60 / 214 MB [Launcher] Processing post-launch actions. Assist launch: true =============================================================================================== [05:29:03] [main/INFO]: ModLauncher running: args [--username, *********, --version, Forge 1.20.1, --gameDir, C:\Users\Windows\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Windows\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, *************************************, --accessToken, вќ„вќ„вќ„вќ„вќ„вќ„вќ„вќ„, --clientId, null, --xuid, null, --userType, mojang, --versionType, modified, --width, 925, --height, 530, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.22, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [05:29:04] [main/INFO]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.12 by Oracle Corporation; OS Windows 10 arch amd64 version 10.0 [05:29:15] [main/INFO]: Loading ImmediateWindowProvider fmlearlywindow [05:29:24] [main/INFO]: Trying GL version 4.6 [05:29:60] [main/INFO]: Requested GL version 4.6 got version 4.6 [05:29:67] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/Windows/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%23100!/ Service=ModLauncher Env=CLIENT FATAL ERROR in native method: Thread[pool-2-thread-1,5,main]: No context is current or a function that is not available in the current context was called. The JVM will abort execution.     at org.lwjgl.opengl.GL11C.nglGetString(org.lwjgl.opengl@3.3.1+7/Native Method)     at org.lwjgl.opengl.GL11C.glGetString(org.lwjgl.opengl@3.3.1+7/GL11C.java:978)     at net.minecraftforge.fml.earlydisplay.DisplayWindow.initRender(fmlearlydisplay@1.20.1-47.3.22/DisplayWindow.java:209)     at net.minecraftforge.fml.earlydisplay.DisplayWindow.lambda$start$5(fmlearlydisplay@1.20.1-47.3.22/DisplayWindow.java:292)     at net.minecraftforge.fml.earlydisplay.DisplayWindow$$Lambda$437/0x000001fab120a618.run(fmlearlydisplay@1.20.1-47.3.22/Unknown Source)     at java.util.concurrent.Executors$RunnableAdapter.call(java.base@17.0.12/Executors.java:539)     at java.util.concurrent.FutureTask.run(java.base@17.0.12/FutureTask.java:264)     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(java.base@17.0.12/ScheduledThreadPoolExecutor.java:304)     at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.12/ThreadPoolExecutor.java:1136)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.12/ThreadPoolExecutor.java:635)     at java.lang.Thread.run(java.base@17.0.12/Thread.java:842) Here I am! [VersionManager] Refreshing versions locally... [VersionManager] Versions has been refreshed (6 ms) [Launcher] Launcher exited. [Launcher] Minecraft closed with exit code: 1 flush now [Launcher] [Crash] Signature "Bad video drivers" matches! [Crash] Signature "Bad video drivers" matches! [Launcher] [Crash] Crash has been recognized! [Crash] Crash has been recognized! flush now
  • Topics

×
×
  • Create New...

Important Information

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