saving items to disk
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
72bacc826a
commit
696f1175bb
@ -7,7 +7,9 @@ import org.joml.Vector3i;
|
|||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.EntityUtils;
|
import electrosphere.entity.EntityUtils;
|
||||||
|
import electrosphere.entity.ServerEntityUtils;
|
||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
import electrosphere.entity.types.creature.CreatureUtils;
|
||||||
|
import electrosphere.entity.types.item.ItemUtils;
|
||||||
import electrosphere.server.content.serialization.ContentSerialization;
|
import electrosphere.server.content.serialization.ContentSerialization;
|
||||||
import electrosphere.server.content.serialization.EntitySerialization;
|
import electrosphere.server.content.serialization.EntitySerialization;
|
||||||
import electrosphere.server.datacell.Realm;
|
import electrosphere.server.datacell.Realm;
|
||||||
@ -97,6 +99,9 @@ public class ServerContentManager {
|
|||||||
Entity creature = CreatureUtils.serverSpawnBasicCreature(realm, serializedEntity.getPosition(), serializedEntity.getSubtype(), null);
|
Entity creature = CreatureUtils.serverSpawnBasicCreature(realm, serializedEntity.getPosition(), serializedEntity.getSubtype(), null);
|
||||||
EntityUtils.getRotation(creature).set(serializedEntity.getRotation());
|
EntityUtils.getRotation(creature).set(serializedEntity.getRotation());
|
||||||
} break;
|
} break;
|
||||||
|
case ItemUtils.ENTITY_TYPE_ITEM: {
|
||||||
|
Entity item = ItemUtils.serverSpawnBasicItem(realm, serializedEntity.getPosition(), serializedEntity.getSubtype());
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,12 @@ public class ContentSerialization {
|
|||||||
rVal.serializedEntities.add(serializedEntity);
|
rVal.serializedEntities.add(serializedEntity);
|
||||||
}
|
}
|
||||||
if(ItemUtils.isItem(entity)){
|
if(ItemUtils.isItem(entity)){
|
||||||
throw new UnsupportedOperationException();
|
EntitySerialization serializedEntity = new EntitySerialization();
|
||||||
|
serializedEntity.setPosition(EntityUtils.getPosition(entity));
|
||||||
|
serializedEntity.setRotation(EntityUtils.getRotation(entity));
|
||||||
|
serializedEntity.setType(ItemUtils.ENTITY_TYPE_ITEM);
|
||||||
|
serializedEntity.setSubtype(ItemUtils.getType(entity));
|
||||||
|
rVal.serializedEntities.add(serializedEntity);
|
||||||
}
|
}
|
||||||
if(ObjectUtils.isObject(entity)){
|
if(ObjectUtils.isObject(entity)){
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user