Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,8 @@ public record OreType(Supplier<BlockState> stoneType, Supplier<Material> materia
Supplier<BlockBehaviour.Properties> template, ResourceLocation baseModelLocation,
boolean isDoubleDrops, boolean isSand, boolean shouldDropAsItem) {}

public record BlockProperties(Supplier<Supplier<RenderType>> renderType,
UnaryOperator<BlockBehaviour.Properties> properties) {}
public record BlockProperties(@NotNull Supplier<Supplier<RenderType>> renderType,
@NotNull UnaryOperator<BlockBehaviour.Properties> properties) {}

@Getter
public final ResourceLocation id;
Expand Down Expand Up @@ -1024,7 +1024,6 @@ public record BlockProperties(Supplier<Supplier<RenderType>> renderType,
@Setter
private BlockItemConstructor blockItemConstructor = MaterialBlockItem::new;
@Getter
@Setter
private BlockProperties blockProperties = new BlockProperties(() -> RenderType::translucent,
UnaryOperator.identity());

Expand Down Expand Up @@ -1180,6 +1179,19 @@ public TagPrefix miningToolTag(TagKey<Block> tag) {
return this;
}

public TagPrefix blockProperties(BlockProperties blockProperties) {
if (blockProperties.renderType() == null) {
throw new IllegalArgumentException(
"Could not set blockProperties with null renderType in TagPrefix " + this.id());
}
if (blockProperties.properties() == null) {
throw new IllegalArgumentException(
"Could not set blockProperties with null properties in TagPrefix " + this.id());
}
this.blockProperties = blockProperties;
return this;
}

public TagPrefix blockProperties(Supplier<Supplier<RenderType>> renderType,
UnaryOperator<BlockBehaviour.Properties> properties) {
return this.blockProperties(new BlockProperties(renderType, properties));
Expand Down
Loading