menu refactoring
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
dffd02853d
commit
6f8e44f325
@ -8,6 +8,7 @@
|
|||||||
- @subpage audioengine
|
- @subpage audioengine
|
||||||
- @subpage timekeeper
|
- @subpage timekeeper
|
||||||
- @subpage archimprovementtargets
|
- @subpage archimprovementtargets
|
||||||
|
- @subpage savesindex
|
||||||
|
|
||||||
|
|
||||||
# What is this section
|
# What is this section
|
||||||
|
|||||||
1
docs/src/architecture/saves/savesindex.md
Normal file
1
docs/src/architecture/saves/savesindex.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
@page savesindex Saves
|
||||||
21
docs/src/architecture/scenemanagement/entitySerialization.md
Normal file
21
docs/src/architecture/scenemanagement/entitySerialization.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
@page entitySerialization Entity Serialization
|
||||||
|
|
||||||
|
How are entities load from disk/sent to player
|
||||||
|
|
||||||
|
Entities have a top level 'type', ie 'creature', 'object', 'foliage', etc
|
||||||
|
Beneath that is the specific subtype, ie 'human', 'elf', 'woodenCrate'
|
||||||
|
|
||||||
|
|
||||||
|
Lets say when the client receives the request 'spawn human' it runs the full human-creation macro. What then needs to be updated from the default for the macro?
|
||||||
|
Visual attributes
|
||||||
|
Equip state
|
||||||
|
current animation
|
||||||
|
movement state
|
||||||
|
idle state
|
||||||
|
gravity state
|
||||||
|
jump state
|
||||||
|
attack state
|
||||||
|
|
||||||
|
|
||||||
|
Specifically when loading files, also need to store server data
|
||||||
|
Which entity is the player's entity
|
||||||
@ -1,3 +1,6 @@
|
|||||||
@page serverSceneManagement Server Scene Management
|
@page serverSceneManagement Server Scene Management
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
- @subpage entitySerialization
|
||||||
@ -195,6 +195,15 @@ Level loading/saving + Basic Editor
|
|||||||
- Menu of types of entities to spawn
|
- Menu of types of entities to spawn
|
||||||
- Button to spawn them at cursor
|
- Button to spawn them at cursor
|
||||||
|
|
||||||
|
More Debug menus
|
||||||
|
- Screen that shows the overall status of client scene
|
||||||
|
- Number of entities
|
||||||
|
- Maybe a listing of each one?
|
||||||
|
- Screen that shows the overall status of draw cell manager
|
||||||
|
- Screen that shows the overall status of fluid cell manager
|
||||||
|
- Screen that shows the overall status of realm 0
|
||||||
|
- Screen that shows the overall status of realm manager
|
||||||
|
|
||||||
Revisit first attempt at instancing (its really laggy lol)
|
Revisit first attempt at instancing (its really laggy lol)
|
||||||
- Maybe have draw call happen on top level entity and immediately queue all children recursively
|
- Maybe have draw call happen on top level entity and immediately queue all children recursively
|
||||||
|
|
||||||
|
|||||||
@ -97,11 +97,11 @@ import electrosphere.entity.types.camera.CameraEntityUtils;
|
|||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
import electrosphere.entity.types.creature.CreatureUtils;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.menu.MenuGenerators;
|
import electrosphere.menu.MenuGenerators;
|
||||||
import electrosphere.menu.MenuGeneratorsDebug;
|
|
||||||
import electrosphere.menu.MenuGeneratorsInGame;
|
|
||||||
import electrosphere.menu.MenuGeneratorsInventory;
|
|
||||||
import electrosphere.menu.WindowStrings;
|
import electrosphere.menu.WindowStrings;
|
||||||
import electrosphere.menu.WindowUtils;
|
import electrosphere.menu.WindowUtils;
|
||||||
|
import electrosphere.menu.ingame.MenuGeneratorsInGame;
|
||||||
|
import electrosphere.menu.ingame.MenuGeneratorsInventory;
|
||||||
|
import electrosphere.menu.mainmenu.MenuGeneratorsDebug;
|
||||||
import electrosphere.renderer.ui.Window;
|
import electrosphere.renderer.ui.Window;
|
||||||
import electrosphere.renderer.ui.events.ClickEvent;
|
import electrosphere.renderer.ui.events.ClickEvent;
|
||||||
import electrosphere.renderer.ui.events.KeyboardEvent;
|
import electrosphere.renderer.ui.events.KeyboardEvent;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import electrosphere.engine.time.Timekeeper;
|
|||||||
import electrosphere.game.config.UserSettings;
|
import electrosphere.game.config.UserSettings;
|
||||||
import electrosphere.game.server.world.MacroData;
|
import electrosphere.game.server.world.MacroData;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.menu.ImGuiWindowMacros;
|
import electrosphere.menu.debug.ImGuiWindowMacros;
|
||||||
import electrosphere.renderer.RenderingEngine;
|
import electrosphere.renderer.RenderingEngine;
|
||||||
import electrosphere.server.simulation.MacroSimulation;
|
import electrosphere.server.simulation.MacroSimulation;
|
||||||
|
|
||||||
|
|||||||
@ -31,9 +31,9 @@ import electrosphere.entity.types.camera.CameraEntityUtils;
|
|||||||
import electrosphere.entity.types.tree.ProceduralTree;
|
import electrosphere.entity.types.tree.ProceduralTree;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.menu.MenuGenerators;
|
import electrosphere.menu.MenuGenerators;
|
||||||
import electrosphere.menu.MenuGeneratorsMultiplayer;
|
|
||||||
import electrosphere.menu.WindowStrings;
|
import electrosphere.menu.WindowStrings;
|
||||||
import electrosphere.menu.WindowUtils;
|
import electrosphere.menu.WindowUtils;
|
||||||
|
import electrosphere.menu.mainmenu.MenuGeneratorsMultiplayer;
|
||||||
import electrosphere.net.NetUtils;
|
import electrosphere.net.NetUtils;
|
||||||
import electrosphere.net.client.ClientNetworking;
|
import electrosphere.net.client.ClientNetworking;
|
||||||
import electrosphere.renderer.ui.Window;
|
import electrosphere.renderer.ui.Window;
|
||||||
|
|||||||
@ -49,10 +49,6 @@ import electrosphere.server.terrain.manager.ServerTerrainManager;
|
|||||||
*/
|
*/
|
||||||
public class LoadingUtils {
|
public class LoadingUtils {
|
||||||
|
|
||||||
// static void initTerrainDataCellManager(){
|
|
||||||
// Globals.griddedDataCellManager.init(Globals.serverWorldData);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void initServerGameTerrainManager(){
|
static void initServerGameTerrainManager(){
|
||||||
@ -62,13 +58,11 @@ public class LoadingUtils {
|
|||||||
*/
|
*/
|
||||||
float randomDampener = 0.0f; //0.25f;
|
float randomDampener = 0.0f; //0.25f;
|
||||||
Globals.serverTerrainManager = new ServerTerrainManager(2000,50,randomDampener,0,new OverworldChunkGenerator());
|
Globals.serverTerrainManager = new ServerTerrainManager(2000,50,randomDampener,0,new OverworldChunkGenerator());
|
||||||
if(Globals.RUN_SERVER){
|
if(Globals.userSettings.gameplayGenerateWorld()){
|
||||||
if(Globals.userSettings.gameplayGenerateWorld()){
|
Globals.serverTerrainManager.generate();
|
||||||
Globals.serverTerrainManager.generate();
|
Globals.serverTerrainManager.save("./terrain.json");
|
||||||
Globals.serverTerrainManager.save("./terrain.json");
|
} else {
|
||||||
} else {
|
SaveUtils.loadSave(Globals.currentSaveName);
|
||||||
SaveUtils.loadSave(Globals.currentSaveName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -32,6 +32,12 @@ public class EntityDataStrings {
|
|||||||
public static final String INSTANCED_MODEL_ATTRIBUTE = "instancedModelAttribute";
|
public static final String INSTANCED_MODEL_ATTRIBUTE = "instancedModelAttribute";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entity type
|
||||||
|
*/
|
||||||
|
public static final String ENTITY_TYPE = "entityType"; //ie "creature", "foliage", "terrain", etc
|
||||||
|
public static final String ENTITY_SUBTYPE = "entitySubtype"; //ie "human", "woodenCrate", etc
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Terrain Entity
|
Terrain Entity
|
||||||
*/
|
*/
|
||||||
@ -46,8 +52,6 @@ public class EntityDataStrings {
|
|||||||
/*
|
/*
|
||||||
Creature Entity
|
Creature Entity
|
||||||
*/
|
*/
|
||||||
public static final String DATA_STRING_CREATURE_IS_CREATURE = "isCreature";
|
|
||||||
public static final String DATA_STRING_CREATURE_TYPE = "creatureType";
|
|
||||||
public static final String DATA_STRING_CREATURE_CONTROLLER_PLAYER_ID = "creaturePlayerId";
|
public static final String DATA_STRING_CREATURE_CONTROLLER_PLAYER_ID = "creaturePlayerId";
|
||||||
public static final String CLIENT_MOVEMENT_BT = "clientMovementBT";
|
public static final String CLIENT_MOVEMENT_BT = "clientMovementBT";
|
||||||
public static final String SERVER_MOVEMENT_BT = "serverMovementBT";
|
public static final String SERVER_MOVEMENT_BT = "serverMovementBT";
|
||||||
@ -176,8 +180,6 @@ public class EntityDataStrings {
|
|||||||
/*
|
/*
|
||||||
Item Entity
|
Item Entity
|
||||||
*/
|
*/
|
||||||
public static final String ITEM_IS_ITEM = "itemIsItem";
|
|
||||||
public static final String ITEM_TYPE = "itemType";
|
|
||||||
public static final String ITEM_IS_WEAPON = "itemIsWeapon";
|
public static final String ITEM_IS_WEAPON = "itemIsWeapon";
|
||||||
public static final String ITEM_IS_ARMOR = "itemIsArmor";
|
public static final String ITEM_IS_ARMOR = "itemIsArmor";
|
||||||
public static final String ITEM_EQUIP_WHITELIST = "itemEquipWhitelist";
|
public static final String ITEM_EQUIP_WHITELIST = "itemEquipWhitelist";
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package electrosphere.entity;
|
package electrosphere.entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tags used in scenes to delineate groups of entities
|
||||||
|
*/
|
||||||
public class EntityTags {
|
public class EntityTags {
|
||||||
|
|
||||||
public static final String BONE_ATTACHED = "boneAttached";
|
public static final String BONE_ATTACHED = "boneAttached";
|
||||||
@ -12,8 +15,8 @@ public class EntityTags {
|
|||||||
public static final String LIFE_STATE = "lifeState";
|
public static final String LIFE_STATE = "lifeState";
|
||||||
public static final String CREATURE = "creature";
|
public static final String CREATURE = "creature";
|
||||||
public static final String FOLIAGE = "foliage";
|
public static final String FOLIAGE = "foliage";
|
||||||
public static final String UI = "ui";
|
public static final String UI = "ui"; //is it a ui entity
|
||||||
public static final String DRAWABLE = "drawable";
|
public static final String DRAWABLE = "drawable"; //is it drawable
|
||||||
public static final String DRAW_INSTANCED = "drawInstanced"; //if it's instanced, but not necessarily managed by a service (ie a tree branch)
|
public static final String DRAW_INSTANCED = "drawInstanced"; //if it's instanced, but not necessarily managed by a service (ie a tree branch)
|
||||||
public static final String DRAW_INSTANCED_MANAGED = "drawInstancedManaged"; //if it's managed by a service (ie foliage manager)
|
public static final String DRAW_INSTANCED_MANAGED = "drawInstancedManaged"; //if it's managed by a service (ie foliage manager)
|
||||||
public static final String LIGHT = "light";
|
public static final String LIGHT = "light";
|
||||||
|
|||||||
@ -118,11 +118,9 @@ public class EntityUtils {
|
|||||||
*/
|
*/
|
||||||
protected static Entity spawnSpatialEntity(){
|
protected static Entity spawnSpatialEntity(){
|
||||||
Entity rVal = new Entity();
|
Entity rVal = new Entity();
|
||||||
// rVal.putData(EntityDataStrings.DATA_STRING_MODEL_PATH, modelPath);
|
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_POSITION, new Vector3d(0,0,0));
|
rVal.putData(EntityDataStrings.DATA_STRING_POSITION, new Vector3d(0,0,0));
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaterniond().identity());
|
rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaterniond().identity());
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(1,1,1));
|
rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(1,1,1));
|
||||||
EntityLookupUtils.registerServerEntity(rVal);
|
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,14 +147,20 @@ public class EntityUtils {
|
|||||||
EntityLookupUtils.removeEntity(e);
|
EntityLookupUtils.removeEntity(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static void setEntityID(Entity e, int id){
|
/**
|
||||||
// Globals.entityManager.mapIdToId(e.getId(), id);
|
* Gets the actor on the entity
|
||||||
// }
|
* @param e The entity
|
||||||
|
* @return The actor
|
||||||
|
*/
|
||||||
public static Actor getActor(Entity e){
|
public static Actor getActor(Entity e){
|
||||||
return (Actor)e.getData(EntityDataStrings.DATA_STRING_ACTOR);
|
return (Actor)e.getData(EntityDataStrings.DATA_STRING_ACTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the pose actor on the entity
|
||||||
|
* @param e The entity
|
||||||
|
* @return the pose actor
|
||||||
|
*/
|
||||||
public static PoseActor getPoseActor(Entity e){
|
public static PoseActor getPoseActor(Entity e){
|
||||||
return (PoseActor)e.getData(EntityDataStrings.POSE_ACTOR);
|
return (PoseActor)e.getData(EntityDataStrings.POSE_ACTOR);
|
||||||
}
|
}
|
||||||
@ -172,5 +176,41 @@ public class EntityUtils {
|
|||||||
public static boolean getDraw(Entity entity){
|
public static boolean getDraw(Entity entity){
|
||||||
return (boolean)entity.getData(EntityDataStrings.DATA_STRING_DRAW);
|
return (boolean)entity.getData(EntityDataStrings.DATA_STRING_DRAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the type of the entity
|
||||||
|
* @param entity The entity
|
||||||
|
* @return The type
|
||||||
|
*/
|
||||||
|
public static int getEntityType(Entity entity){
|
||||||
|
return (int)entity.getData(EntityDataStrings.ENTITY_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the entity type
|
||||||
|
* @param entity the entity
|
||||||
|
* @param type the type
|
||||||
|
*/
|
||||||
|
public static void setEntityType(Entity entity, int type){
|
||||||
|
entity.putData(EntityDataStrings.ENTITY_TYPE, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the subtype of this entity
|
||||||
|
* @param entity The entity
|
||||||
|
* @return The subtype
|
||||||
|
*/
|
||||||
|
public static String getEntitySubtype(Entity entity){
|
||||||
|
return (String)entity.getData(EntityDataStrings.ENTITY_SUBTYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the subtype of this entity
|
||||||
|
* @param entity The entity
|
||||||
|
* @param subtype The subtype
|
||||||
|
*/
|
||||||
|
public static void setEntitySubtype(Entity entity, String subtype){
|
||||||
|
entity.putData(EntityDataStrings.ENTITY_SUBTYPE, subtype);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,9 @@ import electrosphere.util.Utilities;
|
|||||||
* Utilities for creating creatures on the client and server
|
* Utilities for creating creatures on the client and server
|
||||||
*/
|
*/
|
||||||
public class CreatureUtils {
|
public class CreatureUtils {
|
||||||
|
|
||||||
|
//The entity type int for creatures
|
||||||
|
public static final int ENTITY_TYPE_CREATURE = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawns a client-side creature entity
|
* Spawns a client-side creature entity
|
||||||
@ -371,8 +374,8 @@ public class CreatureUtils {
|
|||||||
rVal.putData(EntityDataStrings.TREE_IDLE, idleTree);
|
rVal.putData(EntityDataStrings.TREE_IDLE, idleTree);
|
||||||
Globals.clientScene.registerBehaviorTree(idleTree);
|
Globals.clientScene.registerBehaviorTree(idleTree);
|
||||||
Globals.clientScene.registerEntityToTag(rVal, EntityTags.CREATURE);
|
Globals.clientScene.registerEntityToTag(rVal, EntityTags.CREATURE);
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_CREATURE_IS_CREATURE, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_CREATURE);
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_CREATURE_TYPE, type);
|
EntityUtils.setEntitySubtype(rVal, type);
|
||||||
CreatureUtils.setFacingVector(rVal, new Vector3d(0,0,1));
|
CreatureUtils.setFacingVector(rVal, new Vector3d(0,0,1));
|
||||||
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||||
return rVal;
|
return rVal;
|
||||||
@ -667,8 +670,8 @@ public class CreatureUtils {
|
|||||||
ServerIdleTree.attachTree(rVal);
|
ServerIdleTree.attachTree(rVal);
|
||||||
|
|
||||||
ServerEntityTagUtils.attachTagToEntity(rVal, EntityTags.CREATURE);
|
ServerEntityTagUtils.attachTagToEntity(rVal, EntityTags.CREATURE);
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_CREATURE_IS_CREATURE, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_CREATURE);
|
||||||
rVal.putData(EntityDataStrings.DATA_STRING_CREATURE_TYPE, type);
|
EntityUtils.setEntitySubtype(rVal, type);
|
||||||
CreatureUtils.setFacingVector(rVal, new Vector3d(0,0,1));
|
CreatureUtils.setFacingVector(rVal, new Vector3d(0,0,1));
|
||||||
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||||
return rVal;
|
return rVal;
|
||||||
@ -755,8 +758,13 @@ public class CreatureUtils {
|
|||||||
clientGetAttackTree(e).addNetworkMessage(em);
|
clientGetAttackTree(e).addNetworkMessage(em);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the type of creature
|
||||||
|
* @param e the entity
|
||||||
|
* @return the type
|
||||||
|
*/
|
||||||
public static String getType(Entity e){
|
public static String getType(Entity e){
|
||||||
return (String)e.getData(EntityDataStrings.DATA_STRING_CREATURE_TYPE);
|
return (String)EntityUtils.getEntitySubtype(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getControllerPlayerId(Entity e){
|
public static int getControllerPlayerId(Entity e){
|
||||||
@ -771,8 +779,16 @@ public class CreatureUtils {
|
|||||||
return e.containsKey(EntityDataStrings.DATA_STRING_CREATURE_CONTROLLER_PLAYER_ID);
|
return e.containsKey(EntityDataStrings.DATA_STRING_CREATURE_CONTROLLER_PLAYER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if this entity is a creature
|
||||||
|
* @param e The entity
|
||||||
|
* @return true if it is a creature, false otherwise
|
||||||
|
*/
|
||||||
public static boolean isCreature(Entity e){
|
public static boolean isCreature(Entity e){
|
||||||
return e.containsKey(EntityDataStrings.DATA_STRING_CREATURE_IS_CREATURE);
|
if(!e.containsKey(EntityDataStrings.ENTITY_TYPE)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (int)e.getData(EntityDataStrings.ENTITY_TYPE) == ENTITY_TYPE_CREATURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttackTree clientGetAttackTree(Entity e){
|
public static AttackTree clientGetAttackTree(Entity e){
|
||||||
|
|||||||
@ -40,11 +40,14 @@ import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils;
|
|||||||
import electrosphere.server.datacell.utils.ServerEntityTagUtils;
|
import electrosphere.server.datacell.utils.ServerEntityTagUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Utilities for working with items
|
||||||
* @author amaterasu
|
|
||||||
*/
|
*/
|
||||||
public class ItemUtils {
|
public class ItemUtils {
|
||||||
|
|
||||||
|
//The item creature type
|
||||||
|
public static final int ENTITY_TYPE_ITEM = 1;
|
||||||
|
|
||||||
|
//generic item icon filepath
|
||||||
static final String genericItemIconPath = "Textures/icons/itemIconItemGeneric.png";
|
static final String genericItemIconPath = "Textures/icons/itemIconItemGeneric.png";
|
||||||
|
|
||||||
public static Entity clientSpawnBasicItem(String name){
|
public static Entity clientSpawnBasicItem(String name){
|
||||||
@ -106,9 +109,9 @@ public class ItemUtils {
|
|||||||
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS,item.getEquipClass());
|
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS,item.getEquipClass());
|
||||||
}
|
}
|
||||||
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_ITEM, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_ITEM);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, false);
|
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, false);
|
||||||
rVal.putData(EntityDataStrings.ITEM_TYPE, name);
|
EntityUtils.setEntitySubtype(rVal, name);
|
||||||
// rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(0.005f,0.005f,0.005f));
|
// rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(0.005f,0.005f,0.005f));
|
||||||
// rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaternionf().identity().rotateY((float)(-Math.PI/2)).rotateZ(-(float)(Math.PI/2)));
|
// rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaternionf().identity().rotateY((float)(-Math.PI/2)).rotateZ(-(float)(Math.PI/2)));
|
||||||
Globals.clientSceneWrapper.getScene().registerEntityToTag(rVal, EntityTags.ITEM);
|
Globals.clientSceneWrapper.getScene().registerEntityToTag(rVal, EntityTags.ITEM);
|
||||||
@ -176,9 +179,9 @@ public class ItemUtils {
|
|||||||
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS,item.getEquipClass());
|
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS,item.getEquipClass());
|
||||||
}
|
}
|
||||||
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_ITEM, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_ITEM);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, false);
|
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, false);
|
||||||
rVal.putData(EntityDataStrings.ITEM_TYPE, name);
|
EntityUtils.setEntitySubtype(rVal, name);
|
||||||
// rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(0.005f,0.005f,0.005f));
|
// rVal.putData(EntityDataStrings.DATA_STRING_SCALE, new Vector3f(0.005f,0.005f,0.005f));
|
||||||
// rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaternionf().identity().rotateY((float)(-Math.PI/2)).rotateZ(-(float)(Math.PI/2)));
|
// rVal.putData(EntityDataStrings.DATA_STRING_ROTATION, new Quaternionf().identity().rotateY((float)(-Math.PI/2)).rotateZ(-(float)(Math.PI/2)));
|
||||||
ServerEntityTagUtils.attachTagToEntity(rVal, EntityTags.ITEM);
|
ServerEntityTagUtils.attachTagToEntity(rVal, EntityTags.ITEM);
|
||||||
@ -234,12 +237,26 @@ public class ItemUtils {
|
|||||||
player.addMessage(message);
|
player.addMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isItem(Entity item){
|
|
||||||
return item.containsKey(EntityDataStrings.ITEM_IS_ITEM);
|
/**
|
||||||
|
* Checks if this entity is an item
|
||||||
|
* @param e the entity
|
||||||
|
* @return true if it is an item, false otherwise
|
||||||
|
*/
|
||||||
|
public static boolean isItem(Entity e){
|
||||||
|
if(!e.containsKey(EntityDataStrings.ENTITY_TYPE)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (int)e.getData(EntityDataStrings.ENTITY_TYPE) == ENTITY_TYPE_ITEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the type of item
|
||||||
|
* @param item The entity
|
||||||
|
* @return The type
|
||||||
|
*/
|
||||||
public static String getType(Entity item){
|
public static String getType(Entity item){
|
||||||
return (String)item.getData(EntityDataStrings.ITEM_TYPE);
|
return EntityUtils.getEntitySubtype(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isWeapon(Entity item){
|
public static boolean isWeapon(Entity item){
|
||||||
@ -298,10 +315,10 @@ public class ItemUtils {
|
|||||||
}
|
}
|
||||||
rVal.putData(EntityDataStrings.ITEM_ICON,ItemUtils.getItemIcon(item));
|
rVal.putData(EntityDataStrings.ITEM_ICON,ItemUtils.getItemIcon(item));
|
||||||
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS, item.getData(EntityDataStrings.ITEM_EQUIP_CLASS));
|
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS, item.getData(EntityDataStrings.ITEM_EQUIP_CLASS));
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_ITEM, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_ITEM);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, true);
|
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, true);
|
||||||
ItemUtils.setContainingParent(rVal, containingParent);
|
ItemUtils.setContainingParent(rVal, containingParent);
|
||||||
rVal.putData(EntityDataStrings.ITEM_TYPE, item.getData(EntityDataStrings.ITEM_TYPE));
|
EntityUtils.setEntitySubtype(rVal, EntityUtils.getEntitySubtype(item));
|
||||||
Globals.clientSceneWrapper.getScene().registerEntity(rVal);
|
Globals.clientSceneWrapper.getScene().registerEntity(rVal);
|
||||||
return rVal;
|
return rVal;
|
||||||
} else {
|
} else {
|
||||||
@ -323,10 +340,10 @@ public class ItemUtils {
|
|||||||
}
|
}
|
||||||
rVal.putData(EntityDataStrings.ITEM_ICON,ItemUtils.getItemIcon(item));
|
rVal.putData(EntityDataStrings.ITEM_ICON,ItemUtils.getItemIcon(item));
|
||||||
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS, item.getData(EntityDataStrings.ITEM_EQUIP_CLASS));
|
rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS, item.getData(EntityDataStrings.ITEM_EQUIP_CLASS));
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_ITEM, true);
|
EntityUtils.setEntityType(rVal, ENTITY_TYPE_ITEM);
|
||||||
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, true);
|
rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, true);
|
||||||
ItemUtils.setContainingParent(rVal, containingParent);
|
ItemUtils.setContainingParent(rVal, containingParent);
|
||||||
rVal.putData(EntityDataStrings.ITEM_TYPE, item.getData(EntityDataStrings.ITEM_TYPE));
|
EntityUtils.setEntitySubtype(rVal, EntityUtils.getEntitySubtype(item));
|
||||||
return rVal;
|
return rVal;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import electrosphere.entity.types.camera.CameraEntityUtils;
|
|||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
import electrosphere.entity.types.creature.CreatureUtils;
|
||||||
import electrosphere.game.data.creature.type.CreatureType;
|
import electrosphere.game.data.creature.type.CreatureType;
|
||||||
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
||||||
|
import electrosphere.menu.mainmenu.MenuGeneratorsTitleMenu;
|
||||||
import electrosphere.net.NetUtils;
|
import electrosphere.net.NetUtils;
|
||||||
import electrosphere.renderer.RenderingEngine;
|
import electrosphere.renderer.RenderingEngine;
|
||||||
import electrosphere.renderer.actor.Actor;
|
import electrosphere.renderer.actor.Actor;
|
||||||
@ -70,7 +71,7 @@ public class MenuGenerators {
|
|||||||
selectButton.addChild(selectLabel);
|
selectButton.addChild(selectLabel);
|
||||||
rVal.addChild(selectButton);
|
rVal.addChild(selectButton);
|
||||||
selectButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
selectButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||||
if(SaveUtils.worldHasSave(saveName.toLowerCase())){
|
if(SaveUtils.saveHasWorldFile(saveName.toLowerCase())){
|
||||||
//need to log client in
|
//need to log client in
|
||||||
Globals.clientUsername = "username";
|
Globals.clientUsername = "username";
|
||||||
Globals.clientPassword = AuthenticationManager.getHashedString("password");
|
Globals.clientPassword = AuthenticationManager.getHashedString("password");
|
||||||
@ -152,7 +153,7 @@ public class MenuGenerators {
|
|||||||
saveButton.addChild(saveLabel);
|
saveButton.addChild(saveLabel);
|
||||||
rVal.addChild(saveButton);
|
rVal.addChild(saveButton);
|
||||||
saveButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
saveButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||||
SaveUtils.saveWorldDataToSave(Globals.currentSaveName);
|
SaveUtils.saveWorldData(Globals.currentSaveName);
|
||||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
||||||
return false;
|
return false;
|
||||||
}});
|
}});
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import electrosphere.engine.Globals;
|
|||||||
import electrosphere.entity.state.inventory.InventoryUtils;
|
import electrosphere.entity.state.inventory.InventoryUtils;
|
||||||
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||||
|
import electrosphere.menu.ingame.MenuGeneratorsInventory;
|
||||||
|
import electrosphere.menu.mainmenu.MenuGeneratorsTitleMenu;
|
||||||
import electrosphere.renderer.ui.ContainerElement;
|
import electrosphere.renderer.ui.ContainerElement;
|
||||||
import electrosphere.renderer.ui.DrawableElement;
|
import electrosphere.renderer.ui.DrawableElement;
|
||||||
import electrosphere.renderer.ui.Element;
|
import electrosphere.renderer.ui.Element;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.debug;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -71,6 +71,7 @@ public class ImGuiWindowMacros {
|
|||||||
initFramerateGraphSeries("clientNetwork");
|
initFramerateGraphSeries("clientNetwork");
|
||||||
initFramerateGraphSeries("controls");
|
initFramerateGraphSeries("controls");
|
||||||
globalFrametimeWindow.addElement(globalFrametimePlot);
|
globalFrametimeWindow.addElement(globalFrametimePlot);
|
||||||
|
globalFrametimeWindow.setOpen(false);
|
||||||
RenderingEngine.addImGuiWindow(globalFrametimeWindow);
|
RenderingEngine.addImGuiWindow(globalFrametimeWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.ingame;
|
||||||
|
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
|
|
||||||
@ -11,6 +11,8 @@ import electrosphere.entity.EntityUtils;
|
|||||||
import electrosphere.entity.types.creature.CreatureUtils;
|
import electrosphere.entity.types.creature.CreatureUtils;
|
||||||
import electrosphere.game.data.creature.type.CreatureType;
|
import electrosphere.game.data.creature.type.CreatureType;
|
||||||
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
||||||
|
import electrosphere.menu.WindowStrings;
|
||||||
|
import electrosphere.menu.WindowUtils;
|
||||||
import electrosphere.renderer.RenderingEngine;
|
import electrosphere.renderer.RenderingEngine;
|
||||||
import electrosphere.renderer.actor.Actor;
|
import electrosphere.renderer.actor.Actor;
|
||||||
import electrosphere.renderer.actor.ActorStaticMorph;
|
import electrosphere.renderer.actor.ActorStaticMorph;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.ingame;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,6 +14,8 @@ import electrosphere.entity.state.inventory.InventoryUtils;
|
|||||||
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||||
import electrosphere.entity.types.item.ItemUtils;
|
import electrosphere.entity.types.item.ItemUtils;
|
||||||
|
import electrosphere.menu.WindowStrings;
|
||||||
|
import electrosphere.menu.WindowUtils;
|
||||||
import electrosphere.renderer.ui.DraggableElement.DragEventCallback;
|
import electrosphere.renderer.ui.DraggableElement.DragEventCallback;
|
||||||
import electrosphere.renderer.ui.elements.Div;
|
import electrosphere.renderer.ui.elements.Div;
|
||||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.mainmenu;
|
||||||
|
|
||||||
import electrosphere.auth.AuthenticationManager;
|
import electrosphere.auth.AuthenticationManager;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
@ -1,9 +1,11 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.mainmenu;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
|
import electrosphere.menu.WindowStrings;
|
||||||
|
import electrosphere.menu.WindowUtils;
|
||||||
import electrosphere.renderer.debug.DebugRendering;
|
import electrosphere.renderer.debug.DebugRendering;
|
||||||
import electrosphere.renderer.ui.ClickableElement;
|
import electrosphere.renderer.ui.ClickableElement;
|
||||||
import electrosphere.renderer.ui.ContainerElement;
|
import electrosphere.renderer.ui.ContainerElement;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.mainmenu;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -12,6 +12,8 @@ import electrosphere.entity.types.creature.CreatureTemplate;
|
|||||||
import electrosphere.game.data.creature.type.CreatureType;
|
import electrosphere.game.data.creature.type.CreatureType;
|
||||||
import electrosphere.game.data.creature.type.visualattribute.AttributeVariant;
|
import electrosphere.game.data.creature.type.visualattribute.AttributeVariant;
|
||||||
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
import electrosphere.game.data.creature.type.visualattribute.VisualAttribute;
|
||||||
|
import electrosphere.menu.MenuGenerators;
|
||||||
|
import electrosphere.menu.WindowUtils;
|
||||||
import electrosphere.net.parser.net.message.CharacterMessage;
|
import electrosphere.net.parser.net.message.CharacterMessage;
|
||||||
import electrosphere.renderer.RenderingEngine;
|
import electrosphere.renderer.RenderingEngine;
|
||||||
import electrosphere.renderer.actor.Actor;
|
import electrosphere.renderer.actor.Actor;
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package electrosphere.menu;
|
package electrosphere.menu.mainmenu;
|
||||||
|
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.engine.loadingthreads.LoadingThread;
|
import electrosphere.engine.loadingthreads.LoadingThread;
|
||||||
|
import electrosphere.menu.MenuGenerators;
|
||||||
|
import electrosphere.menu.WindowUtils;
|
||||||
import electrosphere.renderer.ui.ClickableElement;
|
import electrosphere.renderer.ui.ClickableElement;
|
||||||
import electrosphere.renderer.ui.Element;
|
import electrosphere.renderer.ui.Element;
|
||||||
import electrosphere.renderer.ui.elements.Button;
|
import electrosphere.renderer.ui.elements.Button;
|
||||||
@ -6,7 +6,7 @@ import electrosphere.engine.Main;
|
|||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.Scene;
|
import electrosphere.entity.Scene;
|
||||||
import electrosphere.entity.types.hitbox.HitboxManager;
|
import electrosphere.entity.types.hitbox.HitboxManager;
|
||||||
import electrosphere.menu.ImGuiWindowMacros;
|
import electrosphere.menu.debug.ImGuiWindowMacros;
|
||||||
import electrosphere.net.parser.net.message.NetworkMessage;
|
import electrosphere.net.parser.net.message.NetworkMessage;
|
||||||
import electrosphere.server.datacell.interfaces.DataCellManager;
|
import electrosphere.server.datacell.interfaces.DataCellManager;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package electrosphere.server.saves;
|
package electrosphere.server.saves;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import electrosphere.entity.Scene;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Top level save object that stores information about the save
|
||||||
* @author satellite
|
|
||||||
*/
|
*/
|
||||||
public class Save {
|
public class Save {
|
||||||
/*
|
/*
|
||||||
@ -11,4 +14,21 @@ public class Save {
|
|||||||
we can put them all in here then serialize this instead
|
we can put them all in here then serialize this instead
|
||||||
or smthn
|
or smthn
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//the version of the game
|
||||||
|
String versionString;
|
||||||
|
|
||||||
|
//the time the save was created
|
||||||
|
String timeCreated;
|
||||||
|
|
||||||
|
//The scenes
|
||||||
|
List<Scene> scenes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
public Save(){
|
||||||
|
versionString = "0.0.1";
|
||||||
|
timeCreated = System.currentTimeMillis() + "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,8 +15,7 @@ import electrosphere.server.terrain.manager.ServerTerrainManager;
|
|||||||
import electrosphere.util.FileUtils;
|
import electrosphere.util.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Utilities for dealing with saves (init, loading, storing, etc)
|
||||||
* @author satellite
|
|
||||||
*/
|
*/
|
||||||
public class SaveUtils {
|
public class SaveUtils {
|
||||||
|
|
||||||
@ -75,12 +74,7 @@ public class SaveUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static boolean overwriteSave(String saveName){
|
|
||||||
boolean rVal = false;
|
|
||||||
return rVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean loadTerrainAndDB(String saveName){
|
public static boolean loadTerrainAndDB(String saveName){
|
||||||
String dirPath = deriveSaveDirectoryPath(saveName);
|
String dirPath = deriveSaveDirectoryPath(saveName);
|
||||||
String dbFilePath = FileUtils.sanitizeFilePath(dirPath) + "/central.db";
|
String dbFilePath = FileUtils.sanitizeFilePath(dirPath) + "/central.db";
|
||||||
@ -89,6 +83,11 @@ public class SaveUtils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a save into the server
|
||||||
|
* @param saveName The name of the save
|
||||||
|
* @return true always
|
||||||
|
*/
|
||||||
public static boolean loadSave(String saveName){
|
public static boolean loadSave(String saveName){
|
||||||
String dirPath = deriveSaveDirectoryPath(saveName);
|
String dirPath = deriveSaveDirectoryPath(saveName);
|
||||||
String dbFilePath = FileUtils.sanitizeFilePath(dirPath) + "/central.db";
|
String dbFilePath = FileUtils.sanitizeFilePath(dirPath) + "/central.db";
|
||||||
@ -101,16 +100,30 @@ public class SaveUtils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the list of all saves by name
|
||||||
|
* @return The list of all saves
|
||||||
|
*/
|
||||||
public static List<String> getSaves(){
|
public static List<String> getSaves(){
|
||||||
return FileUtils.listDirectory("./saves");
|
return FileUtils.listDirectory("./saves");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean worldHasSave(String saveName){
|
/**
|
||||||
|
* Checks if the save has a world file
|
||||||
|
* @param saveName The name of the save
|
||||||
|
* @return true if the world file exists, false otherwise
|
||||||
|
*/
|
||||||
|
public static boolean saveHasWorldFile(String saveName){
|
||||||
String dirPath = deriveSaveDirectoryPath(saveName) + "/world.json";
|
String dirPath = deriveSaveDirectoryPath(saveName) + "/world.json";
|
||||||
LoggerInterface.loggerEngine.DEBUG("Exists? " + dirPath);
|
LoggerInterface.loggerEngine.DEBUG("Exists? " + dirPath);
|
||||||
return FileUtils.checkFileExists(dirPath);
|
return FileUtils.checkFileExists(dirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads terrain and creates world data object
|
||||||
|
* @param currentSaveName The save name
|
||||||
|
* @return true always
|
||||||
|
*/
|
||||||
public static boolean loadTerrainAndCreateWorldData(String currentSaveName){
|
public static boolean loadTerrainAndCreateWorldData(String currentSaveName){
|
||||||
Globals.serverTerrainManager = new ServerTerrainManager(2000,50,0.0f,0,new OverworldChunkGenerator());
|
Globals.serverTerrainManager = new ServerTerrainManager(2000,50,0.0f,0,new OverworldChunkGenerator());
|
||||||
Globals.serverFluidManager = new ServerFluidManager(Globals.serverTerrainManager, 2000, 50, 0.0f, 0, new ArenaFluidGenerator());
|
Globals.serverFluidManager = new ServerFluidManager(Globals.serverTerrainManager, 2000, 50, 0.0f, 0, new ArenaFluidGenerator());
|
||||||
@ -121,7 +134,12 @@ public class SaveUtils {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean saveWorldDataToSave(String saveName){
|
/**
|
||||||
|
* Saves world data file
|
||||||
|
* @param saveName The name of the save
|
||||||
|
* @return true always
|
||||||
|
*/
|
||||||
|
public static boolean saveWorldData(String saveName){
|
||||||
/*
|
/*
|
||||||
Globals.serverWorldData = ServerWorldData.createGameWorld(Globals.serverTerrainManager);
|
Globals.serverWorldData = ServerWorldData.createGameWorld(Globals.serverTerrainManager);
|
||||||
//TODO: Globals.dataCellManager = new DataCellManager(Globals.serverWorldData);
|
//TODO: Globals.dataCellManager = new DataCellManager(Globals.serverWorldData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user