-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Posts posted by Draco18s
-
-
-
Post the whole crash log.
-
Written against MC 1.14 but has everything
-
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?
-
44 minutes ago, Nefisto said:
Are you saying that the thumbnail is generated in runtime?
Yes.
-
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. -
You can't.
-
35 minutes ago, LexManos said:
Because configs can have a lot of config value types that dont exist in vanilla.
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.
- 1
-
17 hours ago, 1Mangomaster1 said:
the enum and the int if not by passing them, after all, they can be mimiced too...
Yes, but those are direct user input choices.
-
7 minutes ago, 1Mangomaster1 said:
Wdym validate it? You mean checking if the types match? I do
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.
-
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
{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. -
AKA, read your damn errors.
QuoteNon [a-z0-9/._-] character in path of location:
C is not one of a-z, 0-9, /, ., _, or -
-
5 hours ago, harryhrb123 said:
so im just trying to find a mod a SPECIFIC one i have a pic of it here file:///C:/Users/admin/OneDrive/Pictures/Screenshots/2022-04-19.png but idk what it is
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).
-
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.
(The complete shame is a + shape in one of two orientations)
-
Blocks don't have NBT data.
-
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.
-
I think the only way would be a Global Loot Modifier.
-
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.
-
4 hours ago, ChonkoTheGreat said:
mikesfancycontent:test
This is not the registry name of your loot modifier serializser(s) is it?
-
Also there's like a thousand threads on this topic that would have told you as much.
-
Here's a 1.14 example that works like described.
-
The client is a lying, cheating bastard. Do not trust the client to report the correct amounts.
[1.16.5] Formula for brake force
in Modder Support
Posted
Not sure where you're seeing this. BTW, minecarts already have a maximum speed of 8m/s per axis.