recipe work + ServerEntityUtils move method work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-04 19:24:19 -04:00
parent 29e7e3db00
commit 3b8ed5b192
5 changed files with 50 additions and 34 deletions

View File

@ -1,39 +1,6 @@
{ {
"recipes": [ "recipes": [
{ {
"id": 0,
"displayName": "Katana (Two Hand)",
"ingredients": [
{
"itemType": "katana2H",
"count": 1
}
],
"products": [
{
"itemType": "katana2H",
"count": 1
}
]
},
{
"id": 1,
"displayName": "Katana (One Hand)",
"ingredients": [
{
"itemType": "katana",
"count": 1
}
],
"products": [
{
"itemType": "katana",
"count": 1
}
]
},
{
"id": 2,
"displayName": "Workbench", "displayName": "Workbench",
"ingredients": [ "ingredients": [
{ {
@ -50,6 +17,6 @@
} }
], ],
"files": [ "files": [
"Data/game/recipes/weapons.json"
] ]
} }

View File

@ -0,0 +1,37 @@
{
"recipes": [
{
"displayName": "Katana (Two Hand)",
"ingredients": [
{
"itemType": "katana2H",
"count": 1
}
],
"products": [
{
"itemType": "katana2H",
"count": 1
}
]
},
{
"displayName": "Katana (One Hand)",
"ingredients": [
{
"itemType": "katana",
"count": 1
}
],
"products": [
{
"itemType": "katana",
"count": 1
}
]
}
],
"files": [
]
}

View File

@ -1441,6 +1441,8 @@ ServerEntityUtils move entity function properly transfers entity tags now
Fix ServerAttackTree freezing bug Fix ServerAttackTree freezing bug
Fix visually attaching item on server creating item at 0,0,0 on init (thereby creating a new datacell if its not nearby) Fix visually attaching item on server creating item at 0,0,0 on init (thereby creating a new datacell if its not nearby)
Fix test failure debug render writing to file Fix test failure debug render writing to file
Recursive recipe data files
ServerEntityUtils recursive move function potential bugfix

View File

@ -120,6 +120,9 @@ public class ServerEntityUtils {
if(AttachUtils.hasChildren(entity)){ if(AttachUtils.hasChildren(entity)){
List<Entity> children = AttachUtils.getChildrenList(entity); List<Entity> children = AttachUtils.getChildrenList(entity);
for(Entity child : children){ for(Entity child : children){
if(Globals.realmManager.getEntityRealm(child) == null){
continue;
}
ServerEntityUtils.repositionEntityRecursive(realm, child, position); ServerEntityUtils.repositionEntityRecursive(realm, child, position);
} }
} }

View File

@ -14,6 +14,11 @@ import electrosphere.util.FileUtils;
*/ */
public class RecipeDataMap { public class RecipeDataMap {
/**
* Incrementer for assigning IDs to recipes
*/
static int idIncrementer = 0;
/** /**
* The map of recipe id -> recipe data * The map of recipe id -> recipe data
*/ */
@ -64,6 +69,8 @@ public class RecipeDataMap {
//push the types from this file //push the types from this file
for(RecipeData type : loaderFile.getRecipes()){ for(RecipeData type : loaderFile.getRecipes()){
typeList.add(type); typeList.add(type);
type.setId(idIncrementer);
idIncrementer++;
} }
//push types from any other files //push types from any other files
for(String filepath : loaderFile.getFiles()){ for(String filepath : loaderFile.getFiles()){