Skip to content

Commit

Permalink
chore: fix build problems
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Sep 1, 2024
1 parent 5684bb7 commit 314776e
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 75 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.refinedmods.refinedstorage.common.autocrafting;

import com.refinedmods.refinedstorage.api.autocrafting.AbstractPattern;
import com.refinedmods.refinedstorage.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey;

import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;

class CraftingPattern extends AbstractPattern {
class CraftingPattern implements Pattern {
private final UUID id;
private final List<List<PlatformResourceKey>> inputs;
private final ResourceAmount output;
private final List<ResourceAmount> byproducts;
Expand All @@ -19,7 +21,7 @@ class CraftingPattern extends AbstractPattern {
final List<List<PlatformResourceKey>> inputs,
final ResourceAmount output,
final List<ResourceAmount> byproducts) {
super(id);
this.id = id;
this.inputs = inputs;
this.output = output;
this.outputResources = Set.of(output.resource());
Expand All @@ -38,4 +40,21 @@ List<List<PlatformResourceKey>> getInputs() {
ResourceAmount getOutput() {
return output;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final CraftingPattern that = (CraftingPattern) o;
return Objects.equals(id, that.id);
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package com.refinedmods.refinedstorage.common.autocrafting;

import com.refinedmods.refinedstorage.api.autocrafting.AbstractPattern;
import com.refinedmods.refinedstorage.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;

import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

class ProcessingPattern extends AbstractPattern {
class ProcessingPattern implements Pattern {
private final UUID id;
private final List<ResourceAmount> inputs;
private final List<ResourceAmount> outputs;
private final Set<ResourceKey> outputResources;

ProcessingPattern(final UUID id, final List<ResourceAmount> inputs, final List<ResourceAmount> outputs) {
super(id);
this.id = id;
this.inputs = inputs;
this.outputs = outputs;
this.outputResources = outputs.stream().map(ResourceAmount::resource).collect(Collectors.toSet());
Expand All @@ -26,11 +28,24 @@ public Set<ResourceKey> getOutputResources() {
return outputResources;
}

List<ResourceAmount> getInputs() {
return inputs;
}

List<ResourceAmount> getOutputs() {
return outputs;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ProcessingPattern that = (ProcessingPattern) o;
return Objects.equals(id, that.id);
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.refinedmods.refinedstorage.common.autocrafting;

import com.refinedmods.refinedstorage.api.autocrafting.AbstractPattern;
import com.refinedmods.refinedstorage.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.util.Objects;
import java.util.Set;
import java.util.UUID;

class SmithingTablePattern extends AbstractPattern {
class SmithingTablePattern implements Pattern {
private final UUID id;
private final ItemResource template;
private final ItemResource base;
private final ItemResource addition;
Expand All @@ -19,7 +21,7 @@ class SmithingTablePattern extends AbstractPattern {
final ItemResource base,
final ItemResource addition,
final ItemResource output) {
super(id);
this.id = id;
this.template = template;
this.base = base;
this.addition = addition;
Expand Down Expand Up @@ -47,4 +49,21 @@ ItemResource getAddition() {
ItemResource getOutput() {
return output;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final SmithingTablePattern that = (SmithingTablePattern) o;
return Objects.equals(id, that.id);
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package com.refinedmods.refinedstorage.common.autocrafting;

import com.refinedmods.refinedstorage.api.autocrafting.AbstractPattern;
import com.refinedmods.refinedstorage.api.autocrafting.Pattern;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.util.Objects;
import java.util.Set;
import java.util.UUID;

class StonecutterPattern extends AbstractPattern {
class StonecutterPattern implements Pattern {
private final UUID id;
private final ItemResource input;
private final ItemResource output;
private final Set<ResourceKey> outputResources;

StonecutterPattern(final UUID id, final ItemResource input, final ItemResource output) {
super(id);
this.id = id;
this.input = input;
this.output = output;
this.outputResources = Set.of(output);
Expand All @@ -31,4 +33,21 @@ ItemResource getInput() {
ItemResource getOutput() {
return output;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final StonecutterPattern that = (StonecutterPattern) o;
return Objects.equals(id, that.id);
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import com.refinedmods.refinedstorage.api.grid.view.GridResource;
import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys;
import com.refinedmods.refinedstorage.common.support.resource.FluidResource;

import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand All @@ -27,10 +29,12 @@ public Optional<GridResource> apply(final ResourceKey resource, final boolean cr
return Optional.of(new FluidGridResource(
fluidResource,
name,
modId,
modName,
tags,
tooltip,
Map.of(
GridResourceAttributeKeys.MOD_ID, Set.of(modId),
GridResourceAttributeKeys.MOD_NAME, Set.of(modName),
GridResourceAttributeKeys.TAGS, tags,
GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip)
),
craftable
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import com.refinedmods.refinedstorage.api.grid.view.GridResource;
import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory;
import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -33,10 +35,12 @@ public Optional<GridResource> apply(final ResourceKey resource, final boolean cr
itemResource,
itemStack,
name,
modId,
modName,
tags,
tooltip,
Map.of(
GridResourceAttributeKeys.MOD_ID, Set.of(modId),
GridResourceAttributeKeys.MOD_NAME, Set.of(modName),
GridResourceAttributeKeys.TAGS, tags,
GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip)
),
craftable
));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.refinedmods.refinedstorage.common.grid.view;

import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode;
import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey;
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.common.Platform;
import com.refinedmods.refinedstorage.common.api.RefinedStorageApi;
import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys;
import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy;
Expand Down Expand Up @@ -38,17 +38,9 @@ public class FluidGridResource extends AbstractPlatformGridResource<FluidResourc

public FluidGridResource(final FluidResource resource,
final String name,
final String modId,
final String modName,
final Set<String> tags,
final String tooltip,
final Map<GridResourceAttributeKey, Set<String>> attributes,
final boolean craftable) {
super(resource, name, Map.of(
GridResourceAttributeKeys.MOD_ID, Set.of(modId),
GridResourceAttributeKeys.MOD_NAME, Set.of(modName),
GridResourceAttributeKeys.TAGS, tags,
GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip)
), craftable);
super(resource, name, attributes, craftable);
this.id = BuiltInRegistries.FLUID.getId(resource.fluid());
this.rendering = RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.refinedmods.refinedstorage.common.grid.view;

import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode;
import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey;
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys;
import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy;
import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy;
Expand Down Expand Up @@ -38,17 +38,9 @@ public class ItemGridResource extends AbstractPlatformGridResource<ItemResource>
public ItemGridResource(final ItemResource resource,
final ItemStack itemStack,
final String name,
final String modId,
final String modName,
final Set<String> tags,
final String tooltip,
final Map<GridResourceAttributeKey, Set<String>> attributes,
final boolean craftable) {
super(resource, name, Map.of(
GridResourceAttributeKeys.MOD_ID, Set.of(modId),
GridResourceAttributeKeys.MOD_NAME, Set.of(modName),
GridResourceAttributeKeys.TAGS, tags,
GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip)
), craftable);
super(resource, name, attributes, craftable);
this.id = Item.getId(resource.item());
this.itemStack = itemStack;
this.itemResource = resource;
Expand Down

0 comments on commit 314776e

Please sign in to comment.