new items + serverentityutils update
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
2d55b16119
commit
52010d8b5a
@ -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" : [
|
||||||
|
|||||||
BIN
assets/Models/items/materials/rock1.glb
Normal file
BIN
assets/Models/items/materials/rock1.glb
Normal file
Binary file not shown.
BIN
assets/Models/items/materials/stick1.glb
Normal file
BIN
assets/Models/items/materials/stick1.glb
Normal file
Binary file not shown.
@ -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
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
oldCell.getScene().deregisterEntity(entity);
|
if(oldCell != null){
|
||||||
|
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,13 +211,15 @@ public class ServerDataCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//delete the entity for players that dont care about it
|
//delete the entity for players that dont care about it
|
||||||
for(Player player : oldCell.activePlayers){
|
if(oldCell != null){
|
||||||
if(
|
for(Player player : oldCell.activePlayers){
|
||||||
!newCell.containsPlayer(player) &&
|
if(
|
||||||
(player.getPlayerEntity() == null || player.getPlayerEntity() != entity)
|
!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 the player isn't also in the new cell, delete the entity
|
||||||
|
player.addMessage(EntityMessage.constructDestroyMessage(entity.getId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user