diff --git a/README.md b/README.md index 379039f..9909873 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ When you open a Minecraft world, this mod opens an HTTP Server on localhost:9000 The current endpoints of the interface are ``` -GET,PUT,OPTIONS /blocks Modify blocks in the world +GET,PUT /blocks Modify blocks in the world POST /command Run Minecraft commands GET /chunks Get raw chunk nbt data GET /buildarea Get the build area defined by the /setbuildarea chat command diff --git a/src/main/java/com/gdmc/httpinterfacemod/handlers/BlocksHandler.java b/src/main/java/com/gdmc/httpinterfacemod/handlers/BlocksHandler.java index b8f3434..b2670e1 100644 --- a/src/main/java/com/gdmc/httpinterfacemod/handlers/BlocksHandler.java +++ b/src/main/java/com/gdmc/httpinterfacemod/handlers/BlocksHandler.java @@ -206,12 +206,8 @@ public void internalHandle(HttpExchange httpExchange) throws IOException { } else { responseString = responseStringBuilder.deleteCharAt(responseStringBuilder.length() - 1).toString(); } - - } else if (method.equals("options")) { - responseString = new Gson().toJson(new BlockInfoForOptionsRequest()); - } else { - throw new HandlerBase.HttpException("Method not allowed. Only PUT, GET and OPTIONS requests are supported.", 405); + throw new HandlerBase.HttpException("Method not allowed. Only PUT and GET requests are supported.", 405); } //headers @@ -322,18 +318,6 @@ public static String getBlockRegistryName(Block block) { return ForgeRegistries.BLOCKS.getKey(block).toString(); } - public class BlockInfoForOptionsRequest { - private String version; - private String[] methods = {"GET", "PUT", "OPTIONS"}; - private ArrayList dimensions = new ArrayList<>(); - public BlockInfoForOptionsRequest() { - this.version = mcServer.getServerVersion(); - for (ResourceKey levelResourceKey : mcServer.levelKeys()) { - this.dimensions.add(levelResourceKey.location().getPath()); - } - } - } - // function that converts a bunch of Property/Comparable pairs into strings that look like 'property=value' private static final Function, Comparable>, String> propertyToStringFunction = new Function<>() {