Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added BlockType so you can set type=bottom|top|double #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Minecraft/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ data OldBlockHandling

data DataValue
= Facing CardinalDirection
| BlockType BlockType
deriving (Eq, Ord, Read, Show)

instance Render DataValue where
render (Facing dir) = "facing=" <> render dir
render (BlockType bt) = "type=" <> render bt

instance Render [DataValue] where
render [] = mempty
Expand Down
13 changes: 13 additions & 0 deletions Minecraft/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,25 @@ data CardinalDirection
deriving (Eq, Ord, Read, Show)
makeLenses ''CardinalDirection

data BlockType
= Bottom
| Double
| Top
deriving (Eq, Ord, Read, Show)
makeLenses ''BlockType

instance Render CardinalDirection where
render North = "north"
render East = "east"
render South = "south"
render West = "west"

instance Render BlockType where
render Bottom = "bottom"
render Double = "double"
render Top = "top"


ab :: Int32 -> Pos
ab = Pos Abs

Expand Down
2 changes: 1 addition & 1 deletion minecraft-data.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ library
Minecraft.Player
other-extensions: DeriveDataTypeable, DeriveGeneric, OverloadedStrings
build-depends: array,
base >=4.8 && <4.15,
base >=4.8 && <4.16,
bimap,
bytestring,
containers,
Expand Down