|
25 | 25 | package org.spongepowered.api.world; |
26 | 26 |
|
27 | 27 | import org.spongepowered.api.block.BlockTypes; |
| 28 | +import org.spongepowered.api.block.entity.BlockEntity; |
| 29 | +import org.spongepowered.api.block.entity.carrier.chest.Chest; |
28 | 30 |
|
29 | 31 | /** |
30 | 32 | * A flag of sorts that determines whether a block change will perform various |
@@ -103,7 +105,7 @@ public interface BlockChangeFlag { |
103 | 105 | /** |
104 | 106 | * Gets whether this flag is considering that blocks are being moved |
105 | 107 | * in the world, much like how pistons will move blocks. This has some |
106 | | - * effect on {@link org.spongepowered.api.block.entity.BlockEntity} creation |
| 108 | + * effect on {@link BlockEntity} creation |
107 | 109 | * reaction or drop delays. The behaviors are dependent on the block in |
108 | 110 | * particular. |
109 | 111 | * |
@@ -133,6 +135,16 @@ public interface BlockChangeFlag { |
133 | 135 | */ |
134 | 136 | boolean ignoreRender(); |
135 | 137 |
|
| 138 | + /** |
| 139 | + * Gets whether the block change is during a structure placement, which |
| 140 | + * disables certain {@link BlockEntity} behaviors like {@link Chest} dropping |
| 141 | + * items during a break. This can take place during the growth of a tree, |
| 142 | + * a piston moving, or other similar actions. |
| 143 | + * |
| 144 | + * @return True if the block change is during a structure placement. |
| 145 | + */ |
| 146 | + boolean structurePlacement(); |
| 147 | + |
136 | 148 | /** |
137 | 149 | * Gets the equivalent {@link BlockChangeFlag} of this flag with all |
138 | 150 | * other flags while having the desired {@code updateNeighbors} |
@@ -185,6 +197,8 @@ public interface BlockChangeFlag { |
185 | 197 |
|
186 | 198 | BlockChangeFlag withForcedReRender(boolean forcedReRender); |
187 | 199 |
|
| 200 | + BlockChangeFlag withStructurePlacement(boolean structurePlacement); |
| 201 | + |
188 | 202 | /** |
189 | 203 | * Gets the inverted {@link BlockChangeFlag} of this flag. |
190 | 204 | * Normally, this may cancel out certain interactions, such |
|
0 commit comments