Everything posted by Draco18s
-
[1.12.2] Trying to create an ore.
You also don't need the item instanceof check. All the information neccessary is already available from Item directly.
-
[1.14.3] Gui Containers
I swear I tried doing that and Eclipse wouldn't let me. I probably inferred something wrong and the autocompletion was (correctly, but unhelpfully) not suggesting things or otherwise complaining.
-
[1.12.2] Trying to create an ore.
You need this function: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L194-L197 Register your items in it
-
[1.14.3] Gui Containers
Will be here momentarily (need to push changes, will take a few minutes) https://github.com/Draco18s/ReasonableRealism/blob/1.14.3/src/main/java/com/draco18s/harderores/HarderOres.java#L102 Done
-
[1.12.2] Trying to create an ore.
He's on 1.12
-
[1.12.2] Trying to create an ore.
You probably aren't registering it in a RegistryEvent.Register<Item> handler.
-
[1.14.3] Gui Containers
Noted. I'll give that a try. Yes. I know. That's not what I am having a problem with. ContainerType's constructor requires an IFactory parameter (which defines a create method), not an IForgeContainerType (which defines a different create method). ContainerType is already an IForgeContainerType, so either: a) I'm already doing it right and something else is wrong b) I'm doing it wrong What do I need to do to get the IForgeContainerType result?
-
[1.14.3] Gui Containers
1.14.3 or 1.14.4? And how do you register the class as an IForgeContainerType?
-
[1.12.2] Trying to create an ore.
Or if you'd like, I condensed item and block registration down to several helper methods. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/EasyRegistry.java Note that this class (and another) act as Proxy and Client Proxy, though I've done away with this in 1.13+ (note that I'm still refining things in that branch).
-
[1.14.3] Gui Containers
I have that. I extended the interface, actually, but my TE still implements it. createMenu, getDisplayName, and openGUI. All the vanilla TEs implement the interface directly. I'm already using the NetworkHooks.openGui that takes in the player, container, and blockpos. But I don't see where I get that blockpos back on the client end of things.
-
[1.14.3] Gui Containers
I'm trying to figure out how to set up gui containers so that the client side has a reference to the TE in question so that it can get things like the current cook time. Due to all the obfuscation behind factories and container types, I can't figure out how on earth the Furnace (and like classes) actually get injected into the Container used on the client side. For example, the Furnace gets its GuiContainer constructed using a Container that calls a constructor that does this: this(containerTypeIn, recipeTypeIn, id, playerInventoryIn, new Inventory(3), new IntArray(4)); That new Inventory(3) is what gets referenced on the client side later on as the Furnace inventory and the new IntArray(4) is used as field_217064_e, referenced in getCookProgressionScaled(). But it's a blank array! It never gets filled with any values as far as I can find. Going a step further it appears that furnaces are just plain broken (they don't smelt, at all) in the dev environment. Can anyone confirm this?
-
[1.12.2] Trying to create an ore.
Don't call new from a static location. You must do it from a Forge controlled event (such as the Register<Item> event handler) or setRegistryName won't work properly.
-
Problem with baked model z-fighting
Sorry, I was looking at the wrong place. The image getting scaled down made it hard to see the z-fighting. I'm not sure. I can't see any of the cuboids overlapping. My best suggestion is to remove all the cuboids and add them back one at a time, checking at each step to see what introduces the problem.
-
Problem with baked model z-fighting
Well yes. You have two cubes that overlap and occupy the same space. You either need to offset your strings or sticks vertically slightly, or you need to use segmented chunks.
-
[1.12.2] lore is messed up when i export my mod
Don't use the unicode symbols, use the TextComponent classes and call setStyle passing a TextFormatting color.
-
[1.14.4] IForgeItem#initCapabilities called before Capabilities are registered
Not a currently known issue: https://github.com/MinecraftForge/MinecraftForge/issues?utf8=✓&q=is%3Aissue+is%3Aopen+capabilities
-
[1.12.2] sound plays multiple times when right click is held down
Its called four times: Once per logical side per Hand. (Client MainHand, ClientOffHand, Server MainHand, Server OffHand)
-
[MC 1.14.4] Help with Custom Recipe Type
Started poking at this myself. You can't do this because CookingRecipeSerializer.IFactory is not visible (and is required for the lambda syntax to function correctly). I had to clone my own copy of CookingRecipeSerializer and AbstractCookingRecipe as well as all of the register methods vanilla uses. This is probably an ideal solution anyway, as AbstractCookingRecipe is a class that implements IRecipe<IInventory>, which should probably be changed for mod machines anyway, but we can't because of the definition of IRecipe.... I did find this comment, but it still depends on IInventory: https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a#gistcomment-2939062
-
[MC 1.14.4] Help with Custom Recipe Type
I am interested to see where this goes. I may not actually make my machines use it (one's a grinder, it should only be 1->2 for certain items, so I don't mind having complete authority), but at the same time I probably should use it, but I didn't even know where to start, so what's in the OP is more than I had a few minutes ago.
-
[SOLVED] Help with NBTs
Look at what super returns, copy it, change it to return a slightly different value. I'd say "you want it to return SUCCESS" but the actual object is more complicated than that. The super method returns PASS.
-
[SOLVED] Help with NBTs
Eclipse can too, I've just gotten used to using Notepadd++'s file search for all kinds of things (not just Minecraft/Java).
-
[SOLVED] Help with NBTs
Notepad++ Find Replace In Files
-
Entity's Position and its "prev" Counterpart
To compute things based on the change since the previous frame
-
[1.12.2] onBlockActivated Not Working?
Look at the if-statement. Consider likely values. Compute the outcome in your head. If that fails, use the debugger.
-
[1.14.4] [SOLVED] How to interate through the player inventory
Option A: - The event class is registered statically, therefor the methods must be static Option B: - The event class is registered as an instance, therefor the methods must not be static Notice how the first part and the second part match? Notice how both options are possible? Event handlers are not required to be static, but you have to match.
IPS spam blocked by CleanTalk.