├── .gitignore
├── CREDITS-fml.txt
├── LICENSE
├── LICENSE-fml.txt
├── MinecraftForge-Credits.txt
├── MinecraftForge-License.txt
├── README.md
├── build.gradle
├── changelog.md
├── docker
├── dash.sqlite3
├── mcdash.docker
├── mcprom.conf
├── mcprom.docker
├── mcprom.rules
├── minecraft.json
└── start.sh
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── shell.nix
└── src
└── main
├── kotlin
└── info
│ └── brage
│ └── minecraft
│ └── prometheus
│ └── PrometheusIntegration.kt
└── resources
└── mcmod.info
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | *.iml
3 | *.ipr
4 | *.iws
5 | /eclipse
6 | /lib
7 |
--------------------------------------------------------------------------------
/CREDITS-fml.txt:
--------------------------------------------------------------------------------
1 | This is Forge Mod Loader.
2 |
3 | You can find the source code at all times at https://github.com/MinecraftForge/FML
4 |
5 | This minecraft mod is a clean open source implementation of a mod loader for minecraft servers
6 | and minecraft clients.
7 |
8 | The code is authored by cpw.
9 |
10 | It began by partially implementing an API defined by the client side ModLoader, authored by Risugami.
11 | http://www.minecraftforum.net/topic/75440-
12 | This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader.
13 |
14 | It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
15 | http://www.minecraftforge.net/
16 |
17 | Additionally, it contains an implementation of topological sort based on that
18 | published at http://keithschwarz.com/interesting/code/?dir=topological-sort
19 |
20 | It also contains code from the Maven project for performing versioned dependency
21 | resolution. http://maven.apache.org/
22 |
23 | It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
24 | with credit to it's authors.
25 |
26 | Forge Mod Loader downloads components from the Minecraft Coder Pack
27 | (http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.
28 |
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
341 |
--------------------------------------------------------------------------------
/LICENSE-fml.txt:
--------------------------------------------------------------------------------
1 | This minecraft mod, Forge Mod Loader, including all parts herein except as noted below,
2 | is licensed under the GNU LGPL v2.1 or later.
3 |
4 | Homepage: https://github.com/MinecraftForge/FML
5 |
6 | This software includes portions from the Apache Maven project at
7 | http://maven.apache.org/ specifically the ComparableVersion.java code. It is
8 | included based on guidelines at
9 | http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
10 | with notices intact. The only change is a non-functional change of package name.
11 |
12 | This software contains a partial repackaging of javaxdelta, a BSD licensed program for generating
13 | binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
14 | authored by genman, heikok, pivot.
15 | The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
16 |
17 |
18 | === MCP Data ===
19 | This software includes data from the Minecraft Coder Pack (MCP), with kind permission
20 | from them. The license to MCP data is not transitive - distribution of this data by
21 | third parties requires independent licensing from the MCP team. This data is not
22 | redistributable without permission from the MCP team.
23 |
24 | === Sharing ===
25 | I grant permission for some parts of FML to be redistributed outside the terms of the LGPL, for the benefit of
26 | the minecraft modding community. All contributions to these parts should be licensed under the same additional grant.
27 |
28 | -- Runtime patcher --
29 | License is granted to redistribute the runtime patcher code (common/cpw/mods/fml/patcher and subdirectories) under
30 | any alternative open source license as classified by the OSI (http://opensource.org/licenses)
31 |
32 | -- ASM transformers --
33 | License is granted to redistribute the ASM transformer code (common/cpw/mods/fml/common/asm/ and subdirectories)
34 | under any alternative open source license as classified by the OSI (http://opensource.org/licenses)
35 |
36 | ========
37 |
38 | GNU LESSER GENERAL PUBLIC LICENSE
39 | Version 2.1, February 1999
40 |
41 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
42 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
43 | Everyone is permitted to copy and distribute verbatim copies
44 | of this license document, but changing it is not allowed.
45 |
46 | Preamble
47 |
48 | The licenses for most software are designed to take away your
49 | freedom to share and change it. By contrast, the GNU General Public
50 | Licenses are intended to guarantee your freedom to share and change
51 | free software--to make sure the software is free for all its users.
52 |
53 | This license, the Lesser General Public License, applies to some
54 | specially designated software packages--typically libraries--of the
55 | Free Software Foundation and other authors who decide to use it. You
56 | can use it too, but we suggest you first think carefully about whether
57 | this license or the ordinary General Public License is the better
58 | strategy to use in any particular case, based on the explanations below.
59 |
60 | When we speak of free software, we are referring to freedom of use,
61 | not price. Our General Public Licenses are designed to make sure that
62 | you have the freedom to distribute copies of free software (and charge
63 | for this service if you wish); that you receive source code or can get
64 | it if you want it; that you can change the software and use pieces of
65 | it in new free programs; and that you are informed that you can do
66 | these things.
67 |
68 | To protect your rights, we need to make restrictions that forbid
69 | distributors to deny you these rights or to ask you to surrender these
70 | rights. These restrictions translate to certain responsibilities for
71 | you if you distribute copies of the library or if you modify it.
72 |
73 | For example, if you distribute copies of the library, whether gratis
74 | or for a fee, you must give the recipients all the rights that we gave
75 | you. You must make sure that they, too, receive or can get the source
76 | code. If you link other code with the library, you must provide
77 | complete object files to the recipients, so that they can relink them
78 | with the library after making changes to the library and recompiling
79 | it. And you must show them these terms so they know their rights.
80 |
81 | We protect your rights with a two-step method: (1) we copyright the
82 | library, and (2) we offer you this license, which gives you legal
83 | permission to copy, distribute and/or modify the library.
84 |
85 | To protect each distributor, we want to make it very clear that
86 | there is no warranty for the free library. Also, if the library is
87 | modified by someone else and passed on, the recipients should know
88 | that what they have is not the original version, so that the original
89 | author's reputation will not be affected by problems that might be
90 | introduced by others.
91 |
92 | Finally, software patents pose a constant threat to the existence of
93 | any free program. We wish to make sure that a company cannot
94 | effectively restrict the users of a free program by obtaining a
95 | restrictive license from a patent holder. Therefore, we insist that
96 | any patent license obtained for a version of the library must be
97 | consistent with the full freedom of use specified in this license.
98 |
99 | Most GNU software, including some libraries, is covered by the
100 | ordinary GNU General Public License. This license, the GNU Lesser
101 | General Public License, applies to certain designated libraries, and
102 | is quite different from the ordinary General Public License. We use
103 | this license for certain libraries in order to permit linking those
104 | libraries into non-free programs.
105 |
106 | When a program is linked with a library, whether statically or using
107 | a shared library, the combination of the two is legally speaking a
108 | combined work, a derivative of the original library. The ordinary
109 | General Public License therefore permits such linking only if the
110 | entire combination fits its criteria of freedom. The Lesser General
111 | Public License permits more lax criteria for linking other code with
112 | the library.
113 |
114 | We call this license the "Lesser" General Public License because it
115 | does Less to protect the user's freedom than the ordinary General
116 | Public License. It also provides other free software developers Less
117 | of an advantage over competing non-free programs. These disadvantages
118 | are the reason we use the ordinary General Public License for many
119 | libraries. However, the Lesser license provides advantages in certain
120 | special circumstances.
121 |
122 | For example, on rare occasions, there may be a special need to
123 | encourage the widest possible use of a certain library, so that it becomes
124 | a de-facto standard. To achieve this, non-free programs must be
125 | allowed to use the library. A more frequent case is that a free
126 | library does the same job as widely used non-free libraries. In this
127 | case, there is little to gain by limiting the free library to free
128 | software only, so we use the Lesser General Public License.
129 |
130 | In other cases, permission to use a particular library in non-free
131 | programs enables a greater number of people to use a large body of
132 | free software. For example, permission to use the GNU C Library in
133 | non-free programs enables many more people to use the whole GNU
134 | operating system, as well as its variant, the GNU/Linux operating
135 | system.
136 |
137 | Although the Lesser General Public License is Less protective of the
138 | users' freedom, it does ensure that the user of a program that is
139 | linked with the Library has the freedom and the wherewithal to run
140 | that program using a modified version of the Library.
141 |
142 | The precise terms and conditions for copying, distribution and
143 | modification follow. Pay close attention to the difference between a
144 | "work based on the library" and a "work that uses the library". The
145 | former contains code derived from the library, whereas the latter must
146 | be combined with the library in order to run.
147 |
148 | GNU LESSER GENERAL PUBLIC LICENSE
149 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
150 |
151 | 0. This License Agreement applies to any software library or other
152 | program which contains a notice placed by the copyright holder or
153 | other authorized party saying it may be distributed under the terms of
154 | this Lesser General Public License (also called "this License").
155 | Each licensee is addressed as "you".
156 |
157 | A "library" means a collection of software functions and/or data
158 | prepared so as to be conveniently linked with application programs
159 | (which use some of those functions and data) to form executables.
160 |
161 | The "Library", below, refers to any such software library or work
162 | which has been distributed under these terms. A "work based on the
163 | Library" means either the Library or any derivative work under
164 | copyright law: that is to say, a work containing the Library or a
165 | portion of it, either verbatim or with modifications and/or translated
166 | straightforwardly into another language. (Hereinafter, translation is
167 | included without limitation in the term "modification".)
168 |
169 | "Source code" for a work means the preferred form of the work for
170 | making modifications to it. For a library, complete source code means
171 | all the source code for all modules it contains, plus any associated
172 | interface definition files, plus the scripts used to control compilation
173 | and installation of the library.
174 |
175 | Activities other than copying, distribution and modification are not
176 | covered by this License; they are outside its scope. The act of
177 | running a program using the Library is not restricted, and output from
178 | such a program is covered only if its contents constitute a work based
179 | on the Library (independent of the use of the Library in a tool for
180 | writing it). Whether that is true depends on what the Library does
181 | and what the program that uses the Library does.
182 |
183 | 1. You may copy and distribute verbatim copies of the Library's
184 | complete source code as you receive it, in any medium, provided that
185 | you conspicuously and appropriately publish on each copy an
186 | appropriate copyright notice and disclaimer of warranty; keep intact
187 | all the notices that refer to this License and to the absence of any
188 | warranty; and distribute a copy of this License along with the
189 | Library.
190 |
191 | You may charge a fee for the physical act of transferring a copy,
192 | and you may at your option offer warranty protection in exchange for a
193 | fee.
194 |
195 | 2. You may modify your copy or copies of the Library or any portion
196 | of it, thus forming a work based on the Library, and copy and
197 | distribute such modifications or work under the terms of Section 1
198 | above, provided that you also meet all of these conditions:
199 |
200 | a) The modified work must itself be a software library.
201 |
202 | b) You must cause the files modified to carry prominent notices
203 | stating that you changed the files and the date of any change.
204 |
205 | c) You must cause the whole of the work to be licensed at no
206 | charge to all third parties under the terms of this License.
207 |
208 | d) If a facility in the modified Library refers to a function or a
209 | table of data to be supplied by an application program that uses
210 | the facility, other than as an argument passed when the facility
211 | is invoked, then you must make a good faith effort to ensure that,
212 | in the event an application does not supply such function or
213 | table, the facility still operates, and performs whatever part of
214 | its purpose remains meaningful.
215 |
216 | (For example, a function in a library to compute square roots has
217 | a purpose that is entirely well-defined independent of the
218 | application. Therefore, Subsection 2d requires that any
219 | application-supplied function or table used by this function must
220 | be optional: if the application does not supply it, the square
221 | root function must still compute square roots.)
222 |
223 | These requirements apply to the modified work as a whole. If
224 | identifiable sections of that work are not derived from the Library,
225 | and can be reasonably considered independent and separate works in
226 | themselves, then this License, and its terms, do not apply to those
227 | sections when you distribute them as separate works. But when you
228 | distribute the same sections as part of a whole which is a work based
229 | on the Library, the distribution of the whole must be on the terms of
230 | this License, whose permissions for other licensees extend to the
231 | entire whole, and thus to each and every part regardless of who wrote
232 | it.
233 |
234 | Thus, it is not the intent of this section to claim rights or contest
235 | your rights to work written entirely by you; rather, the intent is to
236 | exercise the right to control the distribution of derivative or
237 | collective works based on the Library.
238 |
239 | In addition, mere aggregation of another work not based on the Library
240 | with the Library (or with a work based on the Library) on a volume of
241 | a storage or distribution medium does not bring the other work under
242 | the scope of this License.
243 |
244 | 3. You may opt to apply the terms of the ordinary GNU General Public
245 | License instead of this License to a given copy of the Library. To do
246 | this, you must alter all the notices that refer to this License, so
247 | that they refer to the ordinary GNU General Public License, version 2,
248 | instead of to this License. (If a newer version than version 2 of the
249 | ordinary GNU General Public License has appeared, then you can specify
250 | that version instead if you wish.) Do not make any other change in
251 | these notices.
252 |
253 | Once this change is made in a given copy, it is irreversible for
254 | that copy, so the ordinary GNU General Public License applies to all
255 | subsequent copies and derivative works made from that copy.
256 |
257 | This option is useful when you wish to copy part of the code of
258 | the Library into a program that is not a library.
259 |
260 | 4. You may copy and distribute the Library (or a portion or
261 | derivative of it, under Section 2) in object code or executable form
262 | under the terms of Sections 1 and 2 above provided that you accompany
263 | it with the complete corresponding machine-readable source code, which
264 | must be distributed under the terms of Sections 1 and 2 above on a
265 | medium customarily used for software interchange.
266 |
267 | If distribution of object code is made by offering access to copy
268 | from a designated place, then offering equivalent access to copy the
269 | source code from the same place satisfies the requirement to
270 | distribute the source code, even though third parties are not
271 | compelled to copy the source along with the object code.
272 |
273 | 5. A program that contains no derivative of any portion of the
274 | Library, but is designed to work with the Library by being compiled or
275 | linked with it, is called a "work that uses the Library". Such a
276 | work, in isolation, is not a derivative work of the Library, and
277 | therefore falls outside the scope of this License.
278 |
279 | However, linking a "work that uses the Library" with the Library
280 | creates an executable that is a derivative of the Library (because it
281 | contains portions of the Library), rather than a "work that uses the
282 | library". The executable is therefore covered by this License.
283 | Section 6 states terms for distribution of such executables.
284 |
285 | When a "work that uses the Library" uses material from a header file
286 | that is part of the Library, the object code for the work may be a
287 | derivative work of the Library even though the source code is not.
288 | Whether this is true is especially significant if the work can be
289 | linked without the Library, or if the work is itself a library. The
290 | threshold for this to be true is not precisely defined by law.
291 |
292 | If such an object file uses only numerical parameters, data
293 | structure layouts and accessors, and small macros and small inline
294 | functions (ten lines or less in length), then the use of the object
295 | file is unrestricted, regardless of whether it is legally a derivative
296 | work. (Executables containing this object code plus portions of the
297 | Library will still fall under Section 6.)
298 |
299 | Otherwise, if the work is a derivative of the Library, you may
300 | distribute the object code for the work under the terms of Section 6.
301 | Any executables containing that work also fall under Section 6,
302 | whether or not they are linked directly with the Library itself.
303 |
304 | 6. As an exception to the Sections above, you may also combine or
305 | link a "work that uses the Library" with the Library to produce a
306 | work containing portions of the Library, and distribute that work
307 | under terms of your choice, provided that the terms permit
308 | modification of the work for the customer's own use and reverse
309 | engineering for debugging such modifications.
310 |
311 | You must give prominent notice with each copy of the work that the
312 | Library is used in it and that the Library and its use are covered by
313 | this License. You must supply a copy of this License. If the work
314 | during execution displays copyright notices, you must include the
315 | copyright notice for the Library among them, as well as a reference
316 | directing the user to the copy of this License. Also, you must do one
317 | of these things:
318 |
319 | a) Accompany the work with the complete corresponding
320 | machine-readable source code for the Library including whatever
321 | changes were used in the work (which must be distributed under
322 | Sections 1 and 2 above); and, if the work is an executable linked
323 | with the Library, with the complete machine-readable "work that
324 | uses the Library", as object code and/or source code, so that the
325 | user can modify the Library and then relink to produce a modified
326 | executable containing the modified Library. (It is understood
327 | that the user who changes the contents of definitions files in the
328 | Library will not necessarily be able to recompile the application
329 | to use the modified definitions.)
330 |
331 | b) Use a suitable shared library mechanism for linking with the
332 | Library. A suitable mechanism is one that (1) uses at run time a
333 | copy of the library already present on the user's computer system,
334 | rather than copying library functions into the executable, and (2)
335 | will operate properly with a modified version of the library, if
336 | the user installs one, as long as the modified version is
337 | interface-compatible with the version that the work was made with.
338 |
339 | c) Accompany the work with a written offer, valid for at
340 | least three years, to give the same user the materials
341 | specified in Subsection 6a, above, for a charge no more
342 | than the cost of performing this distribution.
343 |
344 | d) If distribution of the work is made by offering access to copy
345 | from a designated place, offer equivalent access to copy the above
346 | specified materials from the same place.
347 |
348 | e) Verify that the user has already received a copy of these
349 | materials or that you have already sent this user a copy.
350 |
351 | For an executable, the required form of the "work that uses the
352 | Library" must include any data and utility programs needed for
353 | reproducing the executable from it. However, as a special exception,
354 | the materials to be distributed need not include anything that is
355 | normally distributed (in either source or binary form) with the major
356 | components (compiler, kernel, and so on) of the operating system on
357 | which the executable runs, unless that component itself accompanies
358 | the executable.
359 |
360 | It may happen that this requirement contradicts the license
361 | restrictions of other proprietary libraries that do not normally
362 | accompany the operating system. Such a contradiction means you cannot
363 | use both them and the Library together in an executable that you
364 | distribute.
365 |
366 | 7. You may place library facilities that are a work based on the
367 | Library side-by-side in a single library together with other library
368 | facilities not covered by this License, and distribute such a combined
369 | library, provided that the separate distribution of the work based on
370 | the Library and of the other library facilities is otherwise
371 | permitted, and provided that you do these two things:
372 |
373 | a) Accompany the combined library with a copy of the same work
374 | based on the Library, uncombined with any other library
375 | facilities. This must be distributed under the terms of the
376 | Sections above.
377 |
378 | b) Give prominent notice with the combined library of the fact
379 | that part of it is a work based on the Library, and explaining
380 | where to find the accompanying uncombined form of the same work.
381 |
382 | 8. You may not copy, modify, sublicense, link with, or distribute
383 | the Library except as expressly provided under this License. Any
384 | attempt otherwise to copy, modify, sublicense, link with, or
385 | distribute the Library is void, and will automatically terminate your
386 | rights under this License. However, parties who have received copies,
387 | or rights, from you under this License will not have their licenses
388 | terminated so long as such parties remain in full compliance.
389 |
390 | 9. You are not required to accept this License, since you have not
391 | signed it. However, nothing else grants you permission to modify or
392 | distribute the Library or its derivative works. These actions are
393 | prohibited by law if you do not accept this License. Therefore, by
394 | modifying or distributing the Library (or any work based on the
395 | Library), you indicate your acceptance of this License to do so, and
396 | all its terms and conditions for copying, distributing or modifying
397 | the Library or works based on it.
398 |
399 | 10. Each time you redistribute the Library (or any work based on the
400 | Library), the recipient automatically receives a license from the
401 | original licensor to copy, distribute, link with or modify the Library
402 | subject to these terms and conditions. You may not impose any further
403 | restrictions on the recipients' exercise of the rights granted herein.
404 | You are not responsible for enforcing compliance by third parties with
405 | this License.
406 |
407 | 11. If, as a consequence of a court judgment or allegation of patent
408 | infringement or for any other reason (not limited to patent issues),
409 | conditions are imposed on you (whether by court order, agreement or
410 | otherwise) that contradict the conditions of this License, they do not
411 | excuse you from the conditions of this License. If you cannot
412 | distribute so as to satisfy simultaneously your obligations under this
413 | License and any other pertinent obligations, then as a consequence you
414 | may not distribute the Library at all. For example, if a patent
415 | license would not permit royalty-free redistribution of the Library by
416 | all those who receive copies directly or indirectly through you, then
417 | the only way you could satisfy both it and this License would be to
418 | refrain entirely from distribution of the Library.
419 |
420 | If any portion of this section is held invalid or unenforceable under any
421 | particular circumstance, the balance of the section is intended to apply,
422 | and the section as a whole is intended to apply in other circumstances.
423 |
424 | It is not the purpose of this section to induce you to infringe any
425 | patents or other property right claims or to contest validity of any
426 | such claims; this section has the sole purpose of protecting the
427 | integrity of the free software distribution system which is
428 | implemented by public license practices. Many people have made
429 | generous contributions to the wide range of software distributed
430 | through that system in reliance on consistent application of that
431 | system; it is up to the author/donor to decide if he or she is willing
432 | to distribute software through any other system and a licensee cannot
433 | impose that choice.
434 |
435 | This section is intended to make thoroughly clear what is believed to
436 | be a consequence of the rest of this License.
437 |
438 | 12. If the distribution and/or use of the Library is restricted in
439 | certain countries either by patents or by copyrighted interfaces, the
440 | original copyright holder who places the Library under this License may add
441 | an explicit geographical distribution limitation excluding those countries,
442 | so that distribution is permitted only in or among countries not thus
443 | excluded. In such case, this License incorporates the limitation as if
444 | written in the body of this License.
445 |
446 | 13. The Free Software Foundation may publish revised and/or new
447 | versions of the Lesser General Public License from time to time.
448 | Such new versions will be similar in spirit to the present version,
449 | but may differ in detail to address new problems or concerns.
450 |
451 | Each version is given a distinguishing version number. If the Library
452 | specifies a version number of this License which applies to it and
453 | "any later version", you have the option of following the terms and
454 | conditions either of that version or of any later version published by
455 | the Free Software Foundation. If the Library does not specify a
456 | license version number, you may choose any version ever published by
457 | the Free Software Foundation.
458 |
459 | 14. If you wish to incorporate parts of the Library into other free
460 | programs whose distribution conditions are incompatible with these,
461 | write to the author to ask for permission. For software which is
462 | copyrighted by the Free Software Foundation, write to the Free
463 | Software Foundation; we sometimes make exceptions for this. Our
464 | decision will be guided by the two goals of preserving the free status
465 | of all derivatives of our free software and of promoting the sharing
466 | and reuse of software generally.
467 |
468 | NO WARRANTY
469 |
470 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
471 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
472 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
473 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
474 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
475 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
476 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
477 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
478 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
479 |
480 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
481 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
482 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
483 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
484 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
485 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
486 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
487 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
488 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
489 | DAMAGES.
490 |
491 | END OF TERMS AND CONDITIONS
492 |
--------------------------------------------------------------------------------
/MinecraftForge-Credits.txt:
--------------------------------------------------------------------------------
1 | * Eloraam *
2 |
3 | * FlowerChild *
4 |
5 | * Hawkye *
6 |
7 | * MALfunction84 *
8 |
9 | Submitted the sleep handler code for his mod (Somnia) and others to use.
10 |
11 | * Scokeev9 *
12 |
13 | Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it.
14 |
15 | ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed.
16 |
17 | * SpaceToad *
18 |
19 | * LexManos *
20 |
21 | * cpw *
22 |
23 | * Minecraft Coder Pack (MCP) *
24 | Forge Mod Loader and Minecraft Forge have permission to distribute and automatically download components of MCP and distribute MCP data files.
25 | This permission is not transitive and others wishing to redistribute the Minecraft Forge source independently should seek permission of MCP or
26 | remove the MCP data files and request their users to download MCP separately.
27 |
--------------------------------------------------------------------------------
/MinecraftForge-License.txt:
--------------------------------------------------------------------------------
1 | Minecraft Forge Public Licence
2 | ==============================
3 |
4 | Version 1.0
5 |
6 | 0. Definitions
7 | --------------
8 |
9 | Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB
10 |
11 | User: Anybody that interract with the software in one of the following ways:
12 | - play
13 | - decompile
14 | - recompile or compile
15 | - modify
16 |
17 | Minecraft Forge: The Minecraft Forge code, in source form, class file form, as
18 | obtained in a standalone fashion or as part of a wider distribution.
19 |
20 | Dependency: Code required to have Minecraft Forge working properly. That can
21 | include dependencies required to compile the code as well as modifications in
22 | the Minecraft sources that are required to have Minecraft Forge working.
23 |
24 | 1. Scope
25 | --------
26 |
27 | The present license is granted to any user of Minecraft Forge, for all files included
28 | unless stated otherwise in the file itself. As a prerequisite, a user of Minecraft
29 | Forge must own a legally aquired copy of Minecraft.
30 |
31 | 2. Play rights
32 | --------------
33 |
34 | The user of Minecraft Forge is allowed to install the software on a client or
35 | a server and to play it without restriction.
36 |
37 | 3. Modification rights
38 | ----------------------
39 |
40 | The user has the right to decompile the source code, look at either the
41 | decompiled version or the original source code, and to modify it.
42 |
43 | 4. Derivation rights
44 | --------------------
45 |
46 | The user has the rights to derive code from Minecraft Forge, that is to say to
47 | write code that either extends Minecraft Forge class and interfaces,
48 | instantiate the objects declared or calls the functions. This code is known as
49 | "derived" code, and can be licensed with conditions different from Minecraft
50 | Forge.
51 |
52 |
53 | 5. Distribution rights
54 | ----------------------
55 |
56 | The user of Minecraft Forge is allowed to redistribute Minecraft Forge in
57 | partially, in totallity, or included in a distribution. When distributing
58 | binaries or class files, the user must provide means to obtain the sources of
59 | the distributed version of Minecraft Forge at no costs. This includes the
60 | files as well as any dependency that the code may rely on, including patches to
61 | minecraft original sources.
62 |
63 | Modification of Minecraft Forge as well as dependencies, including patches to
64 | minecraft original sources, has to remain under the terms of the present
65 | license.
66 |
67 | The right to distribute Minecraft Forge does not extend to the right to distribute
68 | MCP data files included within Minecraft Forge. These are the property of the MCP
69 | project and should be removed from any customized distribution of Minecraft Forge
70 | or permission sought separately from the MCP team.
71 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Quick Start
2 | [](https://app.fossa.io/projects/git%2Bgithub.com%2FBaughn%2FPrometheusIntegration?ref=badge_shield)
3 |
4 |
5 | * Add PrometheusIntegration to the mods/ directory of your server.
6 | You can download it from https://www.curseforge.com/minecraft/mc-mods/prometheus-integration.
7 |
8 | * Install docker on your server, by whichever means.
9 |
10 | Debian/Ubuntu: sudo apt-get install docker.io
11 |
12 | * Run the following commands.
13 |
14 | This will expose a dashboard on port 3000. Be careful, by default
15 | this is publicly writable; you'll need a reverse proxy such as nginx
16 | to lock it down. See the next section for hints as to how.
17 |
18 | The Prometheus instance on port 9090 also needs to be publicly
19 | accessible. Do not firewall it.
20 |
21 |
22 |
23 | MCDASH_PORT=3000
24 | MCPROM_PORT=9090
25 | docker run -d --name mcprom -p $MCPROM_PORT:9090 baughn/mcprom
26 | docker run -d --name mcdash --link mcprom:mcprom -p $MCDASH_PORT:3000 baughn/mcdash
27 |
28 | * Finally, visit http://(your hostname):3000/servers and edit the URL
29 | of the preconfigured Minecraft server to match the public hostname
30 | of your server.
31 |
32 | # Optional follow-up
33 |
34 | * Do the same thing client-side. It isn't as useful, but
35 | Promdash-Integration absolutely works in single-player or for
36 | multiplayer clients; the same instructions apply.
37 |
38 | * Play around with Prometheus. The easiest way is to visit the /graph
39 | URL of your Prometheus instance; you can do the same with Promdash,
40 | but it's a little fiddlier.
41 |
42 | You can find more documentation at
43 | http://prometheus.io/docs/introduction/overview/
44 |
45 | * Suggest improvements. Talk to me!
46 |
47 | * Set up Nginx as a reverse proxy for Promdash, so other people can't
48 | edit your settings. While it shouldn't be possible to break out of
49 | the container, or even into the container, they can absolutely mess
50 | up your console.
51 |
52 | Here's a good stanza to start with, though note that your Prometheus
53 | port still needs to be accessible. Be careful, HTTP basic
54 | authentication sends your password in cleartext, so it is not safe
55 | to re-use passwords from elsewhere; ideally, use SSL instead.
56 |
57 |
58 |
59 | server {
60 | listen 80;
61 | server_name promdash.example.com;
62 |
63 | location / {
64 | proxy_pass http://localhost:3000;
65 | limit_except GET HEAD {
66 | auth_basic "Promdash";
67 | auth_basic_user_file conf.d/htpasswd;
68 | }
69 | }
70 | }
71 |
72 |
73 | ## License
74 | [](https://app.fossa.io/projects/git%2Bgithub.com%2FBaughn%2FPrometheusIntegration?ref=badge_large)
75 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.2.0'
3 | ext.prometheus_version = "0.1.0"
4 | repositories {
5 | jcenter()
6 | maven {
7 | name = "forge"
8 | url = "http://files.minecraftforge.net/maven"
9 | }
10 | }
11 | dependencies {
12 | classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | plugins {
18 | id 'com.matthewprenger.cursegradle' version '1.0.9'
19 | id "com.github.johnrengelman.plugin-shadow" version "2.0.2"
20 | }
21 |
22 | apply plugin: 'net.minecraftforge.gradle.forge'
23 | apply plugin: 'kotlin'
24 | apply plugin: 'idea'
25 |
26 | allprojects {
27 | tasks.withType(JavaCompile) {
28 | sourceCompatibility = '1.8'
29 | targetCompatibility = '1.8'
30 | }
31 | }
32 |
33 | version = "0.2.2"
34 | group = "info.brage"
35 | archivesBaseName = "prometheus-integration"
36 |
37 | minecraft {
38 | version = "1.12.2-14.23.1.2587"
39 | runDir = "run"
40 |
41 | // the mappings can be changed at any time, and must be in the following format.
42 | // snapshot_YYYYMMDD snapshot are built nightly.
43 | // stable_# stables are built at the discretion of the MCP team.
44 | // Use non-default mappings at your own risk. they may not allways work.
45 | // simply re-run your setup task after changing the mappings to update your workspace.
46 | mappings = "snapshot_20171003"
47 | // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
48 | }
49 |
50 | repositories {
51 | maven {
52 | name 'shadowfacts'
53 | url 'https://maven.shadowfacts.net/'
54 | }
55 | }
56 |
57 | dependencies {
58 | shadow group: "net.shadowfacts", name: "Forgelin", version: "1.6.0"
59 | compile group: 'io.prometheus', name: 'simpleclient', version: prometheus_version
60 | compile group: 'io.prometheus', name: 'simpleclient_httpserver', version: prometheus_version
61 | compile group: 'io.prometheus', name: 'simpleclient_hotspot', version: prometheus_version
62 | }
63 |
64 | sourceSets {
65 | main.java.srcDirs += 'src/main/kotlin'
66 | main.kotlin.srcDirs += 'src/main/kotlin'
67 | }
68 |
69 | idea {
70 | module.inheritOutputDirs = true
71 | project.languageLevel = '1.8'
72 | }
73 |
74 | processResources {
75 | inputs.property "version", project.version
76 | inputs.property "mcversion", project.minecraft.version
77 |
78 | from(sourceSets.main.resources.srcDirs) {
79 | include 'mcmod.info'
80 | expand 'version':project.version, 'mcversion':project.minecraft.version
81 | }
82 |
83 | from(sourceSets.main.resources.srcDirs) {
84 | exclude 'mcmod.info'
85 | }
86 | }
87 |
88 | task sourcesJar(type: Jar) {
89 | classifier = 'sources'
90 | from sourceSets.main.allSource
91 | }
92 |
93 | configureRelocationShadowJar {
94 | prefix = "info.brage.repack"
95 | }
96 |
97 | shadowJar {
98 | classifier = ""
99 | }
100 |
101 | curseforge {
102 | apiKey = project.hasProperty('curseForgeApiKey') ? project.curseForgeApiKey : ""
103 | project {
104 | id = '254573'
105 | changelogType = 'markdown'
106 | changelog = file('changelog.md')
107 | releaseType = 'alpha'
108 | addGameVersion "1.12.2"
109 | addGameVersion "Java 8"
110 | relations {
111 | requiredLibrary 'shadowfacts-forgelin'
112 | }
113 | mainArtifact(shadowJar) {
114 | displayName = "Prometheus-Integration $project.version"
115 | }
116 | addArtifact(sourcesJar) {
117 | displayName = "Prometheus-Integration $project.version Sources"
118 | }
119 | // addArtifact(deobfJar) {
120 | // displayName = "Prometheus-Integration $project.version Deobfuscated"
121 | // }
122 | }
123 | }
124 |
125 | artifacts {
126 | archives shadowJar
127 | archives sourceJar
128 | }
129 |
130 | reobf { shadowJar { mappingType = 'SEARGE' } }
131 | tasks.reobfShadowJar.mustRunAfter shadowJar
132 | tasks.build.dependsOn sourceJar, shadowJar
133 | afterEvaluate {
134 | tasks.curseforge254573.dependsOn reobfShadowJar
135 | }
136 |
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 | ## 0.2.2
2 |
3 | Removed Jetty in favor of the built-in HttpServer.
4 |
5 | ## 0.2.1
6 |
7 | Add quantiles to server/world tick times: 50th, 90th and 95th percentile.
8 |
9 | ## 0.2.0
10 |
11 | First possibly-working 1.10.2 version
12 |
--------------------------------------------------------------------------------
/docker/dash.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Baughn/PrometheusIntegration/e59f2b4d5bfcafb75a08fd0517169006a8ae6afd/docker/dash.sqlite3
--------------------------------------------------------------------------------
/docker/mcdash.docker:
--------------------------------------------------------------------------------
1 | FROM prom/promdash
2 | MAINTAINER Svein Ove Aas
3 |
4 | ENV DATABASE_URL sqlite3:/db/dash.sqlite3
5 | ADD dash.sqlite3 /db/dash.sqlite3
6 | RUN rake db:migrate
7 | VOLUME /db
8 |
--------------------------------------------------------------------------------
/docker/mcprom.conf:
--------------------------------------------------------------------------------
1 | # Global default settings.
2 | global: {
3 | scrape_interval: "15s" # By default, scrape targets every 15 seconds.
4 | evaluation_interval: "15s" # By default, evaluate rules every 15 seconds.
5 | rule_file: "/etc/prometheus/prometheus.rules"
6 | }
7 |
8 | # A job definition containing exactly one endpoint to scrape: Prometheus itself.
9 | job: {
10 | # The job name is added as a label `job={job-name}` to any time series scraped from this job.
11 | name: "prometheus"
12 | # Override the global default and scrape targets from this job every 5 seconds.
13 | scrape_interval: "5s"
14 |
15 | # Let's define a group of static targets to scrape for this job. In this
16 | # case, only one.
17 | target_group: {
18 | # These endpoints are scraped via HTTP.
19 | target: "http://localhost:9090/metrics"
20 | }
21 | }
22 |
23 | job: {
24 | name: "minecraft"
25 | scrape_interval: "5s"
26 |
27 | target_group: {
28 | target: "http://minecraft:1234/metrics"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/docker/mcprom.docker:
--------------------------------------------------------------------------------
1 | FROM prom/prometheus
2 | MAINTAINER Svein Ove Aas
3 |
4 | ADD mcprom.conf /etc/prometheus/prometheus.conf
5 | ADD mcprom.rules /etc/prometheus/prometheus.rules
6 |
7 | RUN mv /bin/prometheus /bin/prometheus.real
8 | ADD start.sh /bin/prometheus
9 |
--------------------------------------------------------------------------------
/docker/mcprom.rules:
--------------------------------------------------------------------------------
1 | // Forge stats
2 | job:ticks:rate1m = avg(rate(ticks[1m])) by (job)
3 | instance:tick_time_ms:rate1m = rate(tick_time_sum{job="minecraft"}[1m]) / rate(tick_time_count{job="minecraft"}[1m]) * 1000
4 | world:world_time_ms:rate1m = rate(world_time_sum{job="minecraft"}[1m]) / rate(world_time_count{job="minecraft"}[1m]) * 1000
5 |
6 | // Players
7 | name:playtime:sum1d = sum(sum_over_time(present{job="minecraft"}[1d])) by(name, job)
8 | job:playtime:sum1d = sum(name:playtime:sum1d) by(job)
9 |
10 | // JVM stats
11 | job:jvm_memory_bytes_used = sum(jvm_memory_bytes_used{job="minecraft"}) by (job)
12 | job:jvm_memory_bytes_committed = sum(jvm_memory_bytes_committed{job="minecraft"}) by (job)
13 | job:jvm_memory_bytes_max = sum(jvm_memory_bytes_max{job="minecraft"}) by (job)
14 |
--------------------------------------------------------------------------------
/docker/minecraft.json:
--------------------------------------------------------------------------------
1 | {"dashboard":{"name":"Minecraft","created_at":"2015-04-25T17:30:57.000Z","updated_at":"2015-04-27T13:18:29.000Z","dashboard_json":{"globalConfig":{"numColumns":2,"aspectRatio":0.75,"theme":"dark_theme","endTime":null,"vars":{},"tags":[],"palette":"colorwheel","resolution":4,"range":"2h","refresh":"30s"},"widgets":[{"title":"Tick time (ms)","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"world:world_time_ms:rate1m \u003e 0.1","legendID":1}],"tags":[],"type":"graph","showLegend":"always","legendFormatStrings":[{"id":1,"name":"{{world}}"}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"stack","scale":"linear","format":"kmbt","id":1}],"resolution":4,"palette":"colorwheel"},{"title":"Ticks per second","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"job:ticks:rate1m"}],"tags":[],"type":"graph","showLegend":"never","legendFormatStrings":[{"id":1,"name":""}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmbt","id":1,"yMin":"0","yMax":"20"}],"resolution":4,"range":"2h","palette":"colorwheel"},{"title":"Players","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"count(present{job=\"minecraft\"})"}],"tags":[],"type":"graph","showLegend":"never","legendFormatStrings":[{"id":1,"name":""}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmbt","id":1}],"resolution":4,"palette":"colorwheel"},{"title":"Chunks generated / second","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"rate(worldgen{job=\"minecraft\"}[5m])"}],"tags":[],"type":"graph","showLegend":"never","legendFormatStrings":[{"id":1,"name":""}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmbt","id":1}],"resolution":4,"palette":"colorwheel"},{"title":"Memory Usage","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"job:jvm_memory_bytes_used{job=\"minecraft\"}","legendID":"14cf869accb"},{"id":1,"serverID":2,"axisID":1,"expression":"job:jvm_memory_bytes_committed{job=\"minecraft\"}","legendID":"14cf8699ec3"},{"id":2,"serverID":2,"axisID":1,"expression":"job:jvm_memory_bytes_max{job=\"minecraft\"}","legendID":1}],"tags":[],"type":"graph","showLegend":"sometimes","legendFormatStrings":[{"id":1,"name":"Limit"},{"id":"14cf8699ec3","name":"Allocated"},{"id":"14cf869accb","name":"Used"}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmgtp1024","id":1}],"resolution":4,"palette":"colorwheel"},{"title":"CPU Usage (cores)","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"rate(process_cpu_seconds_total{job=\"minecraft\"}[5m])"}],"tags":[],"type":"graph","showLegend":"never","legendFormatStrings":[{"id":1,"name":""}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmbt","id":1}],"resolution":4,"palette":"colorwheel"},{"title":"Foreground GC time (s/s)","range":"2h","endTime":null,"expressions":[{"id":0,"serverID":2,"axisID":1,"expression":"rate(jvm_gc_collection_seconds_sum{job=\"minecraft\"}[5m])","legendID":1}],"tags":[],"type":"graph","showLegend":"sometimes","legendFormatStrings":[{"id":1,"name":"{{gc}}"}],"interpolationMethod":"linear","disabledSeries":{},"axes":[{"orientation":"left","renderer":"line","scale":"linear","format":"kmbt","id":1}],"resolution":4}]}}}
2 |
--------------------------------------------------------------------------------
/docker/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | HOST_IP=$(ip route | grep default | awk '{print $3}')
4 | echo $HOST_IP minecraft >> /etc/hosts
5 |
6 | exec /bin/prometheus.real "$@"
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Baughn/PrometheusIntegration/e59f2b4d5bfcafb75a08fd0517169006a8ae6afd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
6 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/shell.nix:
--------------------------------------------------------------------------------
1 | # This is intended to be used with nix-shell.
2 | # It provides a dev environment, in which gradle and 'gradle runClient' work.
3 |
4 | with import {};
5 |
6 |
7 | with xlibs; stdenv.mkDerivation {
8 | name = "devenv";
9 |
10 | buildInputs = [ gradle jdk ];
11 |
12 | shellHook = ''
13 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${stdenv.cc.cc}/lib:${libX11}/lib/:${libXext}/lib/:${libXcursor}/lib/:${libXrandr}/lib/:${libXxf86vm}/lib/:${mesa}/lib/:${openal}/lib/
14 | '';
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/kotlin/info/brage/minecraft/prometheus/PrometheusIntegration.kt:
--------------------------------------------------------------------------------
1 | package info.brage.minecraft.prometheus
2 |
3 | import io.prometheus.client.Counter
4 | import io.prometheus.client.Gauge
5 | import io.prometheus.client.Summary
6 | import io.prometheus.client.exporter.HTTPServer
7 | import io.prometheus.client.hotspot.DefaultExports
8 | import net.minecraft.entity.player.EntityPlayer
9 | import net.minecraftforge.common.ForgeChunkManager
10 | import net.minecraftforge.common.MinecraftForge
11 | import net.minecraftforge.common.config.Configuration
12 | import net.minecraftforge.event.terraingen.PopulateChunkEvent
13 | import net.minecraftforge.fml.common.FMLCommonHandler
14 | import net.minecraftforge.fml.common.Mod
15 | import net.minecraftforge.fml.common.event.FMLInitializationEvent
16 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
17 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
18 | import net.minecraftforge.fml.common.gameevent.TickEvent
19 | import java.util.*
20 |
21 |
22 | const val MODID = "prometheus-integration"
23 | const val VERSION = "1.0"
24 |
25 | @Mod(modid = MODID, version = VERSION, acceptedMinecraftVersions="[1.10.2,)", acceptableRemoteVersions = "*")
26 | class PrometheusIntegration {
27 |
28 | private var httpPort: Int = 0
29 |
30 | @Mod.EventHandler
31 | fun preInit(event: FMLPreInitializationEvent) {
32 | val config = Configuration(event.suggestedConfigurationFile)
33 | config.load()
34 | httpPort = config.getInt("jetty", "ports", 1234, 1025, 32767, "Port to run the metrics-server on.")
35 | config.save()
36 | }
37 |
38 | @Mod.EventHandler
39 | fun init(event: FMLInitializationEvent) {
40 | val server = HTTPServer(httpPort, true)
41 |
42 | // Get some Hotspot stats.
43 | DefaultExports.initialize()
44 |
45 | // Connect to Forge.
46 | MinecraftForge.EVENT_BUS.register(eventHandler)
47 | MinecraftForge.TERRAIN_GEN_BUS.register(eventHandler)
48 | }
49 | }
50 |
51 |
52 | object eventHandler {
53 | // Tick rate.
54 | val ticks = Counter.build().name("ticks").help("Server ticks").register()
55 | val tickTime = Summary.build().name("tick_time").help("Server tick time")
56 | .quantile(0.5, 0.05)
57 | .quantile(0.9, 0.01)
58 | .quantile(0.95, 0.01)
59 | .register()
60 | val worldTickTime = Summary.build().name("world_time").labelNames("world").help("World tick time")
61 | .quantile(0.5, 0.05)
62 | .quantile(0.9, 0.01)
63 | .quantile(0.95, 0.01)
64 | .register()
65 | // World generation.
66 | val worldgen = Counter.build().name("worldgen").help("Chunks generated").register()
67 | // Players.
68 | val present = Gauge.build().name("present").labelNames("name").help("Is player present").register()
69 | // Possible load causes.
70 | val chunksLoaded = Gauge.build().name("chunks_loaded").labelNames("cause", "world")
71 | .help("Count of chunks loaded, by cause").register()
72 |
73 | val server by lazy {
74 | FMLCommonHandler.instance().minecraftServerInstance
75 | }
76 |
77 | var serverTimer: Summary.Timer? = null
78 | var worldTimer: Summary.Timer? = null
79 |
80 | var serverTicks = 0
81 |
82 | private fun setLoadedChunks() {
83 | for (world in server.worlds) {
84 | val total = world.chunkProvider.loadedChunkCount
85 | val forced = ForgeChunkManager.getPersistentChunksFor(world).size()
86 | val name = world.provider.dimensionType.getName()
87 | chunksLoaded.labels("chunkloader", name).set(forced.toDouble())
88 | chunksLoaded.labels("other", name).set((total - forced).toDouble())
89 | }
90 | }
91 |
92 | @SubscribeEvent
93 | fun onServerTick(event: TickEvent.ServerTickEvent) {
94 | serverTicks++
95 |
96 | if (event.phase == TickEvent.Phase.START) {
97 | serverTimer = tickTime.startTimer()
98 | } else if (event.phase == TickEvent.Phase.END) {
99 | serverTimer!!.observeDuration()
100 | serverTimer = null
101 | ticks.inc()
102 | }
103 |
104 | when (serverTicks % 60) {
105 | 27 -> setLoadedChunks()
106 | 47 -> setPlayers()
107 | }
108 | }
109 |
110 | @SubscribeEvent
111 | fun onWorldTick(event: TickEvent.WorldTickEvent) {
112 | if (event.phase == TickEvent.Phase.START) {
113 | worldTimer = worldTickTime.labels(event.world.provider.dimensionType.getName()).startTimer()
114 | } else if (event.phase == TickEvent.Phase.END) {
115 | worldTimer!!.observeDuration()
116 | worldTimer = null
117 | }
118 | }
119 |
120 | @SubscribeEvent
121 | fun onWorldGen(event: PopulateChunkEvent.Pre) {
122 | worldgen.inc()
123 | }
124 |
125 | var seenPreviously = HashSet()
126 |
127 | fun setPlayers() {
128 | val seenNow = HashSet()
129 |
130 | // Set all new players' values to 1.
131 | for (world in server.worlds) {
132 | for (obj in world.playerEntities) {
133 | if (obj is EntityPlayer) {
134 | val name = obj.displayNameString
135 | seenNow.add(name)
136 | if (!seenPreviously.contains(name)) {
137 | present.labels(name).set(1.0)
138 | }
139 | }
140 | }
141 | }
142 | // Delete all gone-away players.
143 | for (name in seenPreviously) {
144 | if (!seenNow.contains(name)) {
145 | present.remove(name)
146 | }
147 | }
148 | seenPreviously = seenNow
149 | }
150 |
151 | }
152 |
--------------------------------------------------------------------------------
/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "modid": "prometheus-integration",
4 | "name": "Prometheus Integration",
5 | "description": "Exports statistics to the Prometheus monitoring format.",
6 | "version": "${version}",
7 | "mcversion": "${mcversion}",
8 | "url": "",
9 | "updateUrl": "",
10 | "authorList": ["Baughn"],
11 | "credits": "",
12 | "logoFile": "",
13 | "screenshots": [],
14 | "dependencies": ["forgelin"]
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------