More BehaviourBuilder related changes
This commit is contained in:
parent
3e66e8e9c5
commit
c1474de774
2 changed files with 39 additions and 0 deletions
|
@ -37,6 +37,15 @@ import java.util.function.Consumer;
|
||||||
public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, RenderLayerProvider, TagProvider, AddMineableShears, AddMineableHoe {
|
public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, RenderLayerProvider, TagProvider, AddMineableShears, AddMineableHoe {
|
||||||
protected final Block sapling;
|
protected final Block sapling;
|
||||||
|
|
||||||
|
public BaseLeavesBlock(
|
||||||
|
Block sapling,
|
||||||
|
BlockBehaviour.Properties properties
|
||||||
|
) {
|
||||||
|
super(properties);
|
||||||
|
this.sapling = sapling;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public BaseLeavesBlock(
|
public BaseLeavesBlock(
|
||||||
Block sapling,
|
Block sapling,
|
||||||
MapColor color,
|
MapColor color,
|
||||||
|
@ -46,6 +55,7 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider,
|
||||||
this.sapling = sapling;
|
this.sapling = sapling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public BaseLeavesBlock(
|
public BaseLeavesBlock(
|
||||||
Block sapling,
|
Block sapling,
|
||||||
MapColor color,
|
MapColor color,
|
||||||
|
@ -59,11 +69,13 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider,
|
||||||
this.sapling = sapling;
|
this.sapling = sapling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public BaseLeavesBlock(Block sapling, MapColor color) {
|
public BaseLeavesBlock(Block sapling, MapColor color) {
|
||||||
super(BehaviourBuilders.createLeaves(color, true));
|
super(BehaviourBuilders.createLeaves(color, true));
|
||||||
this.sapling = sapling;
|
this.sapling = sapling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated(forRemoval = true)
|
||||||
public BaseLeavesBlock(Block sapling, MapColor color, int light) {
|
public BaseLeavesBlock(Block sapling, MapColor color, int light) {
|
||||||
super(BehaviourBuilders.createLeaves(color, true).lightLevel(state -> light));
|
super(BehaviourBuilders.createLeaves(color, true).lightLevel(state -> light));
|
||||||
this.sapling = sapling;
|
this.sapling = sapling;
|
||||||
|
|
|
@ -79,6 +79,33 @@ public class BehaviourBuilders {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createCactus(MapColor color, boolean flammable) {
|
||||||
|
final BlockBehaviour.Properties p = BlockBehaviour.Properties
|
||||||
|
.of()
|
||||||
|
.mapColor(color)
|
||||||
|
.randomTicks()
|
||||||
|
.strength(0.4F)
|
||||||
|
.sound(SoundType.WOOL)
|
||||||
|
.pushReaction(PushReaction.DESTROY)
|
||||||
|
.noOcclusion();
|
||||||
|
if (flammable) {
|
||||||
|
p.ignitedByLava();
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createMetal() {
|
||||||
|
return createMetal(MapColor.METAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createMetal(MapColor color) {
|
||||||
|
return BlockBehaviour.Properties.of()
|
||||||
|
.mapColor(color)
|
||||||
|
.instrument(NoteBlockInstrument.IRON_XYLOPHONE)
|
||||||
|
.strength(5.0F, 6.0F)
|
||||||
|
.sound(SoundType.METAL);
|
||||||
|
}
|
||||||
|
|
||||||
public static BlockBehaviour.Properties createStone() {
|
public static BlockBehaviour.Properties createStone() {
|
||||||
return createStone(MapColor.STONE);
|
return createStone(MapColor.STONE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue