Skip to content

Commit

Permalink
generic project re-structuration (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
SrRapero720 authored Nov 23, 2024
1 parent b679bf4 commit 14e02fa
Show file tree
Hide file tree
Showing 124 changed files with 5,364 additions and 3,740 deletions.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies {

// DEPENDENCIES
shadow "com.github.WaterMediaTeam:videolan-natives:$vlcj_natives_version"
shadow "com.github.WaterMediaTeam:ytdl-java:$jyd_version"
shadow "com.github.WaterMediaTeam:ffmpeg4j:$ffmpeg4j_version"
shadow "net.sf.sevenzipjbinding:sevenzipjbinding:16.02-2.01"
shadow "net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:16.02-2.01"
shadow project(":lib-vlcj")
Expand Down Expand Up @@ -104,10 +104,6 @@ shadowJar {
// Add relocation rules for each dependency
relocate 'com.github', 'me.lib720'
relocate 'com.alibaba', 'me.lib720.alibaba'
relocate 'com.fasterxml', 'me.lib720'
relocate 'org.apache.commons', 'me.lib720.apache'
relocate 'org.tukaani', 'me.lib720.tukaani'
relocate 'uk.co.caprica', 'me.lib720.caprica'

exclude "META-INF/versions/**"
exclude "META-INF/proguard/**"
Expand Down
19 changes: 12 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ curseforgeid=869524
#########################
#### Version ranges ####
#######################
minecraftrange=[1.16.5,)
forgerange=[36,)
forgefmlrange=[36,)
minecraftrange=[1.18.2,)
forgerange=[40.2.21,)
forgefmlrange=[40,)
neorange=[21,)
neofmlrange=[3,)
fabricrange=>=0.14
javarange=>=8
javarange=>=17

##############################
#### Project information ####
Expand All @@ -40,8 +40,12 @@ authors=SrRapero720, Goedix
authors_list=["SrRapero720", "Goedix"]
contributors=ZenoArrows, zFERDQFREZrzfq, Kekscussino, cyyynthia
contributors_list=["ZenoArrows", "zFERDQFREZrzfq", "Kekscussino", "cyyynthia"]
credits=VideoLAN Team for libVLC, Caprica for made VLCJ, Linus torvalds for make us suffer with Linux
description=Library with an API using VLC for multimedia integration with Minecraft. Works also standalone
credits=Powered by FFMPEG and VideoLAN, special thanks to Caprica for vlcj
description=Library and API providing multimedia processing, source patching, rendering, and math tools.

############################
#### Libraries Version ####
##########################

####################
#### Libraries ####
Expand All @@ -50,7 +54,8 @@ modloaders_version=1.0.1
fabric_version=0.16.0
forge_version=unknown
jyd_version=3.2.3
vlcj_natives_version=4.9.0
ffmpeg4j_version=master-SNAPSHOT
vlcj_natives_version=4.11.0
commoncompress_version=1.26.1
commonslang3_version=3.12.0
commonsio_version=2.7
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum State {
ENDED (6),
ERROR (7);

private static final Map<Integer, State> INT_MAP = new HashMap<Integer, State>();
private static final Map<Integer, State> INT_MAP = new HashMap<>();

static {
for (State event : State.values()) {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/me/srrapero720/watermedia/Main.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.srrapero720.watermedia;

import me.srrapero720.watermedia.api.math.MathAPI;
import me.srrapero720.watermedia.tools.IOTool;
import org.watermedia.api.MathAPI;
import org.watermedia.tools.IOTool;
import org.watermedia.WaterMedia;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
Expand Down Expand Up @@ -179,7 +180,7 @@ public void run() {
if (crashReportFiles == null || crashReportFiles.length == 0)
throw new NullPointerException("No such directory or is empty");

Arrays.sort(crashReportFiles, LastModifiedFileComparator.LASTMODIFIED_REVERSE);
// Arrays.sort(crashReportFiles, LastModifiedFileComparator.LASTMODIFIED_REVERSE);
File crashReport = crashReportFiles[0];

LOGGER.info("Collected files: " + Arrays.toString(crashReportFiles));
Expand Down
113 changes: 0 additions & 113 deletions src/main/java/me/srrapero720/watermedia/WaterMedia.java

This file was deleted.

50 changes: 50 additions & 0 deletions src/main/java/me/srrapero720/watermedia/api/MediaContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package me.srrapero720.watermedia.api;

public interface MediaContext {

/**
* Provides the context unique identifier (like a mod id)
* This helps on debugging to find who do the wrong call
* @return a unique identifier in range of [a-z][1-9]
*/
String id();

/**
* Elegant name for the logger and crash report handlers, it can be not unique
* @return a fancy string with the name of your project
*/
String name();

/**
* Preference is established for lower qualities when the exact wanted quality is missing
* @return true if it should prefer lower qualities, false otherwise
*/
boolean preferLowerQuality();

/**
* Very quick and simple implementation of a MediaModContext, no answers, no questions, just a context
*/
final class Simple implements MediaContext {
private final String id;
private final String name;
public Simple(String id, String name) {
this.id = id;
this.name = name;
}

@Override public String id() { return id; }
@Override public String name() { return name; }
@Override public boolean preferLowerQuality() { return false; }
}

final class Static {
private final String id;
private final String name;
private final boolean prefferLowerQuality;
public Static(String id, String name, boolean preferLowerQuality) {
this.id = id;
this.name = name;
this.prefferLowerQuality = preferLowerQuality;
}
}
}
Loading

0 comments on commit 14e02fa

Please sign in to comment.