Compare commits
74 Commits
1.9.4-2.0.
...
1.10.2-2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
325d041bd9 | ||
|
|
d9d57e283c | ||
|
|
24c58cbbe7 | ||
|
|
1ffeb010d5 | ||
|
|
c122d30065 | ||
|
|
27fd25ae84 | ||
|
|
db6b0ff5a6 | ||
|
|
d61d0ac670 | ||
|
|
f7460f9bf5 | ||
|
|
bdbffd5c33 | ||
|
|
5cbfd2884e | ||
|
|
6095aef3d1 | ||
|
|
3f52336852 | ||
|
|
c6293bcbb0 | ||
|
|
c8126edbb2 | ||
|
|
64898ce288 | ||
|
|
70e3e54038 | ||
|
|
3f2b3d62f7 | ||
|
|
d2def94fc1 | ||
|
|
2c64030459 | ||
|
|
4deb374a7f | ||
|
|
5302bcaed4 | ||
|
|
057edccf26 | ||
|
|
c6dec95a57 | ||
|
|
4fdfa9ec87 | ||
|
|
44d4a250eb | ||
|
|
01acbc6f1f | ||
|
|
1c606874ff | ||
|
|
d9b796db5e | ||
|
|
6bbff3bba7 | ||
|
|
6f3ac71a8b | ||
|
|
cd16211309 | ||
|
|
b0a1cdfce2 | ||
|
|
d46589193e | ||
|
|
1b099f9ef6 | ||
|
|
03534c6515 | ||
|
|
4388d6977d | ||
|
|
7ad19aa025 | ||
|
|
655bea0b2d | ||
|
|
458dad6f9a | ||
|
|
eb5ccb2fd5 | ||
|
|
6498d625ad | ||
|
|
2c898a8192 | ||
|
|
5d520a5a3c | ||
|
|
c681742a69 | ||
|
|
fbf165e618 | ||
|
|
905ae75330 | ||
|
|
72e1fe0d6c | ||
|
|
6163585fe5 | ||
|
|
372206fdff | ||
|
|
4a1cceaa47 | ||
|
|
fb39a06ad2 | ||
|
|
030c71c868 | ||
|
|
1fef12d2bd | ||
|
|
e86c66d874 | ||
|
|
9f7ccb9d07 | ||
|
|
ca2bbca7a4 | ||
|
|
5b3284f8f7 | ||
|
|
61d6fd4162 | ||
|
|
00bcc9e65e | ||
|
|
e6a789d4f8 | ||
|
|
50b53fc6a3 | ||
|
|
a817c7367a | ||
|
|
d64ef8b2e1 | ||
|
|
1f2c05e696 | ||
|
|
ad2893bf4e | ||
|
|
75c0e7b77a | ||
|
|
c934cb9694 | ||
|
|
ce313596db | ||
|
|
6efbf919db | ||
|
|
9add2afec1 | ||
|
|
b1661e359a | ||
|
|
7cc0ee523a | ||
|
|
09f167f10e |
20
.drone.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
pipeline:
|
||||
clone:
|
||||
image: plugins/git
|
||||
tags: true
|
||||
build:
|
||||
image: maven:3.3.9-jdk-8
|
||||
commands:
|
||||
- curl --fail --create-dirs -o $HOME/.gradle/init.d/mirror.gradle https://maven.johni0702.de/config/gradle
|
||||
- curl --fail --create-dirs -o $HOME/.m2/settings.xml https://maven.johni0702.de/config/maven
|
||||
- JAVA_OPTS=-Xmx1516M ./gradlew setupDecompWorkspace
|
||||
- ./gradlew :build
|
||||
archive:
|
||||
image: plugins/s3
|
||||
acl: public-read
|
||||
region: "us-east-1"
|
||||
bucket: "replaymod"
|
||||
path_style: true
|
||||
source: build/libs/*
|
||||
strip_prefix: build/libs/
|
||||
target: /
|
||||
1
.drone.yml.sig
Normal file
@@ -0,0 +1 @@
|
||||
eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgY2xvbmU6CiAgICBpbWFnZTogcGx1Z2lucy9naXQKICAgIHRhZ3M6IHRydWUKICBidWlsZDoKICAgIGltYWdlOiBtYXZlbjozLjMuOS1qZGstOAogICAgY29tbWFuZHM6CiAgICAgIC0gY3VybCAtLWZhaWwgLS1jcmVhdGUtZGlycyAtbyAkSE9NRS8uZ3JhZGxlL2luaXQuZC9taXJyb3IuZ3JhZGxlIGh0dHBzOi8vbWF2ZW4uam9obmkwNzAyLmRlL2NvbmZpZy9ncmFkbGUKICAgICAgLSBjdXJsIC0tZmFpbCAtLWNyZWF0ZS1kaXJzIC1vICRIT01FLy5tMi9zZXR0aW5ncy54bWwgaHR0cHM6Ly9tYXZlbi5qb2huaTA3MDIuZGUvY29uZmlnL21hdmVuCiAgICAgIC0gSkFWQV9PUFRTPS1YbXgxNTE2TSAuL2dyYWRsZXcgc2V0dXBEZWNvbXBXb3Jrc3BhY2UKICAgICAgLSAuL2dyYWRsZXcgOmJ1aWxkCiAgYXJjaGl2ZToKICAgIGltYWdlOiBwbHVnaW5zL3MzCiAgICBhY2w6IHB1YmxpYy1yZWFkCiAgICByZWdpb246ICJ1cy1lYXN0LTEiCiAgICBidWNrZXQ6ICJyZXBsYXltb2QiCiAgICBwYXRoX3N0eWxlOiB0cnVlCiAgICBzb3VyY2U6IGJ1aWxkL2xpYnMvKgogICAgc3RyaXBfcHJlZml4OiBidWlsZC9saWJzLwogICAgdGFyZ2V0OiAvCg.nzPW0_TpMIjnFZZ5Ci439QDKlaDo1a3DCH-VCYUgpx8
|
||||
675
LICENSE.md
Normal file
@@ -0,0 +1,675 @@
|
||||
### GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<http://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
### Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom
|
||||
to share and change all versions of a program--to make sure it remains
|
||||
free software for all its users. We, the Free Software Foundation, use
|
||||
the GNU General Public License for most of our software; it applies
|
||||
also to any other work released this way by its authors. You can apply
|
||||
it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you
|
||||
have certain responsibilities if you distribute copies of the
|
||||
software, or if you modify it: responsibilities to respect the freedom
|
||||
of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the
|
||||
manufacturer can do so. This is fundamentally incompatible with the
|
||||
aim of protecting users' freedom to change the software. The
|
||||
systematic pattern of such abuse occurs in the area of products for
|
||||
individuals to use, which is precisely where it is most unacceptable.
|
||||
Therefore, we have designed this version of the GPL to prohibit the
|
||||
practice for those products. If such problems arise substantially in
|
||||
other domains, we stand ready to extend this provision to those
|
||||
domains in future versions of the GPL, as needed to protect the
|
||||
freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish
|
||||
to avoid the special danger that patents applied to a free program
|
||||
could make it effectively proprietary. To prevent this, the GPL
|
||||
assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
### TERMS AND CONDITIONS
|
||||
|
||||
#### 0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a "modified version" of
|
||||
the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
#### 1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for
|
||||
making modifications to it. "Object code" means any non-source form of
|
||||
a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
#### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||
it unnecessary.
|
||||
|
||||
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
#### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
#### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in section 4
|
||||
to "keep intact all notices".
|
||||
- c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
#### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the Corresponding
|
||||
Source from a network server at no charge.
|
||||
- c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission,
|
||||
provided you inform other peers where the object code and
|
||||
Corresponding Source of the work are being offered to the general
|
||||
public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
#### 7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material,
|
||||
or requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors
|
||||
or authors of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions
|
||||
of it) with contractual assumptions of liability to the recipient,
|
||||
for any liability that these contractual assumptions directly
|
||||
impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
#### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
#### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
#### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
#### 11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
#### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree to
|
||||
terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
#### 13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
#### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in
|
||||
detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU General Public
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that numbered version or
|
||||
of any later version published by the Free Software Foundation. If the
|
||||
Program does not specify a version number of the GNU General Public
|
||||
License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU General Public License can be used, that proxy's public
|
||||
statement of acceptance of a version permanently authorizes you to
|
||||
choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
#### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
#### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
#### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
### How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to
|
||||
attach them to the start of each source file to most effectively state
|
||||
the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper
|
||||
mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands \`show w' and \`show c' should show the
|
||||
appropriate parts of the General Public License. Of course, your
|
||||
program's commands might be different; for a GUI interface, you would
|
||||
use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. For more information on this, and how to apply and follow
|
||||
the GNU GPL, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your
|
||||
program into proprietary programs. If your program is a subroutine
|
||||
library, you may consider it more useful to permit linking proprietary
|
||||
applications with the library. If this is what you want to do, use the
|
||||
GNU Lesser General Public License instead of this License. But first,
|
||||
please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
71
README.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# ReplayMod
|
||||
A Minecraft mod to record game sessions and replay them afterwards from any perspective.
|
||||
|
||||
## Building
|
||||
Make sure your sub-projects are up-to-date: `git submodule update --init --recursive`
|
||||
|
||||
For each branch you visit the first time, running `./gradlew setupDecompWorkspace` is necessary.
|
||||
This will also be necessary if the `replaymod_at.cfg` file has been changed (getting errors about code that is trying
|
||||
to access private fields is a good indication that this has happened).
|
||||
|
||||
### No IDE
|
||||
You can build the mod by running `./gradlew :build`. You can then find the final jar files in `build/libs/`.
|
||||
|
||||
### IntelliJ
|
||||
For the initial setup run `./gradlew preshadowJar idea genIntellijRuns`.
|
||||
You also need to enable the Mixin annotation processor:
|
||||
1. Go to File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors
|
||||
2. Tick "Enable annotation processing"
|
||||
3. Add a new entry to the "Annotation Processor options"
|
||||
4. Set the name to "reobfSrgFile" and the value to "$path/build/mcp-srg.srg" where you replace $path with the full
|
||||
path to the folder containing the gradlew file
|
||||
|
||||
Whenever you switch to another branch, you can either just run `./gradlew preshadowJar idea` or instead run
|
||||
`./gradlew preshadowJar copySrg` and then refresh the gradle project from within IntelliJ.
|
||||
|
||||
### Eclipse
|
||||
|
||||
## Development
|
||||
### Branches
|
||||
New features are developed on the `1.8` branch and merged upwards for release. Larger features are developed on their
|
||||
own branch that is based on `1.8` and then merged back once it's finished.
|
||||
|
||||
Features or bug fixes that apply only to a specific Minecraft version are fixed on the branch corresponding to that
|
||||
version and reverted when merging upwards.
|
||||
|
||||
Both subprojects follow a similar branching model.
|
||||
|
||||
The user documentation (`docs` folder) is only committed to on the current development branch. Any changes committed on
|
||||
a branch for a more recent Minecraft version are not kept up to date on the website and should only be
|
||||
of importance once support for the previous Minecraft version is dropped.
|
||||
|
||||
The `master` branch is solely to be used for the `version.json` file that contains a list of all versions
|
||||
used by the clients to check for updates of this mod.
|
||||
|
||||
### Versioning
|
||||
The ReplayMod uses the versioning scheme outlined [here](http://mcforge.readthedocs.io/en/latest/conventions/versioning/)
|
||||
with three changes:
|
||||
- No `MAJORAPI`, the ReplayMod does not provide any external API
|
||||
- "Updating to a new Minecraft version" should not increment `MAJORMOD`, we maintain one version of the ReplayMod
|
||||
for each version of Minecraft and all these versions share the same feature set (and most bugs). We therefore try to
|
||||
keep the version name the same for all of them (with the exception of `MCVERSION` of course). This also means that the
|
||||
"Multiple Minecraft Version" section does not apply.
|
||||
- For pre-releases the shorter `-bX` is used instead of `-betaX`
|
||||
|
||||
When a new version is (pre-)release, a new annotated tag should be added with the name of the version and the
|
||||
`versions.json` file in the `master` branch should be updated. To simplify this process the gradle task `doRelease` can
|
||||
be used: `./gradlew -PreleaseVersion=1.8-2.0.0-rc1 doRelease`. It will create the tag and update the version.json
|
||||
accordingly.
|
||||
|
||||
Care should be taken that the updated `version.json` is not pushed before a jar file is available on the
|
||||
download page (or Jenkins) as it will inform the users of the update.
|
||||
|
||||
### Bugs
|
||||
Bugs in the mod are tracked via [Bugzilla](https://bugs.replaymod.com/).
|
||||
GitHub should only be used for issues that are generally not likely to affect any end users.
|
||||
|
||||
Bug numbers in commits such as `(fixes #42)` refer to Bugzilla unless noted otherwise.
|
||||
|
||||
## License
|
||||
The ReplayMod is provided under the terms of the GNU General Public License Version 3 or (at your option) any later version.
|
||||
See `LICENSE.md` for the full license text.
|
||||
@@ -36,9 +36,11 @@ archivesBaseName = "replaymod"
|
||||
|
||||
minecraft {
|
||||
coreMod = 'com.replaymod.core.LoadingPlugin'
|
||||
version = '1.9.4-12.17.0.1976'
|
||||
version = '1.10.2-12.18.2.2099'
|
||||
runDir = "eclipse"
|
||||
mappings = "snapshot_20160518"
|
||||
replace '@MOD_VERSION@', project.version
|
||||
replace '@MC_VERSION@', project.minecraft.version
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -59,7 +61,7 @@ configurations {
|
||||
dependencies {
|
||||
compile 'org.projectlombok:lombok:1.16.4'
|
||||
|
||||
compile 'org.spongepowered:mixin:0.5.9-SNAPSHOT'
|
||||
compile 'org.spongepowered:mixin:0.6.4-SNAPSHOT'
|
||||
shade 'com.googlecode.mp4parser:isoparser:1.1.7'
|
||||
shade 'org.apache.commons:commons-exec:1.3'
|
||||
shade 'com.google.apis:google-api-services-youtube:v3-rev178-1.22.0'
|
||||
|
||||
2
docs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
content.html
|
||||
21
docs/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
### Documentation
|
||||
The documentation at [replaymod.com/docs](https://www.replaymod.com/docs/) is generated from
|
||||
`content.md` using a custom Node.js script.
|
||||
|
||||
Using an image directly after a header will show it to the right of the text and will show the following
|
||||
text as its caption.
|
||||
|
||||
Block quotes (`> Quote`) are used to highlight sections of texts: `> **Note:** This is important.`
|
||||
|
||||
Images should be available in two formats: jpg, which is loaded by default and the original png which
|
||||
is loaded when the user clicks on the image. Note that some might only be available as jpg right now
|
||||
as their original was lost.
|
||||
Animated images should be available in webm (vp9) format which is displayed by default and as a gif which is used as
|
||||
the fallback for browsers that lack webm support.
|
||||
In `content.md`, the default version is used.
|
||||
|
||||
Make sure you have [npm]() installed.
|
||||
For the initial setup run `npm install`.
|
||||
Run `node build` to generate the html.
|
||||
|
||||
Note: The template used for the live version is different and the one here is only for convenient testing.
|
||||
209
docs/build.js
Normal file
@@ -0,0 +1,209 @@
|
||||
require('array-findindex-polyfill')
|
||||
require('string.prototype.endswith')
|
||||
|
||||
var fs = require('fs')
|
||||
var markdown = require('md-jml')
|
||||
|
||||
var input = fs.readFileSync('content.md', 'utf8')
|
||||
markdown.parse(input, {}, function (tree) {
|
||||
// Assign numbers to headers
|
||||
var counter = [0, 0, 0, 0]
|
||||
var anchorStack = ['']
|
||||
for (var i = 2; i < tree.length; i++) {
|
||||
var e = tree[i]
|
||||
if (typeof e === 'string' || !e[0].match(/h\d/)) {
|
||||
continue // Not a header
|
||||
}
|
||||
var match = / \[(.+)\]/.exec(e[2])
|
||||
if (!match) {
|
||||
continue // Doesn't contain anchor tag
|
||||
}
|
||||
var tag = match[1]
|
||||
e[2] = /(.+) \[.+\]/.exec(e[2])[1]
|
||||
|
||||
var level = +e[0].substring(1)
|
||||
counter[level - 1]++
|
||||
for (var j = level; j < 4; j++) {
|
||||
counter[j] = 0
|
||||
}
|
||||
e[1].index = counter.slice(0, level).join('.')
|
||||
if (e[1].index.indexOf('.') === -1) {
|
||||
// There always has to be at least one dot in the index
|
||||
e[1].index += '.'
|
||||
}
|
||||
// Prepend index to text
|
||||
e[2] = e[1].index + ' ' + e[2]
|
||||
|
||||
anchorStack = anchorStack.slice(0, level)
|
||||
anchorStack.push(anchorStack[level - 1] + '-' + tag)
|
||||
e[1].anchor = anchorStack[level].substring(1)
|
||||
}
|
||||
|
||||
function forEachElement (elements, matcher, callback) {
|
||||
var indices = elements.map(function (h, index) {
|
||||
// Find the indices of all matched children
|
||||
return matcher(h) ? index : null
|
||||
}).filter(function (i) {
|
||||
// Filter out elements that didn't match
|
||||
return i !== null
|
||||
})
|
||||
for (var i = 0; i < indices.length; i++) {
|
||||
var element = elements[indices[i]]
|
||||
var subElements = elements.slice(indices[i] + 1, i + 1 < indices.length ? indices[i + 1] : elements.length)
|
||||
callback(element, subElements)
|
||||
}
|
||||
}
|
||||
|
||||
function generateIndex (headers, level) {
|
||||
var out = ''
|
||||
|
||||
// Header
|
||||
if (level == 0) {
|
||||
out += '<h2>Contents</h2><dl>'
|
||||
} else {
|
||||
out += '<ul>'
|
||||
}
|
||||
|
||||
// Find the indices of all headers one level below this one
|
||||
forEachElement(headers, function (h) {
|
||||
return h[0] === 'h' + (level + 1) && h[1].anchor
|
||||
}, function (header, subHeaders) {
|
||||
// Output header
|
||||
if (level == 0) {
|
||||
out += '<dt><a href="#' + header[1].anchor + '">' + header[2] + '</a></dt>'
|
||||
} else {
|
||||
out += '<dd><a href="#' + header[1].anchor + '">' + header[2] + '</a></dd>'
|
||||
}
|
||||
// Output sub headers (if any)
|
||||
if (subHeaders.length) {
|
||||
out += generateIndex(subHeaders, level + 1)
|
||||
}
|
||||
})
|
||||
|
||||
// Footer
|
||||
if (level == 0) {
|
||||
out += '</dl>'
|
||||
} else {
|
||||
out += '</ul>'
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
var index = generateIndex(tree.slice(2).filter(function (e) {
|
||||
return e[1] && e[1].index
|
||||
}), 0)
|
||||
|
||||
function generateBody (elements) {
|
||||
function generateElements (elements) {
|
||||
return elements.slice(2).map(generateElement).join('')
|
||||
}
|
||||
function generateElement (element) {
|
||||
if (!element) {
|
||||
return ''
|
||||
} else if (typeof element === 'string') {
|
||||
return element
|
||||
} else if (element[0] === 'em') {
|
||||
return '<i>' + generateElements(element) + '</i>'
|
||||
} else if (element[0] === 'strong') {
|
||||
return '<b>' + generateElements(element) + '</b>'
|
||||
} else if (element[0] === 'code') {
|
||||
return '<code>' + generateElements(element) + '</code>'
|
||||
} else if (element[0] === 'p') {
|
||||
if (element.length === 3 && element[2][0] === 'a' && element[2][2] === 'YouTube') {
|
||||
var id = element[2][1].href
|
||||
return '<a href="https://www.youtube.com/watch?v=' + id+ '" class="thumbnail">' +
|
||||
'<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" ' +
|
||||
'src="https://www.youtube.com/embed/' + id + '" allowfullscreen></iframe></div></a>'
|
||||
}
|
||||
return '<p>' + generateElements(element) + '</p>'
|
||||
} else if (element[0] === 'a') {
|
||||
return '<a href=' + element[1].href + '>' + generateElements(element) + '</a>'
|
||||
} else if (element[0] === 'ul') {
|
||||
return '<ul>' + generateElements(element) + '</ul>'
|
||||
} else if (element[0] === 'li') {
|
||||
return '<li>' + generateElements(element) + '</li>'
|
||||
} else if (element[0] === 'img') {
|
||||
return '<img src="' + element[1].src + '" alt="' + element[1].alt + '">'
|
||||
} else if (element[0] === 'blockquote') {
|
||||
return element.slice(2).map(function (e) {
|
||||
return '<p><mark>' + generateElements(e) + '</mark></p>'
|
||||
}).join('')
|
||||
} else if (element[0] === 'hr') {
|
||||
return '<hr>'
|
||||
} else if (element[0] === 'br') {
|
||||
return '<br>'
|
||||
} else {
|
||||
return JSON.stringify(element)
|
||||
}
|
||||
}
|
||||
function generateSection (header, elements) {
|
||||
// Remove images and store them for later
|
||||
var images = []
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var element = elements[i]
|
||||
if (element[0] !== 'p' || element[2][0] !== 'img') break
|
||||
images.push(element)
|
||||
}
|
||||
elements.splice(0, images.length)
|
||||
|
||||
var out = ''
|
||||
if (header[1].anchor) {
|
||||
out += '<a class="anchor" id="' + header[1].anchor + '"></a>'
|
||||
}
|
||||
out += '<' + header[0] + ' class="text-ul">' + header[2] + '</' + header[0] +'>'
|
||||
out += '<div class="row no-gutter"><div class="col-md-8">'
|
||||
// Generate text
|
||||
out += elements.map(generateElement).join('')
|
||||
out += '</div><div class="col-md-4">'
|
||||
// Generate images
|
||||
images.forEach(function (image) {
|
||||
var url = image[2][1].src
|
||||
if (url.endsWith('.jpg') || url.endsWith('.png')) {
|
||||
var fullQualityUrl = url
|
||||
if (url.endsWith('.jpg')) {
|
||||
fullQualityUrl = url.substring(0, url.length - 3) + 'png'
|
||||
}
|
||||
out += '<div class="thumbnail"><a href="' + fullQualityUrl + '" class="thumbnail" data-lightbox="' +
|
||||
url + '"><img src="' +
|
||||
url + '"></a><div class="caption"><p>' + generateElements(image.slice(1)) + '</p></div></div>'
|
||||
} else if (url.endsWith('gif')) {
|
||||
var webmUrl = url.substring(0, url.length - 3) + 'webm'
|
||||
out += '<div class="thumbnail">' +
|
||||
'<a href="' + url + '" class="thumbnail" data-lightbox="' +url + '">' +
|
||||
'<video style="display:block;width:100%" autoplay loop src="' + webmUrl + '">' +
|
||||
'<img src="' + url + '">' +
|
||||
'</video></a><div class="caption"><p>' + generateElements(image.slice(1)) + '</p></div></div>'
|
||||
} else {
|
||||
console.log('[Warning] Unhandled image format: ' + url)
|
||||
}
|
||||
})
|
||||
out += '</div></div>'
|
||||
return out
|
||||
}
|
||||
|
||||
var out = ''
|
||||
forEachElement(elements, function (e) {
|
||||
return e[0] === 'h1'
|
||||
}, function (header, elements) {
|
||||
out += '<div class="panel panel-default"><div class="panel-body">'
|
||||
var firstHeaderIndex = elements.findIndex(function (e) {
|
||||
return e[0].match(/h\d/)
|
||||
})
|
||||
header[0] = 'h2' // h1 headers should be rendered the same way as h2 ones are
|
||||
out += generateSection(header, elements.slice(0, firstHeaderIndex === -1 ? elements.length + 1 : firstHeaderIndex))
|
||||
forEachElement(elements, function (e) {
|
||||
return e[0].match(/h\d/)
|
||||
}, function (header, elements) {
|
||||
out += generateSection(header, elements)
|
||||
})
|
||||
out += '</div></div>'
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
var out = fs.readFileSync('template.html', 'utf-8')
|
||||
.replace('{{index}}', index)
|
||||
.replace('{{content}}', generateBody(tree.slice(2)))
|
||||
//out = JSON.stringify(tree, null, 2)
|
||||
fs.writeFileSync('content.html', out, 'utf-8')
|
||||
})
|
||||
696
docs/content.md
Normal file
@@ -0,0 +1,696 @@
|
||||
# Installation [installing]
|
||||
## Installing the Replay Mod [replaymod]
|
||||
The **ReplayMod** requires **Minecraft Forge** to be installed.
|
||||
|
||||
Depending on your **Replay Mod** version we recommend the following **Forge** versions:
|
||||
|
||||
- Replay Mod 2.0.0 or later for Minecraft 1.11: Forge [1.11-13.19.1.2189](https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.11.html)
|
||||
- Replay Mod 2.0.0 or later for Minecraft 1.10.2: Forge [1.10.2-12.18.2.2099](https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.10.2.html)
|
||||
- Replay Mod 2.0.0 or later for Minecraft 1.9.4: Forge [1.9.4-12.17.0.1976](https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.9.4.html)
|
||||
- Replay Mod 2.0.0 or later for Minecraft 1.8: Forge [1.8-11.14.4.1563](https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.html)
|
||||
- Replay Mod 1.0.8 or older for Minecraft 1.8: Forge [1.8-11.14.3.1450](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.html)
|
||||
|
||||
Other Forge Versions might, but don't necessarily work.
|
||||
|
||||
If you don't know how to install Forge, follow [this tutorial](https://www.youtube.com/watch?v=4i7-RystzC4).
|
||||
|
||||
After installing Forge, simply put the downloaded `ReplayMod.jar` file in the `/mods` folder of your Minecraft directory.
|
||||
|
||||
> **Note:** The **Replay Mod** is entirely client side and can not be installed on the servers you play on.
|
||||
|
||||
## Installing FFmpeg [ffmpeg]
|
||||
To use the **Replay Mod**'s [Rendering Feature](#replaying-render), you need to have FFmpeg installed.
|
||||
|
||||
### Windows [windows]
|
||||
Download the latest **FFmpeg Static Build** for your architecture from <http://ffmpeg.zeranoe.com/builds/>.
|
||||
Then, extract the downloaded `.7z` file in the folder you want to install FFmpeg in.
|
||||
|
||||
Next, download this **Batch Script** to quickly install FFmpeg: <https://replaymod.com/files/ffmpeg-path-installer.bat>
|
||||
|
||||
> **Note:** If your browser warns you about the download, dismiss the message. It's a simple Batch Script which won't damage your computer.
|
||||
|
||||
Put the downloaded script into the folder where you extracted FFmpeg and run itt by double-clicking it.
|
||||
If you see a success message in the console, you've sucessfully installed **FFmpeg**!
|
||||
|
||||
Alternatively, starting with ReplayMod 2.0.0-b5, you can also extract the downloaded `.7z` file into a `ffmpeg` folder
|
||||
(you have to create it, it doesn't exist by default) in your `.minecraft` folder. No need to run any **Batch Script**.
|
||||
The FFmpeg executable should end up at `.minecraft/ffmpeg/bin/ffmpeg.exe`.
|
||||
|
||||
### Mac OSX [mac]
|
||||
On OSX, you can install **FFmpeg** with **[Homebrew](http://brew.sh/)** using `brew install ffmpeg`.
|
||||
|
||||
Alternatively, you can download the latest static build from <https://ffmpeg.org/> and copy the ffmpeg executable to `/usr/local/bin`.
|
||||
|
||||
### Linux [linux]
|
||||
On Linux, you can install **FFmpeg** using your system's package manager, for example using `apt install ffmpeg`.
|
||||
If in doubt, consult the documentation of your distribution.
|
||||
|
||||
## Compatibility with other Mods [compatibility]
|
||||
### General information [general]
|
||||
In General, the Replay Mod _should_ be compatible with most Forge Mods.
|
||||
|
||||
### Shaders Mod [shaders]
|
||||
[Karyonix' Shaders Mod](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1286604-shaders-mod-updated-by-karyonix)
|
||||
is no longer compatible with Minecraft Forge starting with 1.9.4. As such it is not compatible with the Replay Mod either.
|
||||
Please use [Optifine](https://optifine.net/) instead.
|
||||
|
||||
### Custom Main Menu [custom-main-menu]
|
||||
The [Custom Main Menu](https://mods.curse.com/mc-mods/minecraft/226406-custom-main-menu) mod is often used in mod packs to customize their Main Menu with a button layout fitting the background image, links to their website / bug tracker and similar.
|
||||
If you are familiar with it, the button ids for the Replay Mod are: **17890234** (text: `replaymod.gui.replayviewer`), **17890237** (text: `replaymod.gui.replayeditor`) and **17890236** (text: `replaymod.gui.replaycenter`)
|
||||
|
||||
Due to the nature of this Custom Main Menu mod, buttons added to the Main Menu by 3rd party mods like the **Replay Mod** will not show up by default.
|
||||
Thus, to access the Replay Viewer/Editor/Center, you need to manually configure the position for those buttons.
|
||||
To do so, you need to modify the Custom Main Menu configuration file.
|
||||
Usually, you can find it at `.minecraft/config/CustomMainMenu/mainmenu.json` (if you're using a mod pack launcher, it normally has its own .minecraft folder).
|
||||
For an explanation of this config file, have a look at Custom Main Menu's page.
|
||||
|
||||
You can find a list of already modified config files [here](https://gist.github.com/Johni0702/3f3fab81dbf7ada83d045d9fe8f345aa).
|
||||
|
||||
## Troubleshooting [troubleshooting]
|
||||
If you need help installing the **Replay Mod** or **FFmpeg**, please read [this forum thread](https://www.replaymod.com/forum/thread/220)
|
||||
by [bela333](https://www.replaymod.com/user/bela333) - it covers most of the problems that users encountered so far.
|
||||
|
||||
## Settings [settings]
|
||||
To access the **Replay Mod Settings** from the Main Menu click the **"Mods"** button, select the **Replay Mod** from the list and
|
||||
the click the **"Config"** button.
|
||||
|
||||
When in a Replay, you can either bind a hotkey to the **Replay Mod Settings** in Minecraft's Control settings
|
||||
or use the hotkey GUI by clicking on the arrow button in the lower left corner.
|
||||
|
||||
# Recording [recording]
|
||||

|
||||
The **Recording Indicator** which is displayed while recording
|
||||
|
||||
Recording Replays is the core feature of the **Replay Mod**.
|
||||
|
||||
Recording a Replay is really simple: If enabled in the **Replay Settings**, the Mod will automatically record all of your gaming sessions.
|
||||
You will be notified that the Recording started by a **Chat Message**. Chat Messages can be disabled in the **Replay Settings**.
|
||||
In the upper left corner, a **Recording Indicator** will be displayed unless disabled in the **Replay Settings** while you are recording.
|
||||
|
||||
While Recording, you can set [Event Markers](#replaying-markers) using the `M` key.
|
||||
|
||||
Upon exiting your Server/Singleplayer World, you might be asked to wait a couple of seconds until saving the Replay has been finished.
|
||||
Congratulations, your Replay is now accessible via the **Replay Viewer**!
|
||||
|
||||
# Replaying [replaying]
|
||||

|
||||
The **Replay Viewer** with several recorded Replays
|
||||
|
||||
To watch one of your Replays, open up the **Replay Viewer** from the **Main Menu** and select the desired Replay.
|
||||
Then, press the "Load" button.
|
||||
|
||||
In the **Replay Viewer**, you can also **rename**, **delete** and **upload** your **Replay Files**.
|
||||
|
||||
## Movement [movement]
|
||||
### Basic Controls [basic]
|
||||
While in the Replay, you can freely move around using the movement keys (`WASD, Space, Shift` by default).
|
||||
You can move through block similar to Spectator Mode.
|
||||
|
||||
Using the **Mouse Wheel**, you can modify your flying speed. Scrolling **up** causes you to fly faster, while scrolling **down** slows you down.
|
||||
|
||||
If you prefer the camera to be controlled similar to vanilla Creative Mode, you can change that in the **Replay Settings**.
|
||||
|
||||
### Camera Roll [roll]
|
||||

|
||||
A Screenshot taken with a **tilted camera**
|
||||
|
||||
While in a Replay, you can tilt the Camera.
|
||||
|
||||
By default, pressing `J` will tilt the screen clockwise, and pressing `L` will tilt the screen counterclockwise.
|
||||
Using `K`, you can reset the Camera Roll.
|
||||
|
||||
When holding the `Ctrl` key (`Cmd` key on Mac) while tilting, you can tilt slower and more precisely.
|
||||
|
||||
> **Hint:** Most of the Keybindings mentioned in this documentation can be changed in Minecraft's **Control Menu**.
|
||||
|
||||
### Spectating Entities [spectating]
|
||||
You can spectate any living entitiy (including players) while in a Replay. When looking at an entity, a crosshair will be visible.
|
||||
|
||||
By right-clicking, you will start spectating the entity. If you want to stop spectating the entity, use your Sneak Key (`Shift`).
|
||||
|
||||
## Controlling Time [time]
|
||||
### Replay Speed [speed]
|
||||

|
||||
The **Play/Pause button**, **Speed Slider** and **Replay Timeline** hightlighted
|
||||
|
||||
In the upper left corner of you screen, there is a **Play/Pause button** (Shortcut: `P`), using which you can entirely pause the time of the Replay.
|
||||
All Entities, Particles and Block Updates will be frozen until you resume. You can fly through a paused Replay as usual.
|
||||
|
||||
Next to the Play/Pause Button, there is a **Speed Slider**. Using the **Speed Slider**, you can control how fast the time in your Replay passes.
|
||||
The minimum Speed value is **0.1 times** the normal Minecraft Tick Speed, and the maximum Speed is **8 times** as fast.
|
||||
|
||||
### Jumping in Time [travel]
|
||||
To the right of the Speed Slider, there is the **Replay Timeline**.
|
||||
On the Replay Timeline, you see a yellow cursor indicating your current position in the Replay.
|
||||
By clicking somewhere on this Timeline, you will travel in time towards the specified point in time.
|
||||
Please note that it takes longer to do larger steps in time or to jump backwards in time.
|
||||
|
||||
## Camera Paths [paths]
|
||||
### Introduction [intro]
|
||||
While in a Replay, you can create controlled **Camera Movements** using the Mods's **Keyframe System**.
|
||||
Those Camera Paths can be rendered to a video later (see [Rendering](#replaying-render)).
|
||||
|
||||
Camera Paths are inspired by the [PixelCam Mod](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2327429-pixelcam-camera-studio-for-minecraft-1-8) which is based on the Camera Studio Mod.
|
||||
|
||||
The **Replay Mod Keyframe System** is similar to many Video Editing Software's Keyframe Systems.
|
||||
If you're new to Keyframe Systems, try reading [this Wikipedia article](https://en.wikipedia.org/wiki/Key_frame).
|
||||
|
||||
### Keyframe Timeline [timeline]
|
||||

|
||||
The **Keyframe Timeline** highlighted
|
||||
|
||||
All of the Keyframes which define a Camera Path are placed on the **Keyframe Timeline**.
|
||||
The Keyframe Timeline is below the [Replay Timeline](#replaying-time-travel).
|
||||
|
||||
The **Keyframe Timeline** is 10 Minutes long, meaning a Camera Path can take up to 10 Minutes.
|
||||
You can zoom in and out on the Keyframe Timeline using the `+` and `-` buttons next to it.
|
||||
|
||||
Other than the **Replay Timeline**, the **Keyframe Timeline**'s time values are not relative to the Replay's point of time, but refer to **real time**.
|
||||
If two Keyframes are 5 seconds apart, the Camera Path will take 5 seconds to interpolate between those Keyframes.
|
||||
|
||||
You can drag Keyframes on the **Keyframe Timeline** by left-clicking them, holding the mouse button and moving your mouse.
|
||||
|
||||
### Position Keyframes [place]
|
||||
The basic components of a Camera Path are **Position Keyframes**.
|
||||
A Position Keyframe stores a **Camera Position** (x, y, z, yaw, pitch, roll).
|
||||
|
||||
You can set a **Position Keyframe** using the "Add Position Keyframe"  button.
|
||||
A **Position Keyframe** initially contains the state the Camera was in when creating the Keyframe.
|
||||
|
||||
On the **Keyframe Timeline**, a **Position Keyframe** will appear at the cursors's current position.
|
||||
This Keyframe is selected automatically, and the **Position Keyframe Button** will turn red.
|
||||
By clicking the **Position Keyframe Button** again, the selected **Position Keyframe** will be removed.
|
||||
|
||||
By adding multiple **Position Keyframes** on the **Keyframe Timeline**, you can create a simple **Camera Path**.
|
||||
Using the [Path Preview](#replaying-paths-place-preview), you can preview your **Camera Path**.
|
||||
|
||||
> **Hint:** By right-clicking a **Position Keyframe** on the **Keyframe Timeline**, you can jump to this Keyframe's Position.
|
||||
|
||||
#### Path Interpolation [interpolation]
|
||||

|
||||
A **Camera Path** using **Cubic Interpolation**
|
||||
|
||||

|
||||
The same **Camera Path** using **Linear Interpolation**
|
||||
|
||||
By default, Camera Paths follow a smooth curve through all of the set **Position Keyframes**.
|
||||
This curve is generated using [Cubic Spline Interpolation](https://en.wikipedia.org/wiki/Spline_interpolation).
|
||||
If you wish to disable smooth interpolation and want to make the Path follow straight lines instead, change the **Path Interpolation Setting** in the **Replay Settings**.
|
||||
|
||||
You can easily toggle between **Linear** and **Cubic Interpolation** using the `O` key.
|
||||
|
||||
#### Path Preview [preview]
|
||||

|
||||
While the **Path Preview** is enabled, this camera symbol is displayed in the lower right corner of the screen.
|
||||
|
||||

|
||||
A normal **Path Preview**
|
||||
|
||||
Using the `H` key, you can toggle a **visual representation** of your Camera Path.
|
||||
If enabled, you will see a **Red Line** in the World following the Camrea Path.
|
||||
|
||||
The [Path Interpolation Setting](#replaying-paths-place-interpolation) is respected in this preview.
|
||||
|
||||
By moving the cursor on the **Keyframe Timeline**, you can see the Camera's current positon and view direction on the **Path Preview**.
|
||||
|
||||
### Time Keyframes [time]
|
||||
**Time Keyframes** can be used to precisely control time travelling during a **Camera Path**.
|
||||
|
||||
> Every Time Keyframe represents a timestamp in the Replay itself.
|
||||
|
||||
You can set a **Time Keyframe** using the "Add Time Keyframe"  button.
|
||||
A **Time Keyframe** initially contains the Replay's point in time when creating the Keyframe.
|
||||
|
||||
When playing the **Camera Path**, the Replay's time will interpolate between the set **Time Keyframes** in the Keyframes' intervals. Two **Time Keyframes** with the same Timestamp will freeze the Replay time for the duration of their interval.
|
||||
|
||||
> **Hint:** By right-clicking a **Time Keyframe** on the **Keyframe Timeline**, you can jump to this Keyframe's Timestamp Value.
|
||||
|
||||
> **Note:** Travelling backwards in time is not supported during **Camera Paths**. Do not add a **Time Keyframe** containing an earlier point in time after another **Time Keyframe**.
|
||||
|
||||
To play your first **Camera Path**, click the **Play Button** next to the **Keyframe Timeline**.
|
||||
By default, the **Camera Path** starts from the Cursor Position on the Keyframe Timeline.
|
||||
By clicking while holding the `Ctrl` key (`Cmd` key on Mac), you can however start from the beginning regardless of the Cursor Position.
|
||||
|
||||
#### Synchronizing Timelines [sync]
|
||||
Using the `V` key, you can **synchronize** the **Keyframe Timeline** with the time that passed since the last **Time Keyframe**'s timestamp.
|
||||
|
||||
This means that pressing `V` moves the **Keyframe Timeline**'s cursor to the position where placing a **Time Keyframe** would result in a **Replay Speed** of the **Speed Slider's current value** between the newly placed and the last **Time Keyframe**.
|
||||
|
||||
If holding `Shift` while synchronizing, it will be synchronized as if the **Speed Slider's value** was **1.0**.
|
||||
|
||||
### Spectator Keyframes [spectator]
|
||||

|
||||
A **Path Preview** with **Spectator Keyframes**
|
||||
|
||||
While [spectating an entity](#replaying-movement-spectating), the "Add Position Keyframe" button becomes an "Add Spectator Keyframe"  button.
|
||||
|
||||
To sucessfully spectate an entity, you always need at least two **Spectator Keyframes** created while spectating the same entity.
|
||||
On the **Keyframe Timeline**, the periods during which you are spectating an entity are marked with a blue line.
|
||||
|
||||
To leave a spectated entity during a camera path, simply add a normal **Position Keyframe**.
|
||||
|
||||
### Editing Keyframes [edit]
|
||||

|
||||
The **Keyframe Editor** for a **Position Keyframe**
|
||||
|
||||
You can edit any Keyframe by **double-clicking** it on the Keyframe Timeline.
|
||||
A new GUI Screen will open which allows you to modify the Keyframe's properties.
|
||||
|
||||
On the lower part of the screen, you can precisely set the Keyframe's position on the **Keyframe Timeline**.
|
||||
Above that, you can modify Keyframe specific settings, for example its Position value.
|
||||
|
||||
### Removing Keyframes [remove]
|
||||
Using the `DELETE` key, you can remove the currently selected Keyframe.
|
||||
Alternatively, while a Keyframe is selected, its connected Button turns red, and clicking it removes the Keyframe as well.
|
||||
|
||||
> **Note:** If you use an Apple Computer with a built-in keyboard, you may need to press `FN + DELETE` instead.
|
||||
|
||||
### Keyframe Repository [repository]
|
||||

|
||||
The **Keyframe Repository** with two **Path Presets**
|
||||
|
||||
[YouTube](IYrzbbIzWPw)
|
||||
|
||||
Using the `X` key, you can open the **Keyframe Repository**. Every Replay File has a separate Keyframe Repository which can contain several **Keyframe Presets**.
|
||||
|
||||
To save the Keyframes currently on your Timeline, click the **"Save as..."** button.
|
||||
You can change a Preset's name, select it from the list and click the **"Rename"** button.
|
||||
To load a Keyframe Preset, select a Preset from the list and click the **"Load"** button.
|
||||
Using the **"Remove"** button, you can permanently delete a Keyframe Preset from the **Keyframe Repository**.
|
||||
|
||||
## Custom Objects [objects]
|
||||
|
||||
> Custom Objects are not available in the 2.0.0 versions. They are expected to return eventually.
|
||||
|
||||
[YouTube](_Xdpg828fbE)
|
||||
|
||||
### Introduction [introduction]
|
||||
**Custom Objects** are mainly meant for **video creators**. They allow you to add any image into the Replay World and animate its Position, Opacity and much more.
|
||||
|
||||
Instead of using [Motion Tracking](https://en.wikipedia.org/wiki/Match_moving) to add text or pictures to a video, you can directly add these to the rendered file.
|
||||
|
||||
### Adding Assets [assets]
|
||||

|
||||
The **Asset Manager** with an example Asset
|
||||
|
||||
In order to create **Custom Objects**, you first have to add **Assets** to your Replay File.
|
||||
Therefore, open the **Asset Manager** using the `G` key.
|
||||
|
||||
In the **Asset Manager**, you can add **Image Files (.png, .jpg and more)**, so-called **Assets**, to the Replay.
|
||||
When clicking the **"Add"** button, a File Chooser will show up. Select the image file you want to use.
|
||||
You can give the Asset a custom name using the Text Input Field in the top right corner.
|
||||
|
||||
All of the Assets you added can be used by **Custom Objects**.
|
||||
|
||||
### Creating Custom Objects [creating]
|
||||

|
||||
The **Object Manager** with some **Animation Keyframes**
|
||||
|
||||
Using the `F` key, you can open the **Object Manager**. Initially there won't be any Objects in the **Object List**, but you can simply add an Object using the **"Add"** button.
|
||||
|
||||
After doing so, you can name the newly created **Custom Object** using the Text Field in the upper right corner.
|
||||
To define which **Asset File** (i.e. image) the **Custom Object** should use, select the desired **Asset** from the dropdown beneath the Name Input.
|
||||
|
||||
If you leave the **Object Manager**, you should see the image in the World somwhere near your position.
|
||||
|
||||
### Animating Custom Objects [animating]
|
||||

|
||||
An animated **Custom Image Object**.
|
||||
|
||||
Of course, you don't want the image to stay at that position.
|
||||
herefore, open the **Object Manager** again and select the **Custom Object** you want to modify.
|
||||
On the lower half of the screen you will see mutliple **Input Fields**, using which you can modify various settings
|
||||
(so-called **Transformations**), for example the Object's **Position**, **Scale**, **Orientation** and **Opacity**.
|
||||
|
||||
When editing these values, you'll notice that on the TImeline to the right, Keyframes appear.
|
||||
You can set and remove Keyframes for specific settings using its "Add Keyframe" button on the very left of the screen.
|
||||
|
||||
The **Object Manager's Keyframe System** is very similar to the **Position Keyframe** and **Time Keyframe** System.
|
||||
|
||||
During a **Camera Path**, the **Custom Objects** will interpolate their **Transformation Values** like **Position Keyframes** are interpolated.
|
||||
While outside the **Object Manager** you can preview the Objects' position by moving the cursor on the **Keyframe Timeline** - the Objects will interpolate to the position they'll be at that timestamp during the **Camera Path**.
|
||||
|
||||
Once you got the hang of it, you'll be able to quickly animate **Custom Objects**.
|
||||
|
||||
## Rendering [render]
|
||||
With the **Replay Mod**, you can render **Camera Paths** to videos **without** using a screen recording tool like Fraps.
|
||||
To get started, first [set up your Camera Path](#replaying-paths) as described in the previous chapters.
|
||||
Then, press the **"Render Camera Path"** button in the upper left corner.
|
||||
|
||||
### Rendering Method [method]
|
||||
The **Replay Mod** does not only allow you to render "normal" vidoes as you see them on YouTube everyday,
|
||||
you can also render **360 degree videos**, **3D videos** and more.
|
||||
To change the rendering method, use the dropdown on the upper half of the **Render Settings Screen**.
|
||||
|
||||
#### Default Rendering [default]
|
||||

|
||||
A frame exported using **Default Rendering**
|
||||
|
||||
Renders the video in the specified resolution. Fastest Rendering Option.
|
||||
|
||||
#### Stereoscopic Rendering [stereoscopic]
|
||||

|
||||
A frame exported using **Stereoscopic Rendering**
|
||||
|
||||
Renders the video as a [stereoscopic](https://en.wikipedia.org/wiki/Stereoscopy) (side-by-side) 3D move, usable by different 3D technologies. The image for one eye is half the width of the video.
|
||||
|
||||
#### Cubic Rendering [cubic]
|
||||

|
||||
A frame exported using **Cubic Rendering**
|
||||
|
||||
Renders the video with a **360 degree panoramic view**, using [Cubic Projection](http://wiki.panotools.org/Cubic_Projection).
|
||||
This is usable by several 360 degree video players (and the **Oculus Rift**), for example [VR Player](https://vrplayer.codeplex.com/).
|
||||
While **Cubic Videos** can't be used for **YouTube 360° Videos**, it takes less time to render them, so if your player
|
||||
is compatible with **Cubic Projection** anyway, you can use this setting.
|
||||
|
||||
#### Equirectangular Rendering [equirectangular]
|
||||

|
||||
A frame exported using **Equirectangular Rendering**
|
||||
|
||||
Renders the video with a 360 degree panoramic view, using [Equirectangular Projection](http://wiki.panotools.org/Equirectangular_Projection).
|
||||
This is usable by [YouTube's new 360 degree video function](https://support.google.com/youtube/answer/6178631?hl=en), and several video players (and the **Oculus Rift**), for example [VR Player](https://vrplayer.codeplex.com/).
|
||||
|
||||
> **Note:** In order for **YouTube** to recognize 360 Degree Videos, you have to inject some Metadata. Follow [this guide](https://support.google.com/youtube/answer/6178631?hl=en) for a tutorial.
|
||||
|
||||
### Video Settings [settings]
|
||||

|
||||
The **Video Render Settings** Screen
|
||||
|
||||
After you chose the **Rendering Mode** you want to use, you can further customize the rendered video.
|
||||
|
||||
#### Video Resolution [resolution]
|
||||
Below the **Render Method** Dropdown, you can enter the desired **Video Resolution** (Width * Height).
|
||||
You can enter any resolution there, but make sure to use reasonable values.
|
||||
|
||||
Common Video Resolutions for **Default Rendering** are:
|
||||
|
||||
- 720p - 1280 * 720
|
||||
- 1080p - 1920 * 1080
|
||||
- 4k - 3840 * 2160
|
||||
|
||||
---
|
||||
|
||||
When using **Stereoscopic Rendering**, please note that the entered **Width** value is the final video's width.
|
||||
Because **Stereoscopic Videos** have two frames next to each other, you therefore need to **double** the video width,
|
||||
so if you want a **Full HD Stereoscopic Video**, you have to enter **3840 * 1080**.
|
||||
|
||||
---
|
||||
|
||||
Videos in **Equirectangular Projection** always need to have an **Aspect Ratio** of **2:1**.
|
||||
|
||||
Please note that you should generally use a high resolution when exporting **Equirectangular Videos**, as the Video will be mapped onto a spherical surface in the Viewer you're using. To get a decent looking video, we recommend a resolution of **4320 * 2160**.
|
||||
|
||||
> **Note:** If you're re-rendering Equirectangular footage (e.g. using a video editing software like Premiere), make sure to export it at a **2:1** aspect ratio - otherwise it will look strange in 360 degrees.
|
||||
|
||||
#### Video Framerate [framerate]
|
||||
|
||||
#### Video Encoding and Quality [quality]
|
||||

|
||||
A comparison between the quality of the **MP4 Hight, Default and Potato** Quality Presets.
|
||||
|
||||
Below the **Render Method Dropdown**, there is another Dropdown Menu for **Encoding Presets**.
|
||||
|
||||
> **Note:** If you simply want to render an MP4 video in good quality, don't change these settings.
|
||||
|
||||
There are **7 Encoding Presets** you can choose from:
|
||||
|
||||
- **MP4 - Default Quality**
|
||||
Renders an **MP4 video** encoded with the **x264 codec** in **Default Quality**.
|
||||
This is default Encoding Preset, as it exports a video with good quality and a relativly low file size.
|
||||
- **MP4 - High Quality**
|
||||
Renders an **MP4 video** encoded with the **x264 codec** in **High Quality**.
|
||||
Rendered videos have a relatively high file size, but their quality is almost lossless. This is useful for video producers who have to encode (render) their footage several times.
|
||||
- **MP4 - Potato Quality**
|
||||
Renders an **MP4 video** encoded with the **x264 codec** in **Very Low Quality**.
|
||||
While the video itself looks really bad, the file size is tiny and therefore this preset can be used for test renders.
|
||||
- **MP4 - Custom Bitrate**
|
||||
If this Preset is chosen, the **Bitrate Input Field** gets enabled and you can define the video's bitrate yourself.
|
||||
The rendered video is an **MP4 video** encoded with the **x264 codec**.
|
||||
- **WEBM - Custom Bitrate**
|
||||
If this Preset is chosen, the **Bitrate Input Field** gets enabled and you can define the video's bitrate yourself.
|
||||
The rendered video is a **webm video** encoded with the **vp8 codec**.
|
||||
**webm video files** are useful if you want to upload footage directly to streaming services like YouTube,
|
||||
as they usually don't have to convert **vp8-encoded videos** when processing them.
|
||||
- **MKV - Lossless**
|
||||
Renders an **MKV video** encoded with the **x264 codec** in **Lossless Quality**.
|
||||
While these video files are of perfect quality, most **non-FFmpeg-based video players and video editing software** (e.g. QuickTime Player, Sony Vegas and Adobe Premiere) can't play these videos. Therefore, you should instead use the **MP4 - High Quality** preset in most cases.
|
||||
- **PNG Sequence**
|
||||
Exports the sequence as individual frames in the **PNG Format**.
|
||||
**Warning:** This can create a huge amount of files, so make sure to save them in a separate folder.
|
||||
|
||||
### Advanced Settings [advanced]
|
||||

|
||||
The **Advanced Render Settings**
|
||||
|
||||
#### Render Nametags [nametags]
|
||||
If you don't want to see Entity's Nametags in the rendered video, simply un-tick the checkbox. Hidden Nametags also include Nametags of **Armor Stands** and **Mobs**, **not only Players**!
|
||||
|
||||
#### Stabilize Camera [stabilize]
|
||||
This setting is only applicable for **Cubic Rendering** and **Equirectangular Rendering**.
|
||||
Because you can rotate the camera in **360 degree viewers**, a tilted camera persepctive leads to a strange user experience:
|
||||
If the user looks around, his view might appear to be tilted because the camera looked up or down.
|
||||
Therefore, it is recommended to **always stabilize the camera's Pitch and Roll** using the repsective checkboxes.
|
||||
|
||||
[Example 360° video **without stabilized Camera Pitch**](https://www.youtube.com/watch?v=lHGSG-0CVZw)
|
||||
[Example 360° video **with stabilized Camera Pitch and Roll**](https://www.youtube.com/watch?v=mtBehojUotQ)
|
||||
|
||||
#### Chroma Keying [chroma]
|
||||

|
||||
A screenshot of a video rendered with a **Red Chroma Key Setting**
|
||||
|
||||
This is an experimental setting for video producers which allows you to change the sky color to a fixed color.
|
||||
Using a **Video Editing Software** like **Adobe After Effects** or **Sony Vegas**, you can change the sky color to transparency and add your own footage as sky. Read more about **Chroma Keying** [here](https://en.wikipedia.org/wiki/Chroma_key).
|
||||
|
||||
> **Note:** For best results, you should **disable clouds** before rendering, as they are transparent.
|
||||
|
||||
### Command Line Settings [commandline]
|
||||

|
||||
The **Command Line Render Settings**
|
||||
|
||||
|
||||
> **Note**: This is for advanced users only. If you do not know what your're doing, leave these settings as they are.
|
||||
|
||||
The **Replay Mod** runs [FFmpeg](http://ffmpeg.org/) via the **Command Line** to encode videos.
|
||||
|
||||
You can customize both the **executed Command** and the **Command Line Arguments** in the **Command Line Settings** part of the **Render Settings Screen**.
|
||||
|
||||
#### Custom Command [command]
|
||||
If you leave the left input field blank, `ffmpeg` will be used as **command**. If you haven't set your **PATH variable** to link to your FFmpeg distribution, simply enter the full path to your FFmpeg executable (e.g. `C:/ffmpeg/ffmpeg.exe` or `/usr/local/bin/ffmpeg`).
|
||||
|
||||
#### Command Line Arguments [arguments]
|
||||
In the right input field, you can input custom **Command Line Arguments** to be used in the console.
|
||||
|
||||
Each of the **Encoding Presets** basically represents a set of **Command Line Arugments** which are used with the **ffmpeg Command**.
|
||||
Customizing these **Command Line Arguments** allows you to use a specific codec or quality setting and much more.
|
||||
If you need an introduction to **ffmpeg Command Line Arguments**, read the [FFmpeg documentation](http://ffmpeg.org/ffmpeg.html).
|
||||
|
||||
Before passing the given **Command Line Arguments** to the **ffmpeg Command**, the **Replay Mod** replaces the following placeholders with your inputs in the **Render Settings Screen**:
|
||||
- **%WIDTH%**
|
||||
The video's width
|
||||
- **%HEIGHT%**
|
||||
The video's height
|
||||
- **%FPS%**
|
||||
The video's framerate
|
||||
- **%FILENAME%**
|
||||
The video's filename **without the extension**. This should be surrounded with quotation marks `"`, as the filename might contain spaces.
|
||||
As the **ffmpeg Command** is always executed from the target file's parent directory, %FILENAME% does **not** contain the file's full path.
|
||||
- **%BITRATE%**
|
||||
The video's bitrate in **kilobytes per second**. As the %BITRATE% placeholder already contains the **value identifier "K"**,
|
||||
you don't have to take care of the bitrate value's format.
|
||||
|
||||
### Rendering Performance [performance]
|
||||

|
||||
The Screen which is displayed while a video is being rendered
|
||||
|
||||
By clicking the **Render Button** in the lower right corner, you start **Default Performance Rendering**. Usually, this is perfectly satisfying regarding rendering speed, but you can increase it slightly using **High Performance Rendering**.
|
||||
|
||||
To use **High Performance Rendering**, hold down the `Ctrl` key (`Cmd` key on Mac) while clicking the **Render Button**.
|
||||
**High Performance Rendering** has the following changes to improve rendering speed:
|
||||
- Rendering Process, Estimated Time Left and Button Clicks are not recalculated after every rendered frame,
|
||||
but only after one rendered seconds (e.g. every 60 frames when rendering with 60fps)
|
||||
- Resizing the Minecraft Window does not update the Rendering Gui
|
||||
|
||||
### Troubleshooting [troubleshooting]
|
||||
|
||||
> If you have trouble with rendering, please first consult the Documentation before asking for help in the Forums.
|
||||
|
||||
#### No FFmpeg installation found [ffmpeg]
|
||||

|
||||
The error screen that is displayed when no FFmpeg installation could be found
|
||||
|
||||
If the **Replay Mod** tells you to install FFmpeg even though you already have, you have to manually tell the **Replay Mod** where your FFmpeg executable is located.
|
||||
|
||||
First, get the full path to your `ffmpeg.exe` (on Windows) or `ffmpeg` executable (on Mac/Linux).
|
||||
On Windows, this path might look like `C:/ffmpeg/ffmpeg.exe`.
|
||||
|
||||
Then, open the **"Command Line Settings" Tab** in the Render Settings and paste this path into the **left input field** and retry rendering.
|
||||
|
||||
#### Crash while rendering [crash]
|
||||
If Minecraft crashes after a few frames of rendering, it most likely means the **FFmpeg** didn't like the **Command Line Arguments** you passed.
|
||||
If you customized the Command Line Arguments manually, re-check them - it's probably your own fault.
|
||||
|
||||
> **Hint:** In your .minecraft folder, you'll find a file called `export.log` which contains information about FFmpeg's rendering process.
|
||||
|
||||
If you did **not** customize the **Command Line Arguments**, you might have entered some insanely high (or low) values e.g. for Bitrate or Video Resolution. Try again with other, more reasonable values.
|
||||
|
||||
## Ambient Lighting [lighting]
|
||||

|
||||
The same setting, onace with **Ambient Lighting** enabled, once with **Ambient Lighting** disabled
|
||||
|
||||

|
||||
While **Ambient Lighting** is enabled, this eye symbol is displayed in the lower right corner of the screen.
|
||||
|
||||
If you have a Replay in a dark setting (for example at nighttime, or in a cave) and **Brightness: Bright** just isn't bright enough for you, you can toogle **Ambient Lighting** using the `Z` key (`Y` on some keyboards).
|
||||
|
||||
This works as a replacement for the **Night Vision Potion Effect**, without the side effect of a weird sky color.
|
||||
|
||||
## Player Overview [overview]
|
||||

|
||||
The **Player Overview** Screen
|
||||
|
||||
Using the `B` key, you can open the **Player Overview**. In the **Player Overview**, you see a list of all currently loaded **Players** in the Replay.
|
||||
|
||||
By clicking on a player's **Name or Head**, you can **spectate** this player.
|
||||
|
||||
Next to each player, there's a **checkbox** using which you can toggle the player's **visibility**.
|
||||
This way, you can hide certain players from the Replay.
|
||||
Below the individual checkboxes, there are two checkbox buttons - one to **hide all players** and one to **show all players**.
|
||||
|
||||
If you want to **save the player visibility settings**, check **"Remember Hidden Players" checkbox**.
|
||||
If checked, invisible players will stay invisible after closing the Replay (this can of course be reverted),
|
||||
otherwise all of the players are visible again after reloading the Replay.
|
||||
|
||||
## Thumbnails [thumbnail]
|
||||

|
||||
The **Default Thumbnail** which is used if no Thumbnail was created
|
||||
|
||||
While in a Replay, you can use the `N` key to create a **Thumbnail** of the current Replay.
|
||||
A **Thumbnail** is a Screenshot which should give the viewer a good impression of your Replay's content.
|
||||
|
||||
**Thumbnails** are important when uploading a Replay to the **Replay Center**,
|
||||
as other users are much more likely to download your Replay if they can see a preview of it.
|
||||
They also help keeping your **Replay Viewer** clear and structured.
|
||||
|
||||
If no **Thumbnail** is set for a Replay, the **Default Thumbnail** will be displayed in the **Replay Viewer** and in the **Replay Center**.
|
||||
|
||||
## Event Markers [markers]
|
||||

|
||||
The **Replay Timeline** with several **Event Markers**
|
||||
|
||||
Long Replays easily get really clunky and difficult to handle.
|
||||
Therefore, **Event Markers** are a simple way to mark important events in your Replay.
|
||||
|
||||
While [recording a Replay](#recording), you can press the `M` key anytime to set an **Event Marker**.
|
||||
This **Event Marker** remembers the **Position** where you've added it and will later,
|
||||
while watching a Replay, be displayed on the **Replay Timeline**.
|
||||
|
||||
While viewing a Replay, you can jump to an **Event Marker**'s Position and Timestamp by right-clicking it on the **Replay Timeline**.
|
||||
|
||||
You can also add new **Event Markers** while viewing a Replay using the `M` key as well.
|
||||
|
||||
You can name **Event Markers** by double-clicking them.
|
||||
When hovering over the **Event Marker**, its name is displayed.
|
||||
This way, it's even simpler to add structure to your Replays.
|
||||
|
||||
You can **delete an Event Marker** by clicking it once to select it and then pressing the `DELETE` key.
|
||||
|
||||
# Replay Center [center]
|
||||
The **Replay Center** is where you can **share** your **Minecraft Moments** with others and discover awesome **Replays by other Users**.
|
||||
To be able to use the **Replay Center**, you need an **account on ReplayMod.com**.
|
||||
|
||||
## Authentication [auth]
|
||||

|
||||
The **Login Screen** which is displayed upon startup
|
||||
|
||||

|
||||
The **Register Screen**
|
||||
|
||||
When starting Minecraft with the **Replay Mod** installed, you will be asked to login to **ReplayMod.com**.
|
||||
If you don't want to use the **Replay Center**, you can click the **"Skip" Button** to continue without logging in.
|
||||
|
||||
If you want to browse other users' **Replays** and **share your own Replays** however, you need to **Register an account**.
|
||||
|
||||
> **Note:** By registering an Account on **ReplayMod.com**, you agree to the Website's [Terms of Service](https://www.replaymod.com/legal/terms)
|
||||
|
||||
Please note that you can only create **one ReplayMod.com Account per Minecraft Account**, so choose your username wisely.
|
||||
|
||||
Once you've registered, you're automatically going to be logged in. The Mod **remembers your login** until you manually log out from the **Replay Center**, so it won't ask you upon every startup if you logged in once.
|
||||
|
||||
## Replay Files [files]
|
||||

|
||||
The **Replay Center** in the Mod
|
||||
|
||||
Once you've logged in, you can use the **"Replay Center" Button** in the Main Menu to access the **Replay Center**.
|
||||
|
||||
In the upper half of the screen, there are **5 Buttons** for **5 Tabs** of the **Replay Center**:
|
||||
- **Recent**
|
||||
Shows the most recently uploaded Replays in the **Replay Center**
|
||||
- **Best**
|
||||
Shows the Replays with the **best rating and most downloads**
|
||||
- **Downloaded**
|
||||
Shows all of the Replays you've downloaded locally
|
||||
- **Favorited**
|
||||
Shows all of the Replays you favorited
|
||||
- **Search**
|
||||
Allows you to search for specific Replays
|
||||
|
||||
When you've found an insteresting looking Replay, you can download it using the **"Download" Button** in the lower left corner.
|
||||
After downloading, you'll automatically join the Replay.
|
||||
|
||||
After you've downloaded a Replay, you can rate and favorite it in the **Replay Center** using the respective buttons.
|
||||
|
||||
> You are encouraged to rate Replays after you downloaded them to help promoting the best Replays.
|
||||
|
||||
## Upload Replays [upload]
|
||||

|
||||
The **Replay Upload Screen**
|
||||
|
||||
You can share your own **Replay Files** with other users in the **Replay Center**.
|
||||
Therefore, click the **"Upload" Button** in the **Replay Viewer** after selecting a Replay.
|
||||
|
||||
In the **Replay Upload Screen** there are **6 input fields**:
|
||||
- **Replay Name**
|
||||
The Replay's Name in the Replay Center
|
||||
- **Replay Description**
|
||||
A description of what happens in the Replay. Try to give the user a good impression why your Replay is worth downloading.
|
||||
- **Category**
|
||||
The Replay's Category, one of the following: **Survival**, **Build**, **Minigame**, **Miscellaneous**. If none of the other categories fit, use **Miscellaneous**.
|
||||
- **Tags**
|
||||
One or more tags that fit your replay, spearated by comma. **Example tags:** pvp,battle,redstone,creative
|
||||
- **Hide Server IP**
|
||||
If you've recorded a Replay on a private Server, you can remove the Server IP by checking the respective checkbox.
|
||||
- **Thumbnail**
|
||||
While you can't directly edit the Thumbnail when uploading, it is highly recommended that
|
||||
you [create a Thumbnail](#replaying-thumbnail) before sharing your Replay.
|
||||
Replays without a Thumbnail are much less likely to be downloaded by other users.
|
||||
|
||||
When uploading a Replay File, make sure to follow the [Replay Center Rules](https://www.replaymod.com/rules).
|
||||
|
||||
# Frequently Asked Questions [faq]
|
||||
|
||||
### Do I need a ReplayMod.com Account to use the mod?
|
||||
You only need a ReplayMod.com Account to access the [Replay Center](#center).
|
||||
All of the other features are also available offline.
|
||||
|
||||
### For how long can I record?
|
||||
Theoretically, a Replay File can be up to **24 days, 20 hours, 30 minutes and 23 seconds** long - which is a timespan you'll probably never reach.
|
||||
|
||||
### How many chunks around me does the Mod record?
|
||||
If you're playing in **Singleplayer**, all of the loaded chunks within your **Render Distance** are recorded.
|
||||
If you're on a server, this depends on the **view-distance** setting in the **server.properties** file, which is set to **11 Chunks** by default.
|
||||
|
||||
The Replay Mod of course records every **loaded**, not only the **rendered** chunks. Therefore, chunks behind your back are recorded as well.
|
||||
|
||||
### Why can't I start recording in the middle of a session?
|
||||
Due to the way the **Replay Mod** works, you need to start recording when joining a **Server** or **World** - otherwise some data which the **Replay Files** need is missing.
|
||||
|
||||
### How does recording affect my FPS?
|
||||
Usually, recording a Replay does **_not_** affect your framerate, and it also doesn't lead to lag on servers.
|
||||
We've tested the Mod on a low-end notebook with only **3GB of ram**, and everything worked fine.
|
||||
|
||||
### How big are the files the Replay Mod records?
|
||||
The file size of the recorded **.mcpr files** greatly depends on the amount of world data the replay contains.
|
||||
A Replay in which you travelled around and discovered a lot of terrain is significantly larger than a Replay which was recorded in a void world.
|
||||
|
||||
An average Replay File of **10 Minutes duration** usually is between **2MB and 10MB large**.
|
||||
Replays recorded on **Minigame Servers** with lots of particle effects and world changes might be larger.
|
||||
BIN
docs/img/ambient-lighting-comparison.jpg
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
docs/img/ambient-lighting-comparison.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
docs/img/asset-manager.jpg
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
docs/img/asset-manager.png
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
docs/img/auth-login.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
docs/img/auth-login.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/img/auth-register.jpg
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
docs/img/auth-register.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/img/camera-tilted.jpg
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
docs/img/camera-tilted.png
Normal file
|
After Width: | Height: | Size: 151 KiB |
BIN
docs/img/chromasky.jpg
Normal file
|
After Width: | Height: | Size: 590 KiB |
BIN
docs/img/chromasky.png
Normal file
|
After Width: | Height: | Size: 528 KiB |
BIN
docs/img/cubic-path.gif
Normal file
|
After Width: | Height: | Size: 12 MiB |
BIN
docs/img/cubic-path.webm
Normal file
BIN
docs/img/custom-object-animated.gif
Normal file
|
After Width: | Height: | Size: 8.0 MiB |
BIN
docs/img/custom-object-animated.webm
Normal file
BIN
docs/img/default-thumb.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
docs/img/eyecon.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
docs/img/eyecon.png
Normal file
|
After Width: | Height: | Size: 459 B |
BIN
docs/img/ffmpeg-missing.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/ffmpeg-missing.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
docs/img/keyframe-editor.jpg
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
docs/img/keyframe-editor.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
docs/img/keyframe-repository.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/img/keyframe-repository.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
docs/img/keyframe-timeline.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
docs/img/keyframe-timeline.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
docs/img/linear-path.gif
Normal file
|
After Width: | Height: | Size: 12 MiB |
BIN
docs/img/linear-path.webm
Normal file
BIN
docs/img/marker-timeline.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
docs/img/marker-timeline.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
docs/img/object-manager.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/img/object-manager.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
docs/img/path-preview-icon.jpg
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/img/path-preview-icon.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
docs/img/path-preview-spectator.jpg
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
docs/img/path-preview-spectator.png
Normal file
|
After Width: | Height: | Size: 448 KiB |
BIN
docs/img/path-preview.jpg
Normal file
|
After Width: | Height: | Size: 149 KiB |
BIN
docs/img/path-preview.png
Normal file
|
After Width: | Height: | Size: 430 KiB |
BIN
docs/img/player-overview.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
docs/img/player-overview.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
docs/img/position-keyframe-button.png
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
docs/img/quality-comparison.jpg
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
docs/img/quality-comparison.png
Normal file
|
After Width: | Height: | Size: 3.3 MiB |
BIN
docs/img/real-timeline.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
docs/img/real-timeline.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
docs/img/recording-indicator.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
docs/img/recording-indicator.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
docs/img/render-cubic.jpg
Normal file
|
After Width: | Height: | Size: 459 KiB |
BIN
docs/img/render-cubic.png
Normal file
|
After Width: | Height: | Size: 610 KiB |
BIN
docs/img/render-default.jpg
Normal file
|
After Width: | Height: | Size: 893 KiB |
BIN
docs/img/render-default.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
docs/img/render-equirectangular.jpg
Normal file
|
After Width: | Height: | Size: 932 KiB |
BIN
docs/img/render-equirectangular.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/img/render-stereoscopic.jpg
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
docs/img/render-stereoscopic.png
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
BIN
docs/img/rendering-screen.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
docs/img/rendering-screen.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docs/img/rendersettings-advanced.jpg
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
docs/img/rendersettings-advanced.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
docs/img/rendersettings-commandline.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
docs/img/rendersettings-commandline.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
docs/img/rendersettings-video.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
docs/img/rendersettings-video.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
docs/img/replay-center.jpg
Normal file
|
After Width: | Height: | Size: 122 KiB |
BIN
docs/img/replay-center.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
docs/img/replay-upload.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
docs/img/replay-upload.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
docs/img/replay-viewer.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
docs/img/replay-viewer.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
docs/img/spectator-keyframe-button.png
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
docs/img/time-keyframe-button.png
Normal file
|
After Width: | Height: | Size: 321 B |
13
docs/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "replaymod-docs",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"main": "convert.js",
|
||||
"author": "Jonas Herzig <me@johni0702.de>",
|
||||
"license": "GPLv3",
|
||||
"dependencies": {
|
||||
"md-jml": "~2.0.1",
|
||||
"array-findindex-polyfill": "~0.1.0",
|
||||
"string.prototype.endswith": "~0.2.0"
|
||||
}
|
||||
}
|
||||
32
docs/template.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/html" lang="en">
|
||||
<head>
|
||||
<title>Minecraft Replay Mod - Documentation</title>
|
||||
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type">
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/darkly/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://www.replaymod.com/css/replaymod.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.validation/1.14.0/jquery.validate.min.js"></script>
|
||||
<link href="https://www.replaymod.com/css/lightbox.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
{{index}}
|
||||
</div>
|
||||
</div>
|
||||
{{content}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://www.replaymod.com/js/lightbox.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
jGui
@@ -1,23 +1,24 @@
|
||||
package com.replaymod.compat;
|
||||
|
||||
import com.replaymod.compat.optifine.DisableFastRender;
|
||||
import com.replaymod.compat.shaders.ShaderBeginRender;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
|
||||
@Mod(modid = ReplayModCompat.MOD_ID, useMetadata = true)
|
||||
@Mod(modid = ReplayModCompat.MOD_ID,
|
||||
version = "@MOD_VERSION@",
|
||||
acceptedMinecraftVersions = "@MC_VERSION@",
|
||||
useMetadata = true)
|
||||
public class ReplayModCompat {
|
||||
public static final String MOD_ID = "replaymod-compat";
|
||||
|
||||
@Mod.Instance(ReplayMod.MOD_ID)
|
||||
private static ReplayMod core;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
EventBus bus = MinecraftForge.EVENT_BUS;
|
||||
bus.register(new ShaderBeginRender());
|
||||
bus.register(new DisableFastRender());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.replaymod.compat.optifine;
|
||||
|
||||
import com.replaymod.render.events.ReplayRenderEvent;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class DisableFastRender {
|
||||
|
||||
private final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
private boolean wasFastRender = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderBegin(ReplayRenderEvent.Pre event) {
|
||||
if (!FMLClientHandler.instance().hasOptifine()) return;
|
||||
|
||||
try {
|
||||
wasFastRender = (boolean) OptifineReflection.gameSettings_ofFastRender.get(mc.gameSettings);
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, false);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderEnd(ReplayRenderEvent.Post event){
|
||||
if (!FMLClientHandler.instance().hasOptifine()) return;
|
||||
|
||||
try {
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, wasFastRender);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.replaymod.compat.optifine;
|
||||
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class OptifineReflection {
|
||||
|
||||
// GameSettings.ofFastRender
|
||||
public static Field gameSettings_ofFastRender;
|
||||
|
||||
static {
|
||||
try {
|
||||
// this throws an ignored ClassNotFoundException if Optifine isn't installed
|
||||
Class.forName("Config");
|
||||
|
||||
gameSettings_ofFastRender = GameSettings.class.getDeclaredField("ofFastRender");
|
||||
gameSettings_ofFastRender.setAccessible(true);
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
// no optifine installed
|
||||
} catch (NoSuchFieldException e) {
|
||||
// the field wasn't found. Has it been renamed?
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.replaymod.compat.shaders.mixin;
|
||||
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Pseudo
|
||||
@Mixin(targets = "shadersmod/client/ShadersRender", remap = false)
|
||||
public abstract class MixinShadersRender {
|
||||
|
||||
@Inject(method = "renderHand0", at = @At("HEAD"), cancellable = true)
|
||||
private static void replayModCompat_disableRenderHand0(EntityRenderer er, float partialTicks, int renderPass, CallbackInfo ci) {
|
||||
if (ForgeHooksClient.renderFirstPersonHand(er.mc.renderGlobal, partialTicks, renderPass)) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.util.ReportedException;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -19,16 +20,25 @@ import java.util.Map;
|
||||
public class KeyBindingRegistry {
|
||||
private Map<String, KeyBinding> keyBindings = new HashMap<String, KeyBinding>();
|
||||
private Multimap<KeyBinding, Runnable> keyBindingHandlers = ArrayListMultimap.create();
|
||||
private Multimap<KeyBinding, Runnable> repeatedKeyBindingHandlers = ArrayListMultimap.create();
|
||||
private Multimap<Integer, Runnable> rawHandlers = ArrayListMultimap.create();
|
||||
|
||||
public void registerKeyBinding(String name, int keyCode, Runnable whenPressed) {
|
||||
keyBindingHandlers.put(registerKeyBinding(name, keyCode), whenPressed);
|
||||
}
|
||||
|
||||
public void registerRepeatedKeyBinding(String name, int keyCode, Runnable whenPressed) {
|
||||
repeatedKeyBindingHandlers.put(registerKeyBinding(name, keyCode), whenPressed);
|
||||
}
|
||||
|
||||
private KeyBinding registerKeyBinding(String name, int keyCode) {
|
||||
KeyBinding keyBinding = keyBindings.get(name);
|
||||
if (keyBinding == null) {
|
||||
keyBinding = new KeyBinding(name, keyCode, "replaymod.title");
|
||||
keyBindings.put(name, keyBinding);
|
||||
ClientRegistry.registerKeyBinding(keyBinding);
|
||||
}
|
||||
keyBindingHandlers.put(keyBinding, whenPressed);
|
||||
return keyBinding;
|
||||
}
|
||||
|
||||
public void registerRaw(int keyCode, Runnable whenPressed) {
|
||||
@@ -45,20 +55,38 @@ public class KeyBindingRegistry {
|
||||
handleRaw();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.RenderTickEvent event) {
|
||||
if (event.phase != TickEvent.Phase.START) return;
|
||||
handleRepeatedKeyBindings();
|
||||
}
|
||||
|
||||
public void handleRepeatedKeyBindings() {
|
||||
for (Map.Entry<KeyBinding, Collection<Runnable>> entry : repeatedKeyBindingHandlers.asMap().entrySet()) {
|
||||
if (entry.getKey().isKeyDown()) {
|
||||
invokeKeyBindingHandlers(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleKeyBindings() {
|
||||
for (Map.Entry<KeyBinding, Collection<Runnable>> entry : keyBindingHandlers.asMap().entrySet()) {
|
||||
while (entry.getKey().isPressed()) {
|
||||
for (final Runnable runnable : entry.getValue()) {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Throwable cause) {
|
||||
CrashReport crashReport = CrashReport.makeCrashReport(cause, "Handling Key Binding");
|
||||
CrashReportCategory category = crashReport.makeCategory("Key Binding");
|
||||
category.addCrashSection("Key Binding", entry.getKey());
|
||||
category.setDetail("Handler", runnable::toString);
|
||||
throw new ReportedException(crashReport);
|
||||
}
|
||||
}
|
||||
invokeKeyBindingHandlers(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void invokeKeyBindingHandlers(KeyBinding keyBinding, Collection<Runnable> handlers) {
|
||||
for (final Runnable runnable : handlers) {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Throwable cause) {
|
||||
CrashReport crashReport = CrashReport.makeCrashReport(cause, "Handling Key Binding");
|
||||
CrashReportCategory category = crashReport.makeCategory("Key Binding");
|
||||
category.addCrashSection("Key Binding", keyBinding);
|
||||
category.setDetail("Handler", runnable::toString);
|
||||
throw new ReportedException(crashReport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ import java.util.List;
|
||||
|
||||
@Mod(modid = ReplayMod.MOD_ID,
|
||||
useMetadata = true,
|
||||
version = "@MOD_VERSION@",
|
||||
acceptedMinecraftVersions = "@MC_VERSION@",
|
||||
updateJSON = "https://raw.githubusercontent.com/ReplayMod/ReplayMod/master/versions.json",
|
||||
guiFactory = "com.replaymod.core.gui.GuiFactory")
|
||||
public class ReplayMod {
|
||||
@@ -82,7 +84,8 @@ public class ReplayMod {
|
||||
}
|
||||
|
||||
public File getReplayFolder() throws IOException {
|
||||
File folder = new File(getSettingsRegistry().get(Setting.RECORDING_PATH));
|
||||
String path = getSettingsRegistry().get(Setting.RECORDING_PATH);
|
||||
File folder = new File(path.startsWith("./") ? getMinecraft().mcDataDir : null, path);
|
||||
FileUtils.forceMkdir(folder);
|
||||
return folder;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.replaymod.core.gui;
|
||||
import com.google.common.io.Files;
|
||||
import com.replaymod.replaystudio.PacketData;
|
||||
import com.replaymod.replaystudio.io.ReplayInputStream;
|
||||
import com.replaymod.replaystudio.io.ReplayOutputStream;
|
||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.replaystudio.replay.ReplayMetaData;
|
||||
import com.replaymod.replaystudio.replay.ZipReplayFile;
|
||||
@@ -45,15 +46,19 @@ public class RestoreReplayGui extends AbstractGuiScreen<RestoreReplayGui> {
|
||||
ReplayMetaData metaData = replayFile.getMetaData();
|
||||
if (metaData != null && metaData.getDuration() == 0) {
|
||||
// Try to restore replay duration
|
||||
try (ReplayInputStream in = replayFile.getPacketData()) {
|
||||
// We need to re-write the packet data in case there are any incomplete packets dangling at the end
|
||||
try (ReplayInputStream in = replayFile.getPacketData();
|
||||
ReplayOutputStream out = replayFile.writePacketData()) {
|
||||
PacketData last = null;
|
||||
while ((last = in.readPacket()) != null) {
|
||||
metaData.setDuration((int) last.getTime());
|
||||
out.write(last);
|
||||
}
|
||||
replayFile.writeMetaData(metaData);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
// Write back the actual duration
|
||||
replayFile.writeMetaData(metaData);
|
||||
}
|
||||
replayFile.save();
|
||||
replayFile.close();
|
||||
|
||||
@@ -1,17 +1,53 @@
|
||||
package com.replaymod.core.utils;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
import com.google.common.util.concurrent.Futures;
|
||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||
import de.johni0702.minecraft.gui.RenderInfo;
|
||||
import de.johni0702.minecraft.gui.container.AbstractGuiScrollable;
|
||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||
import de.johni0702.minecraft.gui.container.GuiScrollable;
|
||||
import de.johni0702.minecraft.gui.element.GuiButton;
|
||||
import de.johni0702.minecraft.gui.element.GuiElement;
|
||||
import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.GuiInfoPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.util.Dimension;
|
||||
import org.lwjgl.util.ReadableDimension;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import static net.minecraft.client.Minecraft.getMinecraft;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static final BufferedImage DEFAULT_THUMBNAIL;
|
||||
@@ -27,6 +63,42 @@ public class Utils {
|
||||
DEFAULT_THUMBNAIL = thumbnail;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Neither the root certificate of LetsEncrypt nor the root that cross-signed it is included in the default
|
||||
* Java keystore prior to 8u101.
|
||||
* Therefore whenever a connection to the replaymod.com site is made, this SSLContext has to be used instead.
|
||||
* It has been constructed to include the necessary root certificates.
|
||||
* @see #SSL_SOCKET_FACTORY
|
||||
*/
|
||||
public static final SSLContext SSL_CONTEXT;
|
||||
|
||||
/**
|
||||
* @see #SSL_CONTEXT
|
||||
*/
|
||||
public static final SSLSocketFactory SSL_SOCKET_FACTORY;
|
||||
|
||||
static {
|
||||
// Largely from https://community.letsencrypt.org/t/134/37
|
||||
try (InputStream in = Utils.class.getResourceAsStream("/dst_root_ca_x3.pem")){
|
||||
Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(in);
|
||||
|
||||
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||
keyStore.load(null, null);
|
||||
keyStore.setCertificateEntry("1", certificate);
|
||||
|
||||
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||
trustManagerFactory.init(keyStore);
|
||||
|
||||
SSLContext ctx = SSLContext.getInstance("TLS");
|
||||
ctx.init(null, trustManagerFactory.getTrustManagers(), null);
|
||||
SSL_CONTEXT = ctx;
|
||||
SSL_SOCKET_FACTORY = ctx.getSocketFactory();
|
||||
} catch (IOException | CertificateException | KeyStoreException | NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String convertSecondsToShortString(int seconds) {
|
||||
int hours = seconds/(60*60);
|
||||
int min = seconds/60 - hours*60;
|
||||
@@ -63,7 +135,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static ResourceLocation getResourceLocationForPlayerUUID(UUID uuid) {
|
||||
NetworkPlayerInfo info = Minecraft.getMinecraft().getConnection().getPlayerInfo(uuid);
|
||||
NetworkPlayerInfo info = getMinecraft().getConnection().getPlayerInfo(uuid);
|
||||
ResourceLocation skinLocation;
|
||||
if (info != null && info.hasLocationSkin()) {
|
||||
skinLocation = info.getLocationSkin();
|
||||
@@ -76,4 +148,80 @@ public class Utils {
|
||||
public static boolean isCtrlDown() {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
||||
}
|
||||
|
||||
public static GuiInfoPopup error(Logger logger, GuiContainer container, CrashReport crashReport, Runnable onClose) {
|
||||
// Convert crash report to string
|
||||
String crashReportStr = crashReport.getCompleteReport();
|
||||
|
||||
// Log via logger
|
||||
logger.error(crashReportStr);
|
||||
|
||||
// Try to save the crash report
|
||||
if (crashReport.getFile() == null) {
|
||||
try {
|
||||
File folder = new File(getMinecraft().mcDataDir, "crash-reports");
|
||||
File file = new File(folder, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
||||
logger.debug("Saving crash report to file: {}", file);
|
||||
crashReport.saveToFile(file);
|
||||
} catch (Throwable t) {
|
||||
logger.error("Saving crash report file:", t);
|
||||
}
|
||||
} else {
|
||||
logger.debug("Not saving crash report as file already exists: {}", crashReport.getFile());
|
||||
}
|
||||
|
||||
logger.trace("Opening crash report popup GUI");
|
||||
GuiCrashReportPopup popup = new GuiCrashReportPopup(container, crashReportStr);
|
||||
Futures.addCallback(popup.getFuture(), new FutureCallback<Void>() {
|
||||
@Override
|
||||
public void onSuccess(@Nullable Void result) {
|
||||
logger.trace("Crash report popup closed");
|
||||
if (onClose != null) {
|
||||
onClose.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
logger.error("During error popup:", t);
|
||||
}
|
||||
});
|
||||
return popup;
|
||||
}
|
||||
|
||||
private static class GuiCrashReportPopup extends GuiInfoPopup {
|
||||
private final GuiScrollable scrollable;
|
||||
|
||||
public GuiCrashReportPopup(GuiContainer container, String crashReport) {
|
||||
super(container);
|
||||
setBackgroundColor(Colors.DARK_TRANSPARENT);
|
||||
|
||||
// Add crash report to scrollable info
|
||||
getInfo().addElements(new VerticalLayout.Data(0.5),
|
||||
new GuiLabel().setColor(Colors.BLACK).setI18nText("replaymod.gui.unknownerror"),
|
||||
scrollable = new GuiScrollable().setScrollDirection(AbstractGuiScrollable.Direction.VERTICAL)
|
||||
.setLayout(new VerticalLayout().setSpacing(2))
|
||||
.addElements(null,Arrays.stream(crashReport.replace("\t", " ").split("\n")).map(
|
||||
l -> new GuiLabel().setText(l).setColor(Colors.BLACK)).toArray(GuiElement[]::new)));
|
||||
|
||||
// Replace close button with panel containing close and copy buttons
|
||||
GuiButton copyToClipboardButton = new GuiButton().setI18nLabel("chat.copy").onClick(() ->
|
||||
GuiScreen.setClipboardString(crashReport)).setSize(150, 20);
|
||||
GuiButton closeButton = getCloseButton();
|
||||
popup.removeElement(closeButton);
|
||||
popup.addElements(new VerticalLayout.Data(1),
|
||||
new GuiPanel().setLayout(new HorizontalLayout().setSpacing(5)).setSize(305, 20)
|
||||
.addElements(null, copyToClipboardButton, closeButton));
|
||||
|
||||
// And open it
|
||||
open();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) {
|
||||
// Re-size the scrollable containing the crash report to 3/4 of the screen
|
||||
scrollable.setSize(size.getWidth() * 3 / 4, size.getHeight() * 3 / 4);
|
||||
super.draw(renderer, size, renderInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
41
src/main/java/com/replaymod/editor/ReplayModEditor.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.replaymod.editor;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.editor.handler.GuiHandler;
|
||||
import com.replaymod.online.Setting;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@Mod(modid = ReplayModEditor.MOD_ID,
|
||||
version = "@MOD_VERSION@",
|
||||
acceptedMinecraftVersions = "@MC_VERSION@",
|
||||
useMetadata = true)
|
||||
public class ReplayModEditor {
|
||||
public static final String MOD_ID = "replaymod-editor";
|
||||
|
||||
@Mod.Instance(MOD_ID)
|
||||
public static ReplayModEditor instance;
|
||||
|
||||
private ReplayMod core;
|
||||
|
||||
public static Logger LOGGER;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ReplayModEditor.LOGGER = event.getModLog();
|
||||
core = ReplayMod.instance;
|
||||
|
||||
core.getSettingsRegistry().register(Setting.class);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
new GuiHandler(this).register();
|
||||
}
|
||||
|
||||
public ReplayMod getCore() {
|
||||
return core;
|
||||
}
|
||||
}
|
||||
383
src/main/java/com/replaymod/editor/gui/GuiReplayEditor.java
Normal file
@@ -0,0 +1,383 @@
|
||||
package com.replaymod.editor.gui;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import com.google.common.util.concurrent.FutureCallback;
|
||||
import com.google.common.util.concurrent.Futures;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.core.utils.Utils;
|
||||
import com.replaymod.replaystudio.PacketData;
|
||||
import com.replaymod.replaystudio.Studio;
|
||||
import com.replaymod.replaystudio.filter.StreamFilter;
|
||||
import com.replaymod.replaystudio.io.ReplayInputStream;
|
||||
import com.replaymod.replaystudio.io.ReplayOutputStream;
|
||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.replaystudio.replay.ReplayMetaData;
|
||||
import com.replaymod.replaystudio.replay.ZipReplayFile;
|
||||
import com.replaymod.replaystudio.stream.PacketStream;
|
||||
import com.replaymod.replaystudio.studio.ReplayStudio;
|
||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||
import de.johni0702.minecraft.gui.RenderInfo;
|
||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import de.johni0702.minecraft.gui.element.GuiButton;
|
||||
import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.element.GuiTextField;
|
||||
import de.johni0702.minecraft.gui.element.GuiTooltip;
|
||||
import de.johni0702.minecraft.gui.element.advanced.GuiProgressBar;
|
||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||
import de.johni0702.minecraft.gui.layout.GridLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.popup.GuiInfoPopup;
|
||||
import de.johni0702.minecraft.gui.popup.GuiYesNoPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.lwjgl.util.ReadableDimension;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.replaymod.editor.ReplayModEditor.LOGGER;
|
||||
|
||||
public class GuiReplayEditor extends GuiScreen {
|
||||
private final ReplayMod mod;
|
||||
|
||||
private volatile ProcessingStage processingStage;
|
||||
private volatile double progress;
|
||||
private GuiProcessingProgressPopup popup;
|
||||
|
||||
public GuiButton currentTabButton;
|
||||
public GuiPanel currentTabPanel;
|
||||
|
||||
public final GuiPanel tabButtons = new GuiPanel(this).setLayout(new GridLayout().setSpacingX(5));
|
||||
public final List<GuiPanel> tabPanels = new ArrayList<>();
|
||||
|
||||
public final GuiButton saveButton = new GuiButton().setI18nLabel("replaymod.gui.save").setSize(100, 20);
|
||||
public final GuiButton backButton = new GuiButton().setI18nLabel("replaymod.gui.back").setSize(100, 20);
|
||||
|
||||
public final GuiPanel buttonPanel = new GuiPanel(this).setLayout(new HorizontalLayout().setSpacing(5))
|
||||
.addElements(null, saveButton, backButton);
|
||||
|
||||
public GuiReplayEditor(GuiScreen parent, ReplayMod mod) {
|
||||
this.mod = mod;
|
||||
backButton.onClick(parent::display);
|
||||
|
||||
setTitle(new GuiLabel().setI18nText("replaymod.gui.replayeditor"));
|
||||
|
||||
makeTab("trim", () -> new GuiTrimPanel(this));
|
||||
makeTab("connect", GuiPanel::new).setDisabled(); // Not yet implemented
|
||||
makeTab("modify", GuiPanel::new).setDisabled(); // Not yet implemented
|
||||
|
||||
setLayout(new CustomLayout<GuiScreen>() {
|
||||
@Override
|
||||
protected void layout(GuiScreen container, int width, int height) {
|
||||
// Move all inactive panels aside
|
||||
tabPanels.forEach(e -> pos(e, Integer.MIN_VALUE, Integer.MIN_VALUE));
|
||||
|
||||
pos(buttonPanel, width - 10 - width(buttonPanel), height - 10 - height(buttonPanel));
|
||||
|
||||
if (currentTabPanel != null) {
|
||||
pos(currentTabPanel, 10, 50);
|
||||
size(currentTabPanel, width - 20, y(buttonPanel) - 10 - y(currentTabPanel));
|
||||
}
|
||||
|
||||
pos(tabButtons, 10, 20);
|
||||
size(tabButtons, width - 20, 20);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public GuiButton makeTab(String name, Supplier<GuiPanel> panel) {
|
||||
GuiButton button = new GuiButton().setI18nLabel("replaymod.gui.editor." + name + ".title")
|
||||
.setTooltip(new GuiTooltip().setI18nText("replaymod.gui.editor." + name + ".description"))
|
||||
.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
button.onClick(() -> {
|
||||
// Remove previous tab
|
||||
if (currentTabButton != null) {
|
||||
currentTabButton.setEnabled();
|
||||
removeElement(currentTabPanel);
|
||||
}
|
||||
|
||||
// Activate new tab
|
||||
currentTabButton = button.setDisabled();
|
||||
addElements(null, currentTabPanel = panel.get());
|
||||
});
|
||||
// Add new tab button to tabs panel
|
||||
tabButtons.addElements(null, button);
|
||||
((GridLayout) tabButtons.getLayout()).setColumns(tabButtons.getChildren().size());
|
||||
return button;
|
||||
}
|
||||
|
||||
public void save(File inputFile, PacketStream.FilterInfo...filters) {
|
||||
save(FilenameUtils.getBaseName(inputFile.getName()), (outputFile) -> {
|
||||
Studio studio = new ReplayStudio();
|
||||
File tmpDir = null;
|
||||
try {
|
||||
File actualOutputFile = outputFile;
|
||||
if (outputFile.getCanonicalPath().equals(inputFile.getCanonicalPath())) {
|
||||
// Input and output files are identical. Due to the way the ZipReplayFile stores its temporary
|
||||
// data, the same replay file must not be opened twice for writing (tmp files will be deleted once
|
||||
// either one is closed or, on Windows, will throw an exception when deleted).
|
||||
tmpDir = Files.createTempDir();
|
||||
outputFile = new File(tmpDir, "replay.mcpr");
|
||||
LOGGER.debug("Output file is identical to input file, using temporary output file {} instead",
|
||||
outputFile);
|
||||
}
|
||||
try (ReplayFile outputReplay = new ZipReplayFile(studio, inputFile, outputFile);
|
||||
ReplayOutputStream out = outputReplay.writePacketData();
|
||||
ReplayFile inputReplay = new ZipReplayFile(studio, inputFile);
|
||||
ReplayInputStream in = inputReplay.getPacketData()) {
|
||||
ReplayMetaData metaData = inputReplay.getMetaData();
|
||||
PacketStream stream = studio.createReplayStream(in, true);
|
||||
|
||||
stream.addFilter(new ProgressFilter(metaData.getDuration()));
|
||||
for (PacketStream.FilterInfo info : filters) {
|
||||
stream.addFilter(info.getFilter(), info.getFrom(), info.getTo());
|
||||
LOGGER.debug("Added filter {}", info);
|
||||
}
|
||||
|
||||
LOGGER.info("Built pipeline: {}", stream);
|
||||
stream.start();
|
||||
|
||||
long lastTimestamp = 0;
|
||||
|
||||
PacketData data;
|
||||
while ((data = stream.next()) != null) {
|
||||
out.write(data);
|
||||
lastTimestamp = data.getTime();
|
||||
}
|
||||
|
||||
for (PacketData d : stream.end()) {
|
||||
out.write(d);
|
||||
lastTimestamp = d.getTime();
|
||||
}
|
||||
|
||||
updateProgress(ProcessingStage.FINALIZING, 0);
|
||||
|
||||
// Update duration of new replay
|
||||
metaData.setDuration((int) lastTimestamp);
|
||||
outputReplay.writeMetaData(metaData);
|
||||
|
||||
out.close();
|
||||
outputReplay.save();
|
||||
}
|
||||
if (outputFile != actualOutputFile) {
|
||||
LOGGER.debug("Moving temporary output file {} to {}");
|
||||
FileUtils.forceDelete(actualOutputFile);
|
||||
FileUtils.moveFile(outputFile, actualOutputFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (tmpDir != null && !FileUtils.deleteQuietly(tmpDir)) {
|
||||
LOGGER.warn("Failed to delete temporary directory {}", tmpDir);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void save(String sourceName, Consumer<File> runnable) {
|
||||
GuiTextField nameField = new GuiTextField().setSize(200, 20).setFocused(true).setText(sourceName);
|
||||
GuiYesNoPopup popup = GuiYesNoPopup.open(this,
|
||||
nameField
|
||||
).setYesI18nLabel("replaymod.gui.editor.savemode.override").setNoI18nLabel("replaymod.gui.cancel");
|
||||
nameField.onEnter(() -> {
|
||||
if (popup.getYesButton().isEnabled()) {
|
||||
popup.getYesButton().onClick();
|
||||
}
|
||||
}).onTextChanged(obj -> {
|
||||
popup.getYesButton().setEnabled(!nameField.getText().isEmpty());
|
||||
popup.setYesI18nLabel("replaymod.gui.editor.savemode." +
|
||||
(nameField.getText().equals(sourceName) ? "override" : "newfile"));
|
||||
});
|
||||
Futures.addCallback(popup.getFuture(), new FutureCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(@Nullable Boolean result) {
|
||||
if (result == Boolean.TRUE) {
|
||||
// Sanitize their input
|
||||
String name = nameField.getText().trim().replace("[^a-zA-Z0-9\\.\\- ]", "_");
|
||||
// This file is what they want
|
||||
File replayFolder;
|
||||
try {
|
||||
replayFolder = mod.getReplayFolder();
|
||||
} catch (IOException e) {
|
||||
Utils.error(LOGGER, GuiReplayEditor.this, CrashReport.makeCrashReport(e, "Getting replay folder"), null);
|
||||
return;
|
||||
}
|
||||
File targetFile = new File(replayFolder, name + ".mcpr");
|
||||
if (targetFile.exists()) {
|
||||
LOGGER.trace("Selected file already exists, asking for confirmation");
|
||||
Futures.addCallback(GuiYesNoPopup.open(GuiReplayEditor.this,
|
||||
new GuiLabel().setColor(Colors.BLACK)
|
||||
.setI18nText("replaymod.gui.replaymodified.warning1", name),
|
||||
new GuiLabel().setColor(Colors.BLACK)
|
||||
.setI18nText("replaymod.gui.replaymodified.warning2"))
|
||||
.setYesI18nLabel("gui.yes").setNoI18nLabel("gui.no")
|
||||
.getFuture(), new FutureCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(@Nullable Boolean result) {
|
||||
if (result == Boolean.TRUE) {
|
||||
LOGGER.trace("Saving output in {}", targetFile);
|
||||
runEdit(() -> runnable.accept(targetFile));
|
||||
} else {
|
||||
LOGGER.trace("Not overwriting file {}, reopening naming dialog", targetFile);
|
||||
save(sourceName, runnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
LOGGER.error("During save file confirmation dialog:", t);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LOGGER.trace("Saving output in {}", targetFile);
|
||||
runEdit(() -> runnable.accept(targetFile));
|
||||
}
|
||||
} else {
|
||||
LOGGER.trace("Saving cancelled");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
LOGGER.error("During save file dialog:", t);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void runEdit(Runnable runnable) {
|
||||
popup = new GuiProcessingProgressPopup(this);
|
||||
processingStage = ProcessingStage.INITIALIZING;
|
||||
progress = 0;
|
||||
new Thread(() -> {
|
||||
LOGGER.info("Starting editing of replay");
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Throwable t) {
|
||||
CrashReport crashReport = CrashReport.makeCrashReport(t, "Editing replay file");
|
||||
mod.runLater(() -> Utils.error(LOGGER, this, crashReport, popup::close));
|
||||
return;
|
||||
}
|
||||
LOGGER.info("Successfully finished editing");
|
||||
mod.runLater(() -> {
|
||||
popup.close();
|
||||
GuiInfoPopup.open(this, "replaymod.gui.editor.progress.status.finished");
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void updateProgress(ProcessingStage stage, double progress) {
|
||||
if (this.processingStage != stage) {
|
||||
LOGGER.trace("Changing state from {} to {}", this.processingStage, stage);
|
||||
}
|
||||
this.processingStage = stage;
|
||||
this.progress = progress;
|
||||
}
|
||||
|
||||
public ReplayMod getMod() {
|
||||
return mod;
|
||||
}
|
||||
|
||||
public enum ProcessingStage {
|
||||
INITIALIZING("initializing", 0.01),
|
||||
WORKING("writing.raw", 0.89),
|
||||
FINALIZING("writing.final", 0.1),
|
||||
DONE("finished", 0);
|
||||
|
||||
private final String i18nKey;
|
||||
private final double progressFraction;
|
||||
|
||||
ProcessingStage(String i18nKey, double progressFraction) {
|
||||
this.i18nKey = "replaymod.gui.editor.progress.status." + i18nKey;
|
||||
this.progressFraction = progressFraction;
|
||||
}
|
||||
|
||||
public double getOverallProgress(double progress) {
|
||||
progress *= progressFraction;
|
||||
for (ProcessingStage processingStage : values()) {
|
||||
if (processingStage == this) break;
|
||||
progress += processingStage.progressFraction;
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
}
|
||||
|
||||
private class ProgressFilter implements StreamFilter {
|
||||
private final long total;
|
||||
|
||||
public ProgressFilter(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "progress";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Studio studio, JsonObject config) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(PacketStream stream) {
|
||||
updateProgress(ProcessingStage.WORKING, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPacket(PacketStream stream, PacketData data) {
|
||||
updateProgress(ProcessingStage.WORKING, (double) data.getTime() / total);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnd(PacketStream stream, long timestamp) {}
|
||||
}
|
||||
|
||||
private class GuiProcessingProgressPopup extends AbstractGuiPopup<GuiProcessingProgressPopup> {
|
||||
private final GuiProgressBar progressBar = new GuiProgressBar().setSize(300, 20);
|
||||
|
||||
{
|
||||
popup.setLayout(new VerticalLayout().setSpacing(10));
|
||||
popup.addElements(new VerticalLayout.Data(0.5),
|
||||
new GuiLabel().setI18nText("replaymod.gui.editor.progress.title").setColor(Colors.BLACK),
|
||||
new GuiLabel().setI18nText("replaymod.gui.editor.progress.pleasewait").setColor(Colors.BLACK),
|
||||
progressBar);
|
||||
}
|
||||
|
||||
public GuiProcessingProgressPopup(GuiContainer container) {
|
||||
super(container);
|
||||
open();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) {
|
||||
// Update progress bar
|
||||
progressBar.setI18nLabel(processingStage.i18nKey);
|
||||
progressBar.setProgress((float) processingStage.getOverallProgress(progress));
|
||||
|
||||
super.draw(renderer, size, renderInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
super.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiProcessingProgressPopup getThis() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
202
src/main/java/com/replaymod/editor/gui/GuiTrimPanel.java
Normal file
@@ -0,0 +1,202 @@
|
||||
package com.replaymod.editor.gui;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.replaymod.core.utils.Utils;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import com.replaymod.replaystudio.filter.ChangeTimestampFilter;
|
||||
import com.replaymod.replaystudio.filter.RemoveFilter;
|
||||
import com.replaymod.replaystudio.filter.SquashFilter;
|
||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.replaystudio.replay.ReplayMetaData;
|
||||
import com.replaymod.replaystudio.replay.ZipReplayFile;
|
||||
import com.replaymod.replaystudio.stream.PacketStream;
|
||||
import com.replaymod.replaystudio.studio.ReplayStudio;
|
||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||
import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.element.GuiNumberField;
|
||||
import de.johni0702.minecraft.gui.element.advanced.GuiDropdownMenu;
|
||||
import de.johni0702.minecraft.gui.layout.GridLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOCase;
|
||||
import org.apache.commons.io.filefilter.SuffixFileFilter;
|
||||
import org.lwjgl.util.Dimension;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static com.replaymod.editor.ReplayModEditor.LOGGER;
|
||||
import static java.util.Optional.ofNullable;
|
||||
|
||||
public class GuiTrimPanel extends GuiPanel {
|
||||
private static GuiNumberField newGuiNumberField() {
|
||||
return new GuiNumberField().setMaxLength(2).setSize(20, 20).setValidateOnFocusChange(true);
|
||||
}
|
||||
|
||||
// Special value indicating no replay files were found
|
||||
private static final File NO_REPLAY = new File(".");
|
||||
// Special value for the initial "Select Marker Keyframe" entry
|
||||
private static final Marker NO_MARKER = new Marker(); static {NO_MARKER.setTime(-1);}
|
||||
|
||||
private final GuiReplayEditor gui;
|
||||
|
||||
public final GuiDropdownMenu<File> inputReplays = new GuiDropdownMenu<File>(this)
|
||||
.setMinSize(new Dimension(200, 20)).onSelection(i -> updateSelectedReplay())
|
||||
.setToString(f -> f == NO_REPLAY ? "" : FilenameUtils.getBaseName(f.getName()));
|
||||
|
||||
public final GuiNumberField startHour = newGuiNumberField();
|
||||
public final GuiNumberField startMin = newGuiNumberField();
|
||||
public final GuiNumberField startSec = newGuiNumberField();
|
||||
public final GuiNumberField startMilli = newGuiNumberField().setSize(40, 20).setMaxLength(4);
|
||||
public final GuiDropdownMenu<Marker> startMarker = new GuiDropdownMenu<>();
|
||||
|
||||
public final GuiNumberField endHour = newGuiNumberField();
|
||||
public final GuiNumberField endMin = newGuiNumberField();
|
||||
public final GuiNumberField endSec = newGuiNumberField();
|
||||
public final GuiNumberField endMilli = newGuiNumberField().setSize(40, 20).setMaxLength(4);
|
||||
public final GuiDropdownMenu<Marker> endMarker = new GuiDropdownMenu<>();
|
||||
|
||||
public final GuiPanel timePanel = new GuiPanel(this)
|
||||
.setLayout(new GridLayout().setCellsEqualSize(false).setSpacingX(20).setSpacingY(5).setColumns(3))
|
||||
.addElements(new GridLayout.Data(0, 0.5),
|
||||
new GuiLabel().setI18nText("replaymod.gui.start"),
|
||||
new GuiPanel().setLayout(new HorizontalLayout().setSpacing(2)).addElements(
|
||||
new HorizontalLayout.Data(0.5),
|
||||
startHour, new GuiLabel().setI18nText("replaymod.gui.hours"),
|
||||
startMin, new GuiLabel().setI18nText("replaymod.gui.minutes"),
|
||||
startSec, new GuiLabel().setI18nText("replaymod.gui.seconds"),
|
||||
startMilli, new GuiLabel().setI18nText("replaymod.gui.milliseconds")
|
||||
), startMarker,
|
||||
new GuiLabel().setI18nText("replaymod.gui.end"),
|
||||
new GuiPanel().setLayout(new HorizontalLayout().setSpacing(2)).addElements(
|
||||
new HorizontalLayout.Data(0.5),
|
||||
endHour, new GuiLabel().setI18nText("replaymod.gui.hours"),
|
||||
endMin, new GuiLabel().setI18nText("replaymod.gui.minutes"),
|
||||
endSec, new GuiLabel().setI18nText("replaymod.gui.seconds"),
|
||||
endMilli, new GuiLabel().setI18nText("replaymod.gui.milliseconds")
|
||||
), endMarker);
|
||||
|
||||
public GuiTrimPanel(GuiReplayEditor gui) {
|
||||
this.gui = gui;
|
||||
|
||||
setLayout(new VerticalLayout().setSpacing(10));
|
||||
|
||||
Function<Marker, String> toString = m -> {
|
||||
if (m == NO_MARKER) {
|
||||
return I18n.format("replaymod.gui.editor.trim.marker");
|
||||
} else {
|
||||
return ofNullable(m.getName()).orElse(I18n.format("replaymod.gui.ingame.unnamedmarker"))
|
||||
+ " (" + Utils.convertSecondsToShortString(m.getTime() / 1000) + ")";
|
||||
}
|
||||
};
|
||||
startMarker.setToString(toString).setMinSize(new Dimension(100, 20)).onSelection(i ->
|
||||
onSelectedMarkerChanged(startMarker, startHour, startMin, startSec, startMilli));
|
||||
endMarker.setToString(toString).setMinSize(new Dimension(100, 20)).onSelection(i ->
|
||||
onSelectedMarkerChanged(endMarker, endHour, endMin, endSec, endMilli));
|
||||
|
||||
File[] files = null;
|
||||
try {
|
||||
File folder = gui.getMod().getReplayFolder();
|
||||
files = folder.listFiles((FileFilter) new SuffixFileFilter(".mcpr", IOCase.INSENSITIVE));
|
||||
} catch (IOException e) {
|
||||
Utils.error(LOGGER, gui, CrashReport.makeCrashReport(e, "Listing available replays"), gui.backButton::onClick);
|
||||
}
|
||||
if (files == null) {
|
||||
LOGGER.warn("Replay file list is null, has the replay folder been deleted?");
|
||||
files = new File[0];
|
||||
} else {
|
||||
LOGGER.debug("Found {} replays in the replay folder", files.length);
|
||||
}
|
||||
if (files.length == 0) {
|
||||
inputReplays.setValues(NO_REPLAY);
|
||||
} else {
|
||||
inputReplays.setValues(files);
|
||||
}
|
||||
|
||||
updateSelectedReplay();
|
||||
updateReadyState();
|
||||
|
||||
gui.saveButton.onClick(() -> {
|
||||
// Read start and end times
|
||||
int start = ((startHour.getInteger() * 60 + startMin.getInteger()) * 60 + startSec.getInteger()) * 1000 + startMilli.getInteger();
|
||||
int end = ((endHour.getInteger() * 60 + endMin.getInteger()) * 60 + endSec.getInteger()) * 1000 + endMilli.getInteger();
|
||||
// Configure offset of change timestamp filter
|
||||
ChangeTimestampFilter ctf = new ChangeTimestampFilter();
|
||||
JsonObject config = new JsonObject();
|
||||
config.addProperty("offset", -start);
|
||||
ctf.init(null, config);
|
||||
// Pass filters to save dialog
|
||||
gui.save(inputReplays.getSelectedValue(),
|
||||
new PacketStream.FilterInfo(new SquashFilter(), -1, start),
|
||||
new PacketStream.FilterInfo(ctf, start, end),
|
||||
new PacketStream.FilterInfo(new RemoveFilter(), end, -1)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private void onSelectedMarkerChanged(GuiDropdownMenu<Marker> dropdown, GuiNumberField hour, GuiNumberField min,
|
||||
GuiNumberField sec, GuiNumberField milli) {
|
||||
Marker marker = dropdown.getSelectedValue();
|
||||
if (marker != NO_MARKER) {
|
||||
int time = marker.getTime();
|
||||
setTime(time, hour, min, sec, milli);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTime(int time, GuiNumberField hour, GuiNumberField min,
|
||||
GuiNumberField sec, GuiNumberField milli) {
|
||||
milli.setValue(time % 1000); time /= 1000;
|
||||
sec.setValue(time % 60); time /= 60;
|
||||
min.setValue(time % 60); time /= 60;
|
||||
hour.setValue(time);
|
||||
}
|
||||
|
||||
private void updateSelectedReplay() {
|
||||
File file = inputReplays.getSelectedValue();
|
||||
// Load markers and meta data from replay file
|
||||
ReplayMetaData metaData;
|
||||
Set<Marker> markers;
|
||||
if (file == NO_REPLAY) {
|
||||
metaData = new ReplayMetaData();
|
||||
markers = Collections.emptySet();
|
||||
} else {
|
||||
try (ReplayFile replayFile = new ZipReplayFile(new ReplayStudio(), file)) {
|
||||
metaData = replayFile.getMetaData();
|
||||
markers = replayFile.getMarkers().or(Collections.emptySet());
|
||||
LOGGER.debug("Loaded {} markers from replay {}", markers.size(), file);
|
||||
} catch (Exception e) {
|
||||
Utils.error(LOGGER, gui, CrashReport.makeCrashReport(e, "Reading markers from replay"), null);
|
||||
metaData = new ReplayMetaData();
|
||||
markers = Collections.emptySet();
|
||||
}
|
||||
}
|
||||
|
||||
// Sort and add initial "Select Event Marker" element
|
||||
List<Marker> markerList = new ArrayList<>(markers);
|
||||
markerList.sort(Comparator.comparing(Marker::getTime));
|
||||
markerList.add(0, NO_MARKER);
|
||||
|
||||
// Set marker dropdown values
|
||||
Marker[] markerArray = markerList.stream().toArray(Marker[]::new);
|
||||
startMarker.setValues(markerArray).setSelected(0);
|
||||
endMarker.setValues(markerArray).setSelected(0);
|
||||
|
||||
// Set start and end time values
|
||||
setTime(0, startHour, startMin, startSec, startMilli);
|
||||
setTime(metaData.getDuration(), endHour, endMin, endSec, endMilli);
|
||||
}
|
||||
|
||||
private void updateReadyState() {
|
||||
gui.saveButton.setEnabled(inputReplays.getSelectedValue() != NO_REPLAY);
|
||||
}
|
||||
}
|
||||
48
src/main/java/com/replaymod/editor/handler/GuiHandler.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.replaymod.editor.handler;
|
||||
|
||||
import com.replaymod.editor.ReplayModEditor;
|
||||
import com.replaymod.editor.gui.GuiReplayEditor;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class GuiHandler {
|
||||
private static final int BUTTON_REPLAY_EDITOR = 17890237;
|
||||
|
||||
private final ReplayModEditor mod;
|
||||
|
||||
public GuiHandler(ReplayModEditor mod) {
|
||||
this.mod = mod;
|
||||
}
|
||||
|
||||
public void register() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void injectIntoMainMenu(GuiScreenEvent.InitGuiEvent event) {
|
||||
if (!(event.getGui() instanceof GuiMainMenu)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GuiButton button = new GuiButton(BUTTON_REPLAY_EDITOR, event.getGui().width / 2 + 2,
|
||||
event.getGui().height / 4 + 10 + 3 * 24, I18n.format("replaymod.gui.replayeditor"));
|
||||
button.width = button.width / 2 - 2;
|
||||
event.getButtonList().add(button);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onButton(GuiScreenEvent.ActionPerformedEvent.Pre event) {
|
||||
if(!event.getButton().enabled) return;
|
||||
|
||||
if (event.getGui() instanceof GuiMainMenu) {
|
||||
if (event.getButton().id == BUTTON_REPLAY_EDITOR) {
|
||||
new GuiReplayEditor(GuiScreen.wrap(event.getGui()), mod.getCore()).display();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,12 @@ import de.johni0702.minecraft.gui.element.IGuiImage;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class FullBrightness implements Extra {
|
||||
@Mod.Instance(ReplayModReplay.MOD_ID)
|
||||
private static ReplayModReplay module;
|
||||
private ReplayModReplay module;
|
||||
|
||||
private final IGuiImage indicator = new GuiImage().setTexture(ReplayMod.TEXTURE, 90, 20, 19, 13).setSize(19, 13);
|
||||
|
||||
@@ -27,6 +25,7 @@ public class FullBrightness implements Extra {
|
||||
|
||||
@Override
|
||||
public void register(final ReplayMod mod) throws Exception {
|
||||
this.module = ReplayModReplay.instance;
|
||||
this.gameSettings = mod.getMinecraft().gameSettings;
|
||||
|
||||
mod.getKeyBindingRegistry().registerKeyBinding("replaymod.input.lighting", Keyboard.KEY_Z, new Runnable() {
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.client.resources.IResourcePack;
|
||||
import net.minecraft.client.resources.data.IMetadataSection;
|
||||
import net.minecraft.client.resources.data.MetadataSerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -26,11 +25,12 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class LocalizationExtra implements Extra {
|
||||
@Mod.Instance(ReplayModOnline.MOD_ID)
|
||||
private static ReplayModOnline module;
|
||||
private ReplayModOnline module;
|
||||
|
||||
@Override
|
||||
public void register(ReplayMod mod) throws Exception {
|
||||
this.module = ReplayModOnline.instance;
|
||||
|
||||
final Minecraft mc = mod.getMinecraft();
|
||||
Thread localizedResourcePackLoader = new Thread(new Runnable() {
|
||||
@Override
|
||||
@@ -82,7 +82,7 @@ public class LocalizationExtra implements Extra {
|
||||
availableLanguages.put(langcode, prop);
|
||||
return true;
|
||||
} catch (ApiException e) {
|
||||
if (e.getError().getId() != 16) { // This language has not been translated
|
||||
if (e.getError() == null || e.getError().getId() != 16) { // This language has not been translated
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch(ConnectException ce) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.net.URL;
|
||||
@@ -24,8 +25,10 @@ import java.nio.channels.Channels;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
import static com.replaymod.core.utils.Utils.SSL_SOCKET_FACTORY;
|
||||
|
||||
public class OpenEyeExtra implements Extra {
|
||||
private static final String DOWNLOAD_URL = "http://www.replaymod.com/dl/openeye/" + Loader.MC_VERSION;
|
||||
private static final String DOWNLOAD_URL = "https://www.replaymod.com/dl/openeye/" + Loader.MC_VERSION;
|
||||
private static final Setting<Boolean> ASK_FOR_OPEN_EYE = new Setting<>("advanced", "askForOpenEye", null, true);
|
||||
|
||||
private ReplayMod mod;
|
||||
@@ -69,7 +72,9 @@ public class OpenEyeExtra implements Extra {
|
||||
File targetFile = new File("mods/" + Loader.MC_VERSION, "OpenEye.jar");
|
||||
FileUtils.forceMkdir(targetFile.getParentFile());
|
||||
|
||||
ReadableByteChannel in = Channels.newChannel(new URL(DOWNLOAD_URL).openStream());
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(DOWNLOAD_URL).openConnection();
|
||||
connection.setSSLSocketFactory(SSL_SOCKET_FACTORY);
|
||||
ReadableByteChannel in = Channels.newChannel(connection.getInputStream());
|
||||
FileChannel out = new FileOutputStream(targetFile).getChannel();
|
||||
out.transferFrom(in, 0, Long.MAX_VALUE);
|
||||
} catch (Throwable e) {
|
||||
|
||||