Class AbstractBlockHut<B extends AbstractBlockHut<B>>

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
All Implemented Interfaces:
com.ldtteam.structurize.blocks.interfaces.IAnchorBlock, com.ldtteam.structurize.blocks.interfaces.IInvisibleBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.ILeveledBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.IRequirementsBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.ISpecialCreativeHandlerAnchorBlock, IBlockMinecolonies<B>, IBuildingBrowsableBlock, ITickableBlockMinecolonies, IBuilderUndestroyable, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.block.EntityBlock, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeBlock
Direct Known Subclasses:
BlockHutAlchemist, BlockHutArchery, BlockHutBaker, BlockHutBarracks, BlockHutBarracksTower, BlockHutBeekeeper, BlockHutBlacksmith, BlockHutBuilder, BlockHutChickenHerder, BlockHutCitizen, BlockHutCombatAcademy, BlockHutComposter, BlockHutConcreteMixer, BlockHutCook, BlockHutCowboy, BlockHutCrusher, BlockHutDeliveryman, BlockHutDyer, BlockHutEnchanter, BlockHutFarmer, BlockHutFisherman, BlockHutFletcher, BlockHutFlorist, BlockHutGateHouse, BlockHutGlassblower, BlockHutGraveyard, BlockHutGuardTower, BlockHutHospital, BlockHutKitchen, BlockHutLibrary, BlockHutLumberjack, BlockHutMechanic, BlockHutMiner, BlockHutMysticalSite, BlockHutNetherWorker, BlockHutPlantation, BlockHutRabbitHutch, BlockHutSawmill, BlockHutSchool, BlockHutShepherd, BlockHutSifter, BlockHutSmeltery, BlockHutStable, BlockHutStonemason, BlockHutStoneSmeltery, BlockHutSwineHerder, BlockHutTavern, BlockHutTownHall, BlockHutUniversity, BlockHutWareHouse, LargeQuarry, MediumQuarry, SimpleQuarry

public abstract class AbstractBlockHut<B extends AbstractBlockHut<B>> extends AbstractColonyBlock<B> implements com.ldtteam.structurize.blocks.interfaces.IAnchorBlock, com.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.ILeveledBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.IRequirementsBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.IInvisibleBlueprintAnchorBlock, com.ldtteam.structurize.blocks.interfaces.ISpecialCreativeHandlerAnchorBlock, IBuildingBrowsableBlock
Base class for all Minecolonies Hut Blocks. Hut Blocks are the base blocks for Minecolonies buildings. Extending this class enables all the blueprint functionalities.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block

    net.minecraft.world.level.block.Block.BlockStatePairKey

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase, net.minecraft.world.level.block.state.BlockBehaviour.OffsetFunction, net.minecraft.world.level.block.state.BlockBehaviour.OffsetType, net.minecraft.world.level.block.state.BlockBehaviour.Properties, net.minecraft.world.level.block.state.BlockBehaviour.StateArgumentPredicate<A extends Object>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate
  • Field Summary

    Fields inherited from class com.minecolonies.api.blocks.AbstractColonyBlock

    FACING, HARDNESS, RESISTANCE

    Fields inherited from class net.minecraft.world.level.block.Block

    BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS

    Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for a hut block.
    AbstractBlockHut(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties)
    Constructor for a hut block.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    areRequirementsMet(net.minecraft.client.multiplayer.ClientLevel level, net.minecraft.core.BlockPos pos, net.minecraft.client.player.LocalPlayer player)
     
    boolean
    canPlaceAt(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
    Check if the block can be placed at the given position by the player.
    boolean
    Can this block be right-clicked without the appropriate permissions?
    net.minecraft.network.chat.Component
     
    Get the blueprint name.
    List<net.minecraft.network.chat.MutableComponent>
     
    int
    getLevel(net.minecraft.nbt.CompoundTag beData)
     
    List<net.minecraft.network.chat.MutableComponent>
    getRequirements(net.minecraft.client.multiplayer.ClientLevel level, net.minecraft.core.BlockPos pos, net.minecraft.client.player.LocalPlayer player)
     
    com.ldtteam.structurize.placement.structure.AbstractStructureHandler
    getStructureHandler(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.util.PlacementSettings placementSettings, boolean b)
     
    boolean
    isVisible(@Nullable net.minecraft.nbt.CompoundTag beData)
     
    void
    onBlockPlacedByBuildTool(@NotNull net.minecraft.world.level.Level worldIn, @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack, boolean mirror, String style, String blueprintPath)
    Event-Handler for placement of this block.
    void
    registerBlockItem(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties)
    Registery block at gameregistry.
    boolean
    setup(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.util.PlacementSettings settings, boolean fancyPlacement, String pack, String path)
     

    Methods inherited from class net.minecraft.world.level.block.Block

    animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf

    Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isSignalSource, mirror, neighborChanged, onPlace, onProjectileHit, randomTick, requiredFeatures, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, useShapeForLightOcclusion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.block.EntityBlock

    getListener

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods inherited from interface com.minecolonies.api.blocks.interfaces.IBuildingBrowsableBlock

    shouldBrowseBuildings

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock

    addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHiding

    Methods inherited from interface com.minecolonies.api.blocks.interfaces.ITickableBlockMinecolonies

    getTicker
  • Constructor Details

    • AbstractBlockHut

      public AbstractBlockHut()
      Constructor for a hut block.

      Registers the block, sets the creative tab, as well as the resistance and the hardness.

    • AbstractBlockHut

      public AbstractBlockHut(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties)
      Constructor for a hut block.

      Registers the block, sets the creative tab, as well as the resistance and the hardness.

      Parameters:
      properties - custom properties.
  • Method Details

    • onBlockPlacedByBuildTool

      public void onBlockPlacedByBuildTool(@NotNull @NotNull net.minecraft.world.level.Level worldIn, @NotNull @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack, boolean mirror, String style, String blueprintPath)
      Event-Handler for placement of this block.

      Override for custom logic.

      Parameters:
      worldIn - the word we are in.
      pos - the position where the block was placed.
      state - the state the placed block is in.
      placer - the player placing the block.
      stack - the itemstack from where the block was placed.
      mirror - the mirror used.
      style - the style of the building
    • isVisible

      public boolean isVisible(@Nullable @Nullable net.minecraft.nbt.CompoundTag beData)
      Specified by:
      isVisible in interface com.ldtteam.structurize.blocks.interfaces.IInvisibleBlueprintAnchorBlock
    • getRequirements

      public List<net.minecraft.network.chat.MutableComponent> getRequirements(net.minecraft.client.multiplayer.ClientLevel level, net.minecraft.core.BlockPos pos, net.minecraft.client.player.LocalPlayer player)
      Specified by:
      getRequirements in interface com.ldtteam.structurize.blocks.interfaces.IRequirementsBlueprintAnchorBlock
    • areRequirementsMet

      public boolean areRequirementsMet(net.minecraft.client.multiplayer.ClientLevel level, net.minecraft.core.BlockPos pos, net.minecraft.client.player.LocalPlayer player)
      Specified by:
      areRequirementsMet in interface com.ldtteam.structurize.blocks.interfaces.IRequirementsBlueprintAnchorBlock
    • getDesc

      public List<net.minecraft.network.chat.MutableComponent> getDesc()
      Specified by:
      getDesc in interface com.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock
    • getBlueprintDisplayName

      public net.minecraft.network.chat.Component getBlueprintDisplayName()
      Specified by:
      getBlueprintDisplayName in interface com.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock
    • getLevel

      public int getLevel(net.minecraft.nbt.CompoundTag beData)
      Specified by:
      getLevel in interface com.ldtteam.structurize.blocks.interfaces.ILeveledBlueprintAnchorBlock
    • getStructureHandler

      public com.ldtteam.structurize.placement.structure.AbstractStructureHandler getStructureHandler(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.util.PlacementSettings placementSettings, boolean b)
      Specified by:
      getStructureHandler in interface com.ldtteam.structurize.blocks.interfaces.ISpecialCreativeHandlerAnchorBlock
    • setup

      public boolean setup(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.util.PlacementSettings settings, boolean fancyPlacement, String pack, String path)
      Specified by:
      setup in interface com.ldtteam.structurize.blocks.interfaces.ISpecialCreativeHandlerAnchorBlock
    • getBlueprintName

      public String getBlueprintName()
      Get the blueprint name.
      Returns:
      the name.
    • registerBlockItem

      public void registerBlockItem(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties)
      Description copied from interface: IBlockMinecolonies
      Registery block at gameregistry.
      Specified by:
      registerBlockItem in interface IBlockMinecolonies<B extends AbstractBlockHut<B>>
      Overrides:
      registerBlockItem in class AbstractColonyBlock<B extends AbstractBlockHut<B>>
      Parameters:
      registry - the registry to use.
      properties - the item properties.
    • canRightClickWithoutPermissions

      public boolean canRightClickWithoutPermissions()
      Can this block be right-clicked without the appropriate permissions?
      Returns:
      true if so. Default false.
    • canPlaceAt

      public boolean canPlaceAt(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Check if the block can be placed at the given position by the player.
      Parameters:
      pos - the position to check.
      player - the player trying to place the block.
      Returns:
      true if the block can be placed.