Skip to content

Commit

Permalink
Add another bucket overload
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 committed Jul 15, 2024
1 parent 8caaee4 commit c64748d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ publishing {

create<MavenPublication>("regilite") {
groupId = "com.enderio"
artifactId = "Regilite"
artifactId = "regilite"
version = version

artifact(tasks.getByName("jar"))
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/com/enderio/regilite/holder/RegiliteFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,23 @@ public RegiliteFluid<T> withBlock(BlockRegistry registry, Function<Supplier<Base

// region Bucket Item

public <I extends BucketItem> RegiliteFluid<T> withBucket(ItemRegistry registry) {
return withBucket(registry, f -> new BucketItem(f.get(), new Item.Properties().stacksTo(1)), i -> {});
public RegiliteFluid<T> withBucket(ItemRegistry registry) {
return withCustomBucket(registry, f -> new BucketItem(f.get(), new Item.Properties().stacksTo(1)), i -> {});
}

public <I extends BucketItem> RegiliteFluid<T> withBucket(ItemRegistry registry, Item.Properties properties) {
return withBucket(registry, f -> new BucketItem(f.get(), properties), i -> {});
public RegiliteFluid<T> withBucket(ItemRegistry registry, Consumer<RegiliteItem<BucketItem>> itemConfigure) {
return withCustomBucket(registry, f -> new BucketItem(f.get(), new Item.Properties().stacksTo(1)), itemConfigure);
}

public <I extends BucketItem> RegiliteFluid<T> withBucket(ItemRegistry registry, Function<Supplier<BaseFlowingFluid.Source>, I> supplier) {
return withBucket(registry, supplier, i -> {});
public RegiliteFluid<T> withBucket(ItemRegistry registry, Item.Properties properties) {
return withCustomBucket(registry, f -> new BucketItem(f.get(), properties), i -> {});
}

public <I extends BucketItem> RegiliteFluid<T> withBucket(ItemRegistry registry, Function<Supplier<BaseFlowingFluid.Source>, I> supplier, Consumer<RegiliteItem<I>> itemConfigure) {
public <I extends BucketItem> RegiliteFluid<T> withCustomBucket(ItemRegistry registry, Function<Supplier<BaseFlowingFluid.Source>, I> supplier) {
return withCustomBucket(registry, supplier, i -> {});
}

public <I extends BucketItem> RegiliteFluid<T> withCustomBucket(ItemRegistry registry, Function<Supplier<BaseFlowingFluid.Source>, I> supplier, Consumer<RegiliteItem<I>> itemConfigure) {
var bucket = registry.register(getId().getPath() + "_bucket", () -> supplier.apply(this.sourceFluid));
itemConfigure.accept(bucket);
this.bucket = bucket;
Expand Down

0 comments on commit c64748d

Please sign in to comment.