Advertisement
thecodewarrior

LangPlus

Feb 6th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.42 KB | None | 0 0
  1. # Guide book
  2. $import %.guides.lang
  3. ${
  4. PC=practicalities
  5.  
  6. M_CORE=${PC}:craftingPiece|1|0
  7. I_CORE=${PC}:craftingPiece|1|2
  8. D_ROD=${PC}:craftingPiece|1|3
  9. NORTH=${PC}:craftingPiece|1|4
  10. SOUTH=${PC}:craftingPiece|1|5
  11.  
  12. IRON=minecraft:iron_ingot
  13. PEARL=minecraft:ender_pearl
  14. DIAMOND=minecraft:diamond
  15. MAGMA_CREAM=minecraft:magma_cream
  16. BLAZE_ROD=minecraft:blaze_rod
  17. STICK=minecraft:stick
  18. }
  19.  
  20.  
  21. guide.list.{
  22. root.text=Root node
  23. root.iconStack=${PC}:practicalGuide
  24.  
  25. items.text=Items
  26. items.iconStack=${PC}:craftingPiece
  27.  
  28. dev.text=§1Developer
  29. dev.iconStack=minecraft:redstone_torch
  30. }
  31.  
  32. guide.entry.COPYME.{
  33. title=Shows in title card
  34.  
  35. list.text=Shows in entry list
  36. list.iconStack=minecraft:item_in_entry_list
  37.  
  38. page.{
  39. 0[
  40. Some text for the first page
  41. ]
  42.  
  43. 1.type=recipe
  44. 1[
  45. [][][]
  46. [][minecraft:dirt][]
  47. [][][]
  48. [${DIAMOND}]
  49. ]
  50. }
  51. }
  52.  
  53.  
  54. guide.entry.example.{
  55. title=Example
  56.  
  57. list.text=Feature Examples
  58. list.iconStack=minecraft:iron_pickaxe|2|111|{ench:[id:32,lvl:6]}
  59.  
  60. page.{
  61. 0[
  62. All of the information in this guide is located in the language file, including recipes and all other information. §oNone§r of it is in the code.
  63.  
  64. It is based on §oEntries§r, each entry can have many pages, and each page can be of one type. Though at this point only text and recipes are implemented. \
  65. A page is defined with at least two* lines in the lang file.
  66.  
  67. §2§oguide.entry.ENTRYNAME.PAGE.type=TYPE
  68. guide.entry.ENTRYNAME.PAGE=CONTENT§r§0
  69.  
  70. The type line can be either §otext§r or §orecipe§r, though if it doesn't exist it will default to §otext§r. \
  71. These formats will be discussed in further detail later.\n\nThe guide book will search forward from page 0->∞ for a plain \
  72. §2§o...PAGE=SOMETHING§r§0 line to determine the length of the guide, stopping once it finds one missing.
  73.  
  74.  
  75.  
  76. *no type line is required for text
  77. ]
  78.  
  79. 1.type=recipe
  80. 1[
  81. [] [minecraft:nether_star|1|0|{display:{Lore:["It's kind of overkill, don't you think?", "you > Yep, it is."]}}] []
  82. [minecraft:iron_pickaxe|1|111|{display:{Name:"SOmeNaMe"},ench:[{id:32,lvl:7268}]}] [${IRON}] [${IRON}]
  83. [${IRON}] [${IRON}] [${IRON}]
  84. [minecraft:iron_bars|3]
  85. ]
  86.  
  87. 1.text[
  88. Recipes consist of 1 (1x1), 4 (2x2), or 9(3x3) items + one result item. The format for an item is as follows
  89. ¡ §7[§0item:id§7|§0stacksize§7|§0damage§7|§0{nbt}§7]§0
  90.  
  91. Any part can be omitted off the end, so specifying the NBT requires also specifying the stack size and damage.
  92. ]
  93.  
  94. 2.type=recipe
  95. 2=[][minecraft:cobblestone][minecraft:sand][][minecraft:nether_star]
  96. 2.text=That makes the previous recipe a bit better.
  97.  
  98. 3.type=recipe
  99. 3=[minecraft:iron_pickaxe][minecraft:iron_pickaxe|1|111|{display:{Name:"SOmeNaMe"},ench:[{id:32,lvl:7268}]}]
  100. 3.text=That makes the recipe even better!
  101.  
  102. 4[
  103. §nChecklist of things to do§r
  104.  
  105. ■ add more types of pages.
  106. ¡ ■ single item display
  107. ¡ ■ single block display
  108. ]
  109. }
  110. }
  111.  
  112. guide.entry.advancedLang.{
  113. title=Advanced Lang Files
  114. list.text=Advanced Language Files
  115. list.iconStack=minecraft:diamond_pickaxe
  116.  
  117. page.0[
  118. The only place advanced language files are used are in the guide language files. \
  119. Guide lang files are not located in the normal §olang§r folder, instead they are located in the §oguides§r folder.
  120.  
  121. Guide files are only loaded for the currently selected language, or en_US if the language file doesn't exist at all.
  122.  
  123. If a page is defined in en_US, but not in the currently selected language, it won't appear.
  124. ]
  125.  
  126.  
  127. page.1[
  128. Advanced language files have three special things about them, they allow you to nest prefixes, multiline strings, and variables.
  129. §2
  130. ${
  131. ¡ name=thingy
  132. ¡ text=Thing™
  133. }
  134. some.lang.line.{
  135. ¡ item=Text stuff
  136. ¡ sub.{
  137. ¡ item=Another
  138. ¡ }
  139. ¡ text[
  140. ¡ Some long
  141. ¡ \${text}
  142. ¡ ]
  143. ¡ \${name}.var=Var®
  144. }§0
  145.  
  146. The previous block translates to the following:
  147. §2
  148. some.lang.line.item=Text stuff
  149. some.lang.line.sub.item=Another
  150. some.lang.line.text=Some long\\nThing™
  151. some.lang.line.thingy.var=Var®
  152. ]
  153.  
  154. page.2[
  155. §lBracket Groups§r
  156.  
  157. §2tile.mymod.{
  158. ¡ myblock.name=My Block
  159. ¡ mygenerator.name=My Genny
  160. }§0
  161.  
  162. Bracket groups allow you to define a common prefix for a region. Such as having all the translations for your blocks \
  163. start with §2tile.§0 to increase the readability of your language files.
  164.  
  165. Groups begin with §2trans.late.{§0 and end with a line who's first non-whitespace character is §2}§0. The text before the curly brace \
  166. is directly prepended to the translations within, meaning most of the time you will want to add a period after the name and before the brace.
  167. ]
  168.  
  169. page.3[
  170. §lText Blocks§r
  171.  
  172. Text blocks allow you to define multiline blocks of text much more easily then you could with a normal lang file. They begin with a line contianing \
  173. §2some.name[§0 and end with a line who's first character is §2]§0. If you want to begin a line with a §2]§0, add a §2¡§0 character somewhere before it.
  174.  
  175. Any whitespace you put after a §2¡§0 (upside down exclamation mark) character is safe.
  176.  
  177. You can wrap lines in a text block without adding newlines by putting a backslash at the end of a line.
  178.  
  179. §2trans.late[
  180. ¡ Here is a line.
  181. ¡ Here is another line. \
  182. ¡ This is on the same line.
  183. ¡
  184. ¡ Here is a paragraph.
  185. ¡ ¡ This is indented.
  186. ¡ ¡] Brackets are cool!
  187. ¡]§0
  188. ]
  189.  
  190. page.4[
  191. §lVariables§r
  192.  
  193. Variables help reduce the amount of repetition in language files by allowing you to re-use commonly used text.
  194.  
  195. Variables are defined in a special area which starts with a line containing only §2${§0 \
  196. and ends with one containing only §2}§0. The variables are defined each on their own line with §2name=value§0. Names can only contain letters, numbers, and underscores.
  197.  
  198. Variables are accessed by putting §2\${name}§0 anywhere in the lang file. Including other variables. If you want to put a literal §2\${*}§0 in your text you can \
  199. escape it with a backslash.
  200. ]
  201. }
  202.  
  203. enchantment.level.7268=MMMMMMMCCLXVIII
  204.  
  205. # Other pages
  206.  
  207. guide.entry.intro.{
  208. title=Introduction
  209. list.text=Introduction
  210. list.iconStack=${PC}:practicalGuide
  211.  
  212. page.0=This is the Practical Guide. It's a very practical thing to have around.
  213. }
  214.  
  215. # magnet
  216. guide.entry.magnet.{
  217. title=Magnet
  218. list.text=Magnet
  219. list.iconStack=${PC}:magnet
  220.  
  221. page.0.type=recipe
  222. page.0[
  223. [${SOUTH}][][${NORTH}]
  224. [${PEARL}][][${PEARL}]
  225. [${IRON}][${M_CORE}][${IRON}]
  226. [${PC}:magnet]
  227. ]
  228. page.0.text=The Magnet is one of the most useful items in Practicalities. Activate it by pressing Sneak+Activate (default is Shift+RClick).
  229. }
  230.  
  231. # matter transporter
  232. guide.entry.transporter.{
  233. title=Matter Transporter
  234. list.text=Matter Transporter
  235. list.iconStack=${PC}:matterTransporter
  236.  
  237. page.0.type=recipe
  238. page.0[
  239. [${PEARL}][][${PEARL}]
  240. [][${DIAMOND}][]
  241. [][${STICK}][]
  242. [${PC}:matterTransporter]
  243. ]
  244. page.0.text=The Matter Transporter allows the player to move nearly any block, including Monster Spawners and nearly all machines!
  245. }
  246.  
  247. #sitis stick
  248. guide.entry.sitis.{
  249. title=Sitis Stick
  250. list.text=Sitis Stick
  251. list.iconStack=${PC}:sitisStick
  252.  
  253. page.0.type=recipe
  254. page.0[
  255. [] [${DIAMOND}] []
  256. [${MAGMA_CREAM}] [${BLAZE_ROD}] [${MAGMA_CREAM}]
  257. [] [${BLAZE_ROD}] []
  258. [${PC}:sitisStick|1|0|{display:{Lore:["Latin for 'drought'"]}}]
  259. ]
  260. page.0.text=The Sitis Stick is capable of stopping the rain. Hold it in your hand and use it like a bow to turn the rainiest of days into sunshine.
  261. }
  262.  
  263. # IMBUED TOOL
  264. guide.entry.imbuedTool.{
  265. title=Imbued Tool
  266. list.text=Imbued Tool
  267. list.iconStack=${PC}:imbuedTool
  268.  
  269. page.0.type=recipe
  270. page.0[
  271. [${I_CORE}][${I_CORE}][${I_CORE}]
  272. [${I_CORE}][${D_ROD}] [${I_CORE}]
  273. [] [${D_ROD}] []
  274. [${PC}:imbuedTool]
  275. ]
  276. page.0.text=The Imbued Tool is an indestructible end-game mine-all pickaxe capable of destroying blocks instantly. Use with caution.
  277. }
  278.  
  279. # IMBUED SWORD
  280. guide.entry.imbuedSword.{
  281. title=Imbued Sword
  282. list.text=Imbued Sword
  283. list.iconStack=${PC}:imbuedSword
  284.  
  285. page.0.type=recipe
  286. page.0[
  287. [][${I_CORE}][]
  288. [][${I_CORE}][]
  289. [][${D_ROD}][]
  290. [${PC}:imbuedSword]
  291. ]
  292. page.0.text=The Imbued Sword is an indestructible end-game sword that can deal tremendous amounts of damage to your opponent.
  293. }
  294.  
  295. # VOID BUCKET
  296. guide.entry.voidBucket.{
  297. title=Void Bucket
  298. list.text=Void bucket
  299. list.iconStack=${PC}:voidBucket
  300.  
  301. page.0.type=recipe
  302. page.0[
  303. [${IRON}] [${PEARL}] [${IRON}]
  304. [] [${IRON}] []
  305. [] [] []
  306. [${PC}:voidBucket]
  307. ]
  308. page.0.text=The Void Bucket voids any liquid it picks up. A great way to clear lava lakes or small ponds.
  309. }
  310.  
  311. # NETHERBANE
  312. guide.entry.netherbane.{
  313. title=Netherbane
  314. list.text=Netherbane
  315. list.iconStack=${PC}:netherbane
  316.  
  317. page.0.type=display
  318. page.0=The Netherbane's existence is disputed. Some say it is "creative only", but some players have found a way to legitimately get it in survival.
  319. page.0.item=${PC}:netherbane|1|0|{display:{Lore:["It glimmers like a black diamond"]}}
  320. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement