diff --git a/src/main/java/electrosphere/client/collision/ClientNetworkHitboxCollision.java b/src/main/java/electrosphere/client/collision/ClientNetworkHitboxCollision.java index 57382230..220706d3 100644 --- a/src/main/java/electrosphere/client/collision/ClientNetworkHitboxCollision.java +++ b/src/main/java/electrosphere/client/collision/ClientNetworkHitboxCollision.java @@ -2,7 +2,6 @@ package electrosphere.client.collision; import org.joml.Vector3d; -import electrosphere.client.effects.ParticleEffects; import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.entity.types.creature.CreatureUtils; @@ -100,7 +99,7 @@ public class ClientNetworkHitboxCollision { if(isBlockSound){ //TODO: handle } else if(isDamageSound){ - ParticleEffects.spawnBloodsplats(position); + // ParticleEffects.spawnBloodsplats(position); } } else if(ItemUtils.isWeapon(receiverEntity)){ if(isBlockSound){ diff --git a/src/main/java/electrosphere/client/effects/ParticleEffects.java b/src/main/java/electrosphere/client/effects/ParticleEffects.java deleted file mode 100644 index 4f7d7655..00000000 --- a/src/main/java/electrosphere/client/effects/ParticleEffects.java +++ /dev/null @@ -1,47 +0,0 @@ -package electrosphere.client.effects; - -// import electrosphere.client.entity.particle.ParticleUtils; -// import electrosphere.engine.Globals; -// import electrosphere.entity.ClientEntityUtils; -// import electrosphere.entity.Entity; -// import electrosphere.entity.EntityUtils; -// import electrosphere.game.data.particle.ParticleData; - -// import java.util.Random; - -// import org.joml.Quaterniond; -import org.joml.Vector3d; - -/** - * Utility functions for spawning particle effects - */ -public class ParticleEffects { - - /** - * Spawns bloodsplats based on a collision - * @param position The position of the collision - */ - public static void spawnBloodsplats(Vector3d position){ - // int max = 30; - // int min = 10; - // ParticleData bloodsplatData = null; - // for(ParticleData data : Globals.gameConfigCurrent.getParticleDefinition().getData()){ - // if(data.getName().equals("blood")){ - // bloodsplatData = data; - // } - // } - // Random rand = new Random(); - // int num = (int)(rand.nextFloat() * (max - min)) + min; - // for(int i = 0; i < num; i++){ - // Vector3d destination = new Vector3d(rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f).normalize(); - // Entity particleEntity = ParticleUtils.clientSpawnBillboardParticle(bloodsplatData, destination); - // ClientEntityUtils.initiallyPositionEntity( - // particleEntity, - // position, - // new Quaterniond() - // ); - // EntityUtils.getScale(particleEntity).mul(bloodsplatData.getSize()); - // } - } - -} diff --git a/src/main/java/electrosphere/client/instancing/InstanceUpdater.java b/src/main/java/electrosphere/client/entity/instance/InstanceUpdater.java similarity index 96% rename from src/main/java/electrosphere/client/instancing/InstanceUpdater.java rename to src/main/java/electrosphere/client/entity/instance/InstanceUpdater.java index 29bd6815..196ba50c 100644 --- a/src/main/java/electrosphere/client/instancing/InstanceUpdater.java +++ b/src/main/java/electrosphere/client/entity/instance/InstanceUpdater.java @@ -1,4 +1,4 @@ -package electrosphere.client.instancing; +package electrosphere.client.entity.instance; import java.util.Set; diff --git a/src/main/java/electrosphere/client/leveledit/ClientLevelEditorData.java b/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java similarity index 96% rename from src/main/java/electrosphere/client/leveledit/ClientLevelEditorData.java rename to src/main/java/electrosphere/client/scene/ClientLevelEditorData.java index 84e2b7fe..71f3604c 100644 --- a/src/main/java/electrosphere/client/leveledit/ClientLevelEditorData.java +++ b/src/main/java/electrosphere/client/scene/ClientLevelEditorData.java @@ -1,4 +1,4 @@ -package electrosphere.client.leveledit; +package electrosphere.client.scene; import org.joml.Vector3d; diff --git a/src/main/java/electrosphere/client/sim/ClientSimulation.java b/src/main/java/electrosphere/client/sim/ClientSimulation.java index ba1da62b..118a46d3 100644 --- a/src/main/java/electrosphere/client/sim/ClientSimulation.java +++ b/src/main/java/electrosphere/client/sim/ClientSimulation.java @@ -4,8 +4,8 @@ import org.joml.Vector3d; import electrosphere.client.entity.camera.CameraEntityUtils; import electrosphere.client.entity.crosshair.Crosshair; +import electrosphere.client.entity.instance.InstanceUpdater; import electrosphere.client.fluid.manager.ClientFluidManager; -import electrosphere.client.instancing.InstanceUpdater; import electrosphere.client.interact.ClientInteractionEngine; import electrosphere.client.terrain.manager.ClientTerrainManager; import electrosphere.client.ui.menu.ingame.ToolbarPreviewWindow; diff --git a/src/main/java/electrosphere/engine/Globals.java b/src/main/java/electrosphere/engine/Globals.java index 71aed8a4..22493a78 100644 --- a/src/main/java/electrosphere/engine/Globals.java +++ b/src/main/java/electrosphere/engine/Globals.java @@ -20,8 +20,8 @@ import electrosphere.client.entity.character.ClientCharacterManager; import electrosphere.client.entity.particle.ParticleService; import electrosphere.client.fluid.cells.FluidCellManager; import electrosphere.client.fluid.manager.ClientFluidManager; -import electrosphere.client.leveledit.ClientLevelEditorData; import electrosphere.client.player.ClientPlayerData; +import electrosphere.client.scene.ClientLevelEditorData; import electrosphere.client.scene.ClientSceneWrapper; import electrosphere.client.scene.ClientWorldData; import electrosphere.client.sim.ClientSimulation; diff --git a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/ErosionSimulation.java b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/ErosionSimulation.java index 90b80516..1cbd80b2 100644 --- a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/ErosionSimulation.java +++ b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/ErosionSimulation.java @@ -404,7 +404,7 @@ public class ErosionSimulation { * @param elevationMapToCheck The elevation map to reference * @return True if all neighbors are flat, false otherwise */ - private boolean neighborIsFlat(int sourceX, int sourceY, float[][] elevationMapToCheck){ + protected boolean neighborIsFlat(int sourceX, int sourceY, float[][] elevationMapToCheck){ for(int i = 0; i < 4; i++){ if(sourceX + offsetX[i] >= 0 && sourceX + offsetX[i] < primaryHeightmap.length && sourceY + offsetY[i] >= 0 && sourceY + offsetY[i] < primaryHeightmap[0].length diff --git a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/InterpolationDisplay.java b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/InterpolationDisplay.java index 7e0a9a3f..a447ce08 100644 --- a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/InterpolationDisplay.java +++ b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/InterpolationDisplay.java @@ -39,8 +39,8 @@ class InterpolationDisplay extends JPanel{ } } } else if(parent.displayToggle == 1) { - for (int x = 0; x < parent.continentPhaseDimension * parent.EROSION_INTERPOLATION_RATIO; x++) { - for (int y = 0; y < parent.continentPhaseDimension * parent.EROSION_INTERPOLATION_RATIO; y++) { + for (int x = 0; x < parent.continentPhaseDimension * TerrainGenerator.EROSION_INTERPOLATION_RATIO; x++) { + for (int y = 0; y < parent.continentPhaseDimension * TerrainGenerator.EROSION_INTERPOLATION_RATIO; y++) { if (parent.erosionHeightmap[x][y] > TerrainGenerator.MOUNTAIN_THRESHOLD - 1) { float color = Math.max(0,Math.min(parent.erosionHeightmap[x][y],100)); g.setColor(new Color((int) (color / 100.0 * 254 * (parent.brightness / 100.0)), 1, 1)); diff --git a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TectonicSimulation.java b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TectonicSimulation.java index e9fee2af..c9d6e859 100644 --- a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TectonicSimulation.java +++ b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TectonicSimulation.java @@ -247,7 +247,7 @@ class TectonicSimulation { /** * Moves the terrain around based on the vector field */ - private void applyVectorsToElevation(){ + protected void applyVectorsToElevation(){ //allocate new elevation array for(int x = 0; x < DIMENSION; x++){ for(int y = 0; y < DIMENSION; y++){ diff --git a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TerrainGenerator.java b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TerrainGenerator.java index 985d6a07..75863787 100644 --- a/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TerrainGenerator.java +++ b/src/main/java/electrosphere/server/physics/terrain/generation/continentphase/TerrainGenerator.java @@ -272,7 +272,7 @@ public class TerrainGenerator { for(int x = 0; x < dim_x; x++){ for(int y = 0; y < dim_y; y++){ int num_Water_Particles = water_level[x][y]; - int elevation_Center = elevation[x][y]; + // int elevation_Center = elevation[x][y]; int attractor_Values[] = new int[offset_kernel_size]; for(int j = 0; j < offset_kernel_size; j++) { if(x + kernel_offset_x[j] >= 0 && x + kernel_offset_x[j] < dim_x && y + kernel_offset_y[j] >= 0 && y + kernel_offset_y[j] < dim_y) { @@ -968,7 +968,7 @@ public class TerrainGenerator { int floodfill_Reach_Threshold(int[][] data, int[][] closed_Set, int x, int y, int min_val, int max_val){ int rVal = 0; - int num_hits; + // int num_hits; int offset_X[] = {-1,-1,-1,0,0,0,1,1,1}; int offset_Y[] = {-1,0,1,-1,0,1,-1,0,1}; if(data[x][y] > min_val && data[x][y] < max_val){ @@ -989,7 +989,7 @@ public class TerrainGenerator { int[][] remove_Small_Mountain_Ranged(int[][] data){ int rVal[][] = new int[continentPhaseDimension][continentPhaseDimension]; - boolean removed_Something = false; + // boolean removed_Something = false; // for (int x = 0; x < DIMENSION; x++) { // for (int y = 0; y < DIMENSION; y++) { // rVal[x][y] = data[x][y]; @@ -1247,7 +1247,7 @@ public class TerrainGenerator { if(data[x][y] > TerrainGenerator.OCEAN_THRESHOLD && data[x][y] < 90){ //This is the total height that can be above land //eg if ocean level is 25, and the maximum possible height is 100, the maximum height relative to sea level would be 75 - int maxHeightAboveLand = MAX_HEIGHT - OCEAN_THRESHOLD; + // int maxHeightAboveLand = MAX_HEIGHT - OCEAN_THRESHOLD; //This is the current height above sea level int currentHeightAboveLand = data[x][y] - OCEAN_THRESHOLD; //This is the percentage of the total height above sea level that the current height is @@ -1278,8 +1278,8 @@ public class TerrainGenerator { /* Looks at 3x3 kernel */ - int kernel_offset_x[] = {-1,0,1,-1,0,1,-1,0,1}; - int kernel_offset_y[] = {1,1,1,0,0,0,-1,-1,-1}; + // int kernel_offset_x[] = {-1,0,1,-1,0,1,-1,0,1}; + // int kernel_offset_y[] = {1,1,1,0,0,0,-1,-1,-1}; int rVal[][] = new int[100][100]; return rVal; }