-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ffcf38
commit 2485c22
Showing
6 changed files
with
91 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
platform-fabric/src/main/java/band/kessoku/lib/platform/impl/ModDependencyInfoImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package band.kessoku.lib.platform.impl; | ||
|
||
import band.kessoku.lib.platform.api.ModDependencyInfo; | ||
import net.fabricmc.loader.api.metadata.ModDependency; | ||
|
||
public class ModDependencyInfoImpl implements ModDependencyInfo { | ||
private final ModDependency value; | ||
public ModDependencyInfoImpl(ModDependency dependency) { | ||
value = dependency; | ||
} | ||
@Override | ||
public DependencyKind getKind() { | ||
switch (value.getKind()) { | ||
case DEPENDS -> { | ||
return DependencyKind.DEPENDS; | ||
} | ||
case RECOMMENDS -> { | ||
return DependencyKind.RECOMMENDS; | ||
} | ||
case SUGGESTS -> { | ||
return DependencyKind.SUGGESTS; | ||
} | ||
case CONFLICTS -> { | ||
return DependencyKind.CONFLICTS; | ||
} | ||
case BREAKS -> { | ||
return DependencyKind.BREAKS; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getModId() { | ||
return value.getModId(); | ||
} | ||
|
||
public ModDependency getModDependency() { | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
platform-neo/src/main/java/band/kessoku/lib/platform/impl/ModDependencyInfoImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package band.kessoku.lib.platform.impl; | ||
|
||
import band.kessoku.lib.platform.api.ModDependencyInfo; | ||
import net.neoforged.neoforgespi.language.IModInfo; | ||
|
||
public class ModDependencyInfoImpl implements ModDependencyInfo { | ||
private final IModInfo.ModVersion value; | ||
public ModDependencyInfoImpl(IModInfo.ModVersion modVersion) { | ||
value = modVersion; | ||
} | ||
@Override | ||
public DependencyKind getKind() { | ||
switch (value.getType()) { | ||
case OPTIONAL -> { | ||
return DependencyKind.OPTIONAL; | ||
} | ||
case REQUIRED -> { | ||
return DependencyKind.DEPENDS; | ||
} | ||
case DISCOURAGED -> { | ||
return DependencyKind.CONFLICTS; | ||
} | ||
case INCOMPATIBLE -> { | ||
return DependencyKind.BREAKS; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getModId() { | ||
return value.getModId(); | ||
} | ||
|
||
public IModInfo.ModVersion getModVersion() { | ||
return value; | ||
} | ||
} |