Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+68 -68
View File
@@ -22,90 +22,90 @@ import java.util.HashSet;
public class FindBuildingsCmd extends AbstractDevCmd {
public FindBuildingsCmd() {
public FindBuildingsCmd() {
super("findBuildings");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
try {
Vector3fImmutable searchPt = pc.getLoc();
float range = 50.0f;
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
try {
Vector3fImmutable searchPt = pc.getLoc();
float range = 50.0f;
// Arg Count Check
// Valid arg count is 0,1,2,3
if (words.length == 0) {
// Use Player's loc and default range
// Arg Count Check
// Valid arg count is 0,1,2,3
if (words.length == 0) {
// Use Player's loc and default range
} else if (words.length == 1) {
// Use Player's loc and specified range
range = Float.valueOf(words[0]);
} else if (words.length == 1) {
// Use Player's loc and specified range
range = Float.valueOf(words[0]);
} else if (words.length == 2) {
// Use specified loc and default range
searchPt = new Vector3fImmutable(Float.valueOf(words[0]),
searchPt.y,
Float.valueOf(words[1]));
} else if (words.length == 2) {
// Use specified loc and default range
searchPt = new Vector3fImmutable(Float.valueOf(words[0]),
searchPt.y,
Float.valueOf(words[1]));
} else if (words.length == 3) {
// Use specified loc and specified range
searchPt = new Vector3fImmutable(Float.valueOf(words[0]),
searchPt.y,
Float.valueOf(words[1]));
range = Float.valueOf(words[2]);
} else if (words.length == 3) {
// Use specified loc and specified range
searchPt = new Vector3fImmutable(Float.valueOf(words[0]),
searchPt.y,
Float.valueOf(words[1]));
range = Float.valueOf(words[2]);
} else {
this.sendUsage(pc);
return;
}
} else {
this.sendUsage(pc);
return;
}
String s = "";
String s = "";
HashSet<AbstractWorldObject> container = WorldGrid.getObjectsInRangePartial(
searchPt, range, MBServerStatics.MASK_BUILDING);
HashSet<AbstractWorldObject> container = WorldGrid.getObjectsInRangePartial(
searchPt, range, MBServerStatics.MASK_BUILDING);
s += "Found " + container.size();
s += " buildings within " + range;
s += " units of [" + searchPt.toString() + ']';
throwbackInfo(pc, s);
s += "Found " + container.size();
s += " buildings within " + range;
s += " units of [" + searchPt.toString() + ']';
throwbackInfo(pc, s);
int index = 0;
for (AbstractWorldObject awo : container) {
Building b = (Building) awo;
int index = 0;
for (AbstractWorldObject awo : container) {
Building b = (Building) awo;
s = index + ")";
s += " ObjectID: " + awo.getObjectUUID() + ']';
s += " -> Name: " + b.getSimpleName();
if (b.getBlueprint() == null) {
s += " No Blueprint";
} else {
s += " Blueprint UUID: " + b.getBlueprint().getMeshForRank(0);
}
s += "[" + ((Building) awo).getBlueprintUUID() + ']';
s = index + ")";
s += " ObjectID: " + awo.getObjectUUID() + ']';
s += " -> Name: " + b.getSimpleName();
if (b.getBlueprint() == null) {
s += " No Blueprint";
} else {
s += " Blueprint UUID: " + b.getBlueprint().getMeshForRank(0);
}
s += "[" + ((Building) awo).getBlueprintUUID() + ']';
throwbackInfo(pc, s);
++index;
}
throwbackInfo(pc, s);
++index;
}
} catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: '" + words
+ "' failed to parse to a Float.");
} catch (Exception e) {
this.throwbackError(pc,
"An unknown exception occurred while attempting to findBuildings with data: '"
+ words + '\'');
}
}
} catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: '" + words
+ "' failed to parse to a Float.");
} catch (Exception e) {
this.throwbackError(pc,
"An unknown exception occurred while attempting to findBuildings with data: '"
+ words + '\'');
}
}
@Override
protected String _getHelpString() {
return "Sets your character's Mana to 'amount'";
}
@Override
protected String _getHelpString() {
return "Sets your character's Mana to 'amount'";
}
@Override
protected String _getUsageString() {
return "' /findBuildings [lat long] [range]'";
}
@Override
protected String _getUsageString() {
return "' /findBuildings [lat long] [range]'";
}
}