-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reduced blockstates of storage blocks to 10 unique states
- Loading branch information
Showing
3 changed files
with
99 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/io/fabricatedatelier/mayor/block/MayorProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.fabricatedatelier.mayor.block; | ||
|
||
import net.minecraft.state.property.EnumProperty; | ||
import net.minecraft.util.StringIdentifiable; | ||
import net.minecraft.util.math.Direction; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
|
||
public class MayorProperties { | ||
public static final EnumProperty<Position> POSITION = EnumProperty.of("position", Position.class); | ||
|
||
|
||
public enum Position implements StringIdentifiable { | ||
NORTH("north", Direction.EAST, Direction.SOUTH, Direction.WEST), | ||
EAST("east", Direction.NORTH, Direction.SOUTH, Direction.WEST), | ||
SOUTH("south", Direction.NORTH, Direction.EAST, Direction.WEST), | ||
WEST("west", Direction.NORTH, Direction.EAST, Direction.SOUTH), | ||
NORTH_EAST("north_east", Direction.WEST, Direction.SOUTH), | ||
NORTH_WEST("north_west", Direction.EAST, Direction.SOUTH), | ||
SOUTH_EAST("south_east", Direction.NORTH, Direction.WEST), | ||
SOUTH_WEST("south_west", Direction.EAST, Direction.NORTH), | ||
SINGLE("single"), | ||
CENTER("center", Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST); | ||
|
||
private final String name; | ||
private final HashSet<Direction> connectedDirections; | ||
|
||
Position(String name, Direction... involvedPositions) { | ||
this.name = name; | ||
this.connectedDirections = new HashSet<>(Arrays.asList(involvedPositions)); | ||
} | ||
|
||
@Override | ||
public String asString() { | ||
return name; | ||
} | ||
|
||
public HashSet<Direction> getConnectedDirections() { | ||
return connectedDirections; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters