Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. Not sure where you're seeing this. BTW, minecarts already have a maximum speed of 8m/s per axis.
  2. 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
  3. 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?
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. AKA, read your damn errors. C is not one of a-z, 0-9, /, ., _, or -
  9. 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.
  10. Look at how the furnace works.
  11. 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).
  12. 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)
  13. 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.
  14. I think the only way would be a Global Loot Modifier.
  15. 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.
  16. This is not the registry name of your loot modifier serializser(s) is it?
  17. Also there's like a thousand threads on this topic that would have told you as much.
  18. Here's a 1.14 example that works like described. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/industry/inventory/SlotIInventory.java
  19. The client is a lying, cheating bastard. Do not trust the client to report the correct amounts.
×
×
  • Create New...

Important Information

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