Package com.minecolonies.api.blocks
Class AbstractBlockHut<B extends AbstractBlockHut<B>>
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
com.minecolonies.api.blocks.AbstractBlockMinecolonies<B>
com.minecolonies.api.blocks.AbstractColonyBlock<B>
com.minecolonies.api.blocks.AbstractBlockHut<B>
- 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.neoforged.neoforge.common.extensions.IBlockExtension
- 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.BlockStatePairKeyNested 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>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate -
Field Summary
Fields inherited from class com.minecolonies.api.blocks.AbstractColonyBlock
FACING, HARDNESS, RESISTANCEFields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, CODEC, 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_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a hut block.AbstractBlockHut(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties) Constructor for a hut block. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendHoverText(@NotNull net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext context, @NotNull List<net.minecraft.network.chat.Component> tooltip, @NotNull net.minecraft.world.item.TooltipFlag flags) booleanareRequirementsMet(net.minecraft.client.multiplayer.ClientLevel level, net.minecraft.core.BlockPos pos, net.minecraft.client.player.LocalPlayer player) booleancanPlaceAt(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.booleanCan this block be right-clicked without the appropriate permissions?net.minecraft.network.chat.ComponentGet the blueprint name.List<net.minecraft.network.chat.MutableComponent> getDesc()intgetLevel(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.AbstractStructureHandlergetStructureHandler(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos, com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, com.ldtteam.structurize.api.RotationMirror rotationMirror, boolean b) booleanisVisible(@Nullable net.minecraft.nbt.CompoundTag beData) voidonBlockPlacedByBuildTool(@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, com.ldtteam.structurize.api.RotationMirror rotMir, String style, String blueprintPath) Event-Handler for placement of this block.voidregisterBlockItem(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties) Registery block at gameregistry.booleansetup(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.api.RotationMirror rotationMirror, boolean fancyPlacement, String pack, String path) Methods inherited from class com.minecolonies.api.blocks.AbstractColonyBlock
createBlockStateDefinition, getBuildingEntry, getDestroyProgress, getHutName, getRegistryName, getShape, getStateForPlacement, newBlockEntity, onRemove, registerBlock, rotate, setPlacedBy, useItemOnMethods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, codec, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods 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, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isRandomlyTicking, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, useShapeForLightOcclusion, useWithoutItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListenerMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHidingMethods inherited from interface com.minecolonies.api.blocks.interfaces.IBuildingBrowsableBlock
shouldBrowseBuildingsMethods 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, com.ldtteam.structurize.api.RotationMirror rotMir, 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.rotMir- the mirror used.style- the style of the building
-
isVisible
public boolean isVisible(@Nullable @Nullable net.minecraft.nbt.CompoundTag beData) - Specified by:
isVisiblein interfacecom.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:
getRequirementsin interfacecom.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:
areRequirementsMetin interfacecom.ldtteam.structurize.blocks.interfaces.IRequirementsBlueprintAnchorBlock
-
getDesc
- Specified by:
getDescin interfacecom.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock
-
getBlueprintDisplayName
public net.minecraft.network.chat.Component getBlueprintDisplayName()- Specified by:
getBlueprintDisplayNamein interfacecom.ldtteam.structurize.blocks.interfaces.INamedBlueprintAnchorBlock
-
getLevel
public int getLevel(net.minecraft.nbt.CompoundTag beData) - Specified by:
getLevelin interfacecom.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.api.RotationMirror rotationMirror, boolean b) - Specified by:
getStructureHandlerin interfacecom.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.api.RotationMirror rotationMirror, boolean fancyPlacement, String pack, String path) - Specified by:
setupin interfacecom.ldtteam.structurize.blocks.interfaces.ISpecialCreativeHandlerAnchorBlock
-
getBlueprintName
Get the blueprint name.- Returns:
- the name.
-
appendHoverText
public void appendHoverText(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.item.Item.TooltipContext context, @NotNull @NotNull List<net.minecraft.network.chat.Component> tooltip, @NotNull @NotNull net.minecraft.world.item.TooltipFlag flags) - Overrides:
appendHoverTextin classnet.minecraft.world.level.block.Block
-
registerBlockItem
public void registerBlockItem(net.minecraft.core.Registry<net.minecraft.world.item.Item> registry, net.minecraft.world.item.Item.Properties properties) Description copied from interface:IBlockMinecoloniesRegistery block at gameregistry.- Specified by:
registerBlockItemin interfaceIBlockMinecolonies<B extends AbstractBlockHut<B>>- Overrides:
registerBlockItemin classAbstractBlockMinecolonies<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.
-