new items + serverentityutils update
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-03 13:33:22 -04:00
parent 2d55b16119
commit 52010d8b5a
7 changed files with 84 additions and 13 deletions

View File

@ -25,6 +25,58 @@
"offsetZ" : 0 "offsetZ" : 0
}, },
"iconPath" : "Textures/icons/itemIconItemGeneric.png" "iconPath" : "Textures/icons/itemIconItemGeneric.png"
},
{
"id" : "Rock",
"tokens" : [
"GRAVITY",
"TARGETABLE"
],
"graphicsTemplate": {
"model": {
"path" : "Models/items/materials/rock1.glb"
}
},
"collidable": {
"type" : "CUBE",
"dimension1" : 0.1,
"dimension2" : 0.1,
"dimension3" : 0.35,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0,
"offsetY" : 0.05,
"offsetZ" : 0
},
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
},
{
"id" : "Stick",
"tokens" : [
"GRAVITY",
"TARGETABLE"
],
"graphicsTemplate": {
"model": {
"path" : "Models/items/materials/stick1.glb"
}
},
"collidable": {
"type" : "CUBE",
"dimension1" : 0.1,
"dimension2" : 0.1,
"dimension3" : 0.35,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0,
"offsetY" : 0.05,
"offsetZ" : 0
},
"iconPath" : "Textures/icons/itemIconItemGeneric.png"
} }
], ],
"files" : [ "files" : [

Binary file not shown.

Binary file not shown.

View File

@ -6,6 +6,20 @@
"diffuse" : "/Models/items/materials/logmodel.png", "diffuse" : "/Models/items/materials/logmodel.png",
"isDefault" : true "isDefault" : true
} }
],
"Models/items/materials/stick1.glb": [
{
"meshName" : "Cylinder",
"diffuse" : "/Textures/wooden.png",
"isDefault" : true
}
],
"Models/items/materials/rock1.glb": [
{
"meshName" : "Cylinder",
"diffuse" : "/Textures/Ground/rock3_256.png",
"isDefault" : true
}
] ]
} }
} }

View File

@ -1418,6 +1418,10 @@ Lore message resend from client on failure
More surface selection work More surface selection work
Noise control from biome definition Noise control from biome definition
(04/03/2025)
Add rock and stick items
Update ServerEntityUtils.repositionEntityRecursive behavior

View File

@ -113,14 +113,14 @@ public class ServerEntityUtils {
} }
ServerDataCell.moveEntityFromCellToCell(entity, oldDataCell, newDataCell); ServerDataCell.moveEntityFromCellToCell(entity, oldDataCell, newDataCell);
ServerBehaviorTreeUtils.updateCell(entity, oldDataCell); ServerBehaviorTreeUtils.updateCell(entity, oldDataCell);
if(oldDataCell.getScene().containsEntity(entity)){ if(oldDataCell != null && oldDataCell.getScene().containsEntity(entity)){
throw new Error("Entity not removed from scene!"); throw new Error("Entity not removed from scene!");
} }
} }
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){
repositionEntityRecursive(realm, child, position); ServerEntityUtils.repositionEntityRecursive(realm, child, position);
} }
} }
} }

View File

@ -186,14 +186,13 @@ public class ServerDataCell {
if(entity == null){ if(entity == null){
throw new Error("Passed null entity! " + entity); throw new Error("Passed null entity! " + entity);
} }
if(oldCell == null){
throw new Error("Passed null oldCell! " + oldCell);
}
if(newCell == null){ if(newCell == null){
throw new Error("Passed null newCell! " + newCell); throw new Error("Passed null newCell! " + newCell);
} }
//swap which holds the entity //swap which holds the entity
if(oldCell != null){
oldCell.getScene().deregisterEntity(entity); oldCell.getScene().deregisterEntity(entity);
}
newCell.getScene().registerEntity(entity); newCell.getScene().registerEntity(entity);
//update entity data cell mapper //update entity data cell mapper
Globals.entityDataCellMapper.updateEntityCell(entity, newCell); Globals.entityDataCellMapper.updateEntityCell(entity, newCell);
@ -212,6 +211,7 @@ public class ServerDataCell {
} }
} }
//delete the entity for players that dont care about it //delete the entity for players that dont care about it
if(oldCell != null){
for(Player player : oldCell.activePlayers){ for(Player player : oldCell.activePlayers){
if( if(
!newCell.containsPlayer(player) && !newCell.containsPlayer(player) &&
@ -222,6 +222,7 @@ public class ServerDataCell {
} }
} }
} }
}
/** /**
* Gets the scene backing this data cell * Gets the scene backing this data cell