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
},
"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" : [

Binary file not shown.

Binary file not shown.

View File

@ -6,6 +6,20 @@
"diffuse" : "/Models/items/materials/logmodel.png",
"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
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);
ServerBehaviorTreeUtils.updateCell(entity, oldDataCell);
if(oldDataCell.getScene().containsEntity(entity)){
if(oldDataCell != null && oldDataCell.getScene().containsEntity(entity)){
throw new Error("Entity not removed from scene!");
}
}
if(AttachUtils.hasChildren(entity)){
List<Entity> children = AttachUtils.getChildrenList(entity);
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){
throw new Error("Passed null entity! " + entity);
}
if(oldCell == null){
throw new Error("Passed null oldCell! " + oldCell);
}
if(newCell == null){
throw new Error("Passed null newCell! " + newCell);
}
//swap which holds the entity
oldCell.getScene().deregisterEntity(entity);
if(oldCell != null){
oldCell.getScene().deregisterEntity(entity);
}
newCell.getScene().registerEntity(entity);
//update entity data cell mapper
Globals.entityDataCellMapper.updateEntityCell(entity, newCell);
@ -212,13 +211,15 @@ public class ServerDataCell {
}
}
//delete the entity for players that dont care about it
for(Player player : oldCell.activePlayers){
if(
!newCell.containsPlayer(player) &&
(player.getPlayerEntity() == null || player.getPlayerEntity() != entity)
){
//if the player isn't also in the new cell, delete the entity
player.addMessage(EntityMessage.constructDestroyMessage(entity.getId()));
if(oldCell != null){
for(Player player : oldCell.activePlayers){
if(
!newCell.containsPlayer(player) &&
(player.getPlayerEntity() == null || player.getPlayerEntity() != entity)
){
//if the player isn't also in the new cell, delete the entity
player.addMessage(EntityMessage.constructDestroyMessage(entity.getId()));
}
}
}
}