forked from MagicBane/Server
stronghold generation
This commit is contained in:
@@ -3,9 +3,11 @@ package engine.gameManager;
|
|||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.InterestManagement.InterestManager;
|
import engine.InterestManagement.InterestManager;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
|
import engine.math.Vector2f;
|
||||||
import engine.math.Vector3f;
|
import engine.math.Vector3f;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -347,8 +349,35 @@ public class StrongholdManager {
|
|||||||
|
|
||||||
//=====================================NEW STUFF
|
//=====================================NEW STUFF
|
||||||
|
|
||||||
public static void initStrongholdIslands(){
|
public static void generateMaze(){
|
||||||
//Zone island1 = new Zone(501,new Vector3fImmutable(-60032,615,45055),"Stronghold 1");
|
Zone stronghold = ZoneManager.getZoneByUUID(995);
|
||||||
//ZoneManager.addZone(island1.getObjectUUID(),island1);
|
ArrayList<Vector3fImmutable> gridLocs = new ArrayList<>();
|
||||||
|
for(int x = -7; x < 8; x++){
|
||||||
|
for(int z = -7; z < 8; z++) {
|
||||||
|
if((x >= -1 || x <= 1) && (z >= -1 || z <= 1))
|
||||||
|
continue;
|
||||||
|
float offsetX = x * 128;
|
||||||
|
float offsetZ = z * 128;
|
||||||
|
Vector3fImmutable sLoc = stronghold.getLoc();
|
||||||
|
Vector3fImmutable loc = new Vector3fImmutable(offsetX,sLoc.y,offsetZ);
|
||||||
|
gridLocs.add(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(Vector3fImmutable loc : gridLocs){
|
||||||
|
createBuilding(stronghold,405600,loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void createBuilding(Zone zone, int blueprint, Vector3fImmutable offset){
|
||||||
|
|
||||||
|
Vector3fImmutable localLoc = ZoneManager.worldToLocal(offset, zone);
|
||||||
|
|
||||||
|
Building building = DbManager.BuildingQueries.
|
||||||
|
CREATE_BUILDING(
|
||||||
|
zone.getObjectUUID(), 0, "", 1,
|
||||||
|
localLoc, 1.0f, 0, Enum.ProtectionState.PROTECTED, 0, 1,
|
||||||
|
null, blueprint, 0, 0);
|
||||||
|
building.setObjectTypeMask(MBServerStatics.MASK_BUILDING);
|
||||||
|
WorldGrid.addObject(building,zone.getLoc().x + offset.x,zone.getLoc().z + offset.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ public class WorldServer {
|
|||||||
printThreads();
|
printThreads();
|
||||||
Logger.info("Threads Running:");
|
Logger.info("Threads Running:");
|
||||||
|
|
||||||
StrongholdManager.initStrongholdIslands();
|
StrongholdManager.generateMaze();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user