Class DynamicTreeCompat
java.lang.Object
com.minecolonies.api.compatibility.dynamictrees.DynamicTreeProxy
com.minecolonies.api.compatibility.dynamictrees.DynamicTreeCompat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckForDynamicLeavesBlock(net.minecraft.world.level.block.Block block) Check whether the block is a dynamic leafbooleancheckForDynamicSapling(@NotNull net.minecraft.world.item.Item item) Check whether the item is a dynamic SaplingbooleancheckForDynamicTreeBlock(@NotNull net.minecraft.world.level.block.Block block) Check whether the block is part of a dynamic TreebooleancheckForDynamicTrunkShellBlock(net.minecraft.world.level.block.Block block) Check whether the block is a shell block.net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getDropsForLeaf(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockstate, int fortune, net.minecraft.world.level.block.Block leaf) Returns drops of a dynamic seed as ListgetTreeBreakActionCompat(@NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos blockToBreak, net.minecraft.world.item.ItemStack toolToUse, net.minecraft.core.BlockPos workerPos) Creates a runnable to harvest/break a dynamic treebooleanhasFittingTreeFamilyCompat(@NotNull net.minecraft.core.BlockPos block1, @NotNull net.minecraft.core.BlockPos block2, @NotNull net.minecraft.world.level.LevelAccessor world) Method to check if two given blocks have the same Tree familybooleanCheck whether dynamic tree's mod is presentbooleanplantDynamicSaplingCompat(@NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos location, @NotNull net.minecraft.world.item.ItemStack saplingStack) Tries to plant a sapling at the given location
-
Constructor Details
-
DynamicTreeCompat
public DynamicTreeCompat()
-
-
Method Details
-
isDynamicTreePresent
public boolean isDynamicTreePresent()Check whether dynamic tree's mod is present- Overrides:
isDynamicTreePresentin classDynamicTreeProxy- Returns:
- true
-
checkForDynamicTreeBlock
public boolean checkForDynamicTreeBlock(@NotNull @NotNull net.minecraft.world.level.block.Block block) Check whether the block is part of a dynamic Tree- Overrides:
checkForDynamicTreeBlockin classDynamicTreeProxy- Parameters:
block- Block to check- Returns:
- false
-
checkForDynamicLeavesBlock
public boolean checkForDynamicLeavesBlock(net.minecraft.world.level.block.Block block) Check whether the block is a dynamic leaf- Overrides:
checkForDynamicLeavesBlockin classDynamicTreeProxy- Parameters:
block- Block to check- Returns:
- false
-
checkForDynamicTrunkShellBlock
public boolean checkForDynamicTrunkShellBlock(net.minecraft.world.level.block.Block block) Check whether the block is a shell block.- Overrides:
checkForDynamicTrunkShellBlockin classDynamicTreeProxy- Parameters:
block- the block to check- Returns:
- true if it is a shell block.
-
getDropsForLeaf
public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getDropsForLeaf(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockstate, int fortune, net.minecraft.world.level.block.Block leaf) Returns drops of a dynamic seed as List- Overrides:
getDropsForLeafin classDynamicTreeProxy- Parameters:
world- world the Leaf is inpos- position of the Leafblockstate- Blockstate of the Leaffortune- amount of fortune to useleaf- The leaf to check- Returns:
NonNullListofItemStackDrops
-
checkForDynamicSapling
public boolean checkForDynamicSapling(@NotNull @NotNull net.minecraft.world.item.Item item) Check whether the item is a dynamic Sapling- Overrides:
checkForDynamicSaplingin classDynamicTreeProxy- Parameters:
item- Item to check- Returns:
- false
-
getTreeBreakActionCompat
public Runnable getTreeBreakActionCompat(@NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos blockToBreak, net.minecraft.world.item.ItemStack toolToUse, net.minecraft.core.BlockPos workerPos) Creates a runnable to harvest/break a dynamic tree- Overrides:
getTreeBreakActionCompatin classDynamicTreeProxy- Parameters:
world- The world the tree is inblockToBreak- The block of the dynamic treetoolToUse- The tool to break the tree with, optionalworkerPos- The position the fakeplayer breaks the tree from, optional- Returns:
- Runnable to break the Tree
-
plantDynamicSaplingCompat
public boolean plantDynamicSaplingCompat(@NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos location, @NotNull @NotNull net.minecraft.world.item.ItemStack saplingStack) Tries to plant a sapling at the given location- Overrides:
plantDynamicSaplingCompatin classDynamicTreeProxy- Parameters:
world- World to plant the sapling inlocation- location to plant the saplingsaplingStack- Itemstack of the sapling- Returns:
- true if successful
-
hasFittingTreeFamilyCompat
public boolean hasFittingTreeFamilyCompat(@NotNull @NotNull net.minecraft.core.BlockPos block1, @NotNull @NotNull net.minecraft.core.BlockPos block2, @NotNull @NotNull net.minecraft.world.level.LevelAccessor world) Method to check if two given blocks have the same Tree family- Overrides:
hasFittingTreeFamilyCompatin classDynamicTreeProxy- Parameters:
block1- First blockpos to compareblock2- Second blockpos to compareworld- the world it is in.- Returns:
- true when same family
-