Jump to content

twizzork

Vintarian
  • Posts

    6
  • Joined

Everything posted by twizzork

  1. almost certainly because you're missing the -jar flag: java -jar vsmodelcreator.jar
  2. Meant to thank you both for the hints! Thank you Spear for that writeup as well - that is exceptionally helpful.
  3. I guess this would be what I was looking for - I'm not sure how I would go about that though. I will also take a look at harmony, and perusing the DLLs, thanks!
  4. I'm assuming you mean specifically with this game/engine? Working with JSON files is very common, especially to read from to get data. I guess, like I said, I am missing some key concepts in regard to the VS API. To be clear, I am not looking to make a patch/JSON mod, I am using .NET as I'll have to make a GUI, etc. My main goal right now is to programmatically get a list of all possible bed blocks, to then add logic/GUI to interaction with one. I could do something like: serverAPI.World.GetBlock(new AssetLocation("bed-hay-head-north")).BlockId; serverAPI.World.GetBlock(new AssetLocation("bed-hay-head-south")).BlockId; //repeat for every bed type and direction Instead of doing this, my idea was to read the JSON file for beds and extract the values in "variantgroups" and "shapebytype", and do some string manipulation (in .NET, not modifying the JSON, to clarify) and add all of them to an array for later event handling, something like: // class field private List<int> bedIdentifiers; // [...] public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); string bedJson; // get bed.json here and use the values in it for the following lists List<string> bedTypes = new List<string>(); // populate with types from JSON file, i.e., "wood", "hay", etc. List<string> bedParts = new List<string>{ "head", "feet" }; List<string> directions = new List<string>{"north", "east", "south", "west"}; foreach (string bedType in bedTypes) { foreach (string direction in directions) { foreach (string bedPart in bedParts) { // compile bed array bedIdentifiers.Add(serverAPI.World.GetBlock(new AssetLocation($"bed-{bedType}-{bedPart}-{direction}")).BlockId); } } } } Might seem like a ridiculous way to go about this, but if more bed types were added, the mod wouldn't work properly. Hope that was clearer, and I hope there's an easier way to do this via API!
  5. Interesting reasoning! I don't appear to be able to find that the newtonsoft package supports JSON5? Guess I could just try it out and see. The issue I see is trying to programmatically use the JSON files, for example, iterating beds somehow rather than listing all different types of beds one by one - maybe I am missing a key piece of the puzzle as the API documentation is a bit difficult to read, although I also understand that it's generated, and nobody wants to do documentation my early idea was to get the bed.json file with AssetLocation, then prepend "bed-", get the variantgroups, shapebytype, and compile an array with a bunch of string manipulation. It all seems a bit tedious to not have some way to do it programmatically, but like I said maybe I am missing some knowledge here?
  6. I started taking a look at modding after spending some time in the game; is there a particular reason why the JSON files are not actually valid JSON? Is VS using a superset like JSON5 or RJSON? This is nitpicky for sure, but more just curious For example, assets\survival\blocktypes\wood\bed.json: { code: "bed", class: "BlockBed", entityClassByType: { "*-head-*": "Bed", }, According to the JSON standard (see the RFC if you're keen) keys must be strings, and later clarifies (section 7 of that RFC) that strings must be surrounded by quotation marks. Given that "*-head-*" is surrounded and the others aren't, I would assume some sort of superset...?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.