craftground-runtime-mc121 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. craftground_runtime_mc121-0.1.0/.gitignore +129 -0
  2. craftground_runtime_mc121-0.1.0/LICENSE +2 -0
  3. craftground_runtime_mc121-0.1.0/MANIFEST.in +20 -0
  4. craftground_runtime_mc121-0.1.0/PKG-INFO +81 -0
  5. craftground_runtime_mc121-0.1.0/README.md +68 -0
  6. craftground_runtime_mc121-0.1.0/__init__.py +1 -0
  7. craftground_runtime_mc121-0.1.0/build.gradle +307 -0
  8. craftground_runtime_mc121-0.1.0/craftground_runtime_mc121.egg-info/PKG-INFO +81 -0
  9. craftground_runtime_mc121-0.1.0/craftground_runtime_mc121.egg-info/SOURCES.txt +255 -0
  10. craftground_runtime_mc121-0.1.0/craftground_runtime_mc121.egg-info/dependency_links.txt +1 -0
  11. craftground_runtime_mc121-0.1.0/craftground_runtime_mc121.egg-info/top_level.txt +1 -0
  12. craftground_runtime_mc121-0.1.0/gradle/wrapper/gradle-wrapper.jar +0 -0
  13. craftground_runtime_mc121-0.1.0/gradle/wrapper/gradle-wrapper.properties +6 -0
  14. craftground_runtime_mc121-0.1.0/gradle.properties +19 -0
  15. craftground_runtime_mc121-0.1.0/gradlew +186 -0
  16. craftground_runtime_mc121-0.1.0/gradlew.bat +89 -0
  17. craftground_runtime_mc121-0.1.0/mods_to_include.txt +2 -0
  18. craftground_runtime_mc121-0.1.0/pyproject.toml +35 -0
  19. craftground_runtime_mc121-0.1.0/settings.gradle +9 -0
  20. craftground_runtime_mc121-0.1.0/setup.cfg +4 -0
  21. craftground_runtime_mc121-0.1.0/src/main/cpp/CMakeLists.txt +169 -0
  22. craftground_runtime_mc121-0.1.0/src/main/cpp/boost_ipc.cpp +290 -0
  23. craftground_runtime_mc121-0.1.0/src/main/cpp/cursor.cpp +288 -0
  24. craftground_runtime_mc121-0.1.0/src/main/cpp/depth_capture.cpp +268 -0
  25. craftground_runtime_mc121-0.1.0/src/main/cpp/framebuffer_capturer.cpp +302 -0
  26. craftground_runtime_mc121-0.1.0/src/main/cpp/framebuffer_capturer_apple.mm +155 -0
  27. craftground_runtime_mc121-0.1.0/src/main/cpp/framebuffer_capturer_cuda.cpp +227 -0
  28. craftground_runtime_mc121-0.1.0/src/main/cpp/include/cross_gl.h +18 -0
  29. craftground_runtime_mc121-0.1.0/src/main/cpp/include/cross_semaphore.h +95 -0
  30. craftground_runtime_mc121-0.1.0/src/main/cpp/include/cursor.h +7 -0
  31. craftground_runtime_mc121-0.1.0/src/main/cpp/include/depth_capture.h +12 -0
  32. craftground_runtime_mc121-0.1.0/src/main/cpp/include/framebuffer_capturer.h +7 -0
  33. craftground_runtime_mc121-0.1.0/src/main/cpp/include/framebuffer_capturer_apple.h +13 -0
  34. craftground_runtime_mc121-0.1.0/src/main/cpp/include/framebuffer_capturer_cuda.h +21 -0
  35. craftground_runtime_mc121-0.1.0/src/main/cpp/include/png_util.h +20 -0
  36. craftground_runtime_mc121-0.1.0/src/main/cpp/include/rgb_capture.h +3 -0
  37. craftground_runtime_mc121-0.1.0/src/main/cpp/jni/jni_cuda_zerocopy.cpp +117 -0
  38. craftground_runtime_mc121-0.1.0/src/main/cpp/jni/jni_dummy_zerocopy.cpp +79 -0
  39. craftground_runtime_mc121-0.1.0/src/main/cpp/jni/jni_macos_zerocopy.cpp +88 -0
  40. craftground_runtime_mc121-0.1.0/src/main/cpp/noboost_ipc.cpp +504 -0
  41. craftground_runtime_mc121-0.1.0/src/main/cpp/png_util.cpp +52 -0
  42. craftground_runtime_mc121-0.1.0/src/main/cpp/rgb_capture.cpp +22 -0
  43. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/AddListenerInterface.java +17 -0
  44. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/BiomeCenterFinder.kt +110 -0
  45. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/ChatMessageRecord.kt +6 -0
  46. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/CollisionListener.kt +14 -0
  47. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/CsvLogger.kt +40 -0
  48. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/EncodeImageToBytes.kt +31 -0
  49. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/EntityRenderListener.kt +9 -0
  50. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/EntityRenderListenerImpl.kt +23 -0
  51. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/EnvironmentInitializer.kt +710 -0
  52. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/FramebufferCapturer.kt +197 -0
  53. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/GameRendererDepthCaptureMixinGetterInterface.java +5 -0
  54. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/GetMessagesInterface.java +12 -0
  55. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/HeightMapProvider.kt +39 -0
  56. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/KeyboardInfo.kt +104 -0
  57. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/MessageIO.kt +217 -0
  58. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/MinecraftEnv.kt +1092 -0
  59. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/MinecraftSoundListener.kt +85 -0
  60. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/MouseInfo.kt +103 -0
  61. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/Point3D.java +3 -0
  62. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/PrintWithTime.kt +25 -0
  63. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/TickSpeed.kt +5 -0
  64. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/TickSynchronizer.kt +83 -0
  65. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/ToMessage.kt +79 -0
  66. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/client/Minecraft_envClient.java +33 -0
  67. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/customentity/ModelCache.kt +45 -0
  68. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/customentity/OBJLoader.kt +77 -0
  69. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/customentity/RealisticHuman.kt +10 -0
  70. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/customentity/RealisticHumanModel.kt +90 -0
  71. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/customentity/RealisticHumanRenderer.kt +81 -0
  72. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/AbstractBlockCollisionDetectorMixin.java +42 -0
  73. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ChatVisibleMessageAccessor.java +12 -0
  74. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientCommonNetworkHandlerClientAccessor.java +11 -0
  75. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientEntityRenderDispatcherAccessor.java +11 -0
  76. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientIsWindowFocusedMixin.java +13 -0
  77. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientPlayNetworkHandlerMixin.java +27 -0
  78. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientRenderInvoker.java +11 -0
  79. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ClientWorldMixin.java +25 -0
  80. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/DisableRegionalComplianceMixin.java +19 -0
  81. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/EntityCollisionDetectorMixin.java +44 -0
  82. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/GameRendererDepthCaptureMixin.java +70 -0
  83. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/GammaMixin.java +57 -0
  84. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/InputUtilMixin.java +41 -0
  85. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/MinecraftServer_tickspeedMixin.java +218 -0
  86. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/MouseXYAccessor.java +14 -0
  87. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/RenderLayerTrianglesMixin.java +58 -0
  88. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/RenderMixin.java +38 -0
  89. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/RenderSystemPollEventsInvoker.java +10 -0
  90. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/RenderTickCounterAccessor.java +17 -0
  91. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/SaveWorldMixin.java +16 -0
  92. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/ServerPlayNetworkHandlerDisableSpamChecker.java +15 -0
  93. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/TickSpeedMixin.java +29 -0
  94. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/WindowOffScreenMixin.java +20 -0
  95. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/WindowSizeAccessor.java +13 -0
  96. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/mixin/WorldRendererCallEntityRenderMixin.java +44 -0
  97. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ActionSpace.java +2314 -0
  98. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ActionSpaceKt.kt +8 -0
  99. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ActionSpaceKt.proto.kt +8 -0
  100. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ActionSpaceMessageV2Kt.kt +503 -0
  101. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/BiomeInfoKt.kt +135 -0
  102. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/BlockCollisionInfoKt.kt +103 -0
  103. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/BlockInfoKt.kt +103 -0
  104. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ChatMessageInfoKt.kt +94 -0
  105. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/EntitiesWithinDistanceKt.kt +107 -0
  106. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/EntityCollisionInfoKt.kt +103 -0
  107. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/EntityInfoKt.kt +188 -0
  108. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/HeightInfoKt.kt +103 -0
  109. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/HitResultKt.kt +119 -0
  110. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/InitialEnvironment.java +6542 -0
  111. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/InitialEnvironmentKt.kt +8 -0
  112. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/InitialEnvironmentKt.proto.kt +8 -0
  113. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/InitialEnvironmentMessageKt.kt +1253 -0
  114. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ItemStackKt.kt +120 -0
  115. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/LidarConfigKt.kt +160 -0
  116. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/LidarRayKt.kt +185 -0
  117. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/LidarResultKt.kt +210 -0
  118. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/NearbyBiomeKt.kt +103 -0
  119. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ObservationSpace.java +21237 -0
  120. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ObservationSpaceKt.kt +8 -0
  121. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ObservationSpaceKt.proto.kt +8 -0
  122. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/ObservationSpaceMessageKt.kt +1636 -0
  123. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/SoundEntryKt.kt +120 -0
  124. craftground_runtime_mc121-0.1.0/src/main/java/com/kyhsgeekcode/minecraftenv/proto/StatusEffectKt.kt +86 -0
  125. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/models/external/human.mtl +12 -0
  126. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/models/external/human.obj +2695 -0
  127. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/models/external/human_texture_triangle.png +0 -0
  128. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/models/external/sphere.obj +4812 -0
  129. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/textures/entity/human_texture_triangle.png +0 -0
  130. craftground_runtime_mc121-0.1.0/src/main/resources/assets/minecraftenv/textures/entity/skull_and_roses_triangles.png +0 -0
  131. craftground_runtime_mc121-0.1.0/src/main/resources/com.kyhsgeekcode.minecraftenv.mixin.json +38 -0
  132. craftground_runtime_mc121-0.1.0/src/main/resources/fabric.mod.json +38 -0
  133. craftground_runtime_mc121-0.1.0/src/main/resources/minecraftenv.accesswidener +6 -0
@@ -0,0 +1,129 @@
1
+ # User-specific stuff
2
+ .idea/
3
+
4
+ *.iml
5
+ *.ipr
6
+ *.iws
7
+
8
+ # IntelliJ
9
+ out/
10
+ # mpeltonen/sbt-idea plugin
11
+ .idea_modules/
12
+
13
+ # JIRA plugin
14
+ atlassian-ide-plugin.xml
15
+
16
+ # Compiled class file
17
+ *.class
18
+
19
+ # Log file
20
+ *.log
21
+
22
+ # BlueJ files
23
+ *.ctxt
24
+
25
+ # Package Files #
26
+ *.jar
27
+ *.war
28
+ *.nar
29
+ *.ear
30
+ *.zip
31
+ *.tar.gz
32
+ *.rar
33
+
34
+ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
35
+ hs_err_pid*
36
+
37
+ *~
38
+
39
+ # temporary files which can be created if a process still has a handle open of a deleted file
40
+ .fuse_hidden*
41
+
42
+ # KDE directory preferences
43
+ .directory
44
+
45
+ # Linux trash folder which might appear on any partition or disk
46
+ .Trash-*
47
+
48
+ # .nfs files are created when an open file is removed but is still being accessed
49
+ .nfs*
50
+
51
+ # General
52
+ .DS_Store
53
+ .AppleDouble
54
+ .LSOverride
55
+
56
+ # Icon must end with two \r
57
+ Icon
58
+
59
+ # Thumbnails
60
+ ._*
61
+
62
+ # Files that might appear in the root of a volume
63
+ .DocumentRevisions-V100
64
+ .fseventsd
65
+ .Spotlight-V100
66
+ .TemporaryItems
67
+ .Trashes
68
+ .VolumeIcon.icns
69
+ .com.apple.timemachine.donotpresent
70
+
71
+ # Directories potentially created on remote AFP share
72
+ .AppleDB
73
+ .AppleDesktop
74
+ Network Trash Folder
75
+ Temporary Items
76
+ .apdisk
77
+
78
+ # Windows thumbnail cache files
79
+ Thumbs.db
80
+ Thumbs.db:encryptable
81
+ ehthumbs.db
82
+ ehthumbs_vista.db
83
+
84
+ # Dump file
85
+ *.stackdump
86
+
87
+ # Folder config file
88
+ [Dd]esktop.ini
89
+
90
+ # Recycle Bin used on file shares
91
+ $RECYCLE.BIN/
92
+
93
+ # Windows Installer files
94
+ *.cab
95
+ *.msi
96
+ *.msix
97
+ *.msm
98
+ *.msp
99
+
100
+ # Windows shortcuts
101
+ *.lnk
102
+
103
+ .gradle
104
+ build/
105
+ dist/
106
+ *.egg-info/
107
+
108
+ # Ignore Gradle GUI config
109
+ gradle-app.setting
110
+
111
+ # Cache of project
112
+ .gradletasknamecache
113
+
114
+ **/build/
115
+
116
+ # Common working directory
117
+ run/
118
+
119
+ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
120
+ !gradle-wrapper.jar
121
+ CMakeCache.txt
122
+ Makefile
123
+ cmake_install.cmake
124
+ CMakeFiles/
125
+ .cache
126
+ compile_commands.json
127
+ _deps/
128
+ bin/
129
+ .kotlin/
@@ -0,0 +1,2 @@
1
+ Copyright (c) 2023
2
+ All rights reserved.
@@ -0,0 +1,20 @@
1
+ recursive-include . *
2
+ prune build
3
+ prune dist
4
+ prune run
5
+ prune _deps
6
+ prune .gradle
7
+ prune CMakeFiles
8
+ prune craftground_runtime_mc121.egg-info
9
+ exclude CMakeCache.txt
10
+ exclude cmake_install.cmake
11
+ exclude compile_commands.json
12
+ exclude Makefile
13
+ exclude pyproject.toml
14
+ exclude MANIFEST.in
15
+ exclude .gitignore
16
+ global-exclude *.so
17
+ global-exclude *.dylib
18
+ global-exclude *.dll
19
+ global-exclude __pycache__
20
+ global-exclude *.py[co]
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: craftground-runtime-mc121
3
+ Version: 0.1.0
4
+ Summary: CraftGround Fabric mod runtime assets for Minecraft 1.21
5
+ License: Copyright (c) 2023
6
+ All rights reserved.
7
+
8
+ Project-URL: Source, https://github.com/yhs0602/CraftGround
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # MinecraftEnv
15
+
16
+ Lightweight minecraft RL environment on fabric
17
+
18
+ # Features
19
+
20
+ - Works on minecraft 1.21
21
+ - Used fabric mod
22
+ - JDK: 21
23
+
24
+ # initial environment
25
+ - Inventory commands
26
+ - Entities
27
+ - World seed
28
+ - is world superflat
29
+ - is hardcore
30
+ - initial x, y, z
31
+ - always night / day
32
+ - do mob spawn
33
+ - screen size (visible/observed)
34
+ - Arbitrary commands (e.g. status effects)
35
+ - keys for statistics
36
+ - Hud is visible
37
+
38
+ # Observation space
39
+
40
+ - rgb
41
+ - x, y, z
42
+ - pitch, yaw
43
+ - health, food_level, saturation_level
44
+ - is_dead
45
+ - inventory
46
+ - looking at entites, blocks
47
+ - sound subtitles
48
+ - status effects
49
+ - statistics
50
+ - visible entities
51
+ - surrounding entities
52
+ - is bobber thrown
53
+
54
+ # Action space
55
+
56
+ - Similar to https://docs.minedojo.org/sections/core_api/action_space.html
57
+ - No crafting yet
58
+ - Arbitrary command (you should hide this for the agents)
59
+
60
+ Controlled by this reinforcement learning agent: https://github.com/yhs0602/CraftGround
61
+
62
+ renderDistance:6
63
+ simulationDistance:6
64
+
65
+
66
+ # Build cpp
67
+ ```
68
+ mkdir build
69
+ cd build
70
+ cmake ../src/main/cpp
71
+ ```
72
+
73
+ # Docs on MinecraftEnv.kt
74
+ ## ResetPhase
75
+ 1. Initial: END_RESET
76
+ 2. After reading initial environment: WAIT_INIT_ENDS
77
+
78
+ ## IOPhase
79
+ 1. Initial: BEGINNING
80
+ 2. After reading initial environment: GOT_INITIAL_ENVIRONMENT_SHOULD_SEND_OBSERVATION
81
+ 3.
@@ -0,0 +1,68 @@
1
+ # MinecraftEnv
2
+
3
+ Lightweight minecraft RL environment on fabric
4
+
5
+ # Features
6
+
7
+ - Works on minecraft 1.21
8
+ - Used fabric mod
9
+ - JDK: 21
10
+
11
+ # initial environment
12
+ - Inventory commands
13
+ - Entities
14
+ - World seed
15
+ - is world superflat
16
+ - is hardcore
17
+ - initial x, y, z
18
+ - always night / day
19
+ - do mob spawn
20
+ - screen size (visible/observed)
21
+ - Arbitrary commands (e.g. status effects)
22
+ - keys for statistics
23
+ - Hud is visible
24
+
25
+ # Observation space
26
+
27
+ - rgb
28
+ - x, y, z
29
+ - pitch, yaw
30
+ - health, food_level, saturation_level
31
+ - is_dead
32
+ - inventory
33
+ - looking at entites, blocks
34
+ - sound subtitles
35
+ - status effects
36
+ - statistics
37
+ - visible entities
38
+ - surrounding entities
39
+ - is bobber thrown
40
+
41
+ # Action space
42
+
43
+ - Similar to https://docs.minedojo.org/sections/core_api/action_space.html
44
+ - No crafting yet
45
+ - Arbitrary command (you should hide this for the agents)
46
+
47
+ Controlled by this reinforcement learning agent: https://github.com/yhs0602/CraftGround
48
+
49
+ renderDistance:6
50
+ simulationDistance:6
51
+
52
+
53
+ # Build cpp
54
+ ```
55
+ mkdir build
56
+ cd build
57
+ cmake ../src/main/cpp
58
+ ```
59
+
60
+ # Docs on MinecraftEnv.kt
61
+ ## ResetPhase
62
+ 1. Initial: END_RESET
63
+ 2. After reading initial environment: WAIT_INIT_ENDS
64
+
65
+ ## IOPhase
66
+ 1. Initial: BEGINNING
67
+ 2. After reading initial environment: GOT_INITIAL_ENVIRONMENT_SHOULD_SEND_OBSERVATION
68
+ 3.
@@ -0,0 +1 @@
1
+ """CraftGround runtime assets for Minecraft 1.21 (Fabric mod source + Gradle project)."""
@@ -0,0 +1,307 @@
1
+ plugins {
2
+ id 'fabric-loom' version '1.6-SNAPSHOT'
3
+ id 'maven-publish'
4
+ id "org.jetbrains.kotlin.jvm" version "2.0.0"
5
+ // id "com.google.protobuf" version "0.9.2"
6
+ id 'com.github.johnrengelman.shadow' version '7.0.0'
7
+ }
8
+
9
+ shadowJar {
10
+ archiveClassifier.set('')
11
+ }
12
+
13
+ def findVcpkgRoot() {
14
+ try {
15
+ def vcpkgRoot = System.getenv('VCPKG_ROOT')
16
+ if (vcpkgRoot) {
17
+ return vcpkgRoot
18
+ }
19
+ def os = org.gradle.internal.os.OperatingSystem.current()
20
+
21
+ if (os.isWindows()) {
22
+ def process = new ProcessBuilder("cmd", "/c", "where vcpkg").start()
23
+ process.waitFor()
24
+ def output = process.inputStream.text.trim()
25
+ if (output) {
26
+ def vcpkgDir = new File(output).getParentFile()
27
+ return vcpkgDir.absolutePath
28
+ } else {
29
+ throw new RuntimeException("Cannot find vcpkg root")
30
+ }
31
+ } else {
32
+ def process = new ProcessBuilder("bash", "-c", "which vcpkg").start()
33
+ process.waitFor()
34
+ def output = process.inputStream.text.trim()
35
+ if (output) {
36
+ def vcpkgDir = new File(output).getParentFile()
37
+ return vcpkgDir.absolutePath
38
+ } else {
39
+ throw new RuntimeException("Cannot find vcpkg root")
40
+ }
41
+ }
42
+ } catch (Exception e) {
43
+ println "Cannot find vcpkg root: " + e
44
+ return null
45
+ }
46
+ }
47
+
48
+ tasks.register('configureCppProject', Exec) {
49
+ def useConda = System.getenv('CRAFTGROUND_USE_CONDA')?.toBoolean() ?: false
50
+ def os = org.gradle.internal.os.OperatingSystem.current()
51
+ def vcpkgRoot = findVcpkgRoot()
52
+ def vcpkgToolchainFile = vcpkgRoot ? "${vcpkgRoot}/scripts/buildsystems/vcpkg.cmake" : null
53
+ project.logger.lifecycle('Use conda: ' + useConda + ', vcpkg root: ' + vcpkgRoot)
54
+
55
+ def cmakeArgs = ['cmake', '-DCMAKE_POLICY_VERSION_MINIMUM=3.5']
56
+
57
+ if (os.isWindows() && vcpkgToolchainFile && file(vcpkgToolchainFile).exists()) {
58
+ project.logger.lifecycle('Using vcpkg toolchain file: ' + vcpkgToolchainFile)
59
+ cmakeArgs += "-DCMAKE_TOOLCHAIN_FILE=${vcpkgToolchainFile}"
60
+ } else {
61
+ project.logger.lifecycle('Using default cmake, not using vcpkg')
62
+ }
63
+
64
+ if (useConda) {
65
+ cmakeArgs += "-DCMAKE_PREFIX_PATH=$CONDA_PREFIX"
66
+ }
67
+
68
+ cmakeArgs += 'src/main/cpp'
69
+ commandLine cmakeArgs
70
+
71
+ inputs.dir("src/main/cpp")
72
+ outputs.files("MakeFile", "CMakeCache.txt", "cmake_install.cmake")
73
+ outputs.dir("CMakeFiles")
74
+ }
75
+
76
+
77
+ tasks.register('compileCpp', Exec) {
78
+ commandLine 'cmake', '--build', '.', '--config', 'Release', '--parallel', '8'
79
+ inputs.dir("src/main/cpp")
80
+ def os = org.gradle.internal.os.OperatingSystem.current()
81
+ if (os.isLinux()) {
82
+ outputs.file("libnative-lib.so")
83
+ } else if (os.isMacOsX()) {
84
+ outputs.file("libnative-lib.dylib")
85
+ } else if (os.isWindows()) {
86
+ outputs.files(file("Debug/native-lib.dll"), file("Release/native-lib.dll"))
87
+ }
88
+ dependsOn 'configureCppProject'
89
+
90
+ // Copy the built native library to the project root (Only for Windows)
91
+ doLast {
92
+ if (os.isWindows()) {
93
+ // Copy the built native library to the project root
94
+ def debugOutput = new File("Debug/native-lib.dll")
95
+ def releaseOutput = new File("Release/native-lib.dll")
96
+ def targetDir = new File("./native-lib.dll") // Copy to the project root
97
+
98
+ if (releaseOutput.exists()) {
99
+ copy {
100
+ from releaseOutput
101
+ into targetDir.parentFile
102
+ }
103
+ println "Copied ${releaseOutput} to ${targetDir}"
104
+ } else if (debugOutput.exists()) {
105
+ copy {
106
+ from debugOutput
107
+ into targetDir.parentFile
108
+ }
109
+ println "Copied ${debugOutput} to ${targetDir}"
110
+ } else {
111
+ throw new RuntimeException("Cannot find the built native library")
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ tasks.named('runClient').configure {
118
+ dependsOn compileCpp
119
+ }
120
+
121
+ tasks.named('build').configure {
122
+ dependsOn compileCpp
123
+ }
124
+
125
+ tasks.named('runClient') {
126
+ doFirst {
127
+ def maxMemory = System.getenv("CRAFTGROUND_JVM_MAX_MEMORY") ?: "3G"
128
+ def enabledJmx = System.getenv("CRAFTGROUND_JVM_JMX_ENABLED") ?: "false"
129
+ def nativeMemoryTracking = System.getenv("CRAFTGROUND_JVM_NATIVE_TRACKING") ?: "summary"
130
+ jvmArgs += "-Djava.library.path=${projectDir}"
131
+ jvmArgs += "-XX:+UnlockExperimentalVMOptions"
132
+ jvmArgs += "-XX:G1NewSizePercent=40"
133
+ jvmArgs += "-XX:G1MaxNewSizePercent=50"
134
+ jvmArgs += "-XX:G1ReservePercent=20"
135
+ jvmArgs += "-XX:MaxTenuringThreshold=1"
136
+ jvmArgs += "-XX:SurvivorRatio=32"
137
+ jvmArgs += "-XX:+AlwaysPreTouch"
138
+ jvmArgs += "-Xmx${maxMemory}" // Max memory from environment variable
139
+ jvmArgs += "-XX:NativeMemoryTracking=${nativeMemoryTracking}"
140
+ jvmArgs += "-XX:MaxDirectMemorySize=512m"
141
+ jvmArgs += "-XX:MaxMetaspaceSize=1024m" // 1G
142
+ jvmArgs += "-XX:MaxRAM=10G"
143
+ if (enabledJmx.toBoolean()) {
144
+ def jmxPort = System.getenv("CRAFTGROUND_JVM_JMX_PORT") ?: "9010"
145
+ def jmxHost = System.getenv("CRAFTGROUND_JVM_JMX_HOST") ?: "localhost"
146
+ jvmArgs += "-Dcom.sun.management.jmxremote"
147
+ jvmArgs += "-Dcom.sun.management.jmxremote.port=${jmxPort}"
148
+ jvmArgs += "-Dcom.sun.management.jmxremote.ssl=false"
149
+ jvmArgs += "-Dcom.sun.management.jmxremote.authenticate=false"
150
+ jvmArgs += "-Djava.rmi.server.hostname=${jmxHost}"
151
+ }
152
+ // environment.put("LD_PRELOAD", "libjemalloc.so")
153
+ }
154
+ }
155
+
156
+ version = project.mod_version
157
+ group = project.maven_group
158
+
159
+ repositories {
160
+ mavenCentral()
161
+ // Add repositories to retrieve artifacts from in here.
162
+ // You should only use this when depending on other mods because
163
+ // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
164
+ // See https://docs.gradle.org/current/userguide/declaring_repositories.html
165
+ // for more information about repositories.
166
+ maven {
167
+ name = "Modrinth"
168
+ url = "https://api.modrinth.com/maven"
169
+ content {
170
+ includeGroup "maven.modrinth"
171
+ }
172
+ }
173
+ maven {
174
+ url "https://maven.flashyreese.me/releases"
175
+ }
176
+ maven {
177
+ url "https://maven.flashyreese.me/snapshots"
178
+ }
179
+ }
180
+
181
+ dependencies {
182
+ // To change the versions see the gradle.properties file
183
+ minecraft "com.mojang:minecraft:${project.minecraft_version}"
184
+ mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
185
+ modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
186
+
187
+ // Fabric API. This is technically optional, but you probably want it anyway.
188
+ modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
189
+ // https://mvnrepository.com/artifact/maven.modrinth/sodium
190
+ // modApi include("maven.modrinth:sodium:mc1.20-0.4.10")
191
+ // Download this mods from curseforge and modrinth, and put it in the mods folder
192
+ // modRuntimeOnly "maven.modrinth:lithium:mc1.21-0.12.7"
193
+ // modRuntimeOnly "curse.maven:ferritecore-fabric-459857:5434182"
194
+
195
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
196
+ implementation "io.grpc:grpc-kotlin-stub:1.3.0"
197
+ implementation 'com.google.protobuf:protobuf-kotlin:4.29.2'
198
+ implementation "com.github.ben-manes.caffeine:caffeine:3.1.8"
199
+ }
200
+
201
+ processResources {
202
+ inputs.property "version", project.version
203
+ inputs.property "minecraft_version", project.minecraft_version
204
+ inputs.property "loader_version", project.loader_version
205
+ filteringCharset "UTF-8"
206
+
207
+ filesMatching("fabric.mod.json") {
208
+ expand "version": project.version,
209
+ "minecraft_version": project.minecraft_version,
210
+ "loader_version": project.loader_version
211
+ }
212
+ }
213
+
214
+ def targetJavaVersion = 21
215
+ tasks.withType(JavaCompile).configureEach {
216
+ // ensure that the encoding is set to UTF-8, no matter what the system default is
217
+ // this fixes some edge cases with special characters not displaying correctly
218
+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
219
+ // If Javadoc is generated, this must be specified in that task too.
220
+ it.options.encoding = "UTF-8"
221
+ if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
222
+ it.options.release = targetJavaVersion
223
+ }
224
+ }
225
+
226
+ java {
227
+ def javaVersion = JavaVersion.toVersion(targetJavaVersion)
228
+ if (JavaVersion.current() < javaVersion) {
229
+ toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
230
+ }
231
+ archivesBaseName = project.archives_base_name
232
+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
233
+ // if it is present.
234
+ // If you remove this line, sources will not be generated.
235
+ withSourcesJar()
236
+ sourceCompatibility = JavaVersion.VERSION_21
237
+ targetCompatibility = JavaVersion.VERSION_21
238
+ }
239
+
240
+ loom {
241
+ accessWidenerPath = file("src/main/resources/minecraftenv.accesswidener")
242
+ }
243
+
244
+
245
+ //protobuf {
246
+ // protoc {
247
+ // artifact = "com.google.protobuf:protoc:3.22.3"
248
+ // }
249
+ // plugins {
250
+ // grpc {
251
+ // artifact = "io.grpc:protoc-gen-grpc-java:1.54.1"
252
+ // }
253
+ // grpckt {
254
+ // artifact = "io.grpc:protoc-gen-grpc-kotlin:1.3.0:jdk8@jar"
255
+ // }
256
+ // }
257
+ // generateProtoTasks {
258
+ // all().forEach {
259
+ // it.plugins {
260
+ // grpc
261
+ // grpckt
262
+ // }
263
+ // it.builtins {
264
+ // kotlin
265
+ // }
266
+ // }
267
+ // }
268
+ //}
269
+
270
+ jar {
271
+ from("LICENSE") {
272
+ rename { "${it}_${project.archivesBaseName}" }
273
+ }
274
+ }
275
+
276
+ // configure the maven publication
277
+ publishing {
278
+ publications {
279
+ mavenJava(MavenPublication) {
280
+ from components.java
281
+ }
282
+ }
283
+
284
+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
285
+ repositories {
286
+ // Add repositories to publish to here.
287
+ // Notice: This block does NOT have the same function as the block in the top level.
288
+ // The repositories here will be used for publishing your artifact, not for
289
+ // retrieving dependencies.
290
+ }
291
+ }
292
+ compileKotlin {
293
+ kotlinOptions {
294
+ jvmTarget = "21"
295
+ }
296
+ }
297
+ compileTestKotlin {
298
+ kotlinOptions {
299
+ jvmTarget = "21"
300
+ }
301
+ }
302
+
303
+ tasks.named('clean') {
304
+ doLast {
305
+ delete "CMakeFiles", "MakeFile", "CMakeCache.txt", "cmake_install.cmake", "libnative-lib.so", "libnative-lib.dylib", "native-lib.dll"
306
+ }
307
+ }
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: craftground-runtime-mc121
3
+ Version: 0.1.0
4
+ Summary: CraftGround Fabric mod runtime assets for Minecraft 1.21
5
+ License: Copyright (c) 2023
6
+ All rights reserved.
7
+
8
+ Project-URL: Source, https://github.com/yhs0602/CraftGround
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # MinecraftEnv
15
+
16
+ Lightweight minecraft RL environment on fabric
17
+
18
+ # Features
19
+
20
+ - Works on minecraft 1.21
21
+ - Used fabric mod
22
+ - JDK: 21
23
+
24
+ # initial environment
25
+ - Inventory commands
26
+ - Entities
27
+ - World seed
28
+ - is world superflat
29
+ - is hardcore
30
+ - initial x, y, z
31
+ - always night / day
32
+ - do mob spawn
33
+ - screen size (visible/observed)
34
+ - Arbitrary commands (e.g. status effects)
35
+ - keys for statistics
36
+ - Hud is visible
37
+
38
+ # Observation space
39
+
40
+ - rgb
41
+ - x, y, z
42
+ - pitch, yaw
43
+ - health, food_level, saturation_level
44
+ - is_dead
45
+ - inventory
46
+ - looking at entites, blocks
47
+ - sound subtitles
48
+ - status effects
49
+ - statistics
50
+ - visible entities
51
+ - surrounding entities
52
+ - is bobber thrown
53
+
54
+ # Action space
55
+
56
+ - Similar to https://docs.minedojo.org/sections/core_api/action_space.html
57
+ - No crafting yet
58
+ - Arbitrary command (you should hide this for the agents)
59
+
60
+ Controlled by this reinforcement learning agent: https://github.com/yhs0602/CraftGround
61
+
62
+ renderDistance:6
63
+ simulationDistance:6
64
+
65
+
66
+ # Build cpp
67
+ ```
68
+ mkdir build
69
+ cd build
70
+ cmake ../src/main/cpp
71
+ ```
72
+
73
+ # Docs on MinecraftEnv.kt
74
+ ## ResetPhase
75
+ 1. Initial: END_RESET
76
+ 2. After reading initial environment: WAIT_INIT_ENDS
77
+
78
+ ## IOPhase
79
+ 1. Initial: BEGINNING
80
+ 2. After reading initial environment: GOT_INITIAL_ENVIRONMENT_SHOULD_SEND_OBSERVATION
81
+ 3.