Skip to content

Commit

Permalink
Removed deprecated code in preparation for v1.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
DV8FromTheWorld committed Feb 27, 2016
1 parent 23e1adf commit b328fc7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 101 deletions.
56 changes: 1 addition & 55 deletions src/main/java/net/dv8tion/jda/JDA.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,65 +63,11 @@ public interface JDA
*/
void removeEventListener(Object listener);

/**
* <b>This method is deprecated! please switch to {@link net.dv8tion.jda.JDA#createGuildAsync(String, Region, java.util.function.Consumer)}.</b>
* <p>
* Creates a new {@link net.dv8tion.jda.entities.Guild Guild}.
* This will a return the Manager to the existing, but still empty Guild (no members, no channels).
* To create a Guild asynchronously (wait for generation of #general chat), use {@link #createGuildAsync(String, Consumer)} instead.
*
* In the very rare case, that the Discord-server has problems, The created guild can be unavailable until it is actually created.
* In that case, this will return null.
*
* @param name
* the name of the new {@link net.dv8tion.jda.entities.Guild Guild}
* @return
* the {@link net.dv8tion.jda.managers.GuildManager GuildManager} for the created Guild, or null, if the created Guild is temporarily unavailable
*/
@Deprecated
GuildManager createGuild(String name);

/**
* <b>This method is deprecated! please switch to {@link net.dv8tion.jda.JDA#createGuildAsync(String, Region, java.util.function.Consumer)}.</b>
* <p>
* Creates a new {@link net.dv8tion.jda.entities.Guild Guild}.
* This will a return the Manager to the existing, but still empty Guild (no members, no channels).
* To create a Guild asynchronously (wait for generation of #general chat), use {@link #createGuildAsync(String, Consumer)} instead.
*
* In the very rare case, that the Discord-server has problems, The created guild can be unavailable until it is actually created.
* In that case, this will return null.
*
* @param name
* the name of the new {@link net.dv8tion.jda.entities.Guild Guild}
* @param region
* the region of the new {@link net.dv8tion.jda.entities.Guild Guild}
* @return
* the {@link net.dv8tion.jda.managers.GuildManager GuildManager} for the created Guild, or null, if the created Guild is temporarily unavailable
*/
@Deprecated
GuildManager createGuild(String name, Region region);

/**
* <b>This method is deprecated! please switch to {@link net.dv8tion.jda.JDA#createGuildAsync(String, Region, java.util.function.Consumer)}.</b>
* <p>
* Creates a new {@link net.dv8tion.jda.entities.Guild Guild}.
* This function will wait until the Guild was fully created by the Discord-Server (default channels,...),
* and then call the provided callback-function with the GuildManager-object
* To create a Guild synchronously, use {@link #createGuild(String)} instead
*
* @param name
* the name of the new {@link net.dv8tion.jda.entities.Guild Guild}
* @param callback
* the callback-function that gets called once the guild was fully initialized
*/
@Deprecated
void createGuildAsync(String name, Consumer<GuildManager> callback);

/**
* Creates a new {@link net.dv8tion.jda.entities.Guild Guild}.<br>
* This function will wait until the Guild was fully created by the Discord-Server (default channels,...),
* and then call the provided callback-function with the GuildManager-object
* To create a Guild synchronously, use {@link #createGuild(String)} instead
* and then call the provided callback-function with the GuildManager-object.
* <p>
* <b>NOTE: If you do not wish to interact with the created guild, the Consumer CAN BE NULL.</b>
* @param name
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/net/dv8tion/jda/JDABuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,6 @@ public JDABuilder removeListener(Object listener)
return this;
}

/**
* This method has been deprecated due to a name change to clarify what happens.<br>
* Please use {@link #buildAsync() buildAsync()} instead to achieve the same functionality.
*/
@Deprecated
public JDA build() throws LoginException, IllegalArgumentException
{
return buildAsync();
}

/**
* Builds a new {@link net.dv8tion.jda.JDA} instance and uses the provided email and password to start the login process.<br>
* The login process runs in a different thread, so while this will return immediately, {@link net.dv8tion.jda.JDA} has not
Expand Down
36 changes: 0 additions & 36 deletions src/main/java/net/dv8tion/jda/entities/impl/JDAImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,42 +331,6 @@ public List<PrivateChannel> getPrivateChannels()
return Collections.unmodifiableList(new LinkedList<>(pmChannelMap.values()));
}

@Override
@Deprecated
public GuildManager createGuild(String name)
{
return createGuild(name, Region.US_EAST);
}

@Override
@Deprecated
public GuildManager createGuild(String name, Region region)
{
if (name == null)
{
throw new IllegalArgumentException("Guild name must not be null");
}
JSONObject response = getRequester().post("https://discordapp.com/api/guilds",
new JSONObject().put("name", name).put("region", region.getKey()));
if (response == null || !response.has("id"))
{
//error creating guild
throw new RuntimeException("Creating a new Guild failed. Reason: " + (response == null ? "Unknown" : response.toString()));
}
else
{
Guild g = new EntityBuilder(this).createGuildFirstPass(response, null);
return g.isAvailable() ? new GuildManager(g) : null;
}
}

@Override
@Deprecated
public void createGuildAsync(String name, Consumer<GuildManager> callback)
{
createGuildAsync(name, Region.US_EAST, callback);
}

@Override
public void createGuildAsync(String name, Region region, Consumer<GuildManager> callback)
{
Expand Down

0 comments on commit b328fc7

Please sign in to comment.