Download Piston API — Minecraft Mods — MetaMods

Piston API

Active

Downloads

0

Last update

1 year ago

Versions

1.12.2
Client and server
Forge
Game mechanics
Libraries
Utils

Piston API

A small mod for fine-tuning piston interactions!


Main API Features:

Advanced block behavior settings with pistons Piston API allows blocks to interact with pistons taking into account their position and the surrounding world! Mainly concerning block movability and their stickiness. IPushableBehavior Interface: Adds the getPushReaction method, which takes block and piston information and returns EnumPushReaction. Blocks should implement this interface for complex push reaction logic. This interface overrides the standard getPushReaction(IBlockState) method, and blocks without the interface use basic logic. Groovyscript Examples: groovy import static git.jbredwards.piston_api.mod.asm.PushReactionHandler.overridePushReaction import net.minecraft.block.material.EnumPushReaction //makes dirt destructible by pistons when pushed overridePushReaction(block('minecraft:dirt'), EnumPushReaction.DESTROY) //makes orange wool immovable for pistons overridePushReaction(block('minecraft:wool'), {source, pistonInfo -> orangeWool == source.getBlockState() ? EnumPushReaction.BLOCK : EnumPushReaction.NORMAL}) IStickyBehavior Interface: Adds two methods: getStickReaction (checks stickiness between blocks) and hasStickySide (determines the presence of sticky sides). Blocks with advanced stickiness logic should implement this interface. Stickiness Configuration Examples: groovy import static git.jbredwards.piston_api.mod.asm.StickReactionHandler.overrideStickReaction import git.jbredwards.piston_api.api.piston.EnumStickReaction //removes stickiness from slime blocks overrideStickReaction(block('minecraft:slime'), EnumStickReaction.PASS) //makes crafting tables sticky overrideStickReaction(block('minecraft:crafting_table'), EnumStickReaction.STICK)

Key Features:

  • Configurable piston push limit
  • Moving blocks with data using pistons
  • Preserving fluids during piston operation (with Fluidlogged API installed)
  • Compatibility with Quark mod

Additional Capabilities:

  • Modifying existing piston interactions
  • Chests sticking together when moved
  • Block breaking sounds and particles when destroyed by pistons

This mod will not be updated for new versions

Project members
jbredwards

jbredwards

Developer

Created: 18 Jun 2023

ID: 16023