aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/SharedConstants.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/SharedConstants.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/SharedConstants.cpp')
-rw-r--r--Minecraft.World/SharedConstants.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/Minecraft.World/SharedConstants.cpp b/Minecraft.World/SharedConstants.cpp
new file mode 100644
index 00000000..497822bc
--- /dev/null
+++ b/Minecraft.World/SharedConstants.cpp
@@ -0,0 +1,51 @@
+#include "stdafx.h"
+#include "File.h"
+#include "InputOutputStream.h"
+#include "SharedConstants.h"
+
+const wstring SharedConstants::VERSION_STRING = L"1.2.3";
+const bool SharedConstants::TEXTURE_LIGHTING = true;
+
+wstring SharedConstants::readAcceptableChars()
+{
+ // 4J-PB - I've added ã in (for Portuguese in bed string) and added the character at the same place in the default.png font
+ wstring result = L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»ã";
+#if 0 // 4J - do we actually really need to get this from a file?
+ //try {
+ //BufferedReader br = new BufferedReader(new InputStreamReader(SharedConstants.class.getResourceAsStream("/font.txt"), "UTF-8"));
+ BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( new File( wstring(L"/font.txt") ) ) ) );
+ wstring line;
+ while ( !(line = br->readLine()).empty())
+ {
+ if (!( wcscmp( &line[0], L"#") == 0 ) )
+ {
+ result.append( line );
+ }
+ }
+ br->close();
+ //} catch (Exception e) {
+ // TODO 4J Stu - Exception handling?
+ //}
+#endif
+ return result;
+}
+
+bool SharedConstants::isAllowedChatCharacter(char ch)
+{
+ //return ch != '§' && (acceptableLetters.indexOf(ch) >= 0 || (int) ch > 32);
+ // 4J Unused
+ return true;
+}
+
+wstring SharedConstants::acceptableLetters;
+
+void SharedConstants::staticCtor()
+{
+ acceptableLetters = readAcceptableChars();
+}
+
+const wchar_t SharedConstants::ILLEGAL_FILE_CHARACTERS[ILLEGAL_FILE_CHARACTERS_LENGTH] =
+{
+ // 4J-PB - corrected
+ L'/', L'\n', L'\r', L'\t', L'\0', L'\f', L'`', L'?', L'*', L'\\', L'<', L'>', L'|', L'\"', L':'
+}; \ No newline at end of file