Skip to content

Commit

Permalink
Cleanup (#6)
Browse files Browse the repository at this point in the history
* add luacheck

* add mod.conf remove depends.txt

* locale: remove unused string

* move global definition to top

along with 'global' functions

* whitespace and indentation fix part 1

also minetest.* to core.*

* move lines part 2

* move crafting recipes to own file

* update some comments

some comment code comming in subsequent commits

* cleanup unified_inventory handling

also add blank sticker to unified_inventory

* re-order crafts and add missing recycling recipes

* amendment to unified_inventory cleanup

* rename vars to avoid shadowing to help understand

also minetest -> core

* fix blank sticker mess

* whitespace changes

* use double quotes in user facing strings

* remove or comment out not needed lines

* add sticker group for recycling recepes

* add stray blank sticker registration

* use moder meta getting method

* reduce chat spam

* formspec: remove depricated 'invsize'

* formspec: add listring

So shift-clicking stacks works

* use ipairs not pairs for looping list

* simplify logic and reduce amount of indents needed

* cleanup: stray stuff

* Some more comment tweaks

* Separate block and sticker description

* locale updates

* drop intllib and use core translation

* locale add Spanish and Catalán

* update changelog

and tweak some capitalization issues
  • Loading branch information
SwissalpS authored Dec 21, 2024
1 parent 9cd3c6c commit ac1d13a
Show file tree
Hide file tree
Showing 16 changed files with 536 additions and 615 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master
10 changes: 10 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
globals = {
"ehlphabet",
}

read_globals = {
"core",
"screwdriver",
"unified_inventory",
}

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ Textures are licensed under CC-BY-SA 3.0
See LICENSE file

## Changelist
2024-12-15 cleaned up by SwissalpS. Added stickers, shift-clicking inventories,
recycling recipes and dropped [intllib] in favour of core translation. Also added
Spanish and Catalan locales. (probably some more changes)

2018-01-24 patched by Och_Noe to use it as replacement for abjphabet (create aliases)

2018-03-29 support for UTF-8 and cyrillic letters added
2018-03-29 support for UTF-8 and Cyrillic letters added

2018-03-31 german letters added
2018-03-31 German letters added

2018-04-01 intllib support added with Russian and German languages

2018-04-01 intllib support added with russian and german languages
186 changes: 186 additions & 0 deletions crafts.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
-- TODO: xcompat: paper, stick, coal lump

if ehlphabet.has_unified_inventory then
unified_inventory.register_craft_type("ehlphabet", {
description = "Printing",
icon = 'ehlphabet_machine_front.png',
width = 1,
height = 1,
})

unified_inventory.register_craft({
type = "ehlphabet",
items = { "default:paper" },
output = "ehlphabet:32_sticker",
})
end

-- Build the machine!
core.register_craft({
output = "ehlphabet:machine",
recipe = {
{ "default:stick", "default:coal_lump", "default:stick" },
{ "default:coal_lump", "ehlphabet:block", "default:coal_lump" },
{ "default:stick", "default:coal_lump", "default:stick" },
},
})

-- Blank blocks.
core.register_craft({
output = "ehlphabet:block 8",
recipe = {
{ "default:paper", "default:paper", "default:paper" },
{ "default:paper", "", "default:paper" },
{ "default:paper", "default:paper", "default:paper" },
},
})

-- Uncraft blocks back into paper
core.register_craft({
output = "default:paper",
recipe = { "ehlphabet:block" },
type = "shapeless",
})

-- Recycle printed blocks.
core.register_craft({
type = "shapeless",
output = "ehlphabet:block",
recipe = { "group:ehlphabet_block" },
})

-- Recycle printed stickers.
core.register_craft({
type = "shapeless",
output = "default:paper",
recipe = { "group:ehlphabet_sticker" },
})

-- Chinese character blocks - craft from latin characters.
core.register_craft({
output = "ehlphabet:231140 4",
recipe = {
{ "", "", "" },
{ "ehlphabet:78", "", "" },
{ "ehlphabet:69", "ehlphabet:75", "ehlphabet:79" },
},
})

core.register_craft({
output = "ehlphabet:229140 5",
recipe = {
{ "ehlphabet:78", "ehlphabet:79", "ehlphabet:82" },
{ "ehlphabet:84", "ehlphabet:72", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:228184 5",
recipe = {
{ "ehlphabet:69", "ehlphabet:65", "ehlphabet:83" },
{ "ehlphabet:84", "", "ehlphabet:83" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:230157 5",
recipe = {
{ "ehlphabet:69", "ehlphabet:65", "ehlphabet:83" },
{ "ehlphabet:84", "", "ehlphabet:84" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:229141 5",
recipe = {
{ "ehlphabet:83", "ehlphabet:79", "ehlphabet:85" },
{ "ehlphabet:84", "ehlphabet:72", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:232165 4",
recipe = {
{ "ehlphabet:87", "ehlphabet:69", "ehlphabet:83" },
{ "ehlphabet:84", "", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:231171 7",
recipe = {
{ "ehlphabet:83", "ehlphabet:84", "ehlphabet:65" },
{ "ehlphabet:84", "ehlphabet:73", "ehlphabet:79" },
{ "ehlphabet:78", "", "" },
},
})

-- Chinese stickers.
core.register_craft({
output = "ehlphabet:231140_sticker 4",
recipe = {
{ "", "", ""},
{ "ehlphabet:78_sticker", "", "" },
{ "ehlphabet:69_sticker", "ehlphabet:75_sticker", "ehlphabet:79_sticker" },
},
})

core.register_craft({
output = "ehlphabet:229140_sticker 5",
recipe = {
{ "ehlphabet:78_sticker", "ehlphabet:79_sticker", "ehlphabet:82_sticker" },
{ "ehlphabet:84_sticker", "ehlphabet:72_sticker", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:228184_sticker 5",
recipe = {
{ "ehlphabet:69_sticker", "ehlphabet:65_sticker", "ehlphabet:83_sticker" },
{ "ehlphabet:84_sticker", "", "ehlphabet:83_sticker" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:230157_sticker 5",
recipe = {
{ "ehlphabet:69_sticker", "ehlphabet:65_sticker", "ehlphabet:83_sticker" },
{ "ehlphabet:84_sticker", "", "ehlphabet:84_sticker" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:229141_sticker 5",
recipe = {
{ "ehlphabet:83_sticker", "ehlphabet:79_sticker", "ehlphabet:85_sticker" },
{ "ehlphabet:84_sticker", "ehlphabet:72_sticker", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:232165_sticker 4",
recipe = {
{ "ehlphabet:87_sticker", "ehlphabet:69_sticker", "ehlphabet:83_sticker" },
{ "ehlphabet:84_sticker", "", "" },
{ "", "", "" },
},
})

core.register_craft({
output = "ehlphabet:231171_sticker 7",
recipe = {
{ "ehlphabet:83_sticker", "ehlphabet:84_sticker", "ehlphabet:65_sticker" },
{ "ehlphabet:84_sticker", "ehlphabet:73_sticker", "ehlphabet:79_sticker" },
{ "ehlphabet:78_sticker", "", "" },
},
})

4 changes: 0 additions & 4 deletions depends.txt

This file was deleted.

Loading

0 comments on commit ac1d13a

Please sign in to comment.