forked from MagicBane/Server
Project cleanup pre merge.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
@@ -18,62 +17,62 @@ import java.lang.reflect.Field;
|
||||
|
||||
public class RegionCmd extends AbstractDevCmd {
|
||||
|
||||
public RegionCmd() {
|
||||
public RegionCmd() {
|
||||
super("region");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _doCmd(PlayerCharacter pc, String[] words,
|
||||
AbstractGameObject target) {
|
||||
@Override
|
||||
protected void _doCmd(PlayerCharacter pc, String[] words,
|
||||
AbstractGameObject target) {
|
||||
|
||||
|
||||
if (pc.region == null) {
|
||||
this.throwbackInfo(pc, "No Region Found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String newLine = System.getProperty("line.separator");
|
||||
String result = "";
|
||||
result += (pc.region.getClass().getSimpleName());
|
||||
result += (" {");
|
||||
result+=(newLine);
|
||||
Field[] fields = pc.region.getClass().getDeclaredFields();
|
||||
|
||||
//print field names paired with their values
|
||||
for ( Field field : fields ) {
|
||||
field.setAccessible(true);
|
||||
result+=(" ");
|
||||
try {
|
||||
|
||||
if(field.getName().contains("Furniture"))
|
||||
continue;
|
||||
result+=( field.getName());
|
||||
result+=(": ");
|
||||
//requires access to private field:
|
||||
result += (field.get(pc.region).toString());
|
||||
} catch ( IllegalAccessException ex ) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
result.trim();
|
||||
result+=(newLine);
|
||||
}
|
||||
result+=("}");
|
||||
|
||||
this.throwbackInfo(pc, result.toString());
|
||||
this.throwbackInfo(pc, "No Region Found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String newLine = System.getProperty("line.separator");
|
||||
String result = "";
|
||||
result += (pc.region.getClass().getSimpleName());
|
||||
result += (" {");
|
||||
result += (newLine);
|
||||
Field[] fields = pc.region.getClass().getDeclaredFields();
|
||||
|
||||
@Override
|
||||
protected String _getHelpString() {
|
||||
return "Temporarily Changes SubRace";
|
||||
}
|
||||
//print field names paired with their values
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
result += (" ");
|
||||
try {
|
||||
|
||||
@Override
|
||||
protected String _getUsageString() {
|
||||
return "' /setBuildingCollidables add/remove 'add creates a collision line.' needs 4 integers. startX, endX, startY, endY";
|
||||
if (field.getName().contains("Furniture"))
|
||||
continue;
|
||||
result += (field.getName());
|
||||
result += (": ");
|
||||
//requires access to private field:
|
||||
result += (field.get(pc.region).toString());
|
||||
} catch (IllegalAccessException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
result.trim();
|
||||
result += (newLine);
|
||||
}
|
||||
result += ("}");
|
||||
|
||||
}
|
||||
this.throwbackInfo(pc, result.toString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getHelpString() {
|
||||
return "Temporarily Changes SubRace";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String _getUsageString() {
|
||||
return "' /setBuildingCollidables add/remove 'add creates a collision line.' needs 4 integers. startX, endX, startY, endY";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user