reduce unused imports
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
eb7df4093a
commit
9719576bda
@ -48,7 +48,7 @@ public class CollisionWorldData {
|
||||
if(clientWorldData != null){
|
||||
return clientWorldData.convertRealToChunkSpace(real);
|
||||
} else {
|
||||
return serverWorldData.convertRealToChunkSpace(real);
|
||||
return ServerWorldData.convertRealToChunkSpace(real);
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public class CollisionWorldData {
|
||||
if(clientWorldData != null){
|
||||
return clientWorldData.convertChunkToRealSpace(world);
|
||||
} else {
|
||||
return serverWorldData.convertChunkToRealSpace(world);
|
||||
return ServerWorldData.convertChunkToRealSpace(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -759,7 +759,7 @@ public class HitboxCollectionState {
|
||||
* @param data The data
|
||||
* @return The type of hitbox
|
||||
*/
|
||||
private static HitboxType getType(HitboxData data){
|
||||
protected static HitboxType getType(HitboxData data){
|
||||
switch(data.getType()){
|
||||
case HitboxData.HITBOX_TYPE_HIT: {
|
||||
return HitboxType.HIT;
|
||||
@ -788,7 +788,7 @@ public class HitboxCollectionState {
|
||||
* @param data The data
|
||||
* @return The shape type
|
||||
*/
|
||||
private static HitboxShapeType getShapeType(HitboxData data){
|
||||
protected static HitboxShapeType getShapeType(HitboxData data){
|
||||
switch(data.getType()){
|
||||
case HitboxData.HITBOX_TYPE_HIT:
|
||||
case HitboxData.HITBOX_TYPE_HURT: {
|
||||
@ -813,7 +813,7 @@ public class HitboxCollectionState {
|
||||
* @param data The data
|
||||
* @return The subtype
|
||||
*/
|
||||
private static HitboxSubtype getSubType(HitboxData data){
|
||||
protected static HitboxSubtype getSubType(HitboxData data){
|
||||
switch(data.getSubType()){
|
||||
case HitboxData.HITBOX_SUBTYPE_SWEET: {
|
||||
return HitboxSubtype.SWEET;
|
||||
|
||||
@ -1127,7 +1127,7 @@ public class ProceduralTree {
|
||||
|
||||
|
||||
//calculates the bone transform matrix
|
||||
Matrix4d boneTransform = new Matrix4d().identity().rotate(boneRotation);
|
||||
// Matrix4d boneTransform = new Matrix4d().identity().rotate(boneRotation);
|
||||
|
||||
//new position transform
|
||||
Matrix4d newPositionTransform = new Matrix4d().rotate(boneRotation).translate(0,type.getBranchHeight(),0);
|
||||
|
||||
@ -3,7 +3,6 @@ package electrosphere.net.synchronization.transport;
|
||||
|
||||
import electrosphere.entity.state.furniture.ServerDoorState;
|
||||
import electrosphere.entity.state.furniture.ClientDoorState;
|
||||
import electrosphere.util.Utilities;
|
||||
import electrosphere.entity.state.item.ServerChargeState;
|
||||
import electrosphere.entity.state.item.ClientChargeState;
|
||||
import electrosphere.entity.state.movement.editor.ServerEditorMovementTree;
|
||||
|
||||
@ -3,19 +3,10 @@ package electrosphere.script;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.StandardWatchEventKinds;
|
||||
import java.nio.file.WatchEvent;
|
||||
import java.nio.file.WatchKey;
|
||||
import java.nio.file.WatchService;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.graalvm.polyglot.Source;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package electrosphere.server.entity;
|
||||
|
||||
import electrosphere.entity.Entity;
|
||||
import electrosphere.entity.types.foliage.FoliageUtils;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.server.datacell.Realm;
|
||||
import electrosphere.server.datacell.ServerDataCell;
|
||||
import electrosphere.server.datacell.ServerWorldData;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -39,11 +39,11 @@ public class EnvironmentGenerator {
|
||||
LoggerInterface.loggerGameLogic.DEBUG("generate forest");
|
||||
for(int i = 0; i < targetNum; i++){
|
||||
Vector3d position = new Vector3d(
|
||||
realm.getServerWorldData().convertWorldToReal(worldPos.x) + rand.nextFloat() * 16,
|
||||
ServerWorldData.convertWorldToReal(worldPos.x) + rand.nextFloat() * 16,
|
||||
0,
|
||||
realm.getServerWorldData().convertWorldToReal(worldPos.z) + rand.nextFloat() * 16
|
||||
ServerWorldData.convertWorldToReal(worldPos.z) + rand.nextFloat() * 16
|
||||
);
|
||||
Entity tree = FoliageUtils.serverSpawnTreeFoliage(realm, position, "oak", rand.nextLong());
|
||||
FoliageUtils.serverSpawnTreeFoliage(realm, position, "oak", rand.nextLong());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import electrosphere.game.data.biome.BiomeData;
|
||||
import electrosphere.game.data.biome.BiomeFoliageDescription;
|
||||
import electrosphere.server.datacell.Realm;
|
||||
import electrosphere.server.datacell.ServerDataCell;
|
||||
import electrosphere.server.datacell.ServerWorldData;
|
||||
import electrosphere.server.macro.MacroData;
|
||||
import electrosphere.server.macro.spatial.MacroAreaObject;
|
||||
import electrosphere.server.physics.terrain.manager.ServerTerrainChunk;
|
||||
@ -69,13 +70,13 @@ public class ServerContentGenerator {
|
||||
for(int z = 0; z < ServerTerrainChunk.CHUNK_DIMENSION; z++){
|
||||
double height = realm.getServerWorldData().getServerTerrainManager().getElevation(worldPos.x, worldPos.z, x, z) + HEIGHT_MANUAL_ADJUSTMENT;
|
||||
if(
|
||||
realm.getServerWorldData().convertVoxelToRealSpace(0, worldPos.y) < height &&
|
||||
realm.getServerWorldData().convertVoxelToRealSpace(ServerTerrainChunk.CHUNK_DIMENSION, worldPos.y) > height
|
||||
ServerWorldData.convertVoxelToRealSpace(0, worldPos.y) < height &&
|
||||
ServerWorldData.convertVoxelToRealSpace(ServerTerrainChunk.CHUNK_DIMENSION, worldPos.y) > height
|
||||
){
|
||||
BiomeFoliageDescription toPlace = null;
|
||||
double foundPriority = -1;
|
||||
double realX = realm.getServerWorldData().convertVoxelToRealSpace(x, worldPos.x);
|
||||
double realZ = realm.getServerWorldData().convertVoxelToRealSpace(z, worldPos.z);
|
||||
double realX = ServerWorldData.convertVoxelToRealSpace(x, worldPos.x);
|
||||
double realZ = ServerWorldData.convertVoxelToRealSpace(z, worldPos.z);
|
||||
|
||||
//check if a macro object is blocking content here
|
||||
boolean macroBlockingContent = false;
|
||||
|
||||
@ -142,8 +142,8 @@ public class JSChunkGenerator implements ChunkGenerator {
|
||||
int finalChunkZ = (z * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION;
|
||||
heightfield[x][z] = heightmapGen.getHeight(
|
||||
this.terrainModel.getSeed(),
|
||||
this.serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX),
|
||||
this.serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ)
|
||||
ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX),
|
||||
ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -227,8 +227,8 @@ public class JSChunkGenerator implements ChunkGenerator {
|
||||
}
|
||||
double rVal = heightmapGen.getHeight(
|
||||
this.terrainModel.getSeed(),
|
||||
this.serverWorldData.convertVoxelToRealSpace(chunkX, worldX),
|
||||
this.serverWorldData.convertVoxelToRealSpace(chunkZ, worldZ)
|
||||
ServerWorldData.convertVoxelToRealSpace(chunkX, worldX),
|
||||
ServerWorldData.convertVoxelToRealSpace(chunkZ, worldZ)
|
||||
);
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
for(int x = 0; x < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; x++){
|
||||
int finalWorldX = worldX + ((x * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
|
||||
int finalChunkX = (x * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION;
|
||||
double realX = generationContext.getServerWorldData().convertVoxelToRealSpace(finalChunkX,finalWorldX);
|
||||
double realX = ServerWorldData.convertVoxelToRealSpace(finalChunkX,finalWorldX);
|
||||
|
||||
for(int z = 0; z < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; z++){
|
||||
BiomeData surfaceBiome = surfaceBiomeMap[x][z];
|
||||
@ -184,7 +184,7 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
|
||||
int finalWorldZ = worldZ + ((z * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
|
||||
int finalChunkZ = (z * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION;
|
||||
double realZ = generationContext.getServerWorldData().convertVoxelToRealSpace(finalChunkZ,finalWorldZ);
|
||||
double realZ = ServerWorldData.convertVoxelToRealSpace(finalChunkZ,finalWorldZ);
|
||||
double surfaceHeight = heightfield[x][z];
|
||||
double gradient = gradientField[x][z];
|
||||
double surfaceSelection = this.calculateSurfaceNoise(surfaceParams, finalWorldX, finalWorldZ, finalChunkX, finalChunkZ, strideValue, this.terrainModel.getSeed());
|
||||
@ -192,7 +192,7 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
for(int y = 0; y < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; y++){
|
||||
int finalWorldY = worldY + ((y * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
|
||||
int finalChunkY = (y * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION;
|
||||
double realY = generationContext.getServerWorldData().convertVoxelToRealSpace(finalChunkY,finalWorldY);
|
||||
double realY = ServerWorldData.convertVoxelToRealSpace(finalChunkY,finalWorldY);
|
||||
|
||||
voxelGenerator.getVoxel(
|
||||
voxel,
|
||||
@ -259,13 +259,13 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
heightfield[x][z] = this.getMultisampleElevation(finalWorldX, finalWorldZ, finalChunkX, finalChunkZ);
|
||||
|
||||
//calculate real pos
|
||||
double realX = serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
|
||||
double realZ = serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
|
||||
double realX = ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
|
||||
double realZ = ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
|
||||
|
||||
//clamped macro pos
|
||||
int macroDataScale = terrainModel.getMacroDataScale();
|
||||
double macroWorldPosX = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
|
||||
double macroWorldPosZ = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
|
||||
double macroWorldPosX = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
|
||||
double macroWorldPosZ = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
|
||||
double macroWidth = this.terrainModel.getMacroWidthInRealTerms();
|
||||
double percent1 = (realX - macroWorldPosX) / macroWidth;
|
||||
double percent2 = (realZ - macroWorldPosZ) / macroWidth;
|
||||
@ -299,8 +299,8 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
* @return
|
||||
*/
|
||||
private double calculateSurfaceNoise(BiomeSurfaceGenerationParams surfaceParams, int worldX, int worldZ, int chunkX, int chunkZ, int strideValue, long seed){
|
||||
double realX = serverWorldData.convertVoxelToRealSpace(chunkX, worldX);
|
||||
double realZ = serverWorldData.convertVoxelToRealSpace(chunkZ, worldZ);
|
||||
double realX = ServerWorldData.convertVoxelToRealSpace(chunkX, worldX);
|
||||
double realZ = ServerWorldData.convertVoxelToRealSpace(chunkZ, worldZ);
|
||||
float noiseScale = surfaceParams.getNoiseScale();
|
||||
float warpScale = surfaceParams.getWarpScale();
|
||||
|
||||
@ -332,13 +332,13 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
HeightmapGenerator heightmapGen = null;
|
||||
|
||||
//calculate real pos
|
||||
double realX = serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
|
||||
double realZ = serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
|
||||
double realX = ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
|
||||
double realZ = ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
|
||||
|
||||
//clamped macro pos
|
||||
int macroDataScale = terrainModel.getMacroDataScale();
|
||||
double macroWorldPosX = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
|
||||
double macroWorldPosZ = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
|
||||
double macroWorldPosX = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
|
||||
double macroWorldPosZ = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
|
||||
double macroWidth = this.terrainModel.getMacroWidthInRealTerms();
|
||||
double percent1 = (realX - macroWorldPosX) / macroWidth;
|
||||
double percent2 = (realZ - macroWorldPosZ) / macroWidth;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package electrosphere.server.simulation;
|
||||
|
||||
import electrosphere.engine.Globals;
|
||||
import electrosphere.server.macro.character.Character;
|
||||
import electrosphere.server.macro.character.CharacterDataStrings;
|
||||
|
||||
@ -46,7 +45,7 @@ public class MacroSimulation {
|
||||
*/
|
||||
static final int MAX_PLACE_ATTEMPTS = 10;
|
||||
|
||||
private static void checkForShelter(Character chara){
|
||||
protected static void checkForShelter(Character chara){
|
||||
// for(Character chara : Globals.macroData.getAliveCharacters()){
|
||||
/*
|
||||
If doesn’t have shelter, check if in town
|
||||
@ -100,7 +99,7 @@ public class MacroSimulation {
|
||||
// }
|
||||
}
|
||||
|
||||
private static void checkTownMembership(Character chara){
|
||||
protected static void checkTownMembership(Character chara){
|
||||
//TODO: eventually exclude people who shouldn't belong to a town (traders, bandits, etc)
|
||||
// for(Character chara : Globals.macroData.getAliveCharacters()){
|
||||
boolean hasHometown = chara.containsKey(CharacterDataStrings.HOMETOWN);
|
||||
|
||||
@ -11,7 +11,6 @@ import org.recast4j.recast.RecastBuilder.RecastBuilderResult;
|
||||
import org.recast4j.recast.geom.SingleTrimeshInputGeomProvider;
|
||||
|
||||
import electrosphere.entity.state.collidable.TriGeomData;
|
||||
import electrosphere.server.pathfinding.recast.NavMeshConstructor;
|
||||
import electrosphere.test.annotations.UnitTest;
|
||||
import electrosphere.util.math.GeomUtils;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user