Skip to content

Commit

Permalink
Remove unused things +2.0.0-beta.9
Browse files Browse the repository at this point in the history
  • Loading branch information
caoimhebyrne committed Feb 23, 2021
1 parent 0c04e80 commit bcad98c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 139 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies {
embed("com.github.zafarkhaja:java-semver:0.9.0")
embed("com.moandjiezana.toml:toml4j:0.7.2")
embed("com.squareup.okhttp3:okhttp:3.4.2")
embed("com.github.goxr3plus:java-stream-player:10.0.2")
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package me.dreamhopping.mediamod.media;

import me.dreamhopping.mediamod.MediaMod;
import me.dreamhopping.mediamod.event.MediaInfoUpdateEvent;
import me.dreamhopping.mediamod.media.core.IServiceHandler;
import me.dreamhopping.mediamod.media.core.api.MediaInfo;
import me.dreamhopping.mediamod.media.services.browser.BrowserService;
import me.dreamhopping.mediamod.media.services.file.LocalFileService;
import me.dreamhopping.mediamod.media.services.spotify.SpotifyService;
import net.minecraftforge.common.MinecraftForge;
import me.dreamhopping.mediamod.event.MediaInfoUpdateEvent;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -111,8 +110,6 @@ public void loadAll() {

addService(new SpotifyService());
addService(new BrowserService());
addService(new LocalFileService());

loadServices();

MediaMod.INSTANCE.logger.info("Successfully loaded " + loadedServices.size() + " services");
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/me/dreamhopping/mediamod/util/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class Metadata {
public static final String NAME = "MediaMod";
public static final String MODID = "mediamod";
public static final String VERSION = "2.0.0-beta.8";
public static final int VERSION_INT = 16;
public static final String VERSION = "2.0.0-beta.9";
public static final int VERSION_INT = 17;
public static final String MINECRAFT_VERSION = "1.8.9";
}
30 changes: 8 additions & 22 deletions src/main/java/me/dreamhopping/mediamod/util/WebRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import me.dreamhopping.mediamod.MediaMod;
import okhttp3.*;

import javax.net.ssl.*;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
Expand All @@ -20,22 +23,6 @@ public WebRequest() {
client = builder.build();
}

public <T> T post(URL url, String body, Class<T> type) throws IOException {
RequestBody requestBody = RequestBody.create(JSON, body);
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.build();
Response response = client.newCall(request).execute();

ResponseBody responseBody = response.body();
if (responseBody != null) {
return new Gson().fromJson(responseBody.string(), type);
} else {
return null;
}
}

public <T> T post(URL url, Class<T> type) throws IOException {
Request request = new Request.Builder()
.url(url)
Expand Down Expand Up @@ -105,10 +92,8 @@ public int put(URL url, HashMap<String, String> headers) throws IOException {
}

private OkHttpClient.Builder configureToIgnoreCertificate(OkHttpClient.Builder builder) {
MediaMod.INSTANCE.logger.warn("Ignore Ssl Certificate");

try {
final TrustManager[] trustAllCerts = new TrustManager[] {
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
Expand All @@ -131,11 +116,12 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
// Create an ssl socket factory with our all-trusting manager
final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();

builder.sslSocketFactory(sslSocketFactory, (X509TrustManager)trustAllCerts[0]);
builder.sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]);
builder.hostnameVerifier((hostname, session) -> true);
} catch (Exception e) {
MediaMod.INSTANCE.logger.warn("Exception while configuring IgnoreSslCertificate" + e, e);
MediaMod.INSTANCE.logger.warn("Exception thrown whilst running configureToIgnoreCertificate", e);
}

return builder;
}

Expand Down

0 comments on commit bcad98c

Please sign in to comment.