-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Not sure where you're seeing this. BTW, minecarts already have a maximum speed of 8m/s per axis.
-
This line runs before this line.
-
I Keep Getting A Whitelist And It Varies For Different Mods
Draco18s replied to NoursABoar's topic in Support & Bug Reports
Post the whole crash log. -
Stop automation taking from input slot[1.16.5]
Draco18s replied to Will11690's topic in Modder Support
Written against MC 1.14 but has everything https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/entity/TannerTileEntity.java#L140 -
How to get drops from a block using Block#getDrops
Draco18s replied to Sweetmimike's topic in Modder Support
Imagine for a moment that a block exists which drops a different item depending on the biome. Say tall grass. In plains, it drops seeds, in the swamp, melon seeds, in jungle, pumpkin seeds, and in desert, nothing. Which would you want your method to generate? Any? All? One? Which one? -
[1.18] How to get a clients key mappings?
Draco18s replied to [DK] Headcrab [DK]'s topic in Modder Support
Just to clarify, if this code is running on the client in the client thread, that's fine. If this code were to run on a dedicated server, the server will crash (my prior post I thought I saw something about getting the client info from the server). If this code were to run in the integrated server, you would be reaching across sides and the game might crash randomly and unexpectedly. -
[1.18] How to get a clients key mappings?
Draco18s replied to [DK] Headcrab [DK]'s topic in Modder Support
You can't. -
[closed] Why is there no generic mod config GUI?
Draco18s replied to GenElectrovise's topic in Suggestions
Case in point, my work project. Which is Unity/C#, but the idea is the same. The Unity inspector is pretty good at finding public/serializable values and showing them in a list in the Inspector gui, but it's layout or labels aren't always the best, and there's only so much you can do with annotations (of which there are several). So for more flexibility, Unity offers both a CustomInspector feature and a CustomPropertyDrawer feature (the former is for Unity-objects that appear in the inspector, the latter for miscellaneous objects that are contained within the former). However even this is limited to only the things Unity knows how to serialize. Generics? Lists of Interface objects? Abstracts? Not supported. But my project needed support for generic objects because of how our interaction system (ECS components encapsulating simple finite state objects) and our grading system (did the user perform the following steps in the prescribed order?) had to integrate with each other. I had a hard requirement to be able to display any object Foo in the inspector, regardless of what Foo's type was. So I had to dig into Unity's inspector code and extract out how it handled all of the types it did handle and rewrite it to accept arbitrary values, that if it didn't match the available types, would use reflection to find all of the object's public/serializable fields and then try to draw all of those, recursing down again and again until a primative type was able to be drawn. And even with caching to avoid duplicate reflection lookups, it still isn't fast. There's a soft limit of about 20-50 of these inspector drawers that Unity can draw at one time before the lag becomes disruptive. And when you're dealing with complex custom types, the layout isn't pretty. Thus I had to go reimplement Unity's custom editor and custom property drawer system as well. Which is to say...if it's more than a handful of very simple objects (ints, strings, booleans...) you're going to have to do the work yourself. -
Verify that it is a valid location for the player to access. Think about a hacked client that sends whatever location data it wants. Remember, the first rule of net code is: The client is a lying, cheating, bastard. The only thing you should send to the server is what user input was given. user clicked this button user entered this text user pressed this key The server already knows what container the user is interacting with, where the user is, what tile entity they've accessed, and its location. You don't need to send that info. All the server does is go "ok, they clicked a button, let me compute the result of that action." The client can mimic that result, in order to hide the latency, but the server's return update packet will override anything the client did.
-
Cooldown being ruined by more than one item in slot
Draco18s replied to Crescentine's topic in Modder Support
https://github.com/Crescentine/Trajans-Tanks-1.18/blob/main/src/main/java/com/crescentine/trajanstanks/block/steelmanufacturer/SteelManufacturerBlockEntity.java#L180 ItemStack merging would be better (inventory.Insert(...)). What if there's a stack in the output that doesn't match the output of the current recipe? Also, having separate item stack handlers for input(s) and output(s) would simplify things massively. Rather than having to remember that the output slot is slot 10 everywhere you can just say "output." Old 1.14 (MCP names) code, but same idea https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/PackagerTileEntity.java#L191 {edit, scratch that, one mo'...} Nope don't see what the issue is. The entity calls resetProgress from craftItem and that should prevent it from ending up back in that method next tick. You might have to use the debugger to figure it out. -
How would i make a minecraft item recipe?
Draco18s replied to MeowCatSunny's topic in Modder Support
AKA, read your damn errors. C is not one of a-z, 0-9, /, ., _, or - -
That address is a file location on your computer, my computer does not have an admin folder (this is like telling someone over the phone that you put something in the upper right drawer of your desk, they should check the upper right drawer of their desk for it). The OneDrive link does work, because that's an internet address. Still not enough information to identify what you're even asking about, you just have a picture of some minecraft hud elements, but haven't specified which one you're interested in, and most of them look vanilla to me.
-
Look at how the furnace works.
-
The crafting table does not support "timed" crafting, the way the smelter does. So that won't be possible. (Heck the crafting table doesn't even have an inventory).
-
how to check if Block at X position has changed
Draco18s replied to xana43's topic in Modder Support
eg. I had my structure call neighbor updated when it was broken, with a different offset amount, in order to ping the center block about the change. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/block/WindvaneBlock.java#L72 (The complete shame is a + shape in one of two orientations) -
Blocks don't have NBT data.
-
1.18.2 How do I make my block only mineable with netherite?
Draco18s replied to Azarsra's topic in Modder Support
Almost certainly yes. I'm not familiar with the harvest datapack system (ie. what portion of the code reads that file) but there is going to be a way to utilize it for your own stuff. Mind, it might not be clean or easy, as there may not be Forge hooks. But there'd still be a way to do it. -
1.18.2 How do I make my block only mineable with netherite?
Draco18s replied to Azarsra's topic in Modder Support
I think the only way would be a Global Loot Modifier. -
[1.16.4] Global Loot Modifiers for Mobs
Draco18s replied to ChonkoTheGreat's topic in Modder Support
They sure do, I made sure of it. Kinda surprised it isn't part of the test mod that went along with it in the Forge repo source, but whatever. I wrote it and tested it. So I know it works. -
[1.16.4] Global Loot Modifiers for Mobs
Draco18s replied to ChonkoTheGreat's topic in Modder Support
This is not the registry name of your loot modifier serializser(s) is it? -
[1.16.5] Multiple Advancement Start Points
Draco18s replied to BloodshotPico's topic in Modder Support
Yes-ish but also no-ish. Basically you can only have one "root" advancement (consider it the advancement that unlocks the tab itself), but there are some things you can do to make that advancement invisible. While I'm pretty sure the node graph is laid out programmatically now, you can still use Reflection to manipulate the placement (and so on) of the displayed UI (I did something similar in the past to create an achievement with two prerequisites that were themselves unrelated). Old, old code, but you can see that I used reflection to grab the display column and row fields and then set them to specific values for some advancements (mostly vanilla ones to shove them aside for my own). The fakeIronBar advancement sits behind the vanilla iron bar advancement so it looks like there's two arrows pointing at the same thing, but in reality there's only one pre-req per icon. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/ores/util/StatsAchievements.java