Skip to content

Commit

Permalink
Rename the last set methods to with.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 committed Jul 15, 2024
1 parent 9835048 commit 25d57b5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/enderio/regilite/events/ColorEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Items(Regilite regilite) {
public void registerItemColor(RegisterColorHandlersEvent.Item event) {
for (DeferredHolder<Item, ? extends Item> item : regilite.getItems()) {
if (item instanceof RegiliteItem) {
var colorSupplier = ((RegiliteItem<Item>)item).getColorSupplier();
var colorSupplier = ((RegiliteItem<Item>)item).getItemColorSupplier();
if (colorSupplier != null) {
event.register(colorSupplier.get().get(), item.get());
}
Expand All @@ -46,7 +46,7 @@ public Blocks(Regilite regilite) {
public void registerBlockColor(RegisterColorHandlersEvent.Block event) {
for (DeferredHolder<Block, ? extends Block> block : regilite.getBlock()) {
if (block instanceof RegiliteBlock) {
var colorSupplier = ((RegiliteBlock<Block>)block).getColorSupplier();
var colorSupplier = ((RegiliteBlock<Block>)block).getBlockColorSupplier();
if (colorSupplier != null) {
event.register(colorSupplier.get().get(), block.get());
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/enderio/regilite/holder/RegiliteBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public BiConsumer<RegiliteBlockLootProvider, T> getLootTable() {
return lootTable;
}

public RegiliteBlock<T> setBlockStateProvider(BiConsumer<BlockStateProvider, DataGenContext<Block, T>> blockStateProvider) {
public RegiliteBlock<T> withBlockStateProvider(BiConsumer<BlockStateProvider, DataGenContext<Block, T>> blockStateProvider) {
this.blockStateProvider = blockStateProvider;
return this;
}
Expand All @@ -81,7 +81,7 @@ public BiConsumer<BlockStateProvider, DataGenContext<Block, T>> getBlockStatePro
}

@Nullable
public Supplier<Supplier<BlockColor>> getColorSupplier() {
public Supplier<Supplier<BlockColor>> getBlockColorSupplier() {
return colorSupplier;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/enderio/regilite/holder/RegiliteItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Map<ResourceKey<CreativeModeTab>, Consumer<CreativeModeTab.Output>> getTa
return tab;
}

public RegiliteItem<T> setModelProvider(BiConsumer<RegiliteItemModelProvider, DataGenContext<Item, T>> modelProvider) {
public RegiliteItem<T> withModelProvider(BiConsumer<RegiliteItemModelProvider, DataGenContext<Item, T>> modelProvider) {
this.modelProvider = modelProvider;
return this;
}
Expand All @@ -88,11 +88,11 @@ public BiConsumer<RegiliteItemModelProvider, DataGenContext<Item, T>> getModelPr
return modelProvider;
}

public Supplier<Supplier<ItemColor>> getColorSupplier() {
public Supplier<Supplier<ItemColor>> getItemColorSupplier() {
return colorSupplier;
}

public RegiliteItem<T> setColorSupplier(Supplier<Supplier<ItemColor>> colorSupplier) {
public RegiliteItem<T> withItemColor(Supplier<Supplier<ItemColor>> colorSupplier) {
this.colorSupplier = colorSupplier;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private <I extends BlockItem, U extends Block> RegiliteItem<I> registerBlockItem

return ret
.withTranslation("")
.setModelProvider((prov, ctx) -> prov.basicBlock(ctx.get()));
.withModelProvider((prov, ctx) -> prov.basicBlock(ctx.get()));
}

public <I extends BlockItem, U extends Block> RegiliteItem<I> registerBlockItem(String name, RegiliteBlock<U> block, Supplier<I> sup) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/enderio/regilite/examplemod/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class Blocks {
.withTags(BlockTags.MUSHROOM_GROW_BLOCK, BlockTags.LOGS)
.withTranslation("Test Example Block")
.withBlockColor(() -> () -> ExampleColors.BLOCK)
.setBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get()))
.withBlockStateProvider((prov, ctx) -> prov.simpleBlock(ctx.get()))
.withLootTable(RegiliteBlockLootProvider::dropSelf)
.withBlockItem(ITEMS, item -> item
.withTags(ItemTags.PLANKS)
.setModelProvider((prov, ctx) -> prov.basicItem(ctx.get()))
.withModelProvider((prov, ctx) -> prov.basicItem(ctx.get()))
.withTab(CreativeModeTabs.BUILDING_BLOCKS)
.withTab(CreativeTabs.EXAMPLE_TAB.getKey()));

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/enderio/regilite/examplemod/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Items {
.alwaysEdible().nutrition(1).saturationModifier(2f).build()))
.withTags(ItemTags.WOOL)
.withTranslation("Test Example Item")
.setColorSupplier(() -> () -> ExampleColors.ITEM)
.withItemColor(() -> () -> ExampleColors.ITEM)
.withTab(null);

public static void register(IEventBus modEventBus) {
Expand Down

0 comments on commit 25d57b5

Please sign in to comment.