File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
engine/src/main/java/org/terasology/world/block/family Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 3737 */
3838@ RegisterBlockFamily ("freeform" )
3939@ FreeFormSupported (true )
40- public class FreeformFamily extends AbstractBlockFamily {
40+ public class FreeformFamily extends AbstractBlockFamily implements SideDefinedBlockFamily {
4141 private static final Logger logger = LoggerFactory .getLogger (FreeformFamily .class );
4242
4343 private Map <Side , Block > blocks = Maps .newEnumMap (Side .class );
@@ -124,4 +124,23 @@ public Iterable<Block> getBlocks() {
124124 return Arrays .asList (archetypeBlock );
125125 }
126126
127+ @ Override
128+ public Block getBlockForSide (Side side ) {
129+ if (archetypeBlock == null ) {
130+ return blocks .get (side );
131+ }
132+ return archetypeBlock ;
133+ }
134+
135+ @ Override
136+ public Side getSide (Block block ) {
137+ if (archetypeBlock == null ) {
138+ for (Map .Entry <Side , Block > sideBlockEntry : blocks .entrySet ()) {
139+ if (block == sideBlockEntry .getValue ()) {
140+ return sideBlockEntry .getKey ();
141+ }
142+ }
143+ }
144+ return archetypeBlock .getDirection ();
145+ }
127146}
Original file line number Diff line number Diff line change 4646 * - Fence
4747 */
4848public abstract class MultiConnectFamily extends AbstractBlockFamily implements UpdatesWithNeighboursFamily {
49- private static final Logger logger = LoggerFactory .getLogger (FreeformFamily .class );
49+ private static final Logger logger = LoggerFactory .getLogger (MultiConnectFamily .class );
5050
5151 @ In
5252 protected WorldProvider worldProvider ;
You can’t perform that action at this time.
0 commit comments