mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Remove debug
This commit is contained in:
parent
c0101695c6
commit
8a3f6c5eca
@ -62,7 +62,6 @@ public final class NBTInputStream implements Closeable {
|
|||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
private Tag readTag(final int depth, int maxDepth) throws IOException {
|
private Tag readTag(final int depth, int maxDepth) throws IOException {
|
||||||
System.out.print("READING TAG!!!");
|
|
||||||
if ((count++) > maxDepth) throw new IOException("Exceeds max depth: " + count);
|
if ((count++) > maxDepth) throw new IOException("Exceeds max depth: " + count);
|
||||||
final int type = this.is.readByte() & 0xFF;
|
final int type = this.is.readByte() & 0xFF;
|
||||||
String name;
|
String name;
|
||||||
@ -91,7 +90,6 @@ public final class NBTInputStream implements Closeable {
|
|||||||
private Tag readTagPayload(final int type, final String name, final int depth, int maxDepth) throws IOException {
|
private Tag readTagPayload(final int type, final String name, final int depth, int maxDepth) throws IOException {
|
||||||
if ((count++) > maxDepth) throw new IOException("Exceeds max depth: " + count);
|
if ((count++) > maxDepth) throw new IOException("Exceeds max depth: " + count);
|
||||||
count++;
|
count++;
|
||||||
System.out.print(count + " | " + type);
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NBTConstants.TYPE_END:
|
case NBTConstants.TYPE_END:
|
||||||
if (depth == 0) {
|
if (depth == 0) {
|
||||||
|
@ -76,8 +76,6 @@ public class BukkitSchematicHandler extends SchematicHandler {
|
|||||||
final int height = (pos2.getY() - pos1.getY()) + 1;
|
final int height = (pos2.getY() - pos1.getY()) + 1;
|
||||||
final int length = (pos2.getZ() - pos1.getZ()) + 1;
|
final int length = (pos2.getZ() - pos1.getZ()) + 1;
|
||||||
|
|
||||||
System.out.print(width + "," + height + "," + length);
|
|
||||||
|
|
||||||
// Main Schematic tag
|
// Main Schematic tag
|
||||||
final HashMap<String, Tag> schematic = new HashMap<>();
|
final HashMap<String, Tag> schematic = new HashMap<>();
|
||||||
|
|
||||||
@ -117,7 +115,6 @@ public class BukkitSchematicHandler extends SchematicHandler {
|
|||||||
|
|
||||||
Chunk bc = worldObj.getChunkAt(chunk.x, chunk.z);
|
Chunk bc = worldObj.getChunkAt(chunk.x, chunk.z);
|
||||||
if (!bc.load(false)) {
|
if (!bc.load(false)) {
|
||||||
System.out.print("FAILED TO LOAD CHUNK: " + chunk.x + "," + chunk.z);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,8 +171,6 @@ public abstract class SchematicHandler {
|
|||||||
Location bottom = plot.getBottom();
|
Location bottom = plot.getBottom();
|
||||||
Location top = plot.getTop();
|
Location top = plot.getTop();
|
||||||
if (top.getX() - bottom.getX() < WIDTH || top.getZ() - bottom.getZ() < LENGTH || HEIGHT > 256) {
|
if (top.getX() - bottom.getX() < WIDTH || top.getZ() - bottom.getZ() < LENGTH || HEIGHT > 256) {
|
||||||
System.out.print((top.getX() - bottom.getX() + 1) + "," + (top.getZ() - bottom.getZ() + 1));
|
|
||||||
System.out.print(WIDTH + "," + HEIGHT + "," + LENGTH);
|
|
||||||
PS.log("Schematic is too large");
|
PS.log("Schematic is too large");
|
||||||
TaskManager.runTask(whenDone);
|
TaskManager.runTask(whenDone);
|
||||||
return;
|
return;
|
||||||
@ -209,13 +207,10 @@ public abstract class SchematicHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.print("chunks: " + chunks.size());
|
|
||||||
|
|
||||||
TaskManager.runTaskAsync(new Runnable() {
|
TaskManager.runTaskAsync(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
System.out.print("RUNNING: " + chunks.size());
|
|
||||||
while (chunks.size() > 0 && count < 256) {
|
while (chunks.size() > 0 && count < 256) {
|
||||||
count++;
|
count++;
|
||||||
ChunkLoc chunk = chunks.remove(0);
|
ChunkLoc chunk = chunks.remove(0);
|
||||||
@ -512,7 +507,6 @@ public abstract class SchematicHandler {
|
|||||||
|
|
||||||
public Schematic getSchematic(InputStream is) {
|
public Schematic getSchematic(InputStream is) {
|
||||||
if (is == null) {
|
if (is == null) {
|
||||||
System.out.print("SCHEM IS NULL!!!!");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -542,12 +536,10 @@ public abstract class SchematicHandler {
|
|||||||
rawJSON.append(line);
|
rawJSON.append(line);
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
System.out.print(rawJSON);
|
|
||||||
JSONArray array = new JSONArray(rawJSON.toString());
|
JSONArray array = new JSONArray(rawJSON.toString());
|
||||||
List<String> schematics = new ArrayList<>();
|
List<String> schematics = new ArrayList<>();
|
||||||
for (int i = 0; i < array.length(); i++) {
|
for (int i = 0; i < array.length(); i++) {
|
||||||
String schematic = array.getString(i);
|
String schematic = array.getString(i);
|
||||||
System.out.print(schematic);
|
|
||||||
schematics.add(schematic);
|
schematics.add(schematic);
|
||||||
}
|
}
|
||||||
return Lists.reverse(schematics);
|
return Lists.reverse(schematics);
|
||||||
@ -604,21 +596,21 @@ public abstract class SchematicHandler {
|
|||||||
nos.close();
|
nos.close();
|
||||||
output.close();
|
output.close();
|
||||||
}
|
}
|
||||||
try (Reader response = new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8)) {
|
// try (Reader response = new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8)) {
|
||||||
final char[] buffer = new char[256];
|
// final char[] buffer = new char[256];
|
||||||
StringBuilder result = new StringBuilder();
|
// StringBuilder result = new StringBuilder();
|
||||||
while (true) {
|
// while (true) {
|
||||||
int r = response.read(buffer);
|
// int r = response.read(buffer);
|
||||||
if (r < 0) {
|
// if (r < 0) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
result.append(buffer, 0, r);
|
// result.append(buffer, 0, r);
|
||||||
}
|
// }
|
||||||
System.out.print(result);
|
// System.out.print(result);
|
||||||
}
|
// }
|
||||||
catch (Exception e) {
|
// catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
int responseCode = ((HttpURLConnection) con).getResponseCode();
|
int responseCode = ((HttpURLConnection) con).getResponseCode();
|
||||||
if (responseCode != 200) {
|
if (responseCode != 200) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user