[Feature] Added BehaviourBuilders
This commit is contained in:
parent
e66adaf187
commit
b5ceb0defe
2 changed files with 80 additions and 0 deletions
|
@ -0,0 +1,76 @@
|
||||||
|
package org.betterx.bclib.complexmaterials;
|
||||||
|
|
||||||
|
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.material.Material;
|
||||||
|
import net.minecraft.world.level.material.MaterialColor;
|
||||||
|
|
||||||
|
public class BehaviourBuilders {
|
||||||
|
public static BlockBehaviour.Properties createPlant() {
|
||||||
|
return BlockBehaviour.Properties.of(Material.PLANT)
|
||||||
|
.color(MaterialColor.PLANT)
|
||||||
|
.noCollission()
|
||||||
|
.instabreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createTickingPlant() {
|
||||||
|
return createPlant().randomTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createReplaceablePlant() {
|
||||||
|
return BlockBehaviour.Properties.of(Material.REPLACEABLE_PLANT)
|
||||||
|
.color(MaterialColor.PLANT)
|
||||||
|
.noCollission()
|
||||||
|
.instabreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createWaterPlant() {
|
||||||
|
return BlockBehaviour.Properties.of(Material.WATER_PLANT)
|
||||||
|
.noCollission()
|
||||||
|
.instabreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createReplaceableWaterPlant() {
|
||||||
|
return BlockBehaviour.Properties.of(Material.REPLACEABLE_WATER_PLANT)
|
||||||
|
.noCollission()
|
||||||
|
.instabreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createLeaves() {
|
||||||
|
return createLeaves(MaterialColor.PLANT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createLeaves(MaterialColor color) {
|
||||||
|
return BlockBehaviour.Properties.of(Material.LEAVES)
|
||||||
|
.color(color)
|
||||||
|
.strength(0.2f)
|
||||||
|
.randomTicks()
|
||||||
|
.noOcclusion()
|
||||||
|
.isValidSpawn(Blocks::ocelotOrParrot)
|
||||||
|
.isSuffocating(Blocks::never)
|
||||||
|
.isViewBlocking(Blocks::never)
|
||||||
|
.isRedstoneConductor(Blocks::never);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createStone() {
|
||||||
|
return createStone(MaterialColor.STONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createStone(MaterialColor color) {
|
||||||
|
return BlockBehaviour.Properties.of(Material.STONE)
|
||||||
|
.color(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createSign(MaterialColor color) {
|
||||||
|
return BlockBehaviour.Properties.of(Material.WOOD)
|
||||||
|
.color(color)
|
||||||
|
.noCollission()
|
||||||
|
.strength(1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockBehaviour.Properties createWallSign(MaterialColor color, Block dropBlock) {
|
||||||
|
return createSign(color).dropsLike(dropBlock);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,6 +29,10 @@ accessible method net/minecraft/world/level/levelgen/NoiseRouterData slideNether
|
||||||
accessible method net/minecraft/tags/TagEntry elementOrTag ()Lnet/minecraft/util/ExtraCodecs$TagOrElementLocation;
|
accessible method net/minecraft/tags/TagEntry elementOrTag ()Lnet/minecraft/util/ExtraCodecs$TagOrElementLocation;
|
||||||
accessible method net/minecraft/data/worldgen/biome/OverworldBiomes calculateSkyColor (F)I
|
accessible method net/minecraft/data/worldgen/biome/OverworldBiomes calculateSkyColor (F)I
|
||||||
accessible method net/minecraft/advancements/Advancement$Builder <init> (Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/advancements/DisplayInfo;Lnet/minecraft/advancements/AdvancementRewards;Ljava/util/Map;[[Ljava/lang/String;)V
|
accessible method net/minecraft/advancements/Advancement$Builder <init> (Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/advancements/DisplayInfo;Lnet/minecraft/advancements/AdvancementRewards;Ljava/util/Map;[[Ljava/lang/String;)V
|
||||||
|
accessible method net/minecraft/world/level/block/Blocks ocelotOrParrot (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/EntityType;)Ljava/lang/Boolean;
|
||||||
|
accessible method net/minecraft/world/level/block/Blocks never (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/EntityType;)Ljava/lang/Boolean;
|
||||||
|
accessible method net/minecraft/world/level/block/Blocks never (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)Z
|
||||||
|
|
||||||
|
|
||||||
#Fields
|
#Fields
|
||||||
accessible field net/minecraft/world/entity/ai/village/poi/PoiTypes TYPE_BY_STATE Ljava/util/Map;
|
accessible field net/minecraft/world/entity/ai/village/poi/PoiTypes TYPE_BY_STATE Ljava/util/Map;
|
Loading…
Add table
Add a link
Reference in a new issue