Automatic tool configuration for Blocks
This commit is contained in:
parent
2b71f7782a
commit
8c1f9567a5
35 changed files with 89 additions and 76 deletions
|
@ -31,7 +31,7 @@ public class ColoredMaterial {
|
|||
String id = Registry.BLOCK.getKey(source).getPath();
|
||||
colors.forEach((color, name) -> {
|
||||
String blockName = id + "_" + name;
|
||||
Block block = constructor.apply(FabricBlockSettings.copyOf(source).materialColor(MaterialColor.COLOR_BLACK));
|
||||
Block block = constructor.apply(BlocksHelper.copySettingsOf(source).materialColor(MaterialColor.COLOR_BLACK));
|
||||
EndBlocks.registerBlock(blockName, block);
|
||||
if (craftEight) {
|
||||
GridRecipe.make(BetterEnd.MOD_ID, blockName, block).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(8).setShape("###", "#D#", "###").addMaterial('#', source).addMaterial('D', dyes.get(color)).build();
|
||||
|
|
|
@ -10,6 +10,7 @@ import ru.bclib.blocks.BaseSlabBlock;
|
|||
import ru.bclib.blocks.BaseStairsBlock;
|
||||
import ru.bclib.blocks.BaseWallBlock;
|
||||
import ru.bclib.recipes.GridRecipe;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.EndPedestal;
|
||||
|
@ -31,7 +32,7 @@ public class CrystalSubblocksMaterial {
|
|||
public final Block brick_wall;
|
||||
|
||||
public CrystalSubblocksMaterial(String name, Block source) {
|
||||
FabricBlockSettings material = FabricBlockSettings.copyOf(source);
|
||||
FabricBlockSettings material = BlocksHelper.copySettingsOf(source);
|
||||
polished = EndBlocks.registerBlock(name + "_polished", new BaseBlock(material));
|
||||
tiles = EndBlocks.registerBlock(name + "_tiles", new BaseBlock(material));
|
||||
pillar = EndBlocks.registerBlock(name + "_pillar", new BaseRotatedPillarBlock(material));
|
||||
|
|
|
@ -31,6 +31,7 @@ import ru.bclib.items.tool.BaseSwordItem;
|
|||
import ru.bclib.recipes.FurnaceRecipe;
|
||||
import ru.bclib.recipes.GridRecipe;
|
||||
import ru.bclib.recipes.SmithingTableRecipe;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.BulbVineLanternBlock;
|
||||
|
@ -90,26 +91,26 @@ public class MetalMaterial {
|
|||
public final Item boots;
|
||||
|
||||
public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) {
|
||||
return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor);
|
||||
return new MetalMaterial(name, true, BlocksHelper.copySettingsOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor);
|
||||
}
|
||||
|
||||
public static MetalMaterial makeNormal(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) {
|
||||
return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor);
|
||||
return new MetalMaterial(name, true, BlocksHelper.copySettingsOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor);
|
||||
}
|
||||
|
||||
public static MetalMaterial makeOreless(String name, MaterialColor color, Tier material, ArmorMaterial armor) {
|
||||
return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor);
|
||||
return new MetalMaterial(name, false, BlocksHelper.copySettingsOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor);
|
||||
}
|
||||
|
||||
public static MetalMaterial makeOreless(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) {
|
||||
return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor);
|
||||
return new MetalMaterial(name, false, BlocksHelper.copySettingsOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor);
|
||||
}
|
||||
|
||||
private MetalMaterial(String name, boolean hasOre, FabricBlockSettings settings, Properties itemSettings, Tier material, ArmorMaterial armor) {
|
||||
BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings).hardness(1).resistance(1).luminance(15).sound(SoundType.LANTERN);
|
||||
final int level = material.getLevel();
|
||||
|
||||
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseBlock(FabricBlockSettings.copyOf(Blocks.END_STONE))) : null;
|
||||
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseBlock(BlocksHelper.copySettingsOf(Blocks.END_STONE))) : null;
|
||||
block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings));
|
||||
tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings));
|
||||
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile));
|
||||
|
|
|
@ -16,6 +16,7 @@ import ru.bclib.blocks.BaseStoneButtonBlock;
|
|||
import ru.bclib.blocks.BaseWallBlock;
|
||||
import ru.bclib.blocks.StonePressurePlateBlock;
|
||||
import ru.bclib.recipes.GridRecipe;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.EndPedestal;
|
||||
|
@ -46,7 +47,7 @@ public class StoneMaterial {
|
|||
public final Block furnace;
|
||||
|
||||
public StoneMaterial(String name, MaterialColor color) {
|
||||
FabricBlockSettings material = FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color);
|
||||
FabricBlockSettings material = BlocksHelper.copySettingsOf(Blocks.END_STONE).materialColor(color);
|
||||
|
||||
stone = EndBlocks.registerBlock(name, new BaseBlock(material));
|
||||
polished = EndBlocks.registerBlock(name + "_polished", new BaseBlock(material));
|
||||
|
|
|
@ -33,6 +33,7 @@ import ru.bclib.blocks.BaseWoodenButtonBlock;
|
|||
import ru.bclib.blocks.StripableBarkBlock;
|
||||
import ru.bclib.blocks.WoodenPressurePlateBlock;
|
||||
import ru.bclib.recipes.GridRecipe;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.config.Configs;
|
||||
|
@ -69,7 +70,7 @@ public class WoodenMaterial {
|
|||
public final Tag.Named<Item> logItemTag;
|
||||
|
||||
public WoodenMaterial(String name, MaterialColor woodColor, MaterialColor planksColor) {
|
||||
FabricBlockSettings materialPlanks = FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(planksColor);
|
||||
FabricBlockSettings materialPlanks = BlocksHelper.copySettingsOf(Blocks.OAK_PLANKS).materialColor(planksColor);
|
||||
|
||||
log_stripped = EndBlocks.registerBlock(name + "_stripped_log", new BaseRotatedPillarBlock(materialPlanks));
|
||||
bark_stripped = EndBlocks.registerBlock(name + "_stripped_bark", new BaseBarkBlock(materialPlanks));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue