06.xhtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. h t t :: / / t /
  4. h t t :: // // t //
  5. h ttttt ttttt ppppp sssss // // y y sssss ttttt //
  6. hhhh t t p p s // // y y s t //
  7. h hh t t ppppp sssss // // yyyyy sssss t //
  8. h h t t p s :: / / y .. s t .. /
  9. h h t t p sssss :: / / yyyyy .. sssss t .. /
  10. <https://y.st./>
  11. Copyright © 2017 Alex Yst <mailto:copyright@y.st>
  12. This program is free software: you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation, either version 3 of the License, or
  15. (at your option) any later version.
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. GNU General Public License for more details.
  20. You should have received a copy of the GNU General Public License
  21. along with this program. If not, see <https://www.gnu.org./licenses/>.
  22. -->
  23. <!DOCTYPE html>
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <base href="https://y.st./en/weblog/2017/06-June/06.xhtml" />
  27. <title>minestats enhancements &lt;https://y.st./en/weblog/2017/06-June/06.xhtml&gt;</title>
  28. <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
  29. <link rel="stylesheet" type="text/css" href="/link/basic.css" />
  30. <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
  31. <script type="text/javascript" src="/script/javascript.js" />
  32. <meta name="viewport" content="width=device-width" />
  33. </head>
  34. <body>
  35. <nav>
  36. <p>
  37. <a href="/en/">Home</a> |
  38. <a href="/en/a/about.xhtml">About</a> |
  39. <a href="/en/a/contact.xhtml">Contact</a> |
  40. <a href="/a/canary.txt">Canary</a> |
  41. <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
  42. <a href="/en/opinion/">Opinions</a> |
  43. <a href="/en/coursework/">Coursework</a> |
  44. <a href="/en/law/">Law</a> |
  45. <a href="/en/a/links.xhtml">Links</a> |
  46. <a href="/en/weblog/2017/06-June/06.xhtml.asc">{this page}.asc</a>
  47. </p>
  48. <hr/>
  49. <p>
  50. Weblog index:
  51. <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
  52. <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
  53. <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
  54. </p>
  55. <hr/>
  56. <p>
  57. Jump to entry:
  58. <a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
  59. <a rel="prev" href="/en/weblog/2017/06-June/05.xhtml">&lt;Previous</a>
  60. <a rel="next" href="/en/weblog/2017/06-June/07.xhtml">Next&gt;</a>
  61. <a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
  62. </p>
  63. <hr/>
  64. </nav>
  65. <header>
  66. <h1><code>minestats</code> enhancements</h1>
  67. <p>Day 00822: Tuesday, 2017 June 06</p>
  68. </header>
  69. <section id="advertisements">
  70. <h2>Unsponsored advertisements</h2>
  71. <p>
  72. Marc With a C is releasing a new album, <a href="https://marcwithac.bandcamp.com/album/half-serious-half-kidding-ep">Half Serious, Half Kidding EP</a>!
  73. It&apos;s currently on pre-order, but you can listen to the first song now.
  74. </p>
  75. </section>
  76. <section id="general">
  77. <h2>General news</h2>
  78. <p>
  79. Someone came onto <a href="ircs://freenodeok2gncmy.onion:6697/%23Minetest">#Minetest</a> advertising a <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>-development gig, then left.
  80. I inquired, but it turns out the job is to write proprietary code based on the permissively-licensed <a href="https://en.wikipedia.org./wiki/Laravel">Laravel</a>.
  81. So why were they advertising in a free software channel!?
  82. I laughed and said #Minetest might not be the best place to find someone, and that most of the peopel with skills there are free software geeks.
  83. As it turns out though, the person advertising is a Minetest developer themself!
  84. They&apos;re not one of the core developers, but they&apos;re a contributor; they knew exactly what the channel is.
  85. That was a little embarrassing on my part.
  86. I&apos;m glad I wasn&apos;t rude about it.
  87. </p>
  88. <p>
  89. The on-site manager&apos;s parent brought me to the laundry room again to look at bread that someone left.
  90. It was a sweet gesture, but I still don&apos;t know if it&apos;s safe to eat.
  91. Apparently, they know the person that left it, but without an ingredient list, I could very well give myself a headache if I ate it.
  92. </p>
  93. <p>
  94. <code>minestats</code> development hit a bit of a wall today.
  95. First, I ran into the nodes that drop <code>default:dirt</code>.
  96. I was a little disappointed that those nodes made it onto the stats page, but it was tolerable.
  97. It takes time for grass, snow, or whatever to spread on dirt, so players still can&apos;t place and dig back up the same node in quick succession to raise their stats.
  98. If they want to uselessly farm <code>default:dirt_with_grass</code>, they can feel free.
  99. <code>farming:soil</code> can be farmed a bit quicker, but it&apos;s still more than just placing and digging that they&apos;d have to do.
  100. But then I noticed <code>default:dirt_with_grass_footsteps</code>, a node that was sort of dummied out, but never actually removed from the game.
  101. It can never be found, so it can never be mined, resulting in a stat that just sits there taunting players.
  102. Joy.
  103. I wasn&apos;t sure how to get around that, but as it&apos;s a flaw in Minetest game, not in <code>minestats</code>, I was willing to simply point out the problem to users of my mod, then otherwise leave it alone for the time being.
  104. </p>
  105. <p>
  106. But then, a bigger problem arose.
  107. Some nodes should be removed from consideration because they only exist as technical implementations.
  108. I don&apos;t recall exactly which node made me throw in the towel, but for some nodes, the only obvious way to remove them from the consideration pool is to check for the presence of an <code>on_place()</code> method.
  109. Nodes such as grass define this to allow all five lengths of grass to be one item type in inventory, but five lengths in the field.
  110. When you place one, a random one of the five nodes is used.
  111. Beds use this to place the second node of the bed.
  112. Doors use this poorly to place both nodes of the door.
  113. Anyway, it turns out seeds and saplings use this too.
  114. Seeds prevent their own placement if they don&apos;t like the node beneath their now location.
  115. Saplings use this to prevent themselves from being placed in places that would allow you to commit vandalism-by-tree by growing trees into other people&apos;s protected areas.
  116. By ruling out items with an <code>on_place()</code> method, I rule out the main two types of non-mineral nodes I&apos;m actually trying to count!
  117. I give up for now.
  118. I&apos;m not up to this task.
  119. </p>
  120. <p>
  121. I did get some other stuff completed successfully in that mod though.
  122. It doesn&apos;t help my personal use case, as I play mostly with the default game, but my mod now supports more minerals than before!
  123. Legacy item strings are handled with ease, as are any other unnormalised item strings.
  124. Nodes that drop several of the same item are counted as well.
  125. Nodes that can be crafted are exempt now though, preventing <code>default:clay</code> from being considered a minable mineral.
  126. This check was originally coded to prevent <code>default:stone</code>/<code>default:cobble</code> from being considered a mineral, but I&apos;m happy with the clay-blocking too.
  127. I couldn&apos;t find a way to block the various forms of dirt from being counted as minables, but normally, you shouldn&apos;t be able to mine the exact same node repeatedly and get points for it.
  128. </p>
  129. <p>
  130. I emailed my mother to see if tonight was a good night to visit them.
  131. I got no response, so I worked on another project.
  132. </p>
  133. <p>
  134. I was going to work on <code>minequest</code> finally next, but instead, I was set on another mission.
  135. Someone asked me to add player kills to <code>minestats</code>.
  136. Obviously, that&apos;s a bad idea and I refuse to do it.
  137. It&apos;s outside the scope of what <code>minestats</code> is meant for.
  138. However, as a <strong>*separate*</strong> mod, it&apos;s an interesting idea.
  139. It took some time, but I coded what I think will do what the requester wanted.
  140. I don&apos;t very well have the resources to test it though, as my machine&apos;s weak and shouldn&apos;t be running multiple Minetest clients at once.
  141. I left it to the requester to test it, and said I&apos;d be happy to fix any bugs they found.
  142. </p>
  143. <p>
  144. My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
  145. </p>
  146. </section>
  147. <section id="dreams">
  148. <h2>Dream journal</h2>
  149. <p>
  150. I had a bizarre dream last night.
  151. I saw a mouse, though I quickly forgot it was there.
  152. After getting distracted by other things, I rested my hand near the mouse, about twenty centimetres away.
  153. It should&apos;ve run away.
  154. That&apos;s what any other mouse would do.
  155. However, it instead ran at my hand and latched on with its long, rodent front teeth.
  156. It should&apos;ve hurt quite a bit, as I do feel pain in dreams unlike some people, but I guess that&apos;s not where my brain wanted to take the dream.
  157. I expected a strong, sharp pain, but instead, the pain was rather minimal.
  158. After I got over the shock, I became more annoyed with the mouse than afraid of it, and decided to confine it while I decided what o do with it.
  159. I didn&apos;t want to kill it, but I also didn&apos;t want it roaming free in the building.
  160. The mouse was still latched onto me, but when I got up to get a marinara cup (like the ones we have at work) to put the mouse in, it released its vice grip on my hand and dropped to the floor.
  161. I manager to catch it while it was still dazed from the fall; I worried I wouldn&apos;t catch it at all though, as mice are too quick.
  162. It bit me again; though I tried to hold it in a position in which it was in no position to bite, the fact is that mice are incredibly flexible.
  163. Or at least, I assume they are, as rats are incredibly flexible, to the point where they can even shift around their bones and organs to squeeze through tight spaces.
  164. I found the marinara cup wasn&apos;t going to contain the mouse.
  165. The cup was certainly enough to hold the mouse if it held still, but as it was quickly trying to escape, I needed a larger container so I could keep the mouse away from the opening long enough to seal it in.
  166. The mouse escaped again, and once more, I quickly caught it before it could further act.
  167. At this point, I gave up trying to avoid the mouse&apos;s bite.
  168. It was like the bite of a strong garter snake; painful and, if you&apos;re not expecting it, startling.
  169. However, if you know it&apos;s coming, it&apos;s really no big deal.
  170. I found a bigger container, though I&apos;m not sure for the life of me what.
  171. I guess it was some sort of resealable plastic wrapping from something, though the top flap had somehow shrunk, so it wasn&apos;t fitting over the harder, plastic bottom any more.
  172. I barely got the mouse to stay in that, but I kept thinking it had escaped, due to how poorly the container was even closed.
  173. Somehow though, a second mouse had gotten in.
  174. I be later, the container was more of a large tent with large windows in the side.
  175. I&apos;m not sure how that happened, but at this point, there were three mice in it.
  176. At first, I thought they might be breeding.
  177. It was still a mystery as to where the second mouse had come from, but the third could be a product of the other two.
  178. I quickly realised though that the third mouse was as large as the other two; tiny, but not a baby.
  179. Furthermore, the mice had no food in there to build a baby out of.
  180. (Now that I&apos;m awake, I realise one of the mice could&apos;ve been pregnant before being confined, so lack of materials to build a baby from wasn&apos;t an issue, though the size of the third mouse still was.)
  181. </p>
  182. <p>
  183. I&apos;m not sure where this dream took place, really.
  184. It didn&apos;t feel like my home, but it also didn&apos;t seem like a workplace.
  185. I was alone, and with apparently no other task to accomplish besides confining a mouse on a whim.
  186. </p>
  187. </section>
  188. <hr/>
  189. <p>
  190. Copyright © 2017 Alex Yst;
  191. You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
  192. If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
  193. My address is in the source comments near the top of this document.
  194. This license also applies to embedded content such as images.
  195. For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
  196. </p>
  197. <p>
  198. <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
  199. This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F06-June%2F06.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F06-June%2F06.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
  200. </p>
  201. </body>
  202. </html>