

Client-Side Mods can be used when connected to a Minetest server because they are loaded locally. Individual mods in a modpack can still be enabled and disabled as if they were standalone mods.Ī Client-Side Mod (short: “CSM”) is a mod used to customize your Minetest client. Apart from that, there is nothing special about modpacks or mods inside a modpack. The main difference is that they will be displayed differently in the mod manager in Minetest. It's purely a logical grouping and is done mostly for convenience and to group closely-related mods together. Basically, a modpack is just special directory containing the actual mod directories. Rewriting it in Option 1's form (and alternatively Option 3's) is left as an exercise to the reader.A modpack (short: “MP”) is a collection of mods to group them together. Here I used the bitwise-and operator, and represented it in the succinct form shown in option 2. While this approach is the fastest (you are doing simple bit masking instead of division), it is perhaps a little advanced/complicated for a beginner. This can be checked using the bitwise-and operator (&). If the least significant bit is 0 then the number is even. The fourth and final approach is to use knowledge of the binary representation of integers. Option 3: Ternary operatorīoolean isEven = ((a % 2) = 0) ? true : false

Although the ternary operator is often very useful, in this case I consider the second approach superior.

The third approach is here for completeness, and uses the ternary operator. (Don't forget that the = operator returns a boolean.) // Option 2: Clear, succinct, code The second approach takes better advantage of the language, and leads to more succinct code. The first approach is good for beginners, because it is especially verbose. Going back to your code question, though, there are multiple ways of solving for "evenness". Often this subtle distinction doesn't matter. If X is positive you get a result in the range [0, Y). If X is negative you get a result in the range (-Y, 0]. Performing the same operation with the "%" or rem operator maintains the sign of the X value. Said differently, the modulus of X and Y is always greater than or equal to zero, and less than Y. More specifically given two integers, X and Y, the operation (X mod Y) tends to return a value in the range [0, Y). The difference between mod and rem is subtle, but important.

% the "modulus" operator is actually performing the remainder operation. Since everyone else already gave the answer, I'll add a bit of additional context.
