reduce unused imports
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-04 22:57:44 -04:00
parent eb7df4093a
commit 9719576bda
11 changed files with 34 additions and 45 deletions

View File

@ -48,7 +48,7 @@ public class CollisionWorldData {
if(clientWorldData != null){ if(clientWorldData != null){
return clientWorldData.convertRealToChunkSpace(real); return clientWorldData.convertRealToChunkSpace(real);
} else { } else {
return serverWorldData.convertRealToChunkSpace(real); return ServerWorldData.convertRealToChunkSpace(real);
} }
} }
@ -56,7 +56,7 @@ public class CollisionWorldData {
if(clientWorldData != null){ if(clientWorldData != null){
return clientWorldData.convertChunkToRealSpace(world); return clientWorldData.convertChunkToRealSpace(world);
} else { } else {
return serverWorldData.convertChunkToRealSpace(world); return ServerWorldData.convertChunkToRealSpace(world);
} }
} }

View File

@ -759,7 +759,7 @@ public class HitboxCollectionState {
* @param data The data * @param data The data
* @return The type of hitbox * @return The type of hitbox
*/ */
private static HitboxType getType(HitboxData data){ protected static HitboxType getType(HitboxData data){
switch(data.getType()){ switch(data.getType()){
case HitboxData.HITBOX_TYPE_HIT: { case HitboxData.HITBOX_TYPE_HIT: {
return HitboxType.HIT; return HitboxType.HIT;
@ -788,7 +788,7 @@ public class HitboxCollectionState {
* @param data The data * @param data The data
* @return The shape type * @return The shape type
*/ */
private static HitboxShapeType getShapeType(HitboxData data){ protected static HitboxShapeType getShapeType(HitboxData data){
switch(data.getType()){ switch(data.getType()){
case HitboxData.HITBOX_TYPE_HIT: case HitboxData.HITBOX_TYPE_HIT:
case HitboxData.HITBOX_TYPE_HURT: { case HitboxData.HITBOX_TYPE_HURT: {
@ -813,7 +813,7 @@ public class HitboxCollectionState {
* @param data The data * @param data The data
* @return The subtype * @return The subtype
*/ */
private static HitboxSubtype getSubType(HitboxData data){ protected static HitboxSubtype getSubType(HitboxData data){
switch(data.getSubType()){ switch(data.getSubType()){
case HitboxData.HITBOX_SUBTYPE_SWEET: { case HitboxData.HITBOX_SUBTYPE_SWEET: {
return HitboxSubtype.SWEET; return HitboxSubtype.SWEET;

View File

@ -1127,7 +1127,7 @@ public class ProceduralTree {
//calculates the bone transform matrix //calculates the bone transform matrix
Matrix4d boneTransform = new Matrix4d().identity().rotate(boneRotation); // Matrix4d boneTransform = new Matrix4d().identity().rotate(boneRotation);
//new position transform //new position transform
Matrix4d newPositionTransform = new Matrix4d().rotate(boneRotation).translate(0,type.getBranchHeight(),0); Matrix4d newPositionTransform = new Matrix4d().rotate(boneRotation).translate(0,type.getBranchHeight(),0);

View File

@ -3,7 +3,6 @@ package electrosphere.net.synchronization.transport;
import electrosphere.entity.state.furniture.ServerDoorState; import electrosphere.entity.state.furniture.ServerDoorState;
import electrosphere.entity.state.furniture.ClientDoorState; import electrosphere.entity.state.furniture.ClientDoorState;
import electrosphere.util.Utilities;
import electrosphere.entity.state.item.ServerChargeState; import electrosphere.entity.state.item.ServerChargeState;
import electrosphere.entity.state.item.ClientChargeState; import electrosphere.entity.state.item.ClientChargeState;
import electrosphere.entity.state.movement.editor.ServerEditorMovementTree; import electrosphere.entity.state.movement.editor.ServerEditorMovementTree;

View File

@ -3,19 +3,10 @@ package electrosphere.script;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.FileSystem; import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files; 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.WatchService;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.graalvm.polyglot.Source; import org.graalvm.polyglot.Source;

View File

@ -1,10 +1,10 @@
package electrosphere.server.entity; package electrosphere.server.entity;
import electrosphere.entity.Entity;
import electrosphere.entity.types.foliage.FoliageUtils; import electrosphere.entity.types.foliage.FoliageUtils;
import electrosphere.logger.LoggerInterface; import electrosphere.logger.LoggerInterface;
import electrosphere.server.datacell.Realm; import electrosphere.server.datacell.Realm;
import electrosphere.server.datacell.ServerDataCell; import electrosphere.server.datacell.ServerDataCell;
import electrosphere.server.datacell.ServerWorldData;
import java.util.Random; import java.util.Random;
@ -39,11 +39,11 @@ public class EnvironmentGenerator {
LoggerInterface.loggerGameLogic.DEBUG("generate forest"); LoggerInterface.loggerGameLogic.DEBUG("generate forest");
for(int i = 0; i < targetNum; i++){ for(int i = 0; i < targetNum; i++){
Vector3d position = new Vector3d( Vector3d position = new Vector3d(
realm.getServerWorldData().convertWorldToReal(worldPos.x) + rand.nextFloat() * 16, ServerWorldData.convertWorldToReal(worldPos.x) + rand.nextFloat() * 16,
0, 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());
} }
} }
} }

View File

@ -11,6 +11,7 @@ import electrosphere.game.data.biome.BiomeData;
import electrosphere.game.data.biome.BiomeFoliageDescription; import electrosphere.game.data.biome.BiomeFoliageDescription;
import electrosphere.server.datacell.Realm; import electrosphere.server.datacell.Realm;
import electrosphere.server.datacell.ServerDataCell; import electrosphere.server.datacell.ServerDataCell;
import electrosphere.server.datacell.ServerWorldData;
import electrosphere.server.macro.MacroData; import electrosphere.server.macro.MacroData;
import electrosphere.server.macro.spatial.MacroAreaObject; import electrosphere.server.macro.spatial.MacroAreaObject;
import electrosphere.server.physics.terrain.manager.ServerTerrainChunk; import electrosphere.server.physics.terrain.manager.ServerTerrainChunk;
@ -69,13 +70,13 @@ public class ServerContentGenerator {
for(int z = 0; z < ServerTerrainChunk.CHUNK_DIMENSION; z++){ for(int z = 0; z < ServerTerrainChunk.CHUNK_DIMENSION; z++){
double height = realm.getServerWorldData().getServerTerrainManager().getElevation(worldPos.x, worldPos.z, x, z) + HEIGHT_MANUAL_ADJUSTMENT; double height = realm.getServerWorldData().getServerTerrainManager().getElevation(worldPos.x, worldPos.z, x, z) + HEIGHT_MANUAL_ADJUSTMENT;
if( if(
realm.getServerWorldData().convertVoxelToRealSpace(0, worldPos.y) < height && ServerWorldData.convertVoxelToRealSpace(0, worldPos.y) < height &&
realm.getServerWorldData().convertVoxelToRealSpace(ServerTerrainChunk.CHUNK_DIMENSION, worldPos.y) > height ServerWorldData.convertVoxelToRealSpace(ServerTerrainChunk.CHUNK_DIMENSION, worldPos.y) > height
){ ){
BiomeFoliageDescription toPlace = null; BiomeFoliageDescription toPlace = null;
double foundPriority = -1; double foundPriority = -1;
double realX = realm.getServerWorldData().convertVoxelToRealSpace(x, worldPos.x); double realX = ServerWorldData.convertVoxelToRealSpace(x, worldPos.x);
double realZ = realm.getServerWorldData().convertVoxelToRealSpace(z, worldPos.z); double realZ = ServerWorldData.convertVoxelToRealSpace(z, worldPos.z);
//check if a macro object is blocking content here //check if a macro object is blocking content here
boolean macroBlockingContent = false; boolean macroBlockingContent = false;

View File

@ -142,8 +142,8 @@ public class JSChunkGenerator implements ChunkGenerator {
int finalChunkZ = (z * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION; int finalChunkZ = (z * strideValue) % ServerTerrainChunk.CHUNK_DIMENSION;
heightfield[x][z] = heightmapGen.getHeight( heightfield[x][z] = heightmapGen.getHeight(
this.terrainModel.getSeed(), this.terrainModel.getSeed(),
this.serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX), ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX),
this.serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ) ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ)
); );
} }
} }
@ -227,8 +227,8 @@ public class JSChunkGenerator implements ChunkGenerator {
} }
double rVal = heightmapGen.getHeight( double rVal = heightmapGen.getHeight(
this.terrainModel.getSeed(), this.terrainModel.getSeed(),
this.serverWorldData.convertVoxelToRealSpace(chunkX, worldX), ServerWorldData.convertVoxelToRealSpace(chunkX, worldX),
this.serverWorldData.convertVoxelToRealSpace(chunkZ, worldZ) ServerWorldData.convertVoxelToRealSpace(chunkZ, worldZ)
); );
return rVal; return rVal;
} }

View File

@ -175,7 +175,7 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
for(int x = 0; x < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; x++){ for(int x = 0; x < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; x++){
int finalWorldX = worldX + ((x * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION); int finalWorldX = worldX + ((x * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
int finalChunkX = (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++){ for(int z = 0; z < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; z++){
BiomeData surfaceBiome = surfaceBiomeMap[x][z]; BiomeData surfaceBiome = surfaceBiomeMap[x][z];
@ -184,7 +184,7 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
int finalWorldZ = worldZ + ((z * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION); int finalWorldZ = worldZ + ((z * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
int finalChunkZ = (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 surfaceHeight = heightfield[x][z];
double gradient = gradientField[x][z]; double gradient = gradientField[x][z];
double surfaceSelection = this.calculateSurfaceNoise(surfaceParams, finalWorldX, finalWorldZ, finalChunkX, finalChunkZ, strideValue, this.terrainModel.getSeed()); 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++){ for(int y = 0; y < ServerTerrainChunk.CHUNK_DATA_GENERATOR_SIZE; y++){
int finalWorldY = worldY + ((y * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION); int finalWorldY = worldY + ((y * strideValue) / ServerTerrainChunk.CHUNK_DIMENSION);
int finalChunkY = (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( voxelGenerator.getVoxel(
voxel, voxel,
@ -259,13 +259,13 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
heightfield[x][z] = this.getMultisampleElevation(finalWorldX, finalWorldZ, finalChunkX, finalChunkZ); heightfield[x][z] = this.getMultisampleElevation(finalWorldX, finalWorldZ, finalChunkX, finalChunkZ);
//calculate real pos //calculate real pos
double realX = serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX); double realX = ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
double realZ = serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ); double realZ = ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
//clamped macro pos //clamped macro pos
int macroDataScale = terrainModel.getMacroDataScale(); int macroDataScale = terrainModel.getMacroDataScale();
double macroWorldPosX = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX)); double macroWorldPosX = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
double macroWorldPosZ = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ)); double macroWorldPosZ = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
double macroWidth = this.terrainModel.getMacroWidthInRealTerms(); double macroWidth = this.terrainModel.getMacroWidthInRealTerms();
double percent1 = (realX - macroWorldPosX) / macroWidth; double percent1 = (realX - macroWorldPosX) / macroWidth;
double percent2 = (realZ - macroWorldPosZ) / macroWidth; double percent2 = (realZ - macroWorldPosZ) / macroWidth;
@ -299,8 +299,8 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
* @return * @return
*/ */
private double calculateSurfaceNoise(BiomeSurfaceGenerationParams surfaceParams, int worldX, int worldZ, int chunkX, int chunkZ, int strideValue, long seed){ private double calculateSurfaceNoise(BiomeSurfaceGenerationParams surfaceParams, int worldX, int worldZ, int chunkX, int chunkZ, int strideValue, long seed){
double realX = serverWorldData.convertVoxelToRealSpace(chunkX, worldX); double realX = ServerWorldData.convertVoxelToRealSpace(chunkX, worldX);
double realZ = serverWorldData.convertVoxelToRealSpace(chunkZ, worldZ); double realZ = ServerWorldData.convertVoxelToRealSpace(chunkZ, worldZ);
float noiseScale = surfaceParams.getNoiseScale(); float noiseScale = surfaceParams.getNoiseScale();
float warpScale = surfaceParams.getWarpScale(); float warpScale = surfaceParams.getWarpScale();
@ -332,13 +332,13 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
HeightmapGenerator heightmapGen = null; HeightmapGenerator heightmapGen = null;
//calculate real pos //calculate real pos
double realX = serverWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX); double realX = ServerWorldData.convertVoxelToRealSpace(finalChunkX, finalWorldX);
double realZ = serverWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ); double realZ = ServerWorldData.convertVoxelToRealSpace(finalChunkZ, finalWorldZ);
//clamped macro pos //clamped macro pos
int macroDataScale = terrainModel.getMacroDataScale(); int macroDataScale = terrainModel.getMacroDataScale();
double macroWorldPosX = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX)); double macroWorldPosX = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldX));
double macroWorldPosZ = serverWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ)); double macroWorldPosZ = ServerWorldData.convertWorldToReal(serverWorldData.clampWorldToMacro(finalWorldZ));
double macroWidth = this.terrainModel.getMacroWidthInRealTerms(); double macroWidth = this.terrainModel.getMacroWidthInRealTerms();
double percent1 = (realX - macroWorldPosX) / macroWidth; double percent1 = (realX - macroWorldPosX) / macroWidth;
double percent2 = (realZ - macroWorldPosZ) / macroWidth; double percent2 = (realZ - macroWorldPosZ) / macroWidth;

View File

@ -1,6 +1,5 @@
package electrosphere.server.simulation; package electrosphere.server.simulation;
import electrosphere.engine.Globals;
import electrosphere.server.macro.character.Character; import electrosphere.server.macro.character.Character;
import electrosphere.server.macro.character.CharacterDataStrings; import electrosphere.server.macro.character.CharacterDataStrings;
@ -46,7 +45,7 @@ public class MacroSimulation {
*/ */
static final int MAX_PLACE_ATTEMPTS = 10; 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()){ // for(Character chara : Globals.macroData.getAliveCharacters()){
/* /*
If doesnt have shelter, check if in town If doesnt 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) //TODO: eventually exclude people who shouldn't belong to a town (traders, bandits, etc)
// for(Character chara : Globals.macroData.getAliveCharacters()){ // for(Character chara : Globals.macroData.getAliveCharacters()){
boolean hasHometown = chara.containsKey(CharacterDataStrings.HOMETOWN); boolean hasHometown = chara.containsKey(CharacterDataStrings.HOMETOWN);

View File

@ -11,7 +11,6 @@ import org.recast4j.recast.RecastBuilder.RecastBuilderResult;
import org.recast4j.recast.geom.SingleTrimeshInputGeomProvider; import org.recast4j.recast.geom.SingleTrimeshInputGeomProvider;
import electrosphere.entity.state.collidable.TriGeomData; import electrosphere.entity.state.collidable.TriGeomData;
import electrosphere.server.pathfinding.recast.NavMeshConstructor;
import electrosphere.test.annotations.UnitTest; import electrosphere.test.annotations.UnitTest;
import electrosphere.util.math.GeomUtils; import electrosphere.util.math.GeomUtils;