From b3263fdb9879c99ecbc194f55eee5b17759fc930 Mon Sep 17 00:00:00 2001 From: karkzy Date: Fri, 2 Apr 2021 21:18:07 -0500 Subject: [PATCH] added BlockType so you can set type=bottom|top|double --- Minecraft/Command.hs | 2 ++ Minecraft/Core.hs | 13 +++++++++++++ minecraft-data.cabal | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Minecraft/Command.hs b/Minecraft/Command.hs index eb243a8..91bd471 100644 --- a/Minecraft/Command.hs +++ b/Minecraft/Command.hs @@ -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 diff --git a/Minecraft/Core.hs b/Minecraft/Core.hs index 92baf6a..f38625d 100644 --- a/Minecraft/Core.hs +++ b/Minecraft/Core.hs @@ -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 diff --git a/minecraft-data.cabal b/minecraft-data.cabal index 0a2b303..e766575 100644 --- a/minecraft-data.cabal +++ b/minecraft-data.cabal @@ -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,