diff options
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/scripts/init.lua | 36 | ||||
-rw-r--r-- | cwd/assets/altcraft/scripts/ui.lua | 30 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/chat-styles.rcss | 62 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/chat.rml | 16 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/hud.rml | 7 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/loading-styles.rcss | 9 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/loading.rml | 11 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/respawn-styles.rcss | 24 | ||||
-rw-r--r-- | cwd/assets/altcraft/ui/respawn.rml | 12 | ||||
-rw-r--r-- | cwd/items.json | 4298 | ||||
-rw-r--r-- | src/AssetManager.cpp | 26 | ||||
-rw-r--r-- | src/AssetManager.hpp | 2 | ||||
-rw-r--r-- | src/DebugInfo.cpp | 3 | ||||
-rw-r--r-- | src/DebugInfo.hpp | 3 | ||||
-rw-r--r-- | src/Game.hpp | 1 | ||||
-rw-r--r-- | src/GameState.cpp | 20 | ||||
-rw-r--r-- | src/GameState.hpp | 4 | ||||
-rw-r--r-- | src/Plugin.cpp | 52 | ||||
-rw-r--r-- | src/Plugin.hpp | 3 | ||||
-rw-r--r-- | src/Render.cpp | 41 | ||||
-rw-r--r-- | src/Render.hpp | 2 | ||||
-rw-r--r-- | src/RendererWorld.cpp | 2 | ||||
-rw-r--r-- | src/RendererWorld.hpp | 3 | ||||
-rw-r--r-- | src/Rml.cpp | 10 | ||||
-rw-r--r-- | src/Rml.hpp | 1 |
25 files changed, 323 insertions, 4355 deletions
diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua index 790bab0..b60a988 100644 --- a/cwd/assets/altcraft/scripts/init.lua +++ b/cwd/assets/altcraft/scripts/init.lua @@ -6,6 +6,7 @@ local plugin = { onChangeState = nil, onTick = nil, onRequestBlockInfo = nil, + onChatMessage = nil, } function plugin.onLoad () @@ -15,6 +16,9 @@ function plugin.onLoad () con:LoadDocument("altcraft/ui/hud") con:LoadDocument("altcraft/ui/pause") con:LoadDocument("altcraft/ui/options") + con:LoadDocument("altcraft/ui/loading") + con:LoadDocument("altcraft/ui/respawn") + con:LoadDocument("altcraft/ui/chat") uiMainMenu:Show() AC.Settings.Load() @@ -70,9 +74,39 @@ function plugin.onRequestBlockInfo(blockPos) return blocks.GetBlockInfo(blockPos) end +function plugin.onChatMessage(chat, pos) + local chatDoc = {} + for i,d in ipairs(rmlui.contexts["default"].documents) do + if d.title == "Chat" then + chatDoc = d + end + end + + local msg = chat:ToPlainText() + msg = string.gsub(msg,'&','&') + msg = string.gsub(msg,'<','<') + msg = string.gsub(msg,'>','>') + msg = string.gsub(msg,'""','"') + msg = string.gsub(msg,"''",''') + + local color = "" + if pos == 0 then + color = "" + elseif pos == 1 then + color = 'style="color: #BBBBBB"' + elseif pos == 2 then + color = 'style="color: maroon"' + else + color = 'style="color: navy"' + end + + chatDoc:GetElementById('chat').inner_rml = chatDoc:GetElementById('chat').inner_rml .. string.format('<p class="chat-msg" %s>%s</p>', color, msg) + MoveChatToBottom = true +end + AC.RegisterDimension(0, Dimension.new("overworld", true)) AC.RegisterDimension(-1, Dimension.new("the_nether", false)) AC.RegisterDimension(1, Dimension.new("the_end", false)) AC.RegisterPlugin(plugin) -plugin = nil
\ No newline at end of file +plugin = nil diff --git a/cwd/assets/altcraft/scripts/ui.lua b/cwd/assets/altcraft/scripts/ui.lua index 392ad27..b938737 100644 --- a/cwd/assets/altcraft/scripts/ui.lua +++ b/cwd/assets/altcraft/scripts/ui.lua @@ -53,6 +53,16 @@ function ConnectToServer(doc) doc:GetElementById('username'):GetAttribute('value')) end +function SendChatMessage(doc) + local msg = doc:GetElementById("chat-input"):GetAttribute("value") + if msg == nil then + return + end + doc:GetElementById("chat-input"):SetAttribute("value", "") + + AC.SendChatMessage(msg) +end + function OptionsDefaultHandler(event) local input = event.current_element.previous_sibling local id = input:GetAttribute("id") @@ -85,14 +95,21 @@ end function UpdateUi() local doc = {} local uiDoc = {} + local chatDoc = {} for i,d in ipairs(rmlui.contexts["default"].documents) do if d.title == "Playing" then doc = d elseif d.title == "Options" then uiDoc = d + elseif d.title == "Chat" then + chatDoc = d end end + if MoveChatToBottom ~= nil and MoveChatToBottom == true then + chatDoc:GetElementById('chat').scroll_top = chatDoc:GetElementById('chat').scroll_height + end + if AC.GetGameState() and AC.GetGameState():GetPlayer() and AC.GetGameState():GetTimeStatus().worldAge > 0 then local time = AC.GetTime() local rawFps = 1.0 / time:GetRealDeltaS() @@ -106,13 +123,26 @@ function UpdateUi() local selection = AC.GetGameState():GetSelectionStatus() if selection.isBlockSelected then bid = wrld:GetBlockId(selection.selectedBlock) + binfo = AC.GetBlockInfo(bid) + light = wrld:GetBlockLight(selection.selectedBlock) + skyLight = wrld:GetBlockSkyLight(selection.selectedBlock) doc:GetElementById('dbg-select-pos').inner_rml = tostring(selection.selectedBlock) doc:GetElementById('dbg-select-bid').inner_rml = string.format("%d:%d", bid.id, bid.state) + doc:GetElementById('dbg-select-name').inner_rml = string.format("%s:%s", binfo.blockstate, binfo.variant) + doc:GetElementById('dbg-select-light').inner_rml = string.format("%d:%d", light, skyLight) else doc:GetElementById('dbg-select-pos').inner_rml = "" doc:GetElementById('dbg-select-bid').inner_rml = "" + doc:GetElementById('dbg-select-name').inner_rml = "" + doc:GetElementById('dbg-select-light').inner_rml = "" end + doc:GetElementById('dbg-sections-loaded').inner_rml = AC.GetDebugValue(0) + doc:GetElementById('dbg-sections-renderer').inner_rml = AC.GetDebugValue(1) + doc:GetElementById('dbg-sections-ready').inner_rml = AC.GetDebugValue(2) + doc:GetElementById('dbg-sections-culled').inner_rml = AC.GetDebugValue(0) - AC.GetDebugValue(5) + doc:GetElementById('dbg-rendered-faces').inner_rml = AC.GetDebugValue(4) + local player = AC.GetGameState():GetPlayerStatus() local playerHp = string.format("%.0f", player.health) doc:GetElementById('status-hp').inner_rml = playerHp diff --git a/cwd/assets/altcraft/ui/chat-styles.rcss b/cwd/assets/altcraft/ui/chat-styles.rcss new file mode 100644 index 0000000..91f5b81 --- /dev/null +++ b/cwd/assets/altcraft/ui/chat-styles.rcss @@ -0,0 +1,62 @@ +#body-chat { + +} + +p { + display: block; +} + +scrollbarvertical { + background-color: #2c2c2c55; + width: 3vh; + left: 0; +} + +scrollbarvertical sliderbar { + height: 10vh; + background-color: #9c9c9c55; +} + +scrollbarvertical sliderbar:active { + background-color: #cfd69d; +} + +scrollbarvertical sliderarrowdec { + display: none; +} + +scrollbarvertical sliderarrowinc { + display: none; +} + +#chat { + background-color: #00000055; + width: 80%; + height: 70%; + position: fixed; + bottom: 10%; + left: 0; + text-align: left; + overflow-y: auto; +} + +.chat-msg { + font-size: 5vh; + bottom: 0%; +} + +#chat-input { + width: 90%; +} + +#chat-send { + margin: 0.25%; +} + +#chat-footer { + position: fixed; + display: block; + bottom: 0; + width: 100%; + left: 0; +} diff --git a/cwd/assets/altcraft/ui/chat.rml b/cwd/assets/altcraft/ui/chat.rml new file mode 100644 index 0000000..8634450 --- /dev/null +++ b/cwd/assets/altcraft/ui/chat.rml @@ -0,0 +1,16 @@ +<rml> + <head> + <link type="text/rcss" href="mc-styles" /> + <link type="text/rcss" href="chat-styles" /> + <script src="/altcraft/scripts/ui"></script> + <title>Chat</title> + </head> + <body class="body-chat"> + <div id="chat"> + </div> + <div id="chat-footer"> + <input type="text" id="chat-input" class="mc-text" onkeydown="if event.parameters.key_identifier == 72 then SendChatMessage(document) end" /> + <button id="chat-send" class="mc-button" onclick="SendChatMessage(document)">Send</button> + </div> + </body> +</rml> diff --git a/cwd/assets/altcraft/ui/hud.rml b/cwd/assets/altcraft/ui/hud.rml index cbf5c86..baa408a 100644 --- a/cwd/assets/altcraft/ui/hud.rml +++ b/cwd/assets/altcraft/ui/hud.rml @@ -8,8 +8,11 @@ <div class="dbg-hud"> <p>FPS: <span id="dbg-fps">∞?</span></p> <p>Pos: <span id="dbg-pos">∞?</span></p> - <p>Select pos: <span id="dbg-select-pos">∞?</span></p> - <p>Select block: <span id="dbg-select-bid">∞?</span></p> + <p>Select: <span id="dbg-select-pos">∞?</span></p> + <p> block: <span id="dbg-select-bid">∞?</span> (<span style="color: yellow;" id="dbg-select-name">...?</span>)</p> + <p> light: <span id="dbg-select-light">∞?</span></p> + <p>Sections: <span id="dbg-sections-loaded">∞?</span> / <span id="dbg-sections-renderer">∞?</span> (<span id="dbg-sections-ready">∞?</span>)</p> + <p> rendered: <span id="dbg-sections-culled">∞?</span> (<span id="dbg-rendered-faces">∞?</span> faces)</p> </div> <div class="status-hud"> <p>HP: <span id="status-hp">∞?</span> <progress value="15" max="20" id="status-hp-bar" /> </p> diff --git a/cwd/assets/altcraft/ui/loading-styles.rcss b/cwd/assets/altcraft/ui/loading-styles.rcss new file mode 100644 index 0000000..b376fe8 --- /dev/null +++ b/cwd/assets/altcraft/ui/loading-styles.rcss @@ -0,0 +1,9 @@ +#body-loading { + background-color: #160f08; + color: white; +} + +#loading { + font-size: 20vh; + margin: 30% auto auto; +} diff --git a/cwd/assets/altcraft/ui/loading.rml b/cwd/assets/altcraft/ui/loading.rml new file mode 100644 index 0000000..2d84c37 --- /dev/null +++ b/cwd/assets/altcraft/ui/loading.rml @@ -0,0 +1,11 @@ +<rml> + <head> + <link type="text/rcss" href="mc-styles" /> + <link type="text/rcss" href="loading-styles" /> + <title>Loading</title> + <script src="/altcraft/scripts/ui"></script> + </head> + <body id="body-loading"> + <strong class="mc-title" id="loading">Loading</strong> + </body> +</rml> diff --git a/cwd/assets/altcraft/ui/respawn-styles.rcss b/cwd/assets/altcraft/ui/respawn-styles.rcss new file mode 100644 index 0000000..c6bbd7a --- /dev/null +++ b/cwd/assets/altcraft/ui/respawn-styles.rcss @@ -0,0 +1,24 @@ +.body-respawn { + background-color: #800000AA; +} + +#died { + font-size: 10vh; + margin: 30% auto auto; +} + +#respawn { + display: inline-block; + width: 45%; + height: 8%; + position: fixed; + margin: 10% auto auto; +} + +#disconnect { + display: inline-block; + width: 45%; + height: 8%; + position: fixed; + margin: 20% auto auto; +} diff --git a/cwd/assets/altcraft/ui/respawn.rml b/cwd/assets/altcraft/ui/respawn.rml new file mode 100644 index 0000000..093a169 --- /dev/null +++ b/cwd/assets/altcraft/ui/respawn.rml @@ -0,0 +1,12 @@ +<rml> + <head> + <link type="text/rcss" href="mc-styles" /> + <link type="text/rcss" href="respawn-styles" /> + <title>NeedRespawn</title> + </head> + <body class="body-respawn"> + <strong class="mc-title" id="died">You died!</strong> + <button class="mc-button" onclick="AC.GetGameState():PerformRespawn()" id="respawn">Respawn</button> + <button class="mc-button" onclick="AC.Disconnect()" id="disconnect">Title screen</button> + </body> +</rml> diff --git a/cwd/items.json b/cwd/items.json deleted file mode 100644 index 7367d1e..0000000 --- a/cwd/items.json +++ /dev/null @@ -1,4298 +0,0 @@ -[ - { - "type": 0, - "meta": 0, - "name": "Air", - "text_type": "air" - }, - { - "type": 1, - "meta": 0, - "name": "Stone", - "text_type": "stone" - }, - { - "type": 1, - "meta": 1, - "name": "Granite", - "text_type": "stone" - }, - { - "type": 1, - "meta": 2, - "name": "Polished Granite", - "text_type": "stone" - }, - { - "type": 1, - "meta": 3, - "name": "Diorite", - "text_type": "stone" - }, - { - "type": 1, - "meta": 4, - "name": "Polished Diorite", - "text_type": "stone" - }, - { - "type": 1, - "meta": 5, - "name": "Andesite", - "text_type": "stone" - }, - { - "type": 1, - "meta": 6, - "name": "Polished Andesite", - "text_type": "stone" - }, - { - "type": 2, - "meta": 0, - "name": "Grass", - "text_type": "grass" - }, - { - "type": 3, - "meta": 0, - "name": "Dirt", - "text_type": "dirt" - }, - { - "type": 3, - "meta": 1, - "name": "Coarse Dirt", - "text_type": "dirt" - }, - { - "type": 3, - "meta": 2, - "name": "Podzol", - "text_type": "dirt" - }, - { - "type": 4, - "meta": 0, - "name": "Cobblestone", - "text_type": "cobblestone" - }, - { - "type": 5, - "meta": 0, - "name": "Oak Wood Plank", - "text_type": "planks" - }, - { - "type": 5, - "meta": 1, - "name": "Spruce Wood Plank", - "text_type": "planks" - }, - { - "type": 5, - "meta": 2, - "name": "Birch Wood Plank", - "text_type": "planks" - }, - { - "type": 5, - "meta": 3, - "name": "Jungle Wood Plank", - "text_type": "planks" - }, - { - "type": 5, - "meta": 4, - "name": "Acacia Wood Plank", - "text_type": "planks" - }, - { - "type": 5, - "meta": 5, - "name": "Dark Oak Wood Plank", - "text_type": "planks" - }, - { - "type": 6, - "meta": 0, - "name": "Oak Sapling", - "text_type": "sapling" - }, - { - "type": 6, - "meta": 1, - "name": "Spruce Sapling", - "text_type": "sapling" - }, - { - "type": 6, - "meta": 2, - "name": "Birch Sapling", - "text_type": "sapling" - }, - { - "type": 6, - "meta": 3, - "name": "Jungle Sapling", - "text_type": "sapling" - }, - { - "type": 6, - "meta": 4, - "name": "Acacia Sapling", - "text_type": "sapling" - }, - { - "type": 6, - "meta": 5, - "name": "Dark Oak Sapling", - "text_type": "sapling" - }, - { - "type": 7, - "meta": 0, - "name": "Bedrock", - "text_type": "bedrock" - }, - { - "type": 8, - "meta": 0, - "name": "Flowing Water", - "text_type": "flowing_water" - }, - { - "type": 9, - "meta": 0, - "name": "Still Water", - "text_type": "water" - }, - { - "type": 10, - "meta": 0, - "name": "Flowing Lava", - "text_type": "flowing_lava" - }, - { - "type": 11, - "meta": 0, - "name": "Still Lava", - "text_type": "lava" - }, - { - "type": 12, - "meta": 0, - "name": "Sand", - "text_type": "sand" - }, - { - "type": 12, - "meta": 1, - "name": "Red Sand", - "text_type": "sand" - }, - { - "type": 13, - "meta": 0, - "name": "Gravel", - "text_type": "gravel" - }, - { - "type": 14, - "meta": 0, - "name": "Gold Ore", - "text_type": "gold_ore" - }, - { - "type": 15, - "meta": 0, - "name": "Iron Ore", - "text_type": "iron_ore" - }, - { - "type": 16, - "meta": 0, - "name": "Coal Ore", - "text_type": "coal_ore" - }, - { - "type": 17, - "meta": 0, - "name": "Oak Wood", - "text_type": "log" - }, - { - "type": 17, - "meta": 1, - "name": "Spruce Wood", - "text_type": "log" - }, - { - "type": 17, - "meta": 2, - "name": "Birch Wood", - "text_type": "log" - }, - { - "type": 17, - "meta": 3, - "name": "Jungle Wood", - "text_type": "log" - }, - { - "type": 18, - "meta": 0, - "name": "Oak Leaves", - "text_type": "leaves" - }, - { - "type": 18, - "meta": 1, - "name": "Spruce Leaves", - "text_type": "leaves" - }, - { - "type": 18, - "meta": 2, - "name": "Birch Leaves", - "text_type": "leaves" - }, - { - "type": 18, - "meta": 3, - "name": "Jungle Leaves", - "text_type": "leaves" - }, - { - "type": 19, - "meta": 0, - "name": "Sponge", - "text_type": "sponge" - }, - { - "type": 19, - "meta": 1, - "name": "Wet Sponge", - "text_type": "sponge" - }, - { - "type": 20, - "meta": 0, - "name": "Glass", - "text_type": "glass" - }, - { - "type": 21, - "meta": 0, - "name": "Lapis Lazuli Ore", - "text_type": "lapis_ore" - }, - { - "type": 22, - "meta": 0, - "name": "Lapis Lazuli Block", - "text_type": "lapis_block" - }, - { - "type": 23, - "meta": 0, - "name": "Dispenser", - "text_type": "dispenser" - }, - { - "type": 24, - "meta": 0, - "name": "Sandstone", - "text_type": "sandstone" - }, - { - "type": 24, - "meta": 1, - "name": "Chiseled Sandstone", - "text_type": "sandstone" - }, - { - "type": 24, - "meta": 2, - "name": "Smooth Sandstone", - "text_type": "sandstone" - }, - { - "type": 25, - "meta": 0, - "name": "Note Block", - "text_type": "noteblock" - }, - { - "type": 26, - "meta": 0, - "name": "Bed", - "text_type": "bed" - }, - { - "type": 27, - "meta": 0, - "name": "Powered Rail", - "text_type": "golden_rail" - }, - { - "type": 28, - "meta": 0, - "name": "Detector Rail", - "text_type": "detector_rail" - }, - { - "type": 29, - "meta": 0, - "name": "Sticky Piston", - "text_type": "sticky_piston" - }, - { - "type": 30, - "meta": 0, - "name": "Cobweb", - "text_type": "web" - }, - { - "type": 31, - "meta": 0, - "name": "Dead Shrub", - "text_type": "tallgrass" - }, - { - "type": 31, - "meta": 1, - "name": "Grass", - "text_type": "tallgrass" - }, - { - "type": 31, - "meta": 2, - "name": "Fern", - "text_type": "tallgrass" - }, - { - "type": 32, - "meta": 0, - "name": "Dead Bush", - "text_type": "deadbush" - }, - { - "type": 33, - "meta": 0, - "name": "Piston", - "text_type": "piston" - }, - { - "type": 34, - "meta": 0, - "name": "Piston Head", - "text_type": "piston_head" - }, - { - "type": 35, - "meta": 0, - "name": "White Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 1, - "name": "Orange Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 2, - "name": "Magenta Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 3, - "name": "Light Blue Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 4, - "name": "Yellow Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 5, - "name": "Lime Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 6, - "name": "Pink Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 7, - "name": "Gray Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 8, - "name": "Light Gray Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 9, - "name": "Cyan Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 10, - "name": "Purple Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 11, - "name": "Blue Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 12, - "name": "Brown Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 13, - "name": "Green Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 14, - "name": "Red Wool", - "text_type": "wool" - }, - { - "type": 35, - "meta": 15, - "name": "Black Wool", - "text_type": "wool" - }, - { - "type": 37, - "meta": 0, - "name": "Dandelion", - "text_type": "yellow_flower" - }, - { - "type": 38, - "meta": 0, - "name": "Poppy", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 1, - "name": "Blue Orchid", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 2, - "name": "Allium", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 3, - "name": "Azure Bluet", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 4, - "name": "Red Tulip", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 5, - "name": "Orange Tulip", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 6, - "name": "White Tulip", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 7, - "name": "Pink Tulip", - "text_type": "red_flower" - }, - { - "type": 38, - "meta": 8, - "name": "Oxeye Daisy", - "text_type": "red_flower" - }, - { - "type": 39, - "meta": 0, - "name": "Brown Mushroom", - "text_type": "brown_mushroom" - }, - { - "type": 40, - "meta": 0, - "name": "Red Mushroom", - "text_type": "red_mushroom" - }, - { - "type": 41, - "meta": 0, - "name": "Gold Block", - "text_type": "gold_block" - }, - { - "type": 42, - "meta": 0, - "name": "Iron Block", - "text_type": "iron_block" - }, - { - "type": 43, - "meta": 0, - "name": "Double Stone Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 1, - "name": "Double Sandstone Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 2, - "name": "Double Wooden Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 3, - "name": "Double Cobblestone Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 4, - "name": "Double Brick Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 5, - "name": "Double Stone Brick Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 6, - "name": "Double Nether Brick Slab", - "text_type": "double_stone_slab" - }, - { - "type": 43, - "meta": 7, - "name": "Double Quartz Slab", - "text_type": "double_stone_slab" - }, - { - "type": 44, - "meta": 0, - "name": "Stone Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 1, - "name": "Sandstone Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 2, - "name": "Wooden Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 3, - "name": "Cobblestone Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 4, - "name": "Brick Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 5, - "name": "Stone Brick Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 6, - "name": "Nether Brick Slab", - "text_type": "stone_slab" - }, - { - "type": 44, - "meta": 7, - "name": "Quartz Slab", - "text_type": "stone_slab" - }, - { - "type": 45, - "meta": 0, - "name": "Bricks", - "text_type": "brick_block" - }, - { - "type": 46, - "meta": 0, - "name": "TNT", - "text_type": "tnt" - }, - { - "type": 47, - "meta": 0, - "name": "Bookshelf", - "text_type": "bookshelf" - }, - { - "type": 48, - "meta": 0, - "name": "Moss Stone", - "text_type": "mossy_cobblestone" - }, - { - "type": 49, - "meta": 0, - "name": "Obsidian", - "text_type": "obsidian" - }, - { - "type": 50, - "meta": 0, - "name": "Torch", - "text_type": "torch" - }, - { - "type": 51, - "meta": 0, - "name": "Fire", - "text_type": "fire" - }, - { - "type": 52, - "meta": 0, - "name": "Monster Spawner", - "text_type": "mob_spawner" - }, - { - "type": 53, - "meta": 0, - "name": "Oak Wood Stairs", - "text_type": "oak_stairs" - }, - { - "type": 54, - "meta": 0, - "name": "Chest", - "text_type": "chest" - }, - { - "type": 55, - "meta": 0, - "name": "Redstone Wire", - "text_type": "redstone_wire" - }, - { - "type": 56, - "meta": 0, - "name": "Diamond Ore", - "text_type": "diamond_ore" - }, - { - "type": 57, - "meta": 0, - "name": "Diamond Block", - "text_type": "diamond_block" - }, - { - "type": 58, - "meta": 0, - "name": "Crafting Table", - "text_type": "crafting_table" - }, - { - "type": 59, - "meta": 0, - "name": "Wheat Crops", - "text_type": "wheat" - }, - { - "type": 60, - "meta": 0, - "name": "Farmland", - "text_type": "farmland" - }, - { - "type": 61, - "meta": 0, - "name": "Furnace", - "text_type": "furnace" - }, - { - "type": 62, - "meta": 0, - "name": "Burning Furnace", - "text_type": "lit_furnace" - }, - { - "type": 63, - "meta": 0, - "name": "Standing Sign Block", - "text_type": "standing_sign" - }, - { - "type": 64, - "meta": 0, - "name": "Oak Door Block", - "text_type": "wooden_door" - }, - { - "type": 65, - "meta": 0, - "name": "Ladder", - "text_type": "ladder" - }, - { - "type": 66, - "meta": 0, - "name": "Rail", - "text_type": "rail" - }, - { - "type": 67, - "meta": 0, - "name": "Cobblestone Stairs", - "text_type": "stone_stairs" - }, - { - "type": 68, - "meta": 0, - "name": "Wall-mounted Sign Block", - "text_type": "wall_sign" - }, - { - "type": 69, - "meta": 0, - "name": "Lever", - "text_type": "lever" - }, - { - "type": 70, - "meta": 0, - "name": "Stone Pressure Plate", - "text_type": "stone_pressure_plate" - }, - { - "type": 71, - "meta": 0, - "name": "Iron Door Block", - "text_type": "iron_door" - }, - { - "type": 72, - "meta": 0, - "name": "Wooden Pressure Plate", - "text_type": "wooden_pressure_plate" - }, - { - "type": 73, - "meta": 0, - "name": "Redstone Ore", - "text_type": "redstone_ore" - }, - { - "type": 74, - "meta": 0, - "name": "Glowing Redstone Ore", - "text_type": "lit_redstone_ore" - }, - { - "type": 75, - "meta": 0, - "name": "Redstone Torch (off)", - "text_type": "unlit_redstone_torch" - }, - { - "type": 76, - "meta": 0, - "name": "Redstone Torch (on)", - "text_type": "redstone_torch" - }, - { - "type": 77, - "meta": 0, - "name": "Stone Button", - "text_type": "stone_button" - }, - { - "type": 78, - "meta": 0, - "name": "Snow", - "text_type": "snow_layer" - }, - { - "type": 79, - "meta": 0, - "name": "Ice", - "text_type": "ice" - }, - { - "type": 80, - "meta": 0, - "name": "Snow Block", - "text_type": "snow" - }, - { - "type": 81, - "meta": 0, - "name": "Cactus", - "text_type": "cactus" - }, - { - "type": 82, - "meta": 0, - "name": "Clay", - "text_type": "clay" - }, - { - "type": 83, - "meta": 0, - "name": "Sugar Canes", - "text_type": "reeds" - }, - { - "type": 84, - "meta": 0, - "name": "Jukebox", - "text_type": "jukebox" - }, - { - "type": 85, - "meta": 0, - "name": "Oak Fence", - "text_type": "fence" - }, - { - "type": 86, - "meta": 0, - "name": "Pumpkin", - "text_type": "pumpkin" - }, - { - "type": 87, - "meta": 0, - "name": "Netherrack", - "text_type": "netherrack" - }, - { - "type": 88, - "meta": 0, - "name": "Soul Sand", - "text_type": "soul_sand" - }, - { - "type": 89, - "meta": 0, - "name": "Glowstone", - "text_type": "glowstone" - }, - { - "type": 90, - "meta": 0, - "name": "Nether Portal", - "text_type": "portal" - }, - { - "type": 91, - "meta": 0, - "name": "Jack o'Lantern", - "text_type": "lit_pumpkin" - }, - { - "type": 92, - "meta": 0, - "name": "Cake Block", - "text_type": "cake" - }, - { - "type": 93, - "meta": 0, - "name": "Redstone Repeater Block (off)", - "text_type": "unpowered_repeater" - }, - { - "type": 94, - "meta": 0, - "name": "Redstone Repeater Block (on)", - "text_type": "powered_repeater" - }, - { - "type": 95, - "meta": 0, - "name": "White Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 1, - "name": "Orange Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 2, - "name": "Magenta Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 3, - "name": "Light Blue Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 4, - "name": "Yellow Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 5, - "name": "Lime Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 6, - "name": "Pink Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 7, - "name": "Gray Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 8, - "name": "Light Gray Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 9, - "name": "Cyan Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 10, - "name": "Purple Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 11, - "name": "Blue Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 12, - "name": "Brown Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 13, - "name": "Green Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 14, - "name": "Red Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 95, - "meta": 15, - "name": "Black Stained Glass", - "text_type": "stained_glass" - }, - { - "type": 96, - "meta": 0, - "name": "Wooden Trapdoor", - "text_type": "trapdoor" - }, - { - "type": 97, - "meta": 0, - "name": "Stone Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 97, - "meta": 1, - "name": "Cobblestone Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 97, - "meta": 2, - "name": "Stone Brick Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 97, - "meta": 3, - "name": "Mossy Stone Brick Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 97, - "meta": 4, - "name": "Cracked Stone Brick Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 97, - "meta": 5, - "name": "Chiseled Stone Brick Monster Egg", - "text_type": "monster_egg" - }, - { - "type": 98, - "meta": 0, - "name": "Stone Bricks", - "text_type": "stonebrick" - }, - { - "type": 98, - "meta": 1, - "name": "Mossy Stone Bricks", - "text_type": "stonebrick" - }, - { - "type": 98, - "meta": 2, - "name": "Cracked Stone Bricks", - "text_type": "stonebrick" - }, - { - "type": 98, - "meta": 3, - "name": "Chiseled Stone Bricks", - "text_type": "stonebrick" - }, - { - "type": 99, - "meta": 0, - "name": "Brown Mushroom Block", - "text_type": "brown_mushroom_block" - }, - { - "type": 100, - "meta": 0, - "name": "Red Mushroom Block", - "text_type": "red_mushroom_block" - }, - { - "type": 101, - "meta": 0, - "name": "Iron Bars", - "text_type": "iron_bars" - }, - { - "type": 102, - "meta": 0, - "name": "Glass Pane", - "text_type": "glass_pane" - }, - { - "type": 103, - "meta": 0, - "name": "Melon Block", - "text_type": "melon_block" - }, - { - "type": 104, - "meta": 0, - "name": "Pumpkin Stem", - "text_type": "pumpkin_stem" - }, - { - "type": 105, - "meta": 0, - "name": "Melon Stem", - "text_type": "melon_stem" - }, - { - "type": 106, - "meta": 0, - "name": "Vines", - "text_type": "vine" - }, - { - "type": 107, - "meta": 0, - "name": "Oak Fence Gate", - "text_type": "fence_gate" - }, - { - "type": 108, - "meta": 0, - "name": "Brick Stairs", - "text_type": "brick_stairs" - }, - { - "type": 109, - "meta": 0, - "name": "Stone Brick Stairs", - "text_type": "stone_brick_stairs" - }, - { - "type": 110, - "meta": 0, - "name": "Mycelium", - "text_type": "mycelium" - }, - { - "type": 111, - "meta": 0, - "name": "Lily Pad", - "text_type": "waterlily" - }, - { - "type": 112, - "meta": 0, - "name": "Nether Brick", - "text_type": "nether_brick" - }, - { - "type": 113, - "meta": 0, - "name": "Nether Brick Fence", - "text_type": "nether_brick_fence" - }, - { - "type": 114, - "meta": 0, - "name": "Nether Brick Stairs", - "text_type": "nether_brick_stairs" - }, - { - "type": 115, - "meta": 0, - "name": "Nether Wart", - "text_type": "nether_wart" - }, - { - "type": 116, - "meta": 0, - "name": "Enchantment Table", - "text_type": "enchanting_table" - }, - { - "type": 117, - "meta": 0, - "name": "Brewing Stand", - "text_type": "brewing_stand" - }, - { - "type": 118, - "meta": 0, - "name": "Cauldron", - "text_type": "cauldron" - }, - { - "type": 119, - "meta": 0, - "name": "End Portal", - "text_type": "end_portal" - }, - { - "type": 120, - "meta": 0, - "name": "End Portal Frame", - "text_type": "end_portal_frame" - }, - { - "type": 121, - "meta": 0, - "name": "End Stone", - "text_type": "end_stone" - }, - { - "type": 122, - "meta": 0, - "name": "Dragon Egg", - "text_type": "dragon_egg" - }, - { - "type": 123, - "meta": 0, - "name": "Redstone Lamp (inactive)", - "text_type": "redstone_lamp" - }, - { - "type": 124, - "meta": 0, - "name": "Redstone Lamp (active)", - "text_type": "lit_redstone_lamp" - }, - { - "type": 125, - "meta": 0, - "name": "Double Oak Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 125, - "meta": 1, - "name": "Double Spruce Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 125, - "meta": 2, - "name": "Double Birch Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 125, - "meta": 3, - "name": "Double Jungle Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 125, - "meta": 4, - "name": "Double Acacia Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 125, - "meta": 5, - "name": "Double Dark Oak Wood Slab", - "text_type": "double_wooden_slab" - }, - { - "type": 126, - "meta": 0, - "name": "Oak Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 126, - "meta": 1, - "name": "Spruce Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 126, - "meta": 2, - "name": "Birch Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 126, - "meta": 3, - "name": "Jungle Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 126, - "meta": 4, - "name": "Acacia Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 126, - "meta": 5, - "name": "Dark Oak Wood Slab", - "text_type": "wooden_slab" - }, - { - "type": 127, - "meta": 0, - "name": "Cocoa", - "text_type": "cocoa" - }, - { - "type": 128, - "meta": 0, - "name": "Sandstone Stairs", - "text_type": "sandstone_stairs" - }, - { - "type": 129, - "meta": 0, - "name": "Emerald Ore", - "text_type": "emerald_ore" - }, - { - "type": 130, - "meta": 0, - "name": "Ender Chest", - "text_type": "ender_chest" - }, - { - "type": 131, - "meta": 0, - "name": "Tripwire Hook", - "text_type": "tripwire_hook" - }, - { - "type": 132, - "meta": 0, - "name": "Tripwire", - "text_type": "tripwire_hook" - }, - { - "type": 133, - "meta": 0, - "name": "Emerald Block", - "text_type": "emerald_block" - }, - { - "type": 134, - "meta": 0, - "name": "Spruce Wood Stairs", - "text_type": "spruce_stairs" - }, - { - "type": 135, - "meta": 0, - "name": "Birch Wood Stairs", - "text_type": "birch_stairs" - }, - { - "type": 136, - "meta": 0, - "name": "Jungle Wood Stairs", - "text_type": "jungle_stairs" - }, - { - "type": 137, - "meta": 0, - "name": "Command Block", - "text_type": "command_block" - }, - { - "type": 138, - "meta": 0, - "name": "Beacon", - "text_type": "beacon" - }, - { - "type": 139, - "meta": 0, - "name": "Cobblestone Wall", - "text_type": "cobblestone_wall" - }, - { - "type": 139, - "meta": 1, - "name": "Mossy Cobblestone Wall", - "text_type": "cobblestone_wall" - }, - { - "type": 140, - "meta": 0, - "name": "Flower Pot", - "text_type": "flower_pot" - }, - { - "type": 141, - "meta": 0, - "name": "Carrots", - "text_type": "carrots" - }, - { - "type": 142, - "meta": 0, - "name": "Potatoes", - "text_type": "potatoes" - }, - { - "type": 143, - "meta": 0, - "name": "Wooden Button", - "text_type": "wooden_button" - }, - { - "type": 144, - "meta": 0, - "name": "Mob Head", - "text_type": "skull" - }, - { - "type": 145, - "meta": 0, - "name": "Anvil", - "text_type": "anvil" - }, - { - "type": 146, - "meta": 0, - "name": "Trapped Chest", - "text_type": "trapped_chest" - }, - { - "type": 147, - "meta": 0, - "name": "Weighted Pressure Plate (light)", - "text_type": "light_weighted_pressure_plate" - }, - { - "type": 148, - "meta": 0, - "name": "Weighted Pressure Plate (heavy)", - "text_type": "heavy_weighted_pressure_plate" - }, - { - "type": 149, - "meta": 0, - "name": "Redstone Comparator (inactive)", - "text_type": "unpowered_comparator" - }, - { - "type": 150, - "meta": 0, - "name": "Redstone Comparator (active)", - "text_type": "powered_comparator" - }, - { - "type": 151, - "meta": 0, - "name": "Daylight Sensor", - "text_type": "daylight_detector" - }, - { - "type": 152, - "meta": 0, - "name": "Redstone Block", - "text_type": "redstone_block" - }, - { - "type": 153, - "meta": 0, - "name": "Nether Quartz Ore", - "text_type": "quartz_ore" - }, - { - "type": 154, - "meta": 0, - "name": "Hopper", - "text_type": "hopper" - }, - { - "type": 155, - "meta": 0, - "name": "Quartz Block", - "text_type": "quartz_block" - }, - { - "type": 155, - "meta": 1, - "name": "Chiseled Quartz Block", - "text_type": "quartz_block" - }, - { - "type": 155, - "meta": 2, - "name": "Pillar Quartz Block", - "text_type": "quartz_block" - }, - { - "type": 156, - "meta": 0, - "name": "Quartz Stairs", - "text_type": "quartz_stairs" - }, - { - "type": 157, - "meta": 0, - "name": "Activator Rail", - "text_type": "activator_rail" - }, - { - "type": 158, - "meta": 0, - "name": "Dropper", - "text_type": "dropper" - }, - { - "type": 159, - "meta": 0, - "name": "White Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 1, - "name": "Orange Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 2, - "name": "Magenta Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 3, - "name": "Light Blue Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 4, - "name": "Yellow Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 5, - "name": "Lime Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 6, - "name": "Pink Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 7, - "name": "Gray Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 8, - "name": "Light Gray Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 9, - "name": "Cyan Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 10, - "name": "Purple Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 11, - "name": "Blue Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 12, - "name": "Brown Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 13, - "name": "Green Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 14, - "name": "Red Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 159, - "meta": 15, - "name": "Black Hardened Clay", - "text_type": "stained_hardened_clay" - }, - { - "type": 160, - "meta": 0, - "name": "White Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 1, - "name": "Orange Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 2, - "name": "Magenta Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 3, - "name": "Light Blue Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 4, - "name": "Yellow Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 5, - "name": "Lime Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 6, - "name": "Pink Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 7, - "name": "Gray Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 8, - "name": "Light Gray Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 9, - "name": "Cyan Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 10, - "name": "Purple Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 11, - "name": "Blue Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 12, - "name": "Brown Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 13, - "name": "Green Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 14, - "name": "Red Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 160, - "meta": 15, - "name": "Black Stained Glass Pane", - "text_type": "stained_glass_pane" - }, - { - "type": 161, - "meta": 0, - "name": "Acacia Leaves", - "text_type": "leaves2" - }, - { - "type": 161, - "meta": 1, - "name": "Dark Oak Leaves", - "text_type": "leaves2" - }, - { - "type": 162, - "meta": 0, - "name": "Acacia Wood", - "text_type": "log2" - }, - { - "type": 162, - "meta": 1, - "name": "Dark Oak Wood", - "text_type": "log2" - }, - { - "type": 163, - "meta": 0, - "name": "Acacia Wood Stairs", - "text_type": "acacia_stairs" - }, - { - "type": 164, - "meta": 0, - "name": "Dark Oak Wood Stairs", - "text_type": "dark_oak_stairs" - }, - { - "type": 165, - "meta": 0, - "name": "Slime Block", - "text_type": "slime" - }, - { - "type": 166, - "meta": 0, - "name": "Barrier", - "text_type": "barrier" - }, - { - "type": 167, - "meta": 0, - "name": "Iron Trapdoor", - "text_type": "iron_trapdoor" - }, - { - "type": 168, - "meta": 0, - "name": "Prismarine", - "text_type": "prismarine" - }, - { - "type": 168, - "meta": 1, - "name": "Prismarine Bricks", - "text_type": "prismarine" - }, - { - "type": 168, - "meta": 2, - "name": "Dark Prismarine", - "text_type": "prismarine" - }, - { - "type": 169, - "meta": 0, - "name": "Sea Lantern", - "text_type": "sea_lantern" - }, - { - "type": 170, - "meta": 0, - "name": "Hay Bale", - "text_type": "hay_block" - }, - { - "type": 171, - "meta": 0, - "name": "White Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 1, - "name": "Orange Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 2, - "name": "Magenta Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 3, - "name": "Light Blue Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 4, - "name": "Yellow Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 5, - "name": "Lime Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 6, - "name": "Pink Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 7, - "name": "Gray Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 8, - "name": "Light Gray Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 9, - "name": "Cyan Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 10, - "name": "Purple Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 11, - "name": "Blue Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 12, - "name": "Brown Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 13, - "name": "Green Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 14, - "name": "Red Carpet", - "text_type": "carpet" - }, - { - "type": 171, - "meta": 15, - "name": "Black Carpet", - "text_type": "carpet" - }, - { - "type": 172, - "meta": 0, - "name": "Hardened Clay", - "text_type": "hardened_clay" - }, - { - "type": 173, - "meta": 0, - "name": "Block of Coal", - "text_type": "coal_block" - }, - { - "type": 174, - "meta": 0, - "name": "Packed Ice", - "text_type": "packed_ice" - }, - { - "type": 175, - "meta": 0, - "name": "Sunflower", - "text_type": "double_plant" - }, - { - "type": 175, - "meta": 1, - "name": "Lilac", - "text_type": "double_plant" - }, - { - "type": 175, - "meta": 2, - "name": "Double Tallgrass", - "text_type": "double_plant" - }, - { - "type": 175, - "meta": 3, - "name": "Large Fern", - "text_type": "double_plant" - }, - { - "type": 175, - "meta": 4, - "name": "Rose Bush", - "text_type": "double_plant" - }, - { - "type": 175, - "meta": 5, - "name": "Peony", - "text_type": "double_plant" - }, - { - "type": 176, - "meta": 0, - "name": "Free-standing Banner", - "text_type": "standing_banner" - }, - { - "type": 177, - "meta": 0, - "name": "Wall-mounted Banner", - "text_type": "wall_banner" - }, - { - "type": 178, - "meta": 0, - "name": "Inverted Daylight Sensor", - "text_type": "daylight_detector_inverted" - }, - { - "type": 179, - "meta": 0, - "name": "Red Sandstone", - "text_type": "red_sandstone" - }, - { - "type": 179, - "meta": 1, - "name": "Chiseled Red Sandstone", - "text_type": "red_sandstone" - }, - { - "type": 179, - "meta": 2, - "name": "Smooth Red Sandstone", - "text_type": "red_sandstone" - }, - { - "type": 180, - "meta": 0, - "name": "Red Sandstone Stairs", - "text_type": "red_sandstone_stairs" - }, - { - "type": 181, - "meta": 0, - "name": "Double Red Sandstone Slab", - "text_type": "double_stone_slab2" - }, - { - "type": 182, - "meta": 0, - "name": "Red Sandstone Slab", - "text_type": "stone_slab2" - }, - { - "type": 183, - "meta": 0, - "name": "Spruce Fence Gate", - "text_type": "spruce_fence_gate" - }, - { - "type": 184, - "meta": 0, - "name": "Birch Fence Gate", - "text_type": "birch_fence_gate" - }, - { - "type": 185, - "meta": 0, - "name": "Jungle Fence Gate", - "text_type": "jungle_fence_gate" - }, - { - "type": 186, - "meta": 0, - "name": "Dark Oak Fence Gate", - "text_type": "dark_oak_fence_gate" - }, - { - "type": 187, - "meta": 0, - "name": "Acacia Fence Gate", - "text_type": "acacia_fence_gate" - }, - { - "type": 188, - "meta": 0, - "name": "Spruce Fence", - "text_type": "spruce_fence" - }, - { - "type": 189, - "meta": 0, - "name": "Birch Fence", - "text_type": "birch_fence" - }, - { - "type": 190, - "meta": 0, - "name": "Jungle Fence", - "text_type": "jungle_fence" - }, - { - "type": 191, - "meta": 0, - "name": "Dark Oak Fence", - "text_type": "dark_oak_fence" - }, - { - "type": 192, - "meta": 0, - "name": "Acacia Fence", - "text_type": "acacia_fence" - }, - { - "type": 193, - "meta": 0, - "name": "Spruce Door Block", - "text_type": "spruce_door" - }, - { - "type": 194, - "meta": 0, - "name": "Birch Door Block", - "text_type": "birch_door" - }, - { - "type": 195, - "meta": 0, - "name": "Jungle Door Block", - "text_type": "jungle_door" - }, - { - "type": 196, - "meta": 0, - "name": "Acacia Door Block", - "text_type": "acacia_door" - }, - { - "type": 197, - "meta": 0, - "name": "Dark Oak Door Block", - "text_type": "dark_oak_door" - }, - { - "type": 198, - "meta": 0, - "name": "End Rod", - "text_type": "end_rod" - }, - { - "type": 199, - "meta": 0, - "name": "Chorus Plant", - "text_type": "chorus_plant" - }, - { - "type": 200, - "meta": 0, - "name": "Chorus Flower", - "text_type": "chorus_flower" - }, - { - "type": 201, - "meta": 0, - "name": "Purpur Block", - "text_type": "purpur_block" - }, - { - "type": 202, - "meta": 0, - "name": "Purpur Pillar", - "text_type": "purpur_pillar" - }, - { - "type": 203, - "meta": 0, - "name": "Purpur Stairs", - "text_type": "purpur_stairs" - }, - { - "type": 204, - "meta": 0, - "name": "Purpur Double Slab", - "text_type": "purpur_double_slab" - }, - { - "type": 205, - "meta": 0, - "name": "Purpur Slab", - "text_type": "purpur_slab" - }, - { - "type": 206, - "meta": 0, - "name": "End Stone Bricks", - "text_type": "end_bricks" - }, - { - "type": 207, - "meta": 0, - "name": "Beetroot Block", - "text_type": "beetroots" - }, - { - "type": 208, - "meta": 0, - "name": "Grass Path", - "text_type": "grass_path" - }, - { - "type": 209, - "meta": 0, - "name": "End Gateway", - "text_type": "end_gateway" - }, - { - "type": 210, - "meta": 0, - "name": "Repeating Command Block", - "text_type": "repeating_command_block" - }, - { - "type": 211, - "meta": 0, - "name": "Chain Command Block", - "text_type": "chain_command_block" - }, - { - "type": 212, - "meta": 0, - "name": "Frosted Ice", - "text_type": "frosted_ice" - }, - { - "type": 213, - "meta": 0, - "name": "Magma Block", - "text_type": "magma" - }, - { - "type": 214, - "meta": 0, - "name": "Nether Wart Block", - "text_type": "nether_wart_block" - }, - { - "type": 215, - "meta": 0, - "name": "Red Nether Brick", - "text_type": "red_nether_brick" - }, - { - "type": 216, - "meta": 0, - "name": "Bone Block", - "text_type": "bone_block" - }, - { - "type": 217, - "meta": 0, - "name": "Structure Void", - "text_type": "structure_void" - }, - { - "type": 218, - "meta": 0, - "name": "Observer", - "text_type": "observer" - }, - { - "type": 219, - "meta": 0, - "name": "White Shulker Box", - "text_type": "white_shulker_box" - }, - { - "type": 220, - "meta": 0, - "name": "Orange Shulker Box", - "text_type": "orange_shulker_box" - }, - { - "type": 221, - "meta": 0, - "name": "Magenta Shulker Box", - "text_type": "magenta_shulker_box" - }, - { - "type": 222, - "meta": 0, - "name": "Light Blue Shulker Box", - "text_type": "light_blue_shulker_box" - }, - { - "type": 223, - "meta": 0, - "name": "Yellow Shulker Box", - "text_type": "yellow_shulker_box" - }, - { - "type": 224, - "meta": 0, - "name": "Lime Shulker Box", - "text_type": "lime_shulker_box" - }, - { - "type": 225, - "meta": 0, - "name": "Pink Shulker Box", - "text_type": "pink_shulker_box" - }, - { - "type": 226, - "meta": 0, - "name": "Gray Shulker Box", - "text_type": "gray_shulker_box" - }, - { - "type": 227, - "meta": 0, - "name": "Light Gray Shulker Box", - "text_type": "silver_shulker_box" - }, - { - "type": 228, - "meta": 0, - "name": "Cyan Shulker Box", - "text_type": "cyan_shulker_box" - }, - { - "type": 229, - "meta": 0, - "name": "Purple Shulker Box", - "text_type": "purple_shulker_box" - }, - { - "type": 230, - "meta": 0, - "name": "Blue Shulker Box", - "text_type": "blue_shulker_box" - }, - { - "type": 231, - "meta": 0, - "name": "Brown Shulker Box", - "text_type": "brown_shulker_box" - }, - { - "type": 232, - "meta": 0, - "name": "Green Shulker Box", - "text_type": "green_shulker_box" - }, - { - "type": 233, - "meta": 0, - "name": "Red Shulker Box", - "text_type": "red_shulker_box" - }, - { - "type": 234, - "meta": 0, - "name": "Black Shulker Box", - "text_type": "black_shulker_box" - }, - { - "type": 235, - "meta": 0, - "name": "White Glazed Terracotta", - "text_type": "white_glazed_terracotta" - }, - { - "type": 236, - "meta": 0, - "name": "Orange Glazed Terracotta", - "text_type": "orange_glazed_terracotta" - }, - { - "type": 237, - "meta": 0, - "name": "Magenta Glazed Terracotta", - "text_type": "magenta_glazed_terracotta" - }, - { - "type": 238, - "meta": 0, - "name": "Light Blue Glazed Terracotta", - "text_type": "light_blue_glazed_terracotta" - }, - { - "type": 239, - "meta": 0, - "name": "Yellow Glazed Terracotta", - "text_type": "yellow_glazed_terracotta" - }, - { - "type": 240, - "meta": 0, - "name": "Lime Glazed Terracotta", - "text_type": "lime_glazed_terracotta" - }, - { - "type": 241, - "meta": 0, - "name": "Pink Glazed Terracotta", - "text_type": "pink_glazed_terracotta" - }, - { - "type": 242, - "meta": 0, - "name": "Gray Glazed Terracotta", - "text_type": "gray_glazed_terracotta" - }, - { - "type": 243, - "meta": 0, - "name": "Light Gray Glazed Terracotta", - "text_type": "light_gray_glazed_terracotta" - }, - { - "type": 244, - "meta": 0, - "name": "Cyan Glazed Terracotta", - "text_type": "cyan_glazed_terracotta" - }, - { - "type": 245, - "meta": 0, - "name": "Purple Glazed Terracotta", - "text_type": "purple_glazed_terracotta" - }, - { - "type": 246, - "meta": 0, - "name": "Blue Glazed Terracotta", - "text_type": "blue_glazed_terracotta" - }, - { - "type": 247, - "meta": 0, - "name": "Brown Glazed Terracotta", - "text_type": "brown_glazed_terracotta" - }, - { - "type": 248, - "meta": 0, - "name": "Green Glazed Terracotta", - "text_type": "green_glazed_terracotta" - }, - { - "type": 249, - "meta": 0, - "name": "Red Glazed Terracotta", - "text_type": "red_glazed_terracotta" - }, - { - "type": 250, - "meta": 0, - "name": "Black Glazed Terracotta", - "text_type": "black_glazed_terracotta" - }, - { - "type": 251, - "meta": 0, - "name": "White Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 1, - "name": "Orange Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 2, - "name": "Magenta Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 3, - "name": "Light Blue Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 4, - "name": "Yellow Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 5, - "name": "Lime Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 6, - "name": "Pink Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 7, - "name": "Gray Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 8, - "name": "Light Gray Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 9, - "name": "Cyan Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 10, - "name": "Purple Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 11, - "name": "Blue Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 12, - "name": "Brown Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 13, - "name": "Green Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 14, - "name": "Red Concrete", - "text_type": "concrete" - }, - { - "type": 251, - "meta": 15, - "name": "Black Concrete", - "text_type": "concrete" - }, - { - "type": 252, - "meta": 0, - "name": "White Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 1, - "name": "Orange Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 2, - "name": "Magenta Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 3, - "name": "Light Blue Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 4, - "name": "Yellow Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 5, - "name": "Lime Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 6, - "name": "Pink Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 7, - "name": "Gray Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 8, - "name": "Light Gray Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 9, - "name": "Cyan Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 10, - "name": "Purple Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 11, - "name": "Blue Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 12, - "name": "Brown Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 13, - "name": "Green Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 14, - "name": "Red Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 252, - "meta": 15, - "name": "Black Concrete Powder", - "text_type": "concrete_powder" - }, - { - "type": 255, - "meta": 0, - "name": "Structure Block", - "text_type": "structure_block" - }, - { - "type": 256, - "meta": 0, - "name": "Iron Shovel", - "text_type": "iron_shovel" - }, - { - "type": 257, - "meta": 0, - "name": "Iron Pickaxe", - "text_type": "iron_pickaxe" - }, - { - "type": 258, - "meta": 0, - "name": "Iron Axe", - "text_type": "iron_axe" - }, - { - "type": 259, - "meta": 0, - "name": "Flint and Steel", - "text_type": "flint_and_steel" - }, - { - "type": 260, - "meta": 0, - "name": "Apple", - "text_type": "apple" - }, - { - "type": 261, - "meta": 0, - "name": "Bow", - "text_type": "bow" - }, - { - "type": 262, - "meta": 0, - "name": "Arrow", - "text_type": "arrow" - }, - { - "type": 263, - "meta": 0, - "name": "Coal", - "text_type": "coal" - }, - { - "type": 263, - "meta": 1, - "name": "Charcoal", - "text_type": "coal" - }, - { - "type": 264, - "meta": 0, - "name": "Diamond", - "text_type": "diamond" - }, - { - "type": 265, - "meta": 0, - "name": "Iron Ingot", - "text_type": "iron_ingot" - }, - { - "type": 266, - "meta": 0, - "name": "Gold Ingot", - "text_type": "gold_ingot" - }, - { - "type": 267, - "meta": 0, - "name": "Iron Sword", - "text_type": "iron_sword" - }, - { - "type": 268, - "meta": 0, - "name": "Wooden Sword", - "text_type": "wooden_sword" - }, - { - "type": 269, - "meta": 0, - "name": "Wooden Shovel", - "text_type": "wooden_shovel" - }, - { - "type": 270, - "meta": 0, - "name": "Wooden Pickaxe", - "text_type": "wooden_pickaxe" - }, - { - "type": 271, - "meta": 0, - "name": "Wooden Axe", - "text_type": "wooden_axe" - }, - { - "type": 272, - "meta": 0, - "name": "Stone Sword", - "text_type": "stone_sword" - }, - { - "type": 273, - "meta": 0, - "name": "Stone Shovel", - "text_type": "stone_shovel" - }, - { - "type": 274, - "meta": 0, - "name": "Stone Pickaxe", - "text_type": "stone_pickaxe" - }, - { - "type": 275, - "meta": 0, - "name": "Stone Axe", - "text_type": "stone_axe" - }, - { - "type": 276, - "meta": 0, - "name": "Diamond Sword", - "text_type": "diamond_sword" - }, - { - "type": 277, - "meta": 0, - "name": "Diamond Shovel", - "text_type": "diamond_shovel" - }, - { - "type": 278, - "meta": 0, - "name": "Diamond Pickaxe", - "text_type": "diamond_pickaxe" - }, - { - "type": 279, - "meta": 0, - "name": "Diamond Axe", - "text_type": "diamond_axe" - }, - { - "type": 280, - "meta": 0, - "name": "Stick", - "text_type": "stick" - }, - { - "type": 281, - "meta": 0, - "name": "Bowl", - "text_type": "bowl" - }, - { - "type": 282, - "meta": 0, - "name": "Mushroom Stew", - "text_type": "mushroom_stew" - }, - { - "type": 283, - "meta": 0, - "name": "Golden Sword", - "text_type": "golden_sword" - }, - { - "type": 284, - "meta": 0, - "name": "Golden Shovel", - "text_type": "golden_shovel" - }, - { - "type": 285, - "meta": 0, - "name": "Golden Pickaxe", - "text_type": "golden_pickaxe" - }, - { - "type": 286, - "meta": 0, - "name": "Golden Axe", - "text_type": "golden_axe" - }, - { - "type": 287, - "meta": 0, - "name": "String", - "text_type": "string" - }, - { - "type": 288, - "meta": 0, - "name": "Feather", - "text_type": "feather" - }, - { - "type": 289, - "meta": 0, - "name": "Gunpowder", - "text_type": "gunpowder" - }, - { - "type": 290, - "meta": 0, - "name": "Wooden Hoe", - "text_type": "wooden_hoe" - }, - { - "type": 291, - "meta": 0, - "name": "Stone Hoe", - "text_type": "stone_hoe" - }, - { - "type": 292, - "meta": 0, - "name": "Iron Hoe", - "text_type": "iron_hoe" - }, - { - "type": 293, - "meta": 0, - "name": "Diamond Hoe", - "text_type": "diamond_hoe" - }, - { - "type": 294, - "meta": 0, - "name": "Golden Hoe", - "text_type": "golden_hoe" - }, - { - "type": 295, - "meta": 0, - "name": "Wheat Seeds", - "text_type": "wheat_seeds" - }, - { - "type": 296, - "meta": 0, - "name": "Wheat", - "text_type": "wheat" - }, - { - "type": 297, - "meta": 0, - "name": "Bread", - "text_type": "bread" - }, - { - "type": 298, - "meta": 0, - "name": "Leather Helmet", - "text_type": "leather_helmet" - }, - { - "type": 299, - "meta": 0, - "name": "Leather Tunic", - "text_type": "leather_chestplate" - }, - { - "type": 300, - "meta": 0, - "name": "Leather Pants", - "text_type": "leather_leggings" - }, - { - "type": 301, - "meta": 0, - "name": "Leather Boots", - "text_type": "leather_boots" - }, - { - "type": 302, - "meta": 0, - "name": "Chainmail Helmet", - "text_type": "chainmail_helmet" - }, - { - "type": 303, - "meta": 0, - "name": "Chainmail Chestplate", - "text_type": "chainmail_chestplate" - }, - { - "type": 304, - "meta": 0, - "name": "Chainmail Leggings", - "text_type": "chainmail_leggings" - }, - { - "type": 305, - "meta": 0, - "name": "Chainmail Boots", - "text_type": "chainmail_boots" - }, - { - "type": 306, - "meta": 0, - "name": "Iron Helmet", - "text_type": "iron_helmet" - }, - { - "type": 307, - "meta": 0, - "name": "Iron Chestplate", - "text_type": "iron_chestplate" - }, - { - "type": 308, - "meta": 0, - "name": "Iron Leggings", - "text_type": "iron_leggings" - }, - { - "type": 309, - "meta": 0, - "name": "Iron Boots", - "text_type": "iron_boots" - }, - { - "type": 310, - "meta": 0, - "name": "Diamond Helmet", - "text_type": "diamond_helmet" - }, - { - "type": 311, - "meta": 0, - "name": "Diamond Chestplate", - "text_type": "diamond_chestplate" - }, - { - "type": 312, - "meta": 0, - "name": "Diamond Leggings", - "text_type": "diamond_leggings" - }, - { - "type": 313, - "meta": 0, - "name": "Diamond Boots", - "text_type": "diamond_boots" - }, - { - "type": 314, - "meta": 0, - "name": "Golden Helmet", - "text_type": "golden_helmet" - }, - { - "type": 315, - "meta": 0, - "name": "Golden Chestplate", - "text_type": "golden_chestplate" - }, - { - "type": 316, - "meta": 0, - "name": "Golden Leggings", - "text_type": "golden_leggings" - }, - { - "type": 317, - "meta": 0, - "name": "Golden Boots", - "text_type": "golden_boots" - }, - { - "type": 318, - "meta": 0, - "name": "Flint", - "text_type": "flint" - }, - { - "type": 319, - "meta": 0, - "name": "Raw Porkchop", - "text_type": "porkchop" - }, - { - "type": 320, - "meta": 0, - "name": "Cooked Porkchop", - "text_type": "cooked_porkchop" - }, - { - "type": 321, - "meta": 0, - "name": "Painting", - "text_type": "painting" - }, - { - "type": 322, - "meta": 0, - "name": "Golden Apple", - "text_type": "golden_apple" - }, - { - "type": 322, - "meta": 1, - "name": "Enchanted Golden Apple", - "text_type": "golden_apple" - }, - { - "type": 323, - "meta": 0, - "name": "Sign", - "text_type": "sign" - }, - { - "type": 324, - "meta": 0, - "name": "Oak Door", - "text_type": "wooden_door" - }, - { - "type": 325, - "meta": 0, - "name": "Bucket", - "text_type": "bucket" - }, - { - "type": 326, - "meta": 0, - "name": "Water Bucket", - "text_type": "water_bucket" - }, - { - "type": 327, - "meta": 0, - "name": "Lava Bucket", - "text_type": "lava_bucket" - }, - { - "type": 328, - "meta": 0, - "name": "Minecart", - "text_type": "minecart" - }, - { - "type": 329, - "meta": 0, - "name": "Saddle", - "text_type": "saddle" - }, - { - "type": 330, - "meta": 0, - "name": "Iron Door", - "text_type": "iron_door" - }, - { - "type": 331, - "meta": 0, - "name": "Redstone", - "text_type": "redstone" - }, - { - "type": 332, - "meta": 0, - "name": "Snowball", - "text_type": "snowball" - }, - { - "type": 333, - "meta": 0, - "name": "Oak Boat", - "text_type": "boat" - }, - { - "type": 334, - "meta": 0, - "name": "Leather", - "text_type": "leather" - }, - { - "type": 335, - "meta": 0, - "name": "Milk Bucket", - "text_type": "milk_bucket" - }, - { - "type": 336, - "meta": 0, - "name": "Brick", - "text_type": "brick" - }, - { - "type": 337, - "meta": 0, - "name": "Clay", - "text_type": "clay_ball" - }, - { - "type": 338, - "meta": 0, - "name": "Sugar Canes", - "text_type": "reeds" - }, - { - "type": 339, - "meta": 0, - "name": "Paper", - "text_type": "paper" - }, - { - "type": 340, - "meta": 0, - "name": "Book", - "text_type": "book" - }, - { - "type": 341, - "meta": 0, - "name": "Slimeball", - "text_type": "slime_ball" - }, - { - "type": 342, - "meta": 0, - "name": "Minecart with Chest", - "text_type": "chest_minecart" - }, - { - "type": 343, - "meta": 0, - "name": "Minecart with Furnace", - "text_type": "furnace_minecart" - }, - { - "type": 344, - "meta": 0, - "name": "Egg", - "text_type": "egg" - }, - { - "type": 345, - "meta": 0, - "name": "Compass", - "text_type": "compass" - }, - { - "type": 346, - "meta": 0, - "name": "Fishing Rod", - "text_type": "fishing_rod" - }, - { - "type": 347, - "meta": 0, - "name": "Clock", - "text_type": "clock" - }, - { - "type": 348, - "meta": 0, - "name": "Glowstone Dust", - "text_type": "glowstone_dust" - }, - { - "type": 349, - "meta": 0, - "name": "Raw Fish", - "text_type": "fish" - }, - { - "type": 349, - "meta": 1, - "name": "Raw Salmon", - "text_type": "fish" - }, - { - "type": 349, - "meta": 2, - "name": "Clownfish", - "text_type": "fish" - }, - { - "type": 349, - "meta": 3, - "name": "Pufferfish", - "text_type": "fish" - }, - { - "type": 350, - "meta": 0, - "name": "Cooked Fish", - "text_type": "cooked_fish" - }, - { - "type": 350, - "meta": 1, - "name": "Cooked Salmon", - "text_type": "cooked_fish" - }, - { - "type": 351, - "meta": 0, - "name": "Ink Sack", - "text_type": "dye" - }, - { - "type": 351, - "meta": 1, - "name": "Rose Red", - "text_type": "dye" - }, - { - "type": 351, - "meta": 2, - "name": "Cactus Green", - "text_type": "dye" - }, - { - "type": 351, - "meta": 3, - "name": "Coco Beans", - "text_type": "dye" - }, - { - "type": 351, - "meta": 4, - "name": "Lapis Lazuli", - "text_type": "dye" - }, - { - "type": 351, - "meta": 5, - "name": "Purple Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 6, - "name": "Cyan Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 7, - "name": "Light Gray Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 8, - "name": "Gray Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 9, - "name": "Pink Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 10, - "name": "Lime Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 11, - "name": "Dandelion Yellow", - "text_type": "dye" - }, - { - "type": 351, - "meta": 12, - "name": "Light Blue Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 13, - "name": "Magenta Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 14, - "name": "Orange Dye", - "text_type": "dye" - }, - { - "type": 351, - "meta": 15, - "name": "Bone Meal", - "text_type": "dye" - }, - { - "type": 352, - "meta": 0, - "name": "Bone", - "text_type": "bone" - }, - { - "type": 353, - "meta": 0, - "name": "Sugar", - "text_type": "sugar" - }, - { - "type": 354, - "meta": 0, - "name": "Cake", - "text_type": "cake" - }, - { - "type": 355, - "meta": 0, - "name": "Bed", - "text_type": "bed" - }, - { - "type": 356, - "meta": 0, - "name": "Redstone Repeater", - "text_type": "repeater" - }, - { - "type": 357, - "meta": 0, - "name": "Cookie", - "text_type": "cookie" - }, - { - "type": 358, - "meta": 0, - "name": "Map", - "text_type": "filled_map" - }, - { - "type": 359, - "meta": 0, - "name": "Shears", - "text_type": "shears" - }, - { - "type": 360, - "meta": 0, - "name": "Melon", - "text_type": "melon" - }, - { - "type": 361, - "meta": 0, - "name": "Pumpkin Seeds", - "text_type": "pumpkin_seeds" - }, - { - "type": 362, - "meta": 0, - "name": "Melon Seeds", - "text_type": "melon_seeds" - }, - { - "type": 363, - "meta": 0, - "name": "Raw Beef", - "text_type": "beef" - }, - { - "type": 364, - "meta": 0, - "name": "Steak", - "text_type": "cooked_beef" - }, - { - "type": 365, - "meta": 0, - "name": "Raw Chicken", - "text_type": "chicken" - }, - { - "type": 366, - "meta": 0, - "name": "Cooked Chicken", - "text_type": "cooked_chicken" - }, - { - "type": 367, - "meta": 0, - "name": "Rotten Flesh", - "text_type": "rotten_flesh" - }, - { - "type": 368, - "meta": 0, - "name": "Ender Pearl", - "text_type": "ender_pearl" - }, - { - "type": 369, - "meta": 0, - "name": "Blaze Rod", - "text_type": "blaze_rod" - }, - { - "type": 370, - "meta": 0, - "name": "Ghast Tear", - "text_type": "ghast_tear" - }, - { - "type": 371, - "meta": 0, - "name": "Gold Nugget", - "text_type": "gold_nugget" - }, - { - "type": 372, - "meta": 0, - "name": "Nether Wart", - "text_type": "nether_wart" - }, - { - "type": 373, - "meta": 0, - "name": "Potion", - "text_type": "potion" - }, - { - "type": 374, - "meta": 0, - "name": "Glass Bottle", - "text_type": "glass_bottle" - }, - { - "type": 375, - "meta": 0, - "name": "Spider Eye", - "text_type": "spider_eye" - }, - { - "type": 376, - "meta": 0, - "name": "Fermented Spider Eye", - "text_type": "fermented_spider_eye" - }, - { - "type": 377, - "meta": 0, - "name": "Blaze Powder", - "text_type": "blaze_powder" - }, - { - "type": 378, - "meta": 0, - "name": "Magma Cream", - "text_type": "magma_cream" - }, - { - "type": 379, - "meta": 0, - "name": "Brewing Stand", - "text_type": "brewing_stand" - }, - { - "type": 380, - "meta": 0, - "name": "Cauldron", - "text_type": "cauldron" - }, - { - "type": 381, - "meta": 0, - "name": "Eye of Ender", - "text_type": "ender_eye" - }, - { - "type": 382, - "meta": 0, - "name": "Glistering Melon", - "text_type": "speckled_melon" - }, - { - "type": 383, - "meta": 4, - "name": "Spawn Elder Guardian", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 5, - "name": "Spawn Wither Skeleton", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 6, - "name": "Spawn Stray", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 23, - "name": "Spawn Husk", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 27, - "name": "Spawn Zombie Villager", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 28, - "name": "Spawn Skeleton Horse", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 29, - "name": "Spawn Zombie Horse", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 31, - "name": "Spawn Donkey", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 32, - "name": "Spawn Mule", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 34, - "name": "Spawn Evoker", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 35, - "name": "Spawn Vex", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 36, - "name": "Spawn Vindicator", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 50, - "name": "Spawn Creeper", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 51, - "name": "Spawn Skeleton", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 52, - "name": "Spawn Spider", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 54, - "name": "Spawn Zombie", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 55, - "name": "Spawn Slime", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 56, - "name": "Spawn Ghast", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 57, - "name": "Spawn Zombie Pigman", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 58, - "name": "Spawn Enderman", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 59, - "name": "Spawn Cave Spider", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 60, - "name": "Spawn Silverfish", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 61, - "name": "Spawn Blaze", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 62, - "name": "Spawn Magma Cube", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 65, - "name": "Spawn Bat", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 66, - "name": "Spawn Witch", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 67, - "name": "Spawn Endermite", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 68, - "name": "Spawn Guardian", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 69, - "name": "Spawn Shulker", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 90, - "name": "Spawn Pig", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 91, - "name": "Spawn Sheep", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 92, - "name": "Spawn Cow", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 93, - "name": "Spawn Chicken", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 94, - "name": "Spawn Squid", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 95, - "name": "Spawn Wolf", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 96, - "name": "Spawn Mooshroom", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 98, - "name": "Spawn Ocelot", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 100, - "name": "Spawn Horse", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 101, - "name": "Spawn Rabbit", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 102, - "name": "Spawn Polar Bear", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 103, - "name": "Spawn Llama", - "text_type": "spawn_egg" - }, - { - "type": 383, - "meta": 120, - "name": "Spawn Villager", - "text_type": "spawn_egg" - }, - { - "type": 384, - "meta": 0, - "name": "Bottle o' Enchanting", - "text_type": "experience_bottle" - }, - { - "type": 385, - "meta": 0, - "name": "Fire Charge", - "text_type": "fire_charge" - }, - { - "type": 386, - "meta": 0, - "name": "Book and Quill", - "text_type": "writable_book" - }, - { - "type": 387, - "meta": 0, - "name": "Written Book", - "text_type": "written_book" - }, - { - "type": 388, - "meta": 0, - "name": "Emerald", - "text_type": "emerald" - }, - { - "type": 389, - "meta": 0, - "name": "Item Frame", - "text_type": "item_frame" - }, - { - "type": 390, - "meta": 0, - "name": "Flower Pot", - "text_type": "flower_pot" - }, - { - "type": 391, - "meta": 0, - "name": "Carrot", - "text_type": "carrot" - }, - { - "type": 392, - "meta": 0, - "name": "Potato", - "text_type": "potato" - }, - { - "type": 393, - "meta": 0, - "name": "Baked Potato", - "text_type": "baked_potato" - }, - { - "type": 394, - "meta": 0, - "name": "Poisonous Potato", - "text_type": "poisonous_potato" - }, - { - "type": 395, - "meta": 0, - "name": "Empty Map", - "text_type": "map" - }, - { - "type": 396, - "meta": 0, - "name": "Golden Carrot", - "text_type": "golden_carrot" - }, - { - "type": 397, - "meta": 0, - "name": "Mob Head (Skeleton)", - "text_type": "skull" - }, - { - "type": 397, - "meta": 1, - "name": "Mob Head (Wither Skeleton)", - "text_type": "skull" - }, - { - "type": 397, - "meta": 2, - "name": "Mob Head (Zombie)", - "text_type": "skull" - }, - { - "type": 397, - "meta": 3, - "name": "Mob Head (Human)", - "text_type": "skull" - }, - { - "type": 397, - "meta": 4, - "name": "Mob Head (Creeper)", - "text_type": "skull" - }, - { - "type": 397, - "meta": 5, - "name": "Mob Head (Dragon)", - "text_type": "skull" - }, - { - "type": 398, - "meta": 0, - "name": "Carrot on a Stick", - "text_type": "carrot_on_a_stick" - }, - { - "type": 399, - "meta": 0, - "name": "Nether Star", - "text_type": "nether_star" - }, - { - "type": 400, - "meta": 0, - "name": "Pumpkin Pie", - "text_type": "pumpkin_pie" - }, - { - "type": 401, - "meta": 0, - "name": "Firework Rocket", - "text_type": "fireworks" - }, - { - "type": 402, - "meta": 0, - "name": "Firework Star", - "text_type": "firework_charge" - }, - { - "type": 403, - "meta": 0, - "name": "Enchanted Book", - "text_type": "enchanted_book" - }, - { - "type": 404, - "meta": 0, - "name": "Redstone Comparator", - "text_type": "comparator" - }, - { - "type": 405, - "meta": 0, - "name": "Nether Brick", - "text_type": "netherbrick" - }, - { - "type": 406, - "meta": 0, - "name": "Nether Quartz", - "text_type": "quartz" - }, - { - "type": 407, - "meta": 0, - "name": "Minecart with TNT", - "text_type": "tnt_minecart" - }, - { - "type": 408, - "meta": 0, - "name": "Minecart with Hopper", - "text_type": "hopper_minecart" - }, - { - "type": 409, - "meta": 0, - "name": "Prismarine Shard", - "text_type": "prismarine_shard" - }, - { - "type": 410, - "meta": 0, - "name": "Prismarine Crystals", - "text_type": "prismarine_crystals" - }, - { - "type": 411, - "meta": 0, - "name": "Raw Rabbit", - "text_type": "rabbit" - }, - { - "type": 412, - "meta": 0, - "name": "Cooked Rabbit", - "text_type": "cooked_rabbit" - }, - { - "type": 413, - "meta": 0, - "name": "Rabbit Stew", - "text_type": "rabbit_stew" - }, - { - "type": 414, - "meta": 0, - "name": "Rabbit's Foot", - "text_type": "rabbit_foot" - }, - { - "type": 415, - "meta": 0, - "name": "Rabbit Hide", - "text_type": "rabbit_hide" - }, - { - "type": 416, - "meta": 0, - "name": "Armor Stand", - "text_type": "armor_stand" - }, - { - "type": 417, - "meta": 0, - "name": "Iron Horse Armor", - "text_type": "iron_horse_armor" - }, - { - "type": 418, - "meta": 0, - "name": "Golden Horse Armor", - "text_type": "golden_horse_armor" - }, - { - "type": 419, - "meta": 0, - "name": "Diamond Horse Armor", - "text_type": "diamond_horse_armor" - }, - { - "type": 420, - "meta": 0, - "name": "Lead", - "text_type": "lead" - }, - { - "type": 421, - "meta": 0, - "name": "Name Tag", - "text_type": "name_tag" - }, - { - "type": 422, - "meta": 0, - "name": "Minecart with Command Block", - "text_type": "command_block_minecart" - }, - { - "type": 423, - "meta": 0, - "name": "Raw Mutton", - "text_type": "mutton" - }, - { - "type": 424, - "meta": 0, - "name": "Cooked Mutton", - "text_type": "cooked_mutton" - }, - { - "type": 425, - "meta": 0, - "name": "Banner", - "text_type": "banner" - }, - { - "type": 427, - "meta": 0, - "name": "Spruce Door", - "text_type": "spruce_door" - }, - { - "type": 428, - "meta": 0, - "name": "Birch Door", - "text_type": "birch_door" - }, - { - "type": 429, - "meta": 0, - "name": "Jungle Door", - "text_type": "jungle_door" - }, - { - "type": 430, - "meta": 0, - "name": "Acacia Door", - "text_type": "acacia_door" - }, - { - "type": 431, - "meta": 0, - "name": "Dark Oak Door", - "text_type": "dark_oak_door" - }, - { - "type": 432, - "meta": 0, - "name": "Chorus Fruit", - "text_type": "chorus_fruit" - }, - { - "type": 433, - "meta": 0, - "name": "Popped Chorus Fruit", - "text_type": "popped_chorus_fruit" - }, - { - "type": 434, - "meta": 0, - "name": "Beetroot", - "text_type": "beetroot" - }, - { - "type": 435, - "meta": 0, - "name": "Beetroot Seeds", - "text_type": "beetroot_seeds" - }, - { - "type": 436, - "meta": 0, - "name": "Beetroot Soup", - "text_type": "beetroot_soup" - }, - { - "type": 437, - "meta": 0, - "name": "Dragon's Breath", - "text_type": "dragon_breath" - }, - { - "type": 438, - "meta": 0, - "name": "Splash Potion", - "text_type": "splash_potion" - }, - { - "type": 439, - "meta": 0, - "name": "Spectral Arrow", - "text_type": "spectral_arrow" - }, - { - "type": 440, - "meta": 0, - "name": "Tipped Arrow", - "text_type": "tipped_arrow" - }, - { - "type": 441, - "meta": 0, - "name": "Lingering Potion", - "text_type": "lingering_potion" - }, - { - "type": 442, - "meta": 0, - "name": "Shield", - "text_type": "shield" - }, - { - "type": 443, - "meta": 0, - "name": "Elytra", - "text_type": "elytra" - }, - { - "type": 444, - "meta": 0, - "name": "Spruce Boat", - "text_type": "spruce_boat" - }, - { - "type": 445, - "meta": 0, - "name": "Birch Boat", - "text_type": "birch_boat" - }, - { - "type": 446, - "meta": 0, - "name": "Jungle Boat", - "text_type": "jungle_boat" - }, - { - "type": 447, - "meta": 0, - "name": "Acacia Boat", - "text_type": "acacia_boat" - }, - { - "type": 448, - "meta": 0, - "name": "Dark Oak Boat", - "text_type": "dark_oak_boat" - }, - { - "type": 449, - "meta": 0, - "name": "Totem of Undying", - "text_type": "totem_of_undying" - }, - { - "type": 450, - "meta": 0, - "name": "Shulker Shell", - "text_type": "shulker_shell" - }, - { - "type": 452, - "meta": 0, - "name": "Iron Nugget", - "text_type": "iron_nugget" - }, - { - "type": 2256, - "meta": 0, - "name": "13 Disc", - "text_type": "record_13" - }, - { - "type": 2257, - "meta": 0, - "name": "Cat Disc", - "text_type": "record_cat" - }, - { - "type": 2258, - "meta": 0, - "name": "Blocks Disc", - "text_type": "record_blocks" - }, - { - "type": 2259, - "meta": 0, - "name": "Chirp Disc", - "text_type": "record_chirp" - }, - { - "type": 2260, - "meta": 0, - "name": "Far Disc", - "text_type": "record_far" - }, - { - "type": 2261, - "meta": 0, - "name": "Mall Disc", - "text_type": "record_mall" - }, - { - "type": 2262, - "meta": 0, - "name": "Mellohi Disc", - "text_type": "record_mellohi" - }, - { - "type": 2263, - "meta": 0, - "name": "Stal Disc", - "text_type": "record_stal" - }, - { - "type": 2264, - "meta": 0, - "name": "Strad Disc", - "text_type": "record_strad" - }, - { - "type": 2265, - "meta": 0, - "name": "Ward Disc", - "text_type": "record_ward" - }, - { - "type": 2266, - "meta": 0, - "name": "11 Disc", - "text_type": "record_11" - }, - { - "type": 2267, - "meta": 0, - "name": "Wait Disc", - "text_type": "record_wait" - } -]
\ No newline at end of file diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 5f24404..9cbb6df 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -21,7 +21,6 @@ namespace fs = std::filesystem; const fs::path pathToAssets = "./assets/"; const std::string pathToAssetsList = "./items.json"; -std::map<std::string, BlockId> assetIds; std::map<BlockId, std::string> blockIdToBlockName; std::unique_ptr<AssetTreeNode> assetTree; std::unique_ptr<TextureAtlas> atlas; @@ -29,7 +28,6 @@ std::map<BlockId, BlockFaces> blockIdToBlockFaces; BlockFaces errorFaces; -void LoadIds(); void LoadAssets(); void LoadTextures(); void LoadScripts(); @@ -62,7 +60,6 @@ void AssetManager::InitAssetManager() LoadTextures(); - LoadIds(); ParseBlockModels(); PluginSystem::Init(); @@ -79,19 +76,6 @@ void AssetManager::InitPostRml() { } } -void LoadIds() { - std::ifstream in(pathToAssetsList); - nlohmann::json index; - in >> index; - for (auto &it : index) { - unsigned short id = it["type"].get<int>(); - unsigned char state = it["meta"].get<int>(); - std::string blockName = it["text_type"].get<std::string>(); - assetIds[blockName] = BlockId{ id, state }; - } - LOG(INFO) << "Loaded " << assetIds.size() << " ids"; -} - void LoadAssets() { assetTree = std::make_unique<AssetTreeNode>(); assetTree->name = "/"; @@ -661,16 +645,6 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) { return blockIdToBlockFaces.insert(std::make_pair(block, blockFaces)).first->second; } -std::string AssetManager::GetAssetNameByBlockId(BlockId block) { - for (auto& it : assetIds) { - BlockId value = it.second; - value.state = 0; - if (value == block) - return it.first; - } - return "#NF"; -} - Asset *AssetManager::GetAssetPtr(const std::string & assetName) { OPTICK_EVENT(); AssetTreeNode *node; diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index b67d920..7f6c4fb 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -178,8 +178,6 @@ namespace AssetManager { BlockFaces &GetBlockModelByBlockId(BlockId block); - std::string GetAssetNameByBlockId(BlockId block); - Asset *GetAssetPtr(const std::string &assetName); template <typename T> diff --git a/src/DebugInfo.cpp b/src/DebugInfo.cpp index 89e9425..37d181d 100644 --- a/src/DebugInfo.cpp +++ b/src/DebugInfo.cpp @@ -4,4 +4,5 @@ std::atomic_int DebugInfo::totalSections(0); std::atomic_int DebugInfo::renderSections(0); std::atomic_int DebugInfo::readyRenderer(0); std::atomic_int DebugInfo::gameThreadTime(0); -std::atomic_int DebugInfo::renderFaces(0);
\ No newline at end of file +std::atomic_int DebugInfo::renderFaces(0); +std::atomic_int DebugInfo::culledSections(0); diff --git a/src/DebugInfo.hpp b/src/DebugInfo.hpp index e6aa17c..7ba1686 100644 --- a/src/DebugInfo.hpp +++ b/src/DebugInfo.hpp @@ -5,7 +5,8 @@ struct DebugInfo { static std::atomic_int totalSections; static std::atomic_int renderSections; + static std::atomic_int culledSections; static std::atomic_int readyRenderer; static std::atomic_int gameThreadTime; static std::atomic_int renderFaces; -};
\ No newline at end of file +}; diff --git a/src/Game.hpp b/src/Game.hpp index f7efd11..74eeea9 100644 --- a/src/Game.hpp +++ b/src/Game.hpp @@ -13,6 +13,7 @@ enum class State { Paused, Inventory, Chat, + NeedRespawn, }; void RunGame(); diff --git a/src/GameState.cpp b/src/GameState.cpp index be408dd..89743e4 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -6,6 +6,8 @@ #include "Event.hpp" #include "Packet.hpp" +#include "Game.hpp" +#include "Plugin.hpp" void GameState::Update(double deltaTime) { OPTICK_EVENT(); @@ -167,7 +169,7 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { case ChatMessageCB: { auto packet = std::static_pointer_cast<PacketChatMessageCB>(ptr); LOG(INFO) << "Message (" << int(packet->Position) << "): " << packet->JsonData.ToPlainText(); - PUSH_EVENT("ChatMessageReceived", std::make_tuple(packet->JsonData, packet->Position)); + PluginSystem::CallOnChatMessage(packet->JsonData, packet->Position); break; } @@ -383,7 +385,6 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { auto packetResponse = std::make_shared<PacketTeleportConfirm>(packet->TeleportId); PUSH_EVENT("SendPacket", std::static_pointer_cast<Packet>(packetResponse)); - break; } @@ -418,6 +419,9 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { gameStatus.dimension = packet->Dimension; gameStatus.difficulty = packet->Difficulty; gameStatus.levelType = packet->LevelType; + SetState(State::Loading); + gameStatus.isGameStarted = false; + receivedEnoughChunks = false; break; } case EntityHeadLook: @@ -453,9 +457,8 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) { auto packet = std::static_pointer_cast<PacketUpdateHealth>(ptr); playerStatus.health = packet->Health; if (playerStatus.health <= 0) { - LOG(INFO) << "Player is dead. Respawning..."; - auto packetPerformRespawn = std::make_shared<PacketClientStatus>(0); - PUSH_EVENT("SendPacket", std::static_pointer_cast<Packet>(packetPerformRespawn)); + LOG(INFO) << "Player is dead. Need respawn..."; + SetState(State::NeedRespawn); } break; } @@ -678,4 +681,9 @@ void GameState::PlaceBlock() { auto packet = std::static_pointer_cast<Packet>(packetPlace); PUSH_EVENT("SendPacket", packet); -}
\ No newline at end of file +} + +void GameState::PerformRespawn() { + auto packetPerformRespawn = std::make_shared<PacketClientStatus>(0); + PUSH_EVENT("SendPacket", std::static_pointer_cast<Packet>(packetPerformRespawn)); +} diff --git a/src/GameState.hpp b/src/GameState.hpp index 0ca858f..ca2ea81 100644 --- a/src/GameState.hpp +++ b/src/GameState.hpp @@ -75,6 +75,8 @@ class GameState { bool receivedFirstPlayerPosAndLook = false; + std::shared_ptr<PacketRespawn> packetRespawn; + public: void Update(double deltaTime); @@ -89,6 +91,8 @@ public: void PlaceBlock(); + void PerformRespawn(); + enum MoveType { FORWARD, BACKWARD, LEFT, RIGHT, JUMP }; diff --git a/src/Plugin.cpp b/src/Plugin.cpp index ce995fc..98df8c3 100644 --- a/src/Plugin.cpp +++ b/src/Plugin.cpp @@ -11,6 +11,8 @@ #include "Event.hpp" #include "AssetManager.hpp" #include "Settings.hpp" +#include "DebugInfo.hpp" +#include "Chat.hpp" struct Plugin { @@ -22,6 +24,7 @@ struct Plugin { const std::function<void(std::string)> onChangeState; const std::function<void(double)> onTick; const std::function<BlockInfo(Vector)> onRequestBlockInfo; + const std::function<void(Chat, int)> onChatMessage; }; @@ -41,6 +44,7 @@ namespace PluginApi { plugin["onChangeState"].get_or(std::function<void(std::string)>()), plugin["onTick"].get_or(std::function<void(double)>()), plugin["onRequestBlockInfo"].get_or(std::function<BlockInfo(Vector)>()), + plugin["onChatMessage"].get_or(std::function<void(Chat, int)>()), }; plugins.push_back(nativePlugin); LOG(INFO)<<"Loading plugin " << (!nativePlugin.displayName.empty() ? nativePlugin.displayName : nativePlugin.name); @@ -108,6 +112,29 @@ namespace PluginApi { void SettingsUpdate() { PUSH_EVENT("SettingsUpdate", 0); } + + int GetDebugValue(int valId) { + switch (valId) { + case 0: + return DebugInfo::totalSections; + case 1: + return DebugInfo::renderSections; + case 2: + return DebugInfo::readyRenderer; + case 3: + return DebugInfo::gameThreadTime; + case 4: + return DebugInfo::renderFaces; + case 5: + return DebugInfo::culledSections; + default: + return 0; + } + } + + void SendChatMessage(const std::string& msg) { + PUSH_EVENT("SendChatMessage", msg); + } } int LoadFileRequire(lua_State* L) { @@ -154,7 +181,8 @@ void PluginSystem::Init() { "GetGameStatus", &GameState::GetGameStatus, "GetPlayerStatus", &GameState::GetPlayerStatus, "GetSelectionStatus", &GameState::GetSelectionStatus, - "GetInventory", &GameState::GetInventory); + "GetInventory", &GameState::GetInventory, + "PerformRespawn", &GameState::PerformRespawn); lua.new_usertype<TimeStatus>("TimeStatus", "interpolatedTimeOfDay", &TimeStatus::interpolatedTimeOfDay, @@ -194,6 +222,8 @@ void PluginSystem::Init() { "GetEntitiesList", &World::GetEntitiesList, "GetEntity",&World::GetEntityPtr, "Raycast", &World::Raycast, + "GetBlockLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockLight), + "GetBlockSkyLight", sol::resolve<unsigned char(Vector)const>(&World::GetBlockSkyLight), "GetBlockId", &World::GetBlockId, "SetBlockId", &World::SetBlockId); @@ -242,6 +272,9 @@ void PluginSystem::Init() { "GetDeltaS", &LoopExecutionTimeController::GetDeltaS, "GetRealDeltaS", &LoopExecutionTimeController::GetRealDeltaS); + lua.new_usertype<Chat>("Chat", + "ToPlainText", &Chat::ToPlainText); + sol::table apiTable = lua["AC"].get_or_create<sol::table>(); sol::table apiSettings = lua["AC"]["Settings"].get_or_create<sol::table>(); @@ -268,6 +301,9 @@ void PluginSystem::Init() { apiSettings["WriteDouble"] = Settings::WriteDouble; apiTable["SettingsUpdate"] = PluginApi::SettingsUpdate; apiTable["GetTime"] = GetTime; + apiTable["GetBlockInfo"] = GetBlockInfo; + apiTable["GetDebugValue"] = PluginApi::GetDebugValue; + apiTable["SendChatMessage"] = PluginApi::SendChatMessage; } lua_State* PluginSystem::GetLuaState() { @@ -331,3 +367,17 @@ BlockInfo PluginSystem::RequestBlockInfo(Vector blockPos) { } return ret; } + +void PluginSystem::CallOnChatMessage(const Chat& chat, int position) { + OPTICK_EVENT(); + for (Plugin& plugin : plugins) { + if (plugin.onRequestBlockInfo && plugin.errors < 10) + try { + plugin.onChatMessage(chat, position); + } + catch (sol::error& e) { + LOG(ERROR) << e.what(); + plugin.errors++; + } + } +} diff --git a/src/Plugin.hpp b/src/Plugin.hpp index 7af27a4..13b126e 100644 --- a/src/Plugin.hpp +++ b/src/Plugin.hpp @@ -6,6 +6,7 @@ class BlockInfo; struct lua_State; +class Chat; namespace PluginSystem { void Init(); @@ -19,4 +20,6 @@ namespace PluginSystem { void CallOnTick(double deltaTime); BlockInfo RequestBlockInfo(Vector blockPos); + + void CallOnChatMessage(const Chat& chat, int position); }
\ No newline at end of file diff --git a/src/Render.cpp b/src/Render.cpp index bee8ffb..896a05f 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -4,6 +4,7 @@ #include <optick.h> #include <RmlUi/Core.h> #include <RmlUi/Lua.h> +#include <RmlUi/Debugger.h> #include "Shader.hpp" #include "AssetManager.hpp" @@ -28,7 +29,8 @@ const std::map<SDL_Keycode, Rml::Input::KeyIdentifier> keyMapping = { {SDLK_RIGHT, Rml::Input::KI_RIGHT}, {SDLK_UP, Rml::Input::KI_UP}, {SDLK_DOWN, Rml::Input::KI_DOWN}, - {SDLK_TAB, Rml::Input::KI_TAB} + {SDLK_TAB, Rml::Input::KI_TAB}, + {SDLK_RETURN, Rml::Input::KI_RETURN} }; inline int ConvertKeymodsSdlToRml(unsigned short keyMods) { @@ -287,9 +289,19 @@ void Render::HandleEvents() { if (state == State::Playing) { SetState(State::Chat); } - else if (state == State::Chat) { - SetState(State::Playing); - } + break; + } + + case SDL_SCANCODE_F4: + hideRml = !hideRml; + break; + + case SDL_SCANCODE_F8: + Rml::Debugger::SetVisible(!Rml::Debugger::IsVisible()); + break; + + case SDL_SCANCODE_F7: { + SetMouseCapture(!isMouseCaptured); break; } @@ -358,6 +370,11 @@ void Render::HandleEvents() { break; } + case SDL_MOUSEWHEEL: { + rmlContext->ProcessMouseWheel(-event.wheel.y, rmlKeymods); + break; + } + case SDL_TEXTINPUT: { rmlContext->ProcessTextInput(Rml::String(event.text.text)); break; @@ -417,7 +434,8 @@ void Render::Update() { void Render::RenderGui() { OPTICK_EVENT(); - rmlContext->Render(); + if (!hideRml) + rmlContext->Render(); } void Render::InitEvents() { @@ -462,12 +480,6 @@ void Render::InitEvents() { SetState(State::Loading); }); - listener.RegisterHandler("ChatMessageReceived", [this](const Event& eventData) { - auto data = eventData.get<std::tuple<Chat, unsigned char>>(); - std::string msg = "(" + std::to_string((int)std::get<1>(data)) + ") " + (std::get<0>(data).ToPlainText()); - chatMessages.push_back(msg); - }); - listener.RegisterHandler("StateUpdated", [this](const Event& eventData) { switch (GetState()) { case State::Playing: @@ -498,6 +510,10 @@ void Render::InitEvents() { PluginSystem::CallOnChangeState("Chat"); SetMouseCapture(false); break; + case State::NeedRespawn: + PluginSystem::CallOnChangeState("NeedRespawn"); + SetMouseCapture(false); + break; } }); @@ -563,4 +579,7 @@ void Render::InitRml() { Rml::Lua::Initialise(PluginSystem::GetLuaState()); rmlContext = Rml::CreateContext("default", Rml::Vector2i(renderState.WindowWidth, renderState.WindowHeight)); + + if (!Rml::Debugger::Initialise(rmlContext)) + LOG(WARNING) << "Rml debugger not initialized"; } diff --git a/src/Render.hpp b/src/Render.hpp index 4f993c3..9a9feee 100644 --- a/src/Render.hpp +++ b/src/Render.hpp @@ -37,7 +37,6 @@ class Render { float sensetivity = 0.1f; bool isWireframe = false; std::unique_ptr<Framebuffer> framebuffer; - std::vector<std::string> chatMessages; EventListener listener; std::string stateString; std::unique_ptr<RmlRenderInterface> rmlRender; @@ -45,6 +44,7 @@ class Render { std::unique_ptr<RmlFileInterface> rmlFile; Rml::Context* rmlContext; unsigned short sdlKeyMods = 0; + bool hideRml = false; void SetMouseCapture(bool IsCaptured); diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index e3ef738..6996762 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -428,7 +428,7 @@ void RendererWorld::Render(RenderState & renderState) { section.second.Render(renderState); renderedFaces += section.second.numOfFaces; } - this->culledSections = culledSections; + DebugInfo::culledSections = culledSections; DebugInfo::renderFaces = renderedFaces; glCheckError(); } diff --git a/src/RendererWorld.hpp b/src/RendererWorld.hpp index d031179..85cb736 100644 --- a/src/RendererWorld.hpp +++ b/src/RendererWorld.hpp @@ -60,5 +60,4 @@ public: void Update(double timeToUpdate); - int culledSections = 0; -};
\ No newline at end of file +}; diff --git a/src/Rml.cpp b/src/Rml.cpp index 6ed83c1..179d4b9 100644 --- a/src/Rml.cpp +++ b/src/Rml.cpp @@ -117,11 +117,15 @@ void RmlRenderInterface::RenderGeometry(Rml::Vertex* vertices, int num_vertices, } void RmlRenderInterface::EnableScissorRegion(bool enable) { - + if (enable) + glEnable(GL_SCISSOR_TEST); + else + glDisable(GL_SCISSOR_TEST); } void RmlRenderInterface::SetScissorRegion(int x, int y, int width, int height) { - + glScissor(x, vpHeight - (y + height), width, height); + glCheckError(); } bool RmlRenderInterface::LoadTexture(Rml::TextureHandle& texture_handle, Rml::Vector2i& texture_dimensions, const Rml::String& source) { @@ -161,6 +165,8 @@ void RmlRenderInterface::Update(unsigned int windowWidth, unsigned int windowHei AssetManager::GetAsset<AssetShader>("/altcraft/shaders/rmltex")->shader->SetUniform("viewportSize", windowWidth, windowHeight); AssetManager::GetAsset<AssetShader>("/altcraft/shaders/rmltex")->shader->SetUniform("fontTexture", 0); glCheckError(); + vpWidth = windowWidth; + vpHeight = windowHeight; } Rml::FileHandle RmlFileInterface::Open(const Rml::String& path) { diff --git a/src/Rml.hpp b/src/Rml.hpp index 6e4d857..edcdc8b 100644 --- a/src/Rml.hpp +++ b/src/Rml.hpp @@ -34,6 +34,7 @@ class RmlRenderInterface : public Rml::RenderInterface { GLuint Vao, Vbo, Ebo; + unsigned int vpWidth, vpHeight; public: RmlRenderInterface(RenderState &renderState); |