Skip to content

Commit

Permalink
Release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marchermans committed Sep 1, 2024
1 parent 09d9abd commit a6fbb6e
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 16 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
push:
branches:
- "version/*"
- "release/*"
workflow_dispatch:

permissions:
Expand All @@ -16,13 +21,13 @@ permissions:

jobs:
build:
uses: ldtteam/operapublicacreator/.github/workflows/gradle.build.yaml@ng7
uses: ldtteam/operapublicacreator/.github/workflows/gradle.build.yaml@main
with:
java: 21
java: 17
secrets: inherit
pre-release:
uses: ldtteam/operapublicacreator/.github/workflows/gradle.prerelease.yaml@ng7
uses: ldtteam/operapublicacreator/.github/workflows/gradle.prerelease.yaml@main
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && contains( github.event.pull_request.labels.*.name, 'Pre-release')
with:
java: 21
secrets: inherit
java: 17
secrets: inherit
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ on:
branches:
- "version/*"
- "release/*"
- "testing/*"
workflow_dispatch:

permissions:
contents: write
statuses: write

jobs:
release:
uses: ldtteam/operapublicacreator/.github/workflows/gradle.publish.yaml@ng7
uses: ldtteam/operapublicacreator/.github/workflows/gradle.publish.yaml@main
with:
java: 21
java: 17
curse_release_type: ${{ contains(github.ref, 'release') && 'release' || 'beta' }}
secrets: inherit
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public final class RecipeVariant {
private Collection<IRecipeIngredient> ingredients;
private Collection<IRecipeIngredient> remainders;
private ICompoundContainer<?> output;
private final ICompoundContainer<?> output;

/**
* Creates a new recipe variant.
Expand All @@ -22,10 +22,20 @@ public RecipeVariant(ICompoundContainer<?> output) {
this.output = output;
}

/**
* The ingredients that make up this variant.
*
* @return The ingredients in this recipe variant.
*/
public Collection<IRecipeIngredient> ingredients() {
return ingredients;
}

/**
* The remainders of this recipe that are left over when the ingredients are consumed for this variant to produce the output.
*
* @return The remainders of this recipe.
*/
public Collection<IRecipeIngredient> remainders() {
return remainders;
}
Expand All @@ -38,6 +48,11 @@ void setRemainders(Collection<IRecipeIngredient> remainders) {
this.remainders = remainders;
}

/**
* The result of this variant when it is crafted.
*
* @return The output.
*/
public ICompoundContainer<?> output() {
return output;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ public static class DataDrivenData {
}

private record LevelAnalysisOwner(ServerLevel serverLevel) implements IAnalysisOwner {
@Override
public boolean isPrimary() {
return getIdentifier() == Level.OVERWORLD;
}

@Override
public ResourceKey<Level> getIdentifier() {
return serverLevel.dimension();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
public interface IAnalysisOwner
{

/**
* @return True when this is a candidate for being a primary owner.
*/
boolean isPrimary();

/**
* The identifier of the analysis owner.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static IAnalysisOwner determinePrimary(final List<IAnalysisOwner> owners
}

return owners.stream()
.filter(owner -> owner.getIdentifier() == Level.OVERWORLD)
.filter(IAnalysisOwner::isPrimary)
.findFirst()
.orElse(owners.get(0));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ldtteam.aequivaleo.analysis.jgrapht.graph;

public class DuplicateEdgeException extends IllegalArgumentException {
public DuplicateEdgeException() {
super("Edge already exists");
public DuplicateEdgeException(Object source, Object target) {
super("Edge already exists: source=" + source + ", target=" + target);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected String toStringFromSets(final Collection<? extends V> vertexSet, final
@Override
public E addEdge(V sourceVertex, V targetVertex) {
if (getEdge(sourceVertex, targetVertex) != null) {
throw new DuplicateEdgeException();
throw new DuplicateEdgeException(sourceVertex, targetVertex);
}

return super.addEdge(sourceVertex, targetVertex);
Expand All @@ -55,7 +55,7 @@ public E addEdge(V sourceVertex, V targetVertex) {
@Override
public boolean addEdge(V sourceVertex, V targetVertex, E e) {
if (getEdge(sourceVertex, targetVertex) != null) {
throw new IllegalArgumentException("Edge already exists");
throw new DuplicateEdgeException(sourceVertex, targetVertex);
}

return super.addEdge(sourceVertex, targetVertex, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ public void testGenerateValuesWood() {

for (char i : "ABCD".toCharArray()) {
for (char j : "ABCD".toCharArray()) {
if (j < i)
continue;

Set<ICompoundContainer<?>> inputs = s(cc("planks" + i, 1), cc("planks" + j, 1));
if (i == j)
inputs = s(cc("planks" + i, 2));
Expand All @@ -378,6 +381,9 @@ public void testGenerateValuesWood() {
registerRecipe("2x planksA to 1x crafting_table", s(cc("planksA", 4)), s(cc("crafting_table", 1)));
for (char i : "ABCD".toCharArray()) {
for (char j : "ABCD".toCharArray()) {
if (j < i)
continue;

Set<ICompoundContainer<?>> inputs = s(cc("stick", 2), cc("planks" + i, 1), cc("planks" + j, 1));
if (i == j)
inputs = s(cc("stick", 2), cc("planks" + i, 2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public TestAnalysisOwner(final TestName testName, final ResourceKey<Level> key)
this.key = key;
}

@Override
public boolean isPrimary() {
return true;
}

@Override
public ResourceKey<Level> getIdentifier()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public DefaultTestContainer getContents()
return this;
}

@Override
public String getContentNamespace() {
return "minecraft";
}

@Override
public Double getContentsCount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public String getContents()
return content;
}

@Override
public String getContentNamespace() {
return "minecraft";
}

@Override
public Double getContentsCount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public String getContents()
return content;
}

@Override
public String getContentNamespace() {
return "minecraft";
}

@Override
public Double getContentsCount()
{
Expand Down

0 comments on commit a6fbb6e

Please sign in to comment.