summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-08-14 19:42:18 +0200
committerMattes D <github@xoft.cz>2013-08-14 19:42:18 +0200
commita1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd (patch)
treef13155fea5de17421569d7ec563690ecbd5e1d21
parentAdded mtilden to contributors list. (diff)
downloadcuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar.gz
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar.bz2
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar.lz
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar.xz
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.tar.zst
cuberite-a1ec14f7f8b45f8e0a69663b2d25e3b9ce7564bd.zip
-rw-r--r--CONTRIBUTING.md25
1 files changed, 21 insertions, 4 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fe7ad5313..d359f9004 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,12 +1,29 @@
Code Stuff
----------
- * No magic numbers, use named constants like E_ITEM...
- * Please use tabs for indentation and spaces for alignment.
+ * No magic numbers, use named constants:
+ - E_ITEM_XXX, E_BLOCK_XXX and E_META_XXX for items and blocks
+ - E_ENTITY_TYPE_XXX for mob types
+ - dimNether, dimOverworld and dimEnd for world dimension
+ - gmSurvival, gmCreative, gmAdventure for game modes
+ - wSunny, wRain, wThunderstorm for weather
+ - cChunkDef::Width, cChunkDef::Height for chunk dimensions (C++)
+ - etc.
+ * Instead of checking for specific value, use Is functions, if available:
+ - cPlayer:IsGameModeCreative() instead of (cPlayer:GetGameMode() == gmCreative)
+ * Please use tabs for indentation and spaces for alignment. This means that if it's at line start, it's a tab; if it's in the middle of a line, it's a space
+ * Alpha-sort stuff that makes sense alpha-sorting - long lists of similar items etc.
+ * Keep individual functions spaced out by 5 empty lines, this enhances readability and makes navigation in the source file easier.
+ * Add those extra parentheses to conditions, especially in C++
+ - "if ((a == 1) && ((b == 2) || (c == 3)))" instead of ambiguous "if (a == 1 && b == 2 || c == 3)"
+ - This helps prevent mistakes such as "if (a & 1 == 0)"
+ * White space is free, so use it freely
+ - "freely" as in "plentifully", not "arbitrarily"
+
Copyright
---------
-Your work should be licensed under the apache license, and you should add yourself to the CONTRIBUTORS file.
+Your work should be licensed under the Apache license, and you should add yourself to the CONTRIBUTORS file.
-If your work is not licensed under the apache license, then it must be compatible and marked as such.
+If your work is not licensed under the Apache license, then it must be compatible and marked as such. Note that only plugins may choose a different license; MC-server's internals need to be single-license.