MaterialColor
-> MapColor
This commit is contained in:
parent
4602596e60
commit
c051cc54c2
12 changed files with 34 additions and 35 deletions
|
@ -22,7 +22,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public abstract class BaseAnvilBlock extends AnvilBlock implements BlockModelPro
|
|||
public static final IntegerProperty DESTRUCTION = BlockProperties.DESTRUCTION;
|
||||
public IntegerProperty durability;
|
||||
|
||||
public BaseAnvilBlock(MaterialColor color) {
|
||||
public BaseAnvilBlock(MapColor color) {
|
||||
this(Properties.copy(Blocks.ANVIL).color(color));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,10 +7,9 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -61,7 +60,7 @@ public class BaseBlock extends Block implements BlockModelProvider {
|
|||
* It is called from Block-Contructors, to allow the augmentation of the blocks
|
||||
* preset properties.
|
||||
* <p>
|
||||
* For example in {@link BaseLeavesBlock#BaseLeavesBlock(Block, MaterialColor, Consumer)}
|
||||
* For example in {@link BaseLeavesBlock#BaseLeavesBlock(Block, MapColor, Consumer)}
|
||||
*
|
||||
* @param customizeProperties A {@link Consumer} to call with the preset properties
|
||||
* @param settings The properties as created by the Block
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.ChainBlock;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
@ -29,7 +29,7 @@ import java.util.Optional;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BaseChainBlock extends ChainBlock implements BlockModelProvider, RenderLayerProvider {
|
||||
public BaseChainBlock(MaterialColor color) {
|
||||
public BaseChainBlock(MapColor color) {
|
||||
this(Properties.copy(Blocks.CHAIN).color(color));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import java.util.function.Consumer;
|
|||
public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, RenderLayerProvider, TagProvider, AddMineableShears, AddMineableHoe {
|
||||
protected final Block sapling;
|
||||
|
||||
private static BlockBehaviour.Properties makeLeaves(MaterialColor color) {
|
||||
private static BlockBehaviour.Properties makeLeaves(MapColor color) {
|
||||
return BlockBehaviour.Properties
|
||||
.copy(Blocks.OAK_LEAVES)
|
||||
.color(color)
|
||||
|
@ -49,7 +49,7 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider,
|
|||
|
||||
public BaseLeavesBlock(
|
||||
Block sapling,
|
||||
MaterialColor color,
|
||||
MapColor color,
|
||||
Consumer<BlockBehaviour.Properties> customizeProperties
|
||||
) {
|
||||
super(BaseBlock.acceptAndReturn(customizeProperties, makeLeaves(color)));
|
||||
|
@ -58,7 +58,7 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider,
|
|||
|
||||
public BaseLeavesBlock(
|
||||
Block sapling,
|
||||
MaterialColor color,
|
||||
MapColor color,
|
||||
int light,
|
||||
Consumer<BlockBehaviour.Properties> customizeProperties
|
||||
) {
|
||||
|
@ -66,12 +66,12 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider,
|
|||
this.sapling = sapling;
|
||||
}
|
||||
|
||||
public BaseLeavesBlock(Block sapling, MaterialColor color) {
|
||||
public BaseLeavesBlock(Block sapling, MapColor color) {
|
||||
super(makeLeaves(color));
|
||||
this.sapling = sapling;
|
||||
}
|
||||
|
||||
public BaseLeavesBlock(Block sapling, MaterialColor color, int light) {
|
||||
public BaseLeavesBlock(Block sapling, MapColor color, int light) {
|
||||
super(makeLeaves(color).lightLevel(state -> light));
|
||||
this.sapling = sapling;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.DropExperienceBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class BaseOreBlock extends DropExperienceBlock implements BlockModelProvi
|
|||
public BaseOreBlock(Supplier<Item> drop, int minCount, int maxCount, int experience, int miningLevel) {
|
||||
this(
|
||||
Properties
|
||||
.of(Material.STONE, MaterialColor.SAND)
|
||||
.of(Material.STONE, MapColor.SAND)
|
||||
.requiresCorrectToolForDrops()
|
||||
.destroyTime(3F)
|
||||
.explosionResistance(9F)
|
||||
|
|
|
@ -14,14 +14,14 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
|
||||
|
||||
public class BaseStripableLogBlock extends BaseRotatedPillarBlock {
|
||||
private final Block striped;
|
||||
|
||||
public BaseStripableLogBlock(MaterialColor color, Block striped) {
|
||||
public BaseStripableLogBlock(MapColor color, Block striped) {
|
||||
super(Properties.copy(striped).color(color));
|
||||
this.striped = striped;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.SnowLayerBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.lighting.LayerLightEngine;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
|
@ -52,7 +52,7 @@ public class BaseTerrainBlock extends BaseBlock {
|
|||
private final Block baseBlock;
|
||||
private Block pathBlock;
|
||||
|
||||
public BaseTerrainBlock(Block baseBlock, MaterialColor color) {
|
||||
public BaseTerrainBlock(Block baseBlock, MapColor color) {
|
||||
super(Properties
|
||||
.copy(baseBlock)
|
||||
.color(color)
|
||||
|
|
|
@ -7,14 +7,14 @@ import net.minecraft.util.FormattedCharSequence;
|
|||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LeveledAnvilBlock extends BaseAnvilBlock {
|
||||
protected final int level;
|
||||
|
||||
public LeveledAnvilBlock(MaterialColor color, int level) {
|
||||
public LeveledAnvilBlock(MapColor color, int level) {
|
||||
super(color);
|
||||
this.level = level;
|
||||
}
|
||||
|
|
|
@ -13,13 +13,13 @@ import net.minecraft.world.item.Item;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerProvider, TagProvider, AddMineableShears, AddMineableHoe {
|
||||
public SimpleLeavesBlock(MaterialColor color) {
|
||||
public SimpleLeavesBlock(MapColor color) {
|
||||
this(
|
||||
Properties
|
||||
.of(Material.LEAVES)
|
||||
|
@ -33,11 +33,11 @@ public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
);
|
||||
}
|
||||
|
||||
public SimpleLeavesBlock(MaterialColor color, int light) {
|
||||
public SimpleLeavesBlock(MapColor color, int light) {
|
||||
this(
|
||||
Properties
|
||||
.of(Material.LEAVES)
|
||||
.lightLevel(ignored->light)
|
||||
.lightLevel(ignored -> light)
|
||||
.color(color)
|
||||
.strength(0.2F)
|
||||
.sound(SoundType.GRASS)
|
||||
|
|
|
@ -13,14 +13,14 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
|
||||
|
||||
public class StripableBarkBlock extends BaseBarkBlock {
|
||||
private final Block striped;
|
||||
|
||||
public StripableBarkBlock(MaterialColor color, Block striped) {
|
||||
public StripableBarkBlock(MapColor color, Block striped) {
|
||||
super(Properties.copy(striped).color(color));
|
||||
this.striped = striped;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
@ -48,7 +48,7 @@ public class TripleTerrainBlock extends BaseTerrainBlock {
|
|||
this.registerDefaultState(defaultBlockState().setValue(SHAPE, TripleShape.BOTTOM));
|
||||
}
|
||||
|
||||
public TripleTerrainBlock(Block baseBlock, MaterialColor color) {
|
||||
public TripleTerrainBlock(Block baseBlock, MapColor color) {
|
||||
super(baseBlock, color);
|
||||
this.registerDefaultState(defaultBlockState().setValue(SHAPE, TripleShape.BOTTOM));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.properties.WoodType;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
|
||||
|
@ -52,8 +52,8 @@ public class WoodenComplexMaterial extends ComplexMaterial {
|
|||
|
||||
public static final String TAG_LOGS = "logs";
|
||||
|
||||
public final MaterialColor planksColor;
|
||||
public final MaterialColor woodColor;
|
||||
public final MapColor planksColor;
|
||||
public final MapColor woodColor;
|
||||
|
||||
public final WoodType woodType;
|
||||
|
||||
|
@ -61,8 +61,8 @@ public class WoodenComplexMaterial extends ComplexMaterial {
|
|||
String modID,
|
||||
String baseName,
|
||||
String receipGroupPrefix,
|
||||
MaterialColor woodColor,
|
||||
MaterialColor planksColor
|
||||
MapColor woodColor,
|
||||
MapColor planksColor
|
||||
) {
|
||||
super(modID, baseName, receipGroupPrefix);
|
||||
this.planksColor = planksColor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue