Class DynamicTreeCompat

java.lang.Object
com.minecolonies.api.compatibility.dynamictrees.DynamicTreeProxy
com.minecolonies.api.compatibility.dynamictrees.DynamicTreeCompat

public final class DynamicTreeCompat extends DynamicTreeProxy
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkForDynamicLeavesBlock(net.minecraft.world.level.block.Block block)
    Check whether the block is a dynamic leaf
    boolean
    checkForDynamicSapling(@NotNull net.minecraft.world.item.Item item)
    Check whether the item is a dynamic Sapling
    boolean
    checkForDynamicTreeBlock(@NotNull net.minecraft.world.level.block.Block block)
    Check whether the block is part of a dynamic Tree
    boolean
    checkForDynamicTrunkShellBlock(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 List
    net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType>
    Returns the damageType string falling dynamic Tree's use
    getTreeBreakActionCompat(@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 tree
    boolean
    hasFittingTreeFamilyCompat(@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 family
    boolean
    Check whether dynamic tree's mod is present
    boolean
    plantDynamicSaplingCompat(@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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DynamicTreeCompat

      public DynamicTreeCompat()
  • Method Details

    • isDynamicTreePresent

      public boolean isDynamicTreePresent()
      Check whether dynamic tree's mod is present
      Overrides:
      isDynamicTreePresent in class DynamicTreeProxy
      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:
      checkForDynamicTreeBlock in class DynamicTreeProxy
      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:
      checkForDynamicLeavesBlock in class DynamicTreeProxy
      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:
      checkForDynamicTrunkShellBlock in class DynamicTreeProxy
      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:
      getDropsForLeaf in class DynamicTreeProxy
      Parameters:
      world - world the Leaf is in
      pos - position of the Leaf
      blockstate - Blockstate of the Leaf
      fortune - amount of fortune to use
      leaf - The leaf to check
      Returns:
      NonNullList of ItemStack Drops
    • checkForDynamicSapling

      public boolean checkForDynamicSapling(@NotNull @NotNull net.minecraft.world.item.Item item)
      Check whether the item is a dynamic Sapling
      Overrides:
      checkForDynamicSapling in class DynamicTreeProxy
      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:
      getTreeBreakActionCompat in class DynamicTreeProxy
      Parameters:
      world - The world the tree is in
      blockToBreak - The block of the dynamic tree
      toolToUse - The tool to break the tree with, optional
      workerPos - 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:
      plantDynamicSaplingCompat in class DynamicTreeProxy
      Parameters:
      world - World to plant the sapling in
      location - location to plant the sapling
      saplingStack - Itemstack of the sapling
      Returns:
      true if successful
    • getDynamicTreeDamage

      public net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> getDynamicTreeDamage()
      Returns the damageType string falling dynamic Tree's use
      Overrides:
      getDynamicTreeDamage in class DynamicTreeProxy
      Returns:
      damageType
    • 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:
      hasFittingTreeFamilyCompat in class DynamicTreeProxy
      Parameters:
      block1 - First blockpos to compare
      block2 - Second blockpos to compare
      world - the world it is in.
      Returns:
      true when same family