├── .travis.yml ├── docs ├── package-list ├── script.js ├── allclasses-noframe.html ├── allclasses-frame.html ├── org │ └── shanerx │ │ └── mojang │ │ ├── package-frame.html │ │ ├── Untested.html │ │ ├── package-tree.html │ │ ├── package-summary.html │ │ ├── PlayerProfile.html │ │ ├── PlayerProfile.Property.html │ │ ├── SalesStats.html │ │ ├── Mojang.ServiceStatus.html │ │ └── Mojang.SkinType.html ├── index.html ├── deprecated-list.html ├── constant-values.html ├── index-files │ ├── index-4.html │ ├── index-1.html │ ├── index-6.html │ ├── index-7.html │ ├── index-9.html │ ├── index-8.html │ ├── index-5.html │ ├── index-3.html │ ├── index-10.html │ └── index-2.html ├── overview-tree.html └── help-doc.html ├── .gitignore ├── src └── main │ └── java │ └── org │ └── shanerx │ └── mojang │ ├── Untested.java │ ├── SalesStats.java │ ├── PlayerProfile.java │ └── Mojang.java ├── pom.xml ├── README.md └── LICENSE /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | -------------------------------------------------------------------------------- /docs/package-list: -------------------------------------------------------------------------------- 1 | org.shanerx.mojang 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled binaries 2 | /target/ 3 | *.class 4 | /bin/ 5 | 6 | # Package files 7 | *.jar 8 | *.war 9 | *.ear 10 | *.zip 11 | *.tar.gz 12 | *.rar 13 | 14 | # Redundant Gradle files 15 | /.gradle/ 16 | /build/ 17 | 18 | # IntelliJ IDEA project files 19 | /.idea/ 20 | *.iml 21 | 22 | # Eclipse project files 23 | /.settings/ 24 | .classpath 25 | .project 26 | 27 | # Redundant Maven files 28 | dependency-reduced-pom.xml 29 | 30 | # Temporary and log files 31 | **/temp.** 32 | *.log -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/shanerx/mojang/Untested.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 SparklingComet @ http://shanerx.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.shanerx.mojang; 18 | 19 | import java.lang.annotation.Documented; 20 | 21 | /** 22 | * This annotation is applied to methods that were not tested enough to be considered stable. 23 | * If you encounter any issues using them, please make sure to report them. 24 | */ 25 | @Documented 26 | public @interface Untested { 27 | } 28 | -------------------------------------------------------------------------------- /docs/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 | 12 |

All Classes

13 |
14 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 | 12 |

All Classes

13 |
14 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.shanerx.mojang 7 | 8 | 9 | 10 | 11 | 12 |

org.shanerx.mojang

13 |
14 |

Classes

15 | 21 |

Enums

22 | 28 |

Annotation Types

29 | 32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.shanerx 8 | java-mojang-api 9 | 1.0-SNAPSHOT 10 | http://wiki.vg/Mojang_API 11 | Java Mojang API 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | install 19 | 20 | 21 | org.apache.maven.plugins 22 | maven-compiler-plugin 23 | 3.0 24 | 25 | 1.8 26 | 1.8 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 3.0.0 34 | 35 | 36 | 37 | 38 | 39 | 40 | central 41 | Maven Repository Switchboard 42 | https://repo1.maven.org/maven2/ 43 | 44 | 45 | 46 | 47 | 48 | com.mashape.unirest 49 | unirest-java 50 | 1.4.9 51 | 52 | 53 | 54 | com.googlecode.json-simple 55 | json-simple 56 | 1.1.1 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/main/java/org/shanerx/mojang/SalesStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 SparklingComet @ http://shanerx.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.shanerx.mojang; 18 | 19 | /** 20 | * This class is used for retrieving information from the Mojang store. 21 | */ 22 | @SuppressWarnings("unused") 23 | public class SalesStats { 24 | 25 | private int total; 26 | private int last24hrs; 27 | private int salesPerSec; 28 | 29 | protected SalesStats(int total, int last24hrs, int salesPerSec) { 30 | this.total = total; 31 | this.last24hrs = last24hrs; 32 | this.salesPerSec = salesPerSec; 33 | } 34 | 35 | /** 36 | * Gets the total amount of sales over time. 37 | * 38 | * @return all the sales made 39 | */ 40 | public int getTotal() { 41 | return total; 42 | } 43 | 44 | /** 45 | * Gets the sales made within the last 24 hours. 46 | * 47 | * @return the sales made today 48 | */ 49 | public int getLast24hrs() { 50 | return last24hrs; 51 | } 52 | 53 | /** 54 | * Gets the sale rate, aka the average amount of sales in a second. 55 | * 56 | * @return the mean sale rate 57 | */ 58 | public int getSaleVelocityPerSeconds() { 59 | return salesPerSec; 60 | } 61 | 62 | /** 63 | * This enum represents the possible options for the shop-API query. 64 | */ 65 | public enum Options { 66 | ITEM_SOLD_MINECRAFT, 67 | PREPAID_CARD_REDEEMED_MINECRAFT, 68 | ITEM_SOLD_COBALT, 69 | ITEM_SOLD_SCROLLS; 70 | 71 | /** 72 | * Returns the string version of this enum, to be used when querying the API. 73 | * 74 | * @return the string 75 | */ 76 | @Override 77 | public String toString() { 78 | return name().toLowerCase(); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java Mojang API 2 | This repository provides a full Java-wrapper for the Mojang Web-API. 3 |
4 | More information on the API may be found on the [Wiki page](http://wiki.vg/Mojang_API). 5 | 6 | ## Getting Started 7 | * Clone the repository and compile it with Maven and add it to your build path. 8 | ``` 9 | $ git clone https://github.com/SparklingComet/java-mojang-api.git 10 | $ mvn clean install 11 | ``` 12 | 13 | * Alternatively, you can use Maven to include the dependency in your project: 14 | ```xml 15 | 16 | 17 | 18 | 19 | 20 | jitpack.io 21 | https://jitpack.io 22 | 23 | 24 | 25 | 26 | 27 | 28 | com.github.SparklingComet 29 | java-mojang-api 30 | -SNAPSHOT 31 | 32 | 33 | 34 | ``` 35 | 36 | * You can also use Gradle as a dependency manager: 37 | ```gradle 38 | allprojects { 39 | repositories { 40 | ... 41 | maven { url 'https://jitpack.io' } 42 | } 43 | } 44 | 45 | dependencies { 46 | compile 'com.github.SparklingComet:java-mojang-api:-SNAPSHOT' 47 | } 48 | ``` 49 | 50 | * More information on using dependency managers with this repository may be found [on Jitpack](https://jitpack.io/#SparklingComet/java-mojang-api). 51 | * Precompiled binaries will be made available on our CI server soon. 52 | 53 | ## Usage 54 | Once you have imported the library, use the following to establish a connection with Mojang's servers. 55 | ```java 56 | Mojang api = new Mojang().connect(); 57 | ``` 58 | 59 | ## Documentation 60 | * Generated HTML-Javadoc files are available for download in HTML-format in the `docs/` directory. 61 | * You may also use the live version ([click](https://sparklingcomet.github.io/java-mojang-api/index.html)) 62 | 63 | 64 | ## License 65 | The project is licensed under the Apache License v2.0 ([view](https://github.com/SparklingComet/java-mojang-api/blob/master/LICENSE)). 66 | 67 | To license your own project with it, add the file its root and prefix your source files with 68 | ```java 69 | /* 70 | * Copyright 2016-2017 SparklingComet @ http://shanerx.org 71 | * 72 | * Licensed under the Apache License, Version 2.0 (the "License"); 73 | * you may not use this file except in compliance with the License. 74 | * You may obtain a copy of the License at 75 | * 76 | * http://www.apache.org/licenses/LICENSE-2.0 77 | * 78 | * Unless required by applicable law or agreed to in writing, software 79 | * distributed under the License is distributed on an "AS IS" BASIS, 80 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 81 | * See the License for the specific language governing permissions and 82 | * limitations under the License. 83 | */ 84 | ``` 85 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 60 | 61 | 62 | 63 | 64 | 65 | <noscript> 66 | <div>JavaScript is disabled on your browser.</div> 67 | </noscript> 68 | <h2>Frame Alert</h2> 69 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/shanerx/mojang/package-summary.html">Non-frame version</a>.</p> 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /docs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 |
Skip navigation links
30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

Deprecated API

72 |

Contents

73 |
74 | 75 |
76 | 77 | 78 |
Skip navigation links
79 | 80 | 81 | 82 | 90 |
91 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /src/main/java/org/shanerx/mojang/PlayerProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 SparklingComet @ http://shanerx.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.shanerx.mojang; 18 | 19 | import java.net.URL; 20 | import java.util.Map; 21 | import java.util.Optional; 22 | import java.util.Set; 23 | 24 | /** 25 | * This class contains the fields that represent the metadata of a player account and the methods to interact with it. 26 | */ 27 | public class PlayerProfile { 28 | 29 | private String uuid; 30 | private String username; 31 | private Set properties; 32 | private Optional textures; 33 | 34 | /** 35 | * Represents a property. 36 | */ 37 | public static class Property { 38 | String name; 39 | String value; 40 | String signature; 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | public String getValue() { 47 | return value; 48 | } 49 | 50 | public String getSignature() { 51 | return signature; 52 | } 53 | } 54 | 55 | public static class TexturesProperty extends Property { 56 | long timestamp; 57 | String profileId, profileName; 58 | boolean signatureRequired = false; 59 | Map textures; 60 | 61 | public long getTimestamp() { 62 | return timestamp; 63 | } 64 | 65 | public String getProfileId() { 66 | return profileId; 67 | } 68 | 69 | public String getProfileName() { 70 | return profileName; 71 | } 72 | 73 | public boolean isSignatureRequired() { 74 | return signatureRequired; 75 | } 76 | 77 | public Map getTextures() { 78 | return textures; 79 | } 80 | 81 | public Optional getSkin() { 82 | return Optional.ofNullable(textures.get("SKIN")); 83 | } 84 | 85 | public Optional getCape() { 86 | return Optional.ofNullable(textures.get("CAPE")); 87 | } 88 | } 89 | 90 | /** 91 | *

Constructor for the class. 92 | *

You may use {@code new Mojang().connect().getPlayerProfile(uuid)} to retrieve the instance as it will verify the validity of the parameters. 93 | * 94 | * @param uuid the UUID of the player this object should represent 95 | * @param username the username of said player (you may use {@code new Mojang().connect().getNameHistoryOfPlayer(uuid)} to retrieve it). 96 | * @param properties the properties for that player. Depends on what you wish to do with the object 97 | */ 98 | public PlayerProfile(String uuid, String username, Set properties) { 99 | this.uuid = uuid; 100 | this.username = username; 101 | this.properties = properties; 102 | this.textures = properties.stream().filter(p -> p.getName().equals("textures")).map(p -> (TexturesProperty) p).findAny(); 103 | } 104 | 105 | /** 106 | * Gets the UUID of the player. 107 | * 108 | * @return the uuid as a {@link java.lang.String String} 109 | */ 110 | public String getUUID() { 111 | return uuid; 112 | } 113 | 114 | /** 115 | * Gets the username of the player. 116 | * 117 | * @return the username as a {@link java.lang.String String} 118 | */ 119 | public String getUsername() { 120 | return username; 121 | } 122 | 123 | /** 124 | *

Returns the properties this object has. 125 | *

This method exists for transparency, as the properties set is used internally. 126 | * 127 | * @return the properties {@link java.util.Set Set} 128 | */ 129 | public Set getProperties() { 130 | return properties; 131 | } 132 | 133 | public Optional getTextures() { 134 | return textures; 135 | } 136 | } -------------------------------------------------------------------------------- /docs/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 12 | 22 |

JavaScript is disabled on your browser.
24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

Constant Field Values

72 |

Contents

73 |
74 | 75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 90 |
91 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /docs/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | O-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

O

74 |
75 |
org.shanerx.mojang - package org.shanerx.mojang
76 |
 
77 |
78 | C G M O P R S T U V 
79 | 80 |
81 | 82 | 83 | 84 | 85 | 86 | 87 | 95 |
96 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | C-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

C

74 |
75 |
connect() - Method in class org.shanerx.mojang.Mojang
76 |
77 |
Opens the connection with the Mojang API.
78 |
79 |
80 | C G M O P R S T U V 
81 | 82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 |
98 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | R-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

R

74 |
75 |
resetSkin(String, String) - Method in class org.shanerx.mojang.Mojang
76 |
77 |
Resets the skin to the default.
78 |
79 |
80 | C G M O P R S T U V 
81 | 82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 |
98 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /docs/index-files/index-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | S-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

S

74 |
75 |
SalesStats - Class in org.shanerx.mojang
76 |
 
77 |
SalesStats.Options - Enum in org.shanerx.mojang
78 |
79 |
This enum represents the possible options for the shop-API query.
80 |
81 |
82 | C G M O P R S T U V 
83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | 99 |
100 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/Untested.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Untested 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 82 | 83 | 84 |
85 |
org.shanerx.mojang
86 |

Annotation Type Untested

87 |
88 |
89 |
90 |
    91 |
  • 92 |
    93 |
    94 |
    @Documented
     95 | public @interface Untested
    96 |
  • 97 |
98 |
99 |
100 | 101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 117 |
118 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /docs/index-files/index-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

U

74 |
75 |
Untested - Annotation Type in org.shanerx.mojang
76 |
 
77 |
updateAndUpload(String, String, Mojang.SkinType, String) - Method in class org.shanerx.mojang.Mojang
78 |
79 |
Updates the skin of a player using a URI.
80 |
81 |
updateSkin(String, String, Mojang.SkinType, String) - Method in class org.shanerx.mojang.Mojang
82 |
83 |
Updates the skin of a player using a URI.
84 |
85 |
86 | C G M O P R S T U V 
87 | 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 103 |
104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /docs/index-files/index-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | T-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

T

74 |
75 |
toString() - Method in enum org.shanerx.mojang.Mojang.ServiceType
76 |
77 |
This method overrides java.lang.Object.toString() and returns the address of the mojang api portion a certain enum constant represents.
78 |
79 |
toString() - Method in enum org.shanerx.mojang.Mojang.SkinType
80 |
81 |
Returns the query parameter version for these skin types in order to send HTTP requests to the API.
82 |
83 |
toString() - Method in enum org.shanerx.mojang.SalesStats.Options
84 |
85 |
Returns the string version of this enum, to be used when querying the API.
86 |
87 |
88 | C G M O P R S T U V 
89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/index-files/index-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | P-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

P

74 |
75 |
PlayerProfile - Class in org.shanerx.mojang
76 |
 
77 |
PlayerProfile(String, String, Set<PlayerProfile.Property>) - Constructor for class org.shanerx.mojang.PlayerProfile
78 |
79 |
Constructor for the class.
80 |
81 |
PlayerProfile.Property - Class in org.shanerx.mojang
82 |
83 |
Represents a property.
84 |
85 |
Property() - Constructor for class org.shanerx.mojang.PlayerProfile.Property
86 |
 
87 |
88 | C G M O P R S T U V 
89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /docs/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

Hierarchy For All Packages

72 | Package Hierarchies: 73 | 76 |
77 |
78 |

Class Hierarchy

79 | 89 |

Annotation Type Hierarchy

90 |
    91 |
  • org.shanerx.mojang.Untested (implements java.lang.annotation.Annotation)
  • 92 |
93 |

Enum Hierarchy

94 | 108 |
109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 125 |
126 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /docs/index-files/index-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | M-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

M

74 |
75 |
Mojang - Class in org.shanerx.mojang
76 |
 
77 |
Mojang() - Constructor for class org.shanerx.mojang.Mojang
78 |
79 |
Constructor.
80 |
81 |
Mojang.ServiceStatus - Enum in org.shanerx.mojang
82 |
83 |
This enum represents the possible Mojang API servers availability statuses.
84 |
85 |
Mojang.ServiceType - Enum in org.shanerx.mojang
86 |
87 |
This enum represents the various portions of the Mojang API.
88 |
89 |
Mojang.SkinType - Enum in org.shanerx.mojang
90 |
91 |
This enum represents the skin types "Alex" and "Steve".
92 |
93 |
94 | C G M O P R S T U V 
95 | 96 |
97 | 98 | 99 | 100 | 101 | 102 | 103 | 111 |
112 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.shanerx.mojang Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

Hierarchy For Package org.shanerx.mojang

72 |
73 |
74 |

Class Hierarchy

75 | 85 |

Annotation Type Hierarchy

86 |
    87 |
  • org.shanerx.mojang.Untested (implements java.lang.annotation.Annotation)
  • 88 |
89 |

Enum Hierarchy

90 | 104 |
105 | 106 |
107 | 108 | 109 | 110 | 111 | 112 | 113 | 121 |
122 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.shanerx.mojang 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

Package org.shanerx.mojang

72 |
73 |
74 |
    75 |
  • 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 101 | 102 |
    Class Summary 
    ClassDescription
    Mojang 
    PlayerProfile 
    PlayerProfile.Property 94 |
    Represents a property.
    95 |
    SalesStats 
    103 |
  • 104 |
  • 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 117 | 118 | 119 | 120 | 123 | 124 | 125 | 126 | 129 | 130 | 131 | 132 | 135 | 136 | 137 |
    Enum Summary 
    EnumDescription
    Mojang.ServiceStatus 115 |
    This enum represents the possible Mojang API servers availability statuses.
    116 |
    Mojang.ServiceType 121 |
    This enum represents the various portions of the Mojang API.
    122 |
    Mojang.SkinType 127 |
    This enum represents the skin types "Alex" and "Steve".
    128 |
    SalesStats.Options 133 |
    This enum represents the possible options for the shop-API query.
    134 |
    138 |
  • 139 |
  • 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 |
    Annotation Types Summary 
    Annotation TypeDescription
    Untested 
    153 |
  • 154 |
155 |
156 | 157 |
158 | 159 | 160 | 161 | 162 | 163 | 164 | 172 |
173 | 200 | 201 | 202 | 203 | -------------------------------------------------------------------------------- /docs/index-files/index-10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | V-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

V

74 |
75 |
valueOf(String) - Static method in enum org.shanerx.mojang.Mojang.ServiceStatus
76 |
77 |
Returns the enum constant of this type with the specified name.
78 |
79 |
valueOf(String) - Static method in enum org.shanerx.mojang.Mojang.ServiceType
80 |
81 |
Returns the enum constant of this type with the specified name.
82 |
83 |
valueOf(String) - Static method in enum org.shanerx.mojang.Mojang.SkinType
84 |
85 |
Returns the enum constant of this type with the specified name.
86 |
87 |
valueOf(String) - Static method in enum org.shanerx.mojang.SalesStats.Options
88 |
89 |
Returns the enum constant of this type with the specified name.
90 |
91 |
values() - Static method in enum org.shanerx.mojang.Mojang.ServiceStatus
92 |
93 |
Returns an array containing the constants of this enum type, in 94 | the order they are declared.
95 |
96 |
values() - Static method in enum org.shanerx.mojang.Mojang.ServiceType
97 |
98 |
Returns an array containing the constants of this enum type, in 99 | the order they are declared.
100 |
101 |
values() - Static method in enum org.shanerx.mojang.Mojang.SkinType
102 |
103 |
Returns an array containing the constants of this enum type, in 104 | the order they are declared.
105 |
106 |
values() - Static method in enum org.shanerx.mojang.SalesStats.Options
107 |
108 |
Returns an array containing the constants of this enum type, in 109 | the order they are declared.
110 |
111 |
112 | C G M O P R S T U V 
113 | 114 |
115 | 116 | 117 | 118 | 119 | 120 | 121 | 129 |
130 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Help 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
71 |

How This API Document Is Organized

72 |
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
73 |
74 |
75 |
    76 |
  • 77 |

    Package

    78 |

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    79 |
      80 |
    • Interfaces (italic)
    • 81 |
    • Classes
    • 82 |
    • Enums
    • 83 |
    • Exceptions
    • 84 |
    • Errors
    • 85 |
    • Annotation Types
    • 86 |
    87 |
  • 88 |
  • 89 |

    Class/Interface

    90 |

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    91 |
      92 |
    • Class inheritance diagram
    • 93 |
    • Direct Subclasses
    • 94 |
    • All Known Subinterfaces
    • 95 |
    • All Known Implementing Classes
    • 96 |
    • Class/interface declaration
    • 97 |
    • Class/interface description
    • 98 |
    99 |
      100 |
    • Nested Class Summary
    • 101 |
    • Field Summary
    • 102 |
    • Constructor Summary
    • 103 |
    • Method Summary
    • 104 |
    105 |
      106 |
    • Field Detail
    • 107 |
    • Constructor Detail
    • 108 |
    • Method Detail
    • 109 |
    110 |

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    111 |
  • 112 |
  • 113 |

    Annotation Type

    114 |

    Each annotation type has its own separate page with the following sections:

    115 |
      116 |
    • Annotation Type declaration
    • 117 |
    • Annotation Type description
    • 118 |
    • Required Element Summary
    • 119 |
    • Optional Element Summary
    • 120 |
    • Element Detail
    • 121 |
    122 |
  • 123 |
  • 124 |

    Enum

    125 |

    Each enum has its own separate page with the following sections:

    126 |
      127 |
    • Enum declaration
    • 128 |
    • Enum description
    • 129 |
    • Enum Constant Summary
    • 130 |
    • Enum Constant Detail
    • 131 |
    132 |
  • 133 |
  • 134 |

    Tree (Class Hierarchy)

    135 |

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    136 |
      137 |
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • 138 |
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • 139 |
    140 |
  • 141 |
  • 142 |

    Deprecated API

    143 |

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    144 |
  • 145 |
  • 146 |

    Index

    147 |

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    148 |
  • 149 |
  • 150 |

    Prev/Next

    151 |

    These links take you to the next or previous class, interface, package, or related page.

    152 |
  • 153 |
  • 154 |

    Frames/No Frames

    155 |

    These links show and hide the HTML frames. All pages are available with or without frames.

    156 |
  • 157 |
  • 158 |

    All Classes

    159 |

    The All Classes link shows all classes and interfaces except non-static nested types.

    160 |
  • 161 |
  • 162 |

    Serialized Form

    163 |

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    164 |
  • 165 |
  • 166 |

    Constant Field Values

    167 |

    The Constant Field Values page lists the static final fields and their values.

    168 |
  • 169 |
170 | This help file applies to API documentation generated using the standard doclet.
171 | 172 |
173 | 174 | 175 | 176 | 177 | 178 | 179 | 187 |
188 | 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /docs/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | G-Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 69 | 70 |
C G M O P R S T U V  71 | 72 | 73 |

G

74 |
75 |
getLast24hrs() - Method in class org.shanerx.mojang.SalesStats
76 |
77 |
Gets the sales made within the last 24 hours.
78 |
79 |
getName() - Method in class org.shanerx.mojang.PlayerProfile.Property
80 |
 
81 |
getNameHistoryOfPlayer(String) - Method in class org.shanerx.mojang.Mojang
82 |
83 |
Retrieves all the username a certain UUID has had in the past, including the current one.
84 |
85 |
getPlayerProfile(String) - Method in class org.shanerx.mojang.Mojang
86 |
87 |
Returns the PlayerProfile object which holds and represents the metadata for a certain account.
88 |
89 |
getSaleStatistics(SalesStats.Options...) - Method in class org.shanerx.mojang.Mojang
90 |
91 |
Returns the official mojang's product sales statistics.
92 |
93 |
getSaleVelocityPerSeconds() - Method in class org.shanerx.mojang.SalesStats
94 |
95 |
Gets the sale rate, aka the average amount of sales in a second.
96 |
97 |
getServerBlacklist() - Method in class org.shanerx.mojang.Mojang
98 |
99 |
Returns a list of blacklisted hostnames, belonging to servers that were blocked due to Mojang's EULA infringement.
100 |
101 |
getSignature() - Method in class org.shanerx.mojang.PlayerProfile.Property
102 |
 
103 |
getStatus(Mojang.ServiceType) - Method in class org.shanerx.mojang.Mojang
104 |
105 |
Retrieves the status of a portion of the API.
106 |
107 |
getTotal() - Method in class org.shanerx.mojang.SalesStats
108 |
109 |
Gets the total amount of sales over time.
110 |
111 |
getUUIDOfUsername(String) - Method in class org.shanerx.mojang.Mojang
112 |
113 |
Retrieves the current UUID linked to a username.
114 |
115 |
getUUIDOfUsername(String, String) - Method in class org.shanerx.mojang.Mojang
116 |
117 |
Retrieves the UUID linked to a username at a certain moment in time.
118 |
119 |
getValue() - Method in class org.shanerx.mojang.PlayerProfile.Property
120 |
 
121 |
122 | C G M O P R S T U V 
123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 | 131 | 139 |
140 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/PlayerProfile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PlayerProfile 7 | 8 | 9 | 10 | 11 | 12 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 |
42 | 84 | 85 | 86 |
87 |
org.shanerx.mojang
88 |

Class PlayerProfile

89 |
90 |
91 |
    92 |
  • java.lang.Object
  • 93 |
  • 94 |
      95 |
    • org.shanerx.mojang.PlayerProfile
    • 96 |
    97 |
  • 98 |
99 |
100 |
    101 |
  • 102 |
    103 |
    104 |
    public class PlayerProfile
    105 | extends java.lang.Object
    106 |
  • 107 |
108 |
109 |
110 |
    111 |
  • 112 | 113 |
      114 |
    • 115 | 116 | 117 |

      Nested Class Summary

      118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 129 | 130 |
      Nested Classes 
      Modifier and TypeClass and Description
      static class PlayerProfile.Property 127 |
      Represents a property.
      128 |
      131 |
    • 132 |
    133 | 134 |
      135 |
    • 136 | 137 | 138 |

      Constructor Summary

      139 | 140 | 141 | 142 | 143 | 144 | 145 | 150 | 151 |
      Constructors 
      Constructor and Description
      PlayerProfile(java.lang.String uuid, 146 | java.lang.String username, 147 | java.util.Set<PlayerProfile.Property> properties) 148 |
      Constructor for the class.
      149 |
      152 |
    • 153 |
    154 | 155 |
      156 |
    • 157 | 158 | 159 |

      Method Summary

      160 |
        161 |
      • 162 | 163 | 164 |

        Methods inherited from class java.lang.Object

        165 | equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 166 |
      167 |
    • 168 |
    169 |
  • 170 |
171 |
172 |
173 |
    174 |
  • 175 | 176 |
      177 |
    • 178 | 179 | 180 |

      Constructor Detail

      181 | 182 | 183 | 184 |
        185 |
      • 186 |

        PlayerProfile

        187 |
        public PlayerProfile(java.lang.String uuid,
        188 |                      java.lang.String username,
        189 |                      java.util.Set<PlayerProfile.Property> properties)
        190 |

        Constructor for the class. 191 |

        You may use new Mojang().connect().getPlayerProfile(uuid) to retrieve the instance as it will verify the validity of the parameters.

        192 |
        193 |
        Parameters:
        194 |
        uuid - the UUID of the player this object should represent
        195 |
        username - the username of said player (you may use new Mojang().connect().getNameHistoryOfPlayer(uuid) to retrieve it).
        196 |
        properties - the properties for that player. Depends on what you wish to do with the object
        197 |
        198 |
      • 199 |
      200 |
    • 201 |
    202 |
  • 203 |
204 |
205 |
206 | 207 | 208 |
209 | 210 | 211 | 212 | 213 | 214 | 215 | 223 |
224 | 266 | 267 | 268 | 269 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/PlayerProfile.Property.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PlayerProfile.Property 7 | 8 | 9 | 10 | 11 | 12 | 28 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 |
48 | 90 | 91 | 92 |
93 |
org.shanerx.mojang
94 |

Class PlayerProfile.Property

95 |
96 |
97 |
    98 |
  • java.lang.Object
  • 99 |
  • 100 |
      101 |
    • org.shanerx.mojang.PlayerProfile.Property
    • 102 |
    103 |
  • 104 |
105 |
106 |
    107 |
  • 108 |
    109 |
    Enclosing class:
    110 |
    PlayerProfile
    111 |
    112 |
    113 |
    114 |
    public static class PlayerProfile.Property
    115 | extends java.lang.Object
    116 |
    Represents a property.
    117 |
  • 118 |
119 |
120 |
121 |
    122 |
  • 123 | 124 |
      125 |
    • 126 | 127 | 128 |

      Constructor Summary

      129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 |
      Constructors 
      Constructor and Description
      Property() 
      138 |
    • 139 |
    140 | 141 |
      142 |
    • 143 | 144 | 145 |

      Method Summary

      146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 |
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetName() 
      java.lang.StringgetSignature() 
      java.lang.StringgetValue() 
      165 |
        166 |
      • 167 | 168 | 169 |

        Methods inherited from class java.lang.Object

        170 | equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 171 |
      172 |
    • 173 |
    174 |
  • 175 |
176 |
177 |
178 |
    179 |
  • 180 | 181 |
      182 |
    • 183 | 184 | 185 |

      Constructor Detail

      186 | 187 | 188 | 189 |
        190 |
      • 191 |

        Property

        192 |
        public Property()
        193 |
      • 194 |
      195 |
    • 196 |
    197 | 198 |
      199 |
    • 200 | 201 | 202 |

      Method Detail

      203 | 204 | 205 | 206 |
        207 |
      • 208 |

        getName

        209 |
        public java.lang.String getName()
        210 |
      • 211 |
      212 | 213 | 214 | 215 |
        216 |
      • 217 |

        getValue

        218 |
        public java.lang.String getValue()
        219 |
      • 220 |
      221 | 222 | 223 | 224 |
        225 |
      • 226 |

        getSignature

        227 |
        public java.lang.String getSignature()
        228 |
      • 229 |
      230 |
    • 231 |
    232 |
  • 233 |
234 |
235 |
236 | 237 | 238 |
239 | 240 | 241 | 242 | 243 | 244 | 245 | 253 |
254 | 296 | 297 | 298 | 299 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/SalesStats.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SalesStats 7 | 8 | 9 | 10 | 11 | 12 | 28 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 |
48 | 90 | 91 | 92 |
93 |
org.shanerx.mojang
94 |

Class SalesStats

95 |
96 |
97 |
    98 |
  • java.lang.Object
  • 99 |
  • 100 |
      101 |
    • org.shanerx.mojang.SalesStats
    • 102 |
    103 |
  • 104 |
105 |
106 |
    107 |
  • 108 |
    109 |
    110 |
    public class SalesStats
    111 | extends java.lang.Object
    112 |
  • 113 |
114 |
115 |
116 |
    117 |
  • 118 | 119 |
      120 |
    • 121 | 122 | 123 |

      Nested Class Summary

      124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 135 | 136 |
      Nested Classes 
      Modifier and TypeClass and Description
      static class SalesStats.Options 133 |
      This enum represents the possible options for the shop-API query.
      134 |
      137 |
    • 138 |
    139 | 140 |
      141 |
    • 142 | 143 | 144 |

      Method Summary

      145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 156 | 157 | 158 | 159 | 162 | 163 | 164 | 165 | 168 | 169 |
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetLast24hrs() 154 |
      Gets the sales made within the last 24 hours.
      155 |
      intgetSaleVelocityPerSeconds() 160 |
      Gets the sale rate, aka the average amount of sales in a second.
      161 |
      intgetTotal() 166 |
      Gets the total amount of sales over time.
      167 |
      170 |
        171 |
      • 172 | 173 | 174 |

        Methods inherited from class java.lang.Object

        175 | equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 176 |
      177 |
    • 178 |
    179 |
  • 180 |
181 |
182 |
183 |
    184 |
  • 185 | 186 |
      187 |
    • 188 | 189 | 190 |

      Method Detail

      191 | 192 | 193 | 194 |
        195 |
      • 196 |

        getTotal

        197 |
        public int getTotal()
        198 |
        Gets the total amount of sales over time.
        199 |
        200 |
        Returns:
        201 |
        all the sales made
        202 |
        203 |
      • 204 |
      205 | 206 | 207 | 208 |
        209 |
      • 210 |

        getLast24hrs

        211 |
        public int getLast24hrs()
        212 |
        Gets the sales made within the last 24 hours.
        213 |
        214 |
        Returns:
        215 |
        the sales made today
        216 |
        217 |
      • 218 |
      219 | 220 | 221 | 222 |
        223 |
      • 224 |

        getSaleVelocityPerSeconds

        225 |
        public int getSaleVelocityPerSeconds()
        226 |
        Gets the sale rate, aka the average amount of sales in a second.
        227 |
        228 |
        Returns:
        229 |
        the mean sale rate
        230 |
        231 |
      • 232 |
      233 |
    • 234 |
    235 |
  • 236 |
237 |
238 |
239 | 240 | 241 |
242 | 243 | 244 | 245 | 246 | 247 | 248 | 256 |
257 | 299 | 300 | 301 | 302 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/main/java/org/shanerx/mojang/Mojang.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 SparklingComet @ http://shanerx.org 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.shanerx.mojang; 18 | 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | import java.util.Arrays; 22 | import java.util.Collections; 23 | import java.util.HashMap; 24 | import java.util.List; 25 | import java.util.Map; 26 | import java.util.Map.Entry; 27 | import java.util.Set; 28 | import java.util.stream.Collectors; 29 | import java.util.stream.Stream; 30 | 31 | import org.apache.commons.codec.binary.Base64; 32 | import org.json.simple.JSONArray; 33 | import org.json.simple.JSONObject; 34 | import org.json.simple.parser.JSONParser; 35 | import org.json.simple.parser.ParseException; 36 | 37 | import com.mashape.unirest.http.Unirest; 38 | import com.mashape.unirest.http.exceptions.UnirestException; 39 | 40 | /** 41 | *

This class represents the connection with the Mojang API. 42 | *

All instances of other classes of this wrapper API should be retrieved through this class. 43 | *

Remember to call api.connect() after creating an instance of this class. 44 | */ 45 | @SuppressWarnings({ "unchecked" }) 46 | public class Mojang 47 | { 48 | 49 | /** 50 | * Constructor. Initializes member variables. 51 | */ 52 | public Mojang() {} 53 | 54 | /** 55 | *

Opens the connection with the Mojang API. 56 | * Should always be called after creating the API object. 57 | * 58 | *

Example: 59 | * Mojang api = new Mojang().connect(); 60 | * 61 | * @return the api itself. Useful for concatenation. 62 | */ 63 | public Mojang connect() 64 | { 65 | return this; 66 | } 67 | 68 | /** 69 | * @deprecated This service was closed down by Mojang on October 8th 2021 due to incorrect status responses. 70 | * https://wiki.vg/Mojang_API#API_Status_-_Outdated 71 | * 72 | * https://bugs.mojang.com/browse/WEB-2303?focusedCommentId=1086543&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1086543 73 | */ 74 | public ServiceStatus getStatus(ServiceType service) 75 | { 76 | return ServiceStatus.UNKNOWN; 77 | } 78 | 79 | /** 80 | * Retrieves the current UUID linked to a username. 81 | * 82 | * @param username the username 83 | * 84 | * @return the UUID as a {@link java.lang.String String} 85 | */ 86 | public String getUUIDOfUsername(String username) 87 | { 88 | return (String) getJSONObject("https://api.mojang.com/users/profiles/minecraft/" + username).get("id"); 89 | } 90 | 91 | /** 92 | * Retrieves the UUID linked to a username at a certain moment in time. 93 | * 94 | * @param username the username 95 | * @param timestamp the Java Timestamp that represents the time 96 | * 97 | * @return the UUID as a {@link java.lang.String String} 98 | */ 99 | public String getUUIDOfUsername(String username, String timestamp) 100 | { 101 | return (String) getJSONObject("https://api.mojang.com/users/profiles/minecraft/" + username + "?at=" + timestamp).get("id"); 102 | } 103 | 104 | /** 105 | * Retrieves all the username a certain UUID has had in the past, including the current one. 106 | * 107 | * @param uuid the UUID 108 | * 109 | * @return a map with the username as key value and the Timestamp as a {@link java.lang.Long Long} 110 | */ 111 | public Map getNameHistoryOfPlayer(String uuid) 112 | { 113 | JSONArray arr = getJSONArray("https://api.mojang.com/user/profiles/" + uuid + "/names"); 114 | Map history = new HashMap<>(); 115 | arr.forEach(o -> 116 | { 117 | JSONObject obj = (JSONObject) o; 118 | history.put((String) obj.get("name"), obj.get("changedToAt") == null ? 0 : Long.parseLong(obj.get("changedToAt").toString())); 119 | }); 120 | return history; 121 | } 122 | 123 | /** 124 | * Returns the {@link org.shanerx.mojang.PlayerProfile PlayerProfile} object which holds and represents the metadata for a certain account. 125 | * 126 | * @param uuid the UUID of the player 127 | * 128 | * @return the {@link org.shanerx.mojang.PlayerProfile PlayerProfile} object} 129 | */ 130 | public PlayerProfile getPlayerProfile(String uuid) { 131 | JSONObject obj = getJSONObject("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid); 132 | String name = (String) obj.get("name"); 133 | Set properties = (Set) ((JSONArray) obj.get("properties")).stream().map(o -> { 134 | PlayerProfile.Property p; 135 | JSONObject prop = (JSONObject) o; 136 | 137 | String propName = (String) prop.get("name"); 138 | String propValue = (String) prop.get("value"); 139 | if (propName.equals("textures")) { 140 | JSONObject tex; 141 | try { 142 | tex = (JSONObject) new JSONParser().parse(new String(Base64.decodeBase64(propValue))); 143 | } catch (ParseException e2) { 144 | /* Don't blame me, I just follow the pattern from #getJSONObject */ 145 | throw new RuntimeException(e2); 146 | } 147 | PlayerProfile.TexturesProperty q = new PlayerProfile.TexturesProperty(); 148 | q.timestamp = (Long) tex.get("timestamp"); 149 | q.profileId = (String) tex.get("profileId"); 150 | q.profileName = (String) tex.get("profileName"); 151 | q.signatureRequired = Boolean.parseBoolean((String) tex.get("signatureRequired")); 152 | q.textures = ((Stream>) ((JSONObject) tex.get("textures")).entrySet().stream()).collect(Collectors.toMap( 153 | e -> (String) e.getKey(), 154 | e -> { 155 | try { 156 | return new URL((String) ((JSONObject) e.getValue()).get("url")); 157 | } catch (MalformedURLException e1) { 158 | /* I want lambdas with exceptions in Java, *please* */ 159 | throw new RuntimeException("Wrapper for checked exception for lambda", e1); 160 | } 161 | })); 162 | p = q; 163 | } else 164 | p = new PlayerProfile.Property(); 165 | p.name = propName; 166 | p.signature = (String) prop.get("signature"); 167 | p.value = propValue; 168 | return p; 169 | }).collect(Collectors.toSet()); 170 | return new PlayerProfile(uuid, name, properties); 171 | } 172 | 173 | /** 174 | * Updates the skin of a player using a URI. 175 | * This means that the image file will not be uploaded to Mojang's servers, hence the API will need to query the given URI. 176 | * 177 | * @param uuid the UUID of said player 178 | * @param token the token used for API authentication 179 | * @param skinType the {@link org.shanerx.mojang.Mojang.SkinType type} of the skin 180 | * @param skinUrl a direct URL to the skin 181 | */ 182 | public void updateSkin(String uuid, String token, SkinType skinType, String skinUrl) 183 | { 184 | try 185 | { 186 | Unirest.post("https://api.mojang.com/user/profile/" + uuid + "/skin").header("Authorization", "Bearer " + token).field("model", skinType.toString()).field("url", skinUrl).asString(); 187 | } 188 | catch (UnirestException e) 189 | { 190 | e.printStackTrace(); 191 | } 192 | } 193 | 194 | /** 195 | * Updates the skin of a player using a URI. 196 | * The raw skin data will be uploaded to Mojang's servers and stored there potentially forever. 197 | * 198 | * @param uuid the UUID of said player 199 | * @param token the token used for API authentication 200 | * @param skinType the {@link org.shanerx.mojang.Mojang.SkinType type} of the skin 201 | * @param file the raw image data 202 | */ 203 | @Untested 204 | public void updateAndUpload(String uuid, String token, SkinType skinType, String file) 205 | { 206 | try 207 | { 208 | Unirest.put("https://api.mojang.com/user/profile/" + uuid + "/skin").header("Authorization", "Bearer " + token).field("model", skinType.toString().equals("") ? "alex" : skinType.toString()).field("file", file).asString(); 209 | } 210 | catch (UnirestException e) 211 | { 212 | e.printStackTrace(); 213 | } 214 | } 215 | 216 | /** 217 | * Resets the skin to the default. 218 | * 219 | * @param uuid the UUID of the player 220 | * @param token the token used for API authentication 221 | */ 222 | public void resetSkin(String uuid, String token) 223 | { 224 | try 225 | { 226 | Unirest.delete("https://api.mojang.com/user/profile/" + uuid + "/skin").header("Authorization", "Bearer " + token).asString(); 227 | } 228 | catch (UnirestException e) 229 | { 230 | e.printStackTrace(); 231 | } 232 | } 233 | 234 | /** 235 | *

Returns a list of blacklisted hostnames, belonging to servers that were blocked due to Mojang's EULA infringement. 236 | *

N.B.: These may not be in human friendly form as they were hashed. You may want to use third-party services to obtain an (unofficial) list. 237 | * 238 | * @return a {@link java.util.List List} of all the blocked hostnames 239 | */ 240 | public List getServerBlacklist() 241 | { 242 | try 243 | { 244 | return Arrays.asList(Unirest.get("https://sessionserver.mojang.com/blockedservers").asString().getBody().split("\n")); 245 | } 246 | catch (UnirestException e) 247 | { 248 | e.printStackTrace(); 249 | return null; 250 | } 251 | } 252 | 253 | /** 254 | * Returns the official mojang's product sales statistics. 255 | * 256 | * @param options the query {@link org.shanerx.mojang.SalesStats.Options options} 257 | * 258 | * @return the stats 259 | */ 260 | @Untested 261 | public SalesStats getSaleStatistics(SalesStats.Options... options) 262 | { 263 | JSONArray arr = new JSONArray(); 264 | Collections.addAll(arr, options); 265 | 266 | SalesStats stats = null; 267 | try 268 | { 269 | JSONObject resp = (JSONObject) new JSONParser().parse(Unirest.post("https://api.mojang.com/orders/statistics").field("metricKeys", arr).asString().getBody()); 270 | stats = new SalesStats(Integer.valueOf((String) resp.get("total")), Integer.valueOf((String) resp.get("last24h")), Integer.valueOf((String) resp.get("saleVelocityPerSeconds"))); 271 | } 272 | catch (Exception e) 273 | { 274 | e.printStackTrace(); 275 | } 276 | return stats; 277 | } 278 | 279 | /** 280 | * This enum represents the possible Mojang API servers availability statuses. 281 | */ 282 | public enum ServiceStatus 283 | { 284 | 285 | RED, 286 | YELLOW, 287 | GREEN, 288 | UNKNOWN 289 | } 290 | 291 | /** 292 | * This enum represents the various portions of the Mojang API. 293 | */ 294 | public enum ServiceType 295 | { 296 | 297 | MINECRAFT_NET, 298 | SESSION_MINECRAFT_NET, 299 | ACCOUNT_MOJANG_COM, 300 | AUTHSERVER_MOJANG_COM, 301 | SESSIONSERVER_MOJANG_COM, 302 | API_MOJANG_COM, 303 | TEXTURES_MINECRAFT_NET, 304 | MOJANG_COM; 305 | 306 | /** 307 | *

This method overrides {@code java.lang.Object.toString()} and returns the address of the mojang api portion a certain enum constant represents. 308 | *

Example: 309 | * {@code org.shanerx.mojang.Mojang.ServiceType.MINECRAFT_NET.toString()} will return {@literal minecraft.net} 310 | * 311 | * @return the string 312 | */ 313 | @Override 314 | public String toString() 315 | { 316 | return name().toLowerCase().replace("_", "."); 317 | } 318 | } 319 | 320 | /** 321 | * This enum represents the skin types "Alex" and "Steve". 322 | */ 323 | public enum SkinType 324 | { 325 | /** 326 | * Steve 327 | */ 328 | DEFAULT, 329 | /** 330 | * Alex 331 | */ 332 | SLIM; 333 | 334 | /** 335 | * Returns the query parameter version for these skin types in order to send HTTP requests to the API. 336 | * 337 | * @return the string 338 | */ 339 | @Override 340 | public String toString() 341 | { 342 | return this == DEFAULT ? "" : "slim"; 343 | } 344 | } 345 | 346 | private static JSONObject getJSONObject(String url) 347 | { 348 | JSONObject obj; 349 | 350 | try 351 | { 352 | obj = (JSONObject) new JSONParser().parse(Unirest.get(url).asString().getBody()); 353 | String err = (String) (obj.get("error")); 354 | if (err != null) 355 | { 356 | switch (err) 357 | { 358 | case "IllegalArgumentException": 359 | throw new IllegalArgumentException((String) obj.get("errorMessage")); 360 | default: 361 | throw new RuntimeException(err); 362 | } 363 | } 364 | } 365 | catch (ParseException | UnirestException e) 366 | { 367 | throw new RuntimeException(e); 368 | } 369 | 370 | return obj; 371 | } 372 | 373 | private static JSONArray getJSONArray(String url) 374 | { 375 | JSONArray arr; 376 | 377 | try 378 | { 379 | arr = (JSONArray) new JSONParser().parse(Unirest.get(url).asString().getBody()); 380 | 381 | } 382 | catch (ParseException | UnirestException e) 383 | { 384 | throw new RuntimeException(e); 385 | } 386 | 387 | return arr; 388 | } 389 | } 390 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/Mojang.ServiceStatus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mojang.ServiceStatus 7 | 8 | 9 | 10 | 11 | 12 | 28 |

JavaScript is disabled on your browser.
30 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 |
48 | 90 | 91 | 92 |
93 |
org.shanerx.mojang
94 |

Enum Mojang.ServiceStatus

95 |
96 |
97 |
    98 |
  • java.lang.Object
  • 99 |
  • 100 |
      101 |
    • java.lang.Enum<Mojang.ServiceStatus>
    • 102 |
    • 103 |
        104 |
      • org.shanerx.mojang.Mojang.ServiceStatus
      • 105 |
      106 |
    • 107 |
    108 |
  • 109 |
110 |
111 |
    112 |
  • 113 |
    114 |
    All Implemented Interfaces:
    115 |
    java.io.Serializable, java.lang.Comparable<Mojang.ServiceStatus>
    116 |
    117 |
    118 |
    Enclosing class:
    119 |
    Mojang
    120 |
    121 |
    122 |
    123 |
    public static enum Mojang.ServiceStatus
    124 | extends java.lang.Enum<Mojang.ServiceStatus>
    125 |
    This enum represents the possible Mojang API servers availability statuses.
    126 |
  • 127 |
128 |
129 |
130 |
    131 |
  • 132 | 133 |
      134 |
    • 135 | 136 | 137 |

      Enum Constant Summary

      138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 |
      Enum Constants 
      Enum Constant and Description
      GREEN 
      RED 
      UNKNOWN 
      YELLOW 
      156 |
    • 157 |
    158 | 159 |
      160 |
    • 161 | 162 | 163 |

      Method Summary

      164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 175 | 176 | 177 | 178 | 182 | 183 |
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Mojang.ServiceStatusvalueOf(java.lang.String name) 173 |
      Returns the enum constant of this type with the specified name.
      174 |
      static Mojang.ServiceStatus[]values() 179 |
      Returns an array containing the constants of this enum type, in 180 | the order they are declared.
      181 |
      184 |
        185 |
      • 186 | 187 | 188 |

        Methods inherited from class java.lang.Enum

        189 | compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • 190 |
      191 |
        192 |
      • 193 | 194 | 195 |

        Methods inherited from class java.lang.Object

        196 | getClass, notify, notifyAll, wait, wait, wait
      • 197 |
      198 |
    • 199 |
    200 |
  • 201 |
202 |
203 |
204 |
    205 |
  • 206 | 207 | 250 | 251 |
      252 |
    • 253 | 254 | 255 |

      Method Detail

      256 | 257 | 258 | 259 |
        260 |
      • 261 |

        values

        262 |
        public static Mojang.ServiceStatus[] values()
        263 |
        Returns an array containing the constants of this enum type, in 264 | the order they are declared. This method may be used to iterate 265 | over the constants as follows: 266 |
        267 | for (Mojang.ServiceStatus c : Mojang.ServiceStatus.values())
        268 |     System.out.println(c);
        269 | 
        270 |
        271 |
        Returns:
        272 |
        an array containing the constants of this enum type, in the order they are declared
        273 |
        274 |
      • 275 |
      276 | 277 | 278 | 279 |
        280 |
      • 281 |

        valueOf

        282 |
        public static Mojang.ServiceStatus valueOf(java.lang.String name)
        283 |
        Returns the enum constant of this type with the specified name. 284 | The string must match exactly an identifier used to declare an 285 | enum constant in this type. (Extraneous whitespace characters are 286 | not permitted.)
        287 |
        288 |
        Parameters:
        289 |
        name - the name of the enum constant to be returned.
        290 |
        Returns:
        291 |
        the enum constant with the specified name
        292 |
        Throws:
        293 |
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        294 |
        java.lang.NullPointerException - if the argument is null
        295 |
        296 |
      • 297 |
      298 |
    • 299 |
    300 |
  • 301 |
302 |
303 |
304 | 305 | 306 |
307 | 308 | 309 | 310 | 311 | 312 | 313 | 321 |
322 | 364 | 365 | 366 | 367 | -------------------------------------------------------------------------------- /docs/org/shanerx/mojang/Mojang.SkinType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mojang.SkinType 7 | 8 | 9 | 10 | 11 | 12 | 28 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 |
48 | 90 | 91 | 92 |
93 |
org.shanerx.mojang
94 |

Enum Mojang.SkinType

95 |
96 |
97 |
    98 |
  • java.lang.Object
  • 99 |
  • 100 |
      101 |
    • java.lang.Enum<Mojang.SkinType>
    • 102 |
    • 103 |
        104 |
      • org.shanerx.mojang.Mojang.SkinType
      • 105 |
      106 |
    • 107 |
    108 |
  • 109 |
110 |
111 |
    112 |
  • 113 |
    114 |
    All Implemented Interfaces:
    115 |
    java.io.Serializable, java.lang.Comparable<Mojang.SkinType>
    116 |
    117 |
    118 |
    Enclosing class:
    119 |
    Mojang
    120 |
    121 |
    122 |
    123 |
    public static enum Mojang.SkinType
    124 | extends java.lang.Enum<Mojang.SkinType>
    125 |
    This enum represents the skin types "Alex" and "Steve".
    126 |
  • 127 |
128 |
129 |
130 |
    131 |
  • 132 | 133 |
      134 |
    • 135 | 136 | 137 |

      Enum Constant Summary

      138 | 139 | 140 | 141 | 142 | 143 | 144 | 147 | 148 | 149 | 152 | 153 |
      Enum Constants 
      Enum Constant and Description
      DEFAULT 145 |
      Steve
      146 |
      SLIM 150 |
      Alex
      151 |
      154 |
    • 155 |
    156 | 157 |
      158 |
    • 159 | 160 | 161 |

      Method Summary

      162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 173 | 174 | 175 | 176 | 179 | 180 | 181 | 182 | 186 | 187 |
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringtoString() 171 |
      Returns the query parameter version for these skin types in order to send HTTP requests to the API.
      172 |
      static Mojang.SkinTypevalueOf(java.lang.String name) 177 |
      Returns the enum constant of this type with the specified name.
      178 |
      static Mojang.SkinType[]values() 183 |
      Returns an array containing the constants of this enum type, in 184 | the order they are declared.
      185 |
      188 |
        189 |
      • 190 | 191 | 192 |

        Methods inherited from class java.lang.Enum

        193 | compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
      • 194 |
      195 |
        196 |
      • 197 | 198 | 199 |

        Methods inherited from class java.lang.Object

        200 | getClass, notify, notifyAll, wait, wait, wait
      • 201 |
      202 |
    • 203 |
    204 |
  • 205 |
206 |
207 |
208 |
    209 |
  • 210 | 211 | 238 | 239 |
      240 |
    • 241 | 242 | 243 |

      Method Detail

      244 | 245 | 246 | 247 |
        248 |
      • 249 |

        values

        250 |
        public static Mojang.SkinType[] values()
        251 |
        Returns an array containing the constants of this enum type, in 252 | the order they are declared. This method may be used to iterate 253 | over the constants as follows: 254 |
        255 | for (Mojang.SkinType c : Mojang.SkinType.values())
        256 |     System.out.println(c);
        257 | 
        258 |
        259 |
        Returns:
        260 |
        an array containing the constants of this enum type, in the order they are declared
        261 |
        262 |
      • 263 |
      264 | 265 | 266 | 267 |
        268 |
      • 269 |

        valueOf

        270 |
        public static Mojang.SkinType valueOf(java.lang.String name)
        271 |
        Returns the enum constant of this type with the specified name. 272 | The string must match exactly an identifier used to declare an 273 | enum constant in this type. (Extraneous whitespace characters are 274 | not permitted.)
        275 |
        276 |
        Parameters:
        277 |
        name - the name of the enum constant to be returned.
        278 |
        Returns:
        279 |
        the enum constant with the specified name
        280 |
        Throws:
        281 |
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        282 |
        java.lang.NullPointerException - if the argument is null
        283 |
        284 |
      • 285 |
      286 | 287 | 288 | 289 |
        290 |
      • 291 |

        toString

        292 |
        public java.lang.String toString()
        293 |
        Returns the query parameter version for these skin types in order to send HTTP requests to the API.
        294 |
        295 |
        Overrides:
        296 |
        toString in class java.lang.Enum<Mojang.SkinType>
        297 |
        Returns:
        298 |
        the string
        299 |
        300 |
      • 301 |
      302 |
    • 303 |
    304 |
  • 305 |
306 |
307 |
308 | 309 | 310 |
311 | 312 | 313 | 314 | 315 | 316 | 317 | 325 |
326 | 368 | 369 | 370 | 371 | --------------------------------------------------------------------------------