Moved to Forge 1.7.10 and fixed folder structure
This commit is contained in:
parent
85bc364949
commit
caa13e854f
389 changed files with 13076 additions and 2859 deletions
.gitignoreCREDITS-fml.txtLICENSE-fml.txtMinecraftForge-Credits.txtMinecraftForge-License.txtbuild.gradleforge-1.7.10-10.13.4.1490-1.7.10-changelog.txtdo_not_include_in_output.txt
gradle/wrapper
gradlewgradlew.batgraveyard
src
cofh
api
block
core
energy
EnergyStorage.javaIEnergyContainerItem.javaIEnergyHandler.javaIEnergyStorage.javaItemEnergyContainer.javaTileEnergyHandler.java
tileentity
IEnergyInfo.javaIReconfigurableFacing.javaIReconfigurableSides.javaIRedstoneControl.javaISecureTile.javaISidedBlockTexture.java
transport
world
cr0s
dan200
computercraft/api
do_not_include_in_output.txtjava/cr0s/warpdrive
BlockMetaRotation.javaCloakChunkWatcher.javaCommonProxy.javaEntityJump.javaGravityManager.javaLocalProfiler.javaMetaRotations$1.javaMetaRotations.javaPacketHandler.javaSoundHandler.javaSpaceEventHandler.javaWCClassTransformer.javaWCDummyContainer.javaWCFMLLoadingPlugin.javaWarpDrive.javaWarpDriveConfig.javaWarpDriveCreativeTab.javaWarpDrivePeripheralHandler.java
api
block
client
command
data
172
.gitignore
vendored
172
.gitignore
vendored
|
@ -1,164 +1,16 @@
|
|||
#################
|
||||
## Eclipse
|
||||
#################
|
||||
!*.*
|
||||
/bin
|
||||
|
||||
*.pydevproject
|
||||
.project
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.classpath
|
||||
*.classpath
|
||||
*.project
|
||||
.gradle/
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
build/
|
||||
eclipse/
|
||||
|
||||
|
||||
#################
|
||||
## Visual Studio
|
||||
#################
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.vspscc
|
||||
.builds
|
||||
*.dotCover
|
||||
|
||||
## TODO: If you have NuGet Package Restore enabled, uncomment this
|
||||
#packages/
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish
|
||||
|
||||
# Others
|
||||
[Bb]in
|
||||
[Oo]bj
|
||||
sql
|
||||
TestResults
|
||||
*.Cache
|
||||
ClientBin
|
||||
stylecop.*
|
||||
~$*
|
||||
*.dbmdl
|
||||
Generated_Code #added for RIA/Silverlight projects
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
|
||||
|
||||
|
||||
############
|
||||
## Windows
|
||||
############
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
|
||||
#############
|
||||
## Python
|
||||
#############
|
||||
|
||||
*.py[co]
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
dist
|
||||
build
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
.coverage
|
||||
.tox
|
||||
|
||||
#Translations
|
||||
*.mo
|
||||
|
||||
#Mr Developer
|
||||
.mr.developer.cfg
|
||||
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
|
||||
*.iml
|
||||
*.iws
|
||||
*.ipr
|
||||
*.idea/
|
||||
src/main/resources/Thumbs.db
|
||||
|
|
28
CREDITS-fml.txt
Normal file
28
CREDITS-fml.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
This is Forge Mod Loader.
|
||||
|
||||
You can find the source code at all times at https://github.com/MinecraftForge/FML
|
||||
|
||||
This minecraft mod is a clean open source implementation of a mod loader for minecraft servers
|
||||
and minecraft clients.
|
||||
|
||||
The code is authored by cpw.
|
||||
|
||||
It began by partially implementing an API defined by the client side ModLoader, authored by Risugami.
|
||||
http://www.minecraftforum.net/topic/75440-
|
||||
This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader.
|
||||
|
||||
It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
|
||||
http://www.minecraftforge.net/
|
||||
|
||||
Additionally, it contains an implementation of topological sort based on that
|
||||
published at http://keithschwarz.com/interesting/code/?dir=topological-sort
|
||||
|
||||
It also contains code from the Maven project for performing versioned dependency
|
||||
resolution. http://maven.apache.org/
|
||||
|
||||
It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
|
||||
with credit to it's authors.
|
||||
|
||||
Forge Mod Loader downloads components from the Minecraft Coder Pack
|
||||
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.
|
||||
|
491
LICENSE-fml.txt
Normal file
491
LICENSE-fml.txt
Normal file
|
@ -0,0 +1,491 @@
|
|||
This minecraft mod, Forge Mod Loader, including all parts herein except as noted below,
|
||||
is licensed under the GNU LGPL v2.1 or later.
|
||||
|
||||
Homepage: https://github.com/MinecraftForge/FML
|
||||
|
||||
This software includes portions from the Apache Maven project at
|
||||
http://maven.apache.org/ specifically the ComparableVersion.java code. It is
|
||||
included based on guidelines at
|
||||
http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
|
||||
with notices intact. The only change is a non-functional change of package name.
|
||||
|
||||
This software contains a partial repackaging of javaxdelta, a BSD licensed program for generating
|
||||
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
|
||||
authored by genman, heikok, pivot.
|
||||
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
|
||||
|
||||
|
||||
=== MCP Data ===
|
||||
This software includes data from the Minecraft Coder Pack (MCP), with kind permission
|
||||
from them. The license to MCP data is not transitive - distribution of this data by
|
||||
third parties requires independent licensing from the MCP team. This data is not
|
||||
redistributable without permission from the MCP team.
|
||||
|
||||
=== Sharing ===
|
||||
I grant permission for some parts of FML to be redistributed outside the terms of the LGPL, for the benefit of
|
||||
the minecraft modding community. All contributions to these parts should be licensed under the same additional grant.
|
||||
|
||||
-- Runtime patcher --
|
||||
License is granted to redistribute the runtime patcher code (common/cpw/mods/fml/patcher and subdirectories) under
|
||||
any alternative open source license as classified by the OSI (http://opensource.org/licenses)
|
||||
|
||||
-- ASM transformers --
|
||||
License is granted to redistribute the ASM transformer code (common/cpw/mods/fml/common/asm/ and subdirectories)
|
||||
under any alternative open source license as classified by the OSI (http://opensource.org/licenses)
|
||||
|
||||
========
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
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 this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser 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 Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "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
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY 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
|
||||
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
26
MinecraftForge-Credits.txt
Normal file
26
MinecraftForge-Credits.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
* Eloraam *
|
||||
|
||||
* FlowerChild *
|
||||
|
||||
* Hawkye *
|
||||
|
||||
* MALfunction84 *
|
||||
|
||||
Submitted the sleep handler code for his mod (Somnia) and others to use.
|
||||
|
||||
* Scokeev9 *
|
||||
|
||||
Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it.
|
||||
|
||||
ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed.
|
||||
|
||||
* SpaceToad *
|
||||
|
||||
* LexManos *
|
||||
|
||||
* cpw *
|
||||
|
||||
* Minecraft Coder Pack (MCP) *
|
||||
Forge Mod Loader and Minecraft Forge have permission to distribute and automatically download components of MCP and distribute MCP data files.
|
||||
This permission is not transitive and others wishing to redistribute the Minecraft Forge source independently should seek permission of MCP or
|
||||
remove the MCP data files and request their users to download MCP separately.
|
70
MinecraftForge-License.txt
Normal file
70
MinecraftForge-License.txt
Normal file
|
@ -0,0 +1,70 @@
|
|||
Minecraft Forge Public Licence
|
||||
==============================
|
||||
|
||||
Version 1.0
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB
|
||||
|
||||
User: Anybody that interract with the software in one of the following ways:
|
||||
- play
|
||||
- decompile
|
||||
- recompile or compile
|
||||
- modify
|
||||
|
||||
Minecraft Forge: The Minecraft Forge code, in source form, class file form, as
|
||||
obtained in a standalone fashion or as part of a wider distribution.
|
||||
|
||||
Dependency: Code required to have Minecraft Forge working properly. That can
|
||||
include dependencies required to compile the code as well as modifications in
|
||||
the Minecraft sources that are required to have Minecraft Forge working.
|
||||
|
||||
1. Scope
|
||||
--------
|
||||
|
||||
The present license is granted to any user of Minecraft Forge, for all files included
|
||||
unless stated otherwise in the file itself. As a prerequisite, a user of Minecraft
|
||||
Forge must own a legally aquired copy of Minecraft.
|
||||
|
||||
2. Play rights
|
||||
--------------
|
||||
|
||||
The user of Minecraft Forge is allowed to install the software on a client or
|
||||
a server and to play it without restriction.
|
||||
|
||||
3. Modification rights
|
||||
----------------------
|
||||
|
||||
The user has the right to decompile the source code, look at either the
|
||||
decompiled version or the original source code, and to modify it.
|
||||
|
||||
4. Derivation rights
|
||||
--------------------
|
||||
|
||||
The user has the rights to derive code from Minecraft Forge, that is to say to
|
||||
write code that either extends Minecraft Forge class and interfaces,
|
||||
instantiate the objects declared or calls the functions. This code is known as
|
||||
"derived" code, and can be licensed with conditions different from Minecraft
|
||||
Forge.
|
||||
|
||||
|
||||
5. Distribution rights
|
||||
----------------------
|
||||
|
||||
The user of Minecraft Forge is allowed to redistribute Minecraft Forge in
|
||||
partially, in totallity, or included in a distribution. When distributing
|
||||
binaries or class files, the user must provide means to obtain the sources of
|
||||
the distributed version of Minecraft Forge at no costs. This includes the
|
||||
files as well as any dependency that the code may rely on, including patches to
|
||||
minecraft original sources.
|
||||
|
||||
Modification of Minecraft Forge as well as dependencies, including patches to
|
||||
minecraft original sources, has to remain under the terms of the present
|
||||
license.
|
||||
|
||||
The right to distribute Minecraft Forge does not extend to the right to distribute
|
||||
MCP data files included within Minecraft Forge. These are the property of the MCP
|
||||
project and should be removed from any customized distribution of Minecraft Forge
|
||||
or permission sought separately from the MCP team.
|
63
build.gradle
Normal file
63
build.gradle
Normal file
|
@ -0,0 +1,63 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "2.0.0"
|
||||
group= "cr0s.warpdrive" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "warpdrive"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.4.1490-1.7.10"
|
||||
runDir = "eclipse"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
//compile "some.group:artifact:version:classifier"
|
||||
//compile "some.group:artifact:version"
|
||||
|
||||
// real examples
|
||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
|
||||
// for more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
7851
forge-1.7.10-10.13.4.1490-1.7.10-changelog.txt
Normal file
7851
forge-1.7.10-10.13.4.1490-1.7.10-changelog.txt
Normal file
File diff suppressed because it is too large
Load diff
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
#Wed Jul 02 15:54:47 CDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
164
gradlew
vendored
Normal file
164
gradlew
vendored
Normal file
|
@ -0,0 +1,164 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
90
gradlew.bat
vendored
Normal file
90
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
|
@ -17,7 +17,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
/**
|
||||
* List of block IDs.
|
|
@ -1,33 +0,0 @@
|
|||
package cofh.api.block;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on blocks which have some debug method which can be activated via a tool or other means.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IBlockDebug {
|
||||
|
||||
/**
|
||||
* This function debugs a block.
|
||||
*
|
||||
* @param world
|
||||
* Reference to the world.
|
||||
* @param x
|
||||
* X coordinate of the block.
|
||||
* @param y
|
||||
* Y coordinate of the block.
|
||||
* @param z
|
||||
* Z coordinate of the block.
|
||||
* @param side
|
||||
* The side of the block.
|
||||
* @param player
|
||||
* Player doing the debugging.
|
||||
*/
|
||||
public void debugBlock(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player);
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cofh.api.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on blocks which can provide information about themselves.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IBlockInfo {
|
||||
|
||||
/**
|
||||
* This function appends information to a list provided to it.
|
||||
*
|
||||
* @param world
|
||||
* Reference to the world.
|
||||
* @param x
|
||||
* X coordinate of the block.
|
||||
* @param y
|
||||
* Y coordinate of the block.
|
||||
* @param z
|
||||
* Z coordinate of the block.
|
||||
* @param side
|
||||
* The side of the block that is being queried.
|
||||
* @param player
|
||||
* Player doing the querying - this can be NULL.
|
||||
* @param info
|
||||
* The list that the information should be appended to.
|
||||
* @param debug
|
||||
* If true, the Block should return "debug" information.
|
||||
*/
|
||||
public void getBlockInfo(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player, List<String> info, boolean debug);
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package cofh.api.block;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Implemented on Blocks which have some method of being instantly dismantled.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IDismantleable {
|
||||
|
||||
/**
|
||||
* Dismantles the block. If returnBlock is true, the drop(s) should be placed into the player's inventory.
|
||||
*/
|
||||
public ItemStack dismantleBlock(EntityPlayer player, World world, int x, int y, int z, boolean returnBlock);
|
||||
|
||||
/**
|
||||
* Return true if the block can be dismantled. The criteria for this is entirely up to the block.
|
||||
*/
|
||||
public boolean canDismantle(EntityPlayer player, World world, int x, int y, int z);
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package cofh.api.core;
|
||||
|
||||
/**
|
||||
* Interface which can be put on just about anything to allow for iteration during initialization.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IInitializer {
|
||||
|
||||
public boolean preInit();
|
||||
|
||||
public boolean initialize();
|
||||
|
||||
public boolean postInit();
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package cofh.api.core;
|
||||
|
||||
/**
|
||||
* Basic interface for the Cape and Skin Registries.
|
||||
*
|
||||
* @author Zeldo Kavira
|
||||
*
|
||||
*/
|
||||
public interface ISimpleRegistry {
|
||||
|
||||
/**
|
||||
* Register a new entry.
|
||||
*
|
||||
* @param playerName
|
||||
* The player to register.
|
||||
* @param URL
|
||||
* Location of the cape/skin.
|
||||
* @return True if registration was successful.
|
||||
*/
|
||||
public boolean register(String playerName, String URL);
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package cofh.api.core;
|
||||
|
||||
/**
|
||||
* Dummy class used to initialize Cape and Skin Registries to prevent accidental NPEs.
|
||||
*
|
||||
* @author Zeldo Kavira
|
||||
*
|
||||
*/
|
||||
public class NullSimpleRegistry implements ISimpleRegistry {
|
||||
|
||||
@Override
|
||||
public boolean register(String playerName, String URL) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package cofh.api.core;
|
||||
|
||||
/**
|
||||
* Access to the Cape and Skin Registries of CoFH Core.
|
||||
*
|
||||
* @author Zeldo Kavira
|
||||
*
|
||||
*/
|
||||
public class RegistryAccess {
|
||||
|
||||
public static ISimpleRegistry capeRegistry = new NullSimpleRegistry();
|
||||
public static ISimpleRegistry skinRegistry = new NullSimpleRegistry();
|
||||
|
||||
}
|
|
@ -1,158 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class EnergyStorage implements IEnergyStorage {
|
||||
|
||||
protected int energy;
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public EnergyStorage(int capacity) {
|
||||
|
||||
this(capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxTransfer) {
|
||||
|
||||
this(capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public EnergyStorage readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
this.energy = nbt.getInteger("Energy");
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
if (energy < 0) {
|
||||
energy = 0;
|
||||
}
|
||||
nbt.setInteger("Energy", energy);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
}
|
||||
|
||||
public void setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
}
|
||||
|
||||
public void setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public int getMaxReceive() {
|
||||
|
||||
return maxReceive;
|
||||
}
|
||||
|
||||
public int getMaxExtract() {
|
||||
|
||||
return maxExtract;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers are
|
||||
* guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void setEnergyStored(int energy) {
|
||||
|
||||
this.energy = energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this
|
||||
* externally, as not all IEnergyHandlers are guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void modifyEnergyStored(int energy) {
|
||||
|
||||
this.energy += energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* IEnergyStorage */
|
||||
@Override
|
||||
public int receiveEnergy(int maxReceive, boolean simulate) {
|
||||
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(int maxExtract, boolean simulate) {
|
||||
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
|
||||
return energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation of their internal energy storages.
|
||||
*
|
||||
* A reference implementation is provided {@link ItemEnergyContainer}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyContainerItem {
|
||||
|
||||
/**
|
||||
* Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be charged.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be sent into the item.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received by the item.
|
||||
*/
|
||||
int receiveEnergy(ItemStack container, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally
|
||||
* discharged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be discharged.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted from the item.
|
||||
* @param simulate
|
||||
* If TRUE, the discharge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the item.
|
||||
*/
|
||||
int extractEnergy(ItemStack container, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Get the amount of energy currently stored in the container item.
|
||||
*/
|
||||
int getEnergyStored(ItemStack container);
|
||||
|
||||
/**
|
||||
* Get the max amount of energy that can be stored in the container item.
|
||||
*/
|
||||
int getMaxEnergyStored(ItemStack container);
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on TileEntities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
*
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyHandler {
|
||||
|
||||
/**
|
||||
* Add energy to an IEnergyHandler, internal distribution is left entirely to the IEnergyHandler.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is received from.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to receive.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received.
|
||||
*/
|
||||
int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Remove energy from an IEnergyHandler, internal distribution is left entirely to the IEnergyHandler.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is extracted from.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to extract.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted.
|
||||
*/
|
||||
int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns true if the Handler functions on a given side - if a Tile Entity can receive or send energy on a given side, this should return true.
|
||||
*/
|
||||
boolean canInterface(ForgeDirection from);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored(ForgeDirection from);
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored(ForgeDirection from);
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
/**
|
||||
* An energy storage is the unit of interaction with Energy inventories.
|
||||
*
|
||||
* A reference implementation can be found at {@link EnergyStorage}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyStorage {
|
||||
|
||||
/**
|
||||
* Adds energy to the storage. Returns quantity of energy that was accepted.
|
||||
*
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be inserted.
|
||||
* @param simulate
|
||||
* If TRUE, the insertion will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) accepted by the storage.
|
||||
*/
|
||||
int receiveEnergy(int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from the storage. Returns quantity of energy that was removed.
|
||||
*
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the storage.
|
||||
*/
|
||||
int extractEnergy(int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored();
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored();
|
||||
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class ItemEnergyContainer extends Item implements IEnergyContainerItem {
|
||||
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public ItemEnergyContainer(int itemID) {
|
||||
|
||||
super(itemID);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int itemID, int capacity) {
|
||||
|
||||
this(itemID, capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int itemID, int capacity, int maxTransfer) {
|
||||
|
||||
this(itemID, capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int itemID, int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
super(itemID);
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
}
|
||||
|
||||
public void setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
}
|
||||
|
||||
public void setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
/* IEnergyContainerItem */
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null) {
|
||||
container.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
return container.stackTagCompound.getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class TileEnergyHandler extends TileEntity implements IEnergyHandler {
|
||||
|
||||
protected EnergyStorage storage = new EnergyStorage(32000);
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
super.readFromNBT(nbt);
|
||||
storage.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
super.writeToNBT(nbt);
|
||||
storage.writeToNBT(nbt);
|
||||
}
|
||||
|
||||
/* IEnergyHandler */
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
|
||||
return storage.receiveEnergy(maxReceive, simulate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
|
||||
return storage.extractEnergy(maxExtract, simulate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInterface(ForgeDirection from) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
|
||||
return storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which can report information about their energy usage.
|
||||
*
|
||||
* This is used for reporting purposes - Energy transactions should be handled through IEnergyHandler!
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyInfo {
|
||||
|
||||
public int getEnergyPerTick();
|
||||
|
||||
public int getMaxEnergyPerTick();
|
||||
|
||||
public int getEnergy();
|
||||
|
||||
public int getMaxEnergy();
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which allow for reconfiguration of their facing.
|
||||
*
|
||||
* Coordination with the containing block is required.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IReconfigurableFacing {
|
||||
|
||||
/**
|
||||
* Returns the current facing of the block.
|
||||
*/
|
||||
public int getFacing();
|
||||
|
||||
/**
|
||||
* Returns whether or not the block's face can be aligned with the Y Axis.
|
||||
*/
|
||||
public boolean allowYAxisFacing();
|
||||
|
||||
/**
|
||||
* Attempt to rotate the block. Arbitrary based on implementation.
|
||||
*
|
||||
* @return True if rotation was successful, false otherwise.
|
||||
*/
|
||||
public boolean rotateBlock();
|
||||
|
||||
/**
|
||||
* Set the facing of the block.
|
||||
*
|
||||
* @param side
|
||||
* The side to set the facing to.
|
||||
* @return True if the facing was set, false otherwise.
|
||||
*/
|
||||
public boolean setFacing(int side);
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which allow for reconfiguration of their sides.
|
||||
*
|
||||
* Coordination with the containing block is required.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IReconfigurableSides {
|
||||
|
||||
/**
|
||||
* Decrement the config for a given side.
|
||||
*
|
||||
* @param side
|
||||
* The side to decrement.
|
||||
* @return True if config was changed, false otherwise.
|
||||
*/
|
||||
public boolean decrSide(int side);
|
||||
|
||||
/**
|
||||
* Increment the config for a given side.
|
||||
*
|
||||
* @param side
|
||||
* The side to decrement.
|
||||
* @return True if config was changed, false otherwise.
|
||||
*/
|
||||
public boolean incrSide(int side);
|
||||
|
||||
/**
|
||||
* Set the config for a given side.
|
||||
*
|
||||
* @param side
|
||||
* The side to set.
|
||||
* @param config
|
||||
* The config value to use.
|
||||
* @return True of config was set, false otherwise.
|
||||
*/
|
||||
public boolean setSide(int side, int config);
|
||||
|
||||
/**
|
||||
* Reset configs on all sides to their base values.
|
||||
*
|
||||
* @return True if reset was successful, false otherwise.
|
||||
*/
|
||||
public boolean resetSides();
|
||||
|
||||
/**
|
||||
* Returns the number of possible config settings for a given side.
|
||||
*/
|
||||
public int getNumConfig(int side);
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which have redstone control functionality.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IRedstoneControl {
|
||||
|
||||
public boolean getControlDisable();
|
||||
|
||||
public boolean getControlSetting();
|
||||
|
||||
public boolean setControlDisable(boolean disable);
|
||||
|
||||
public boolean setControlSetting(boolean state);
|
||||
|
||||
public boolean setRedstoneConfig(boolean disable, boolean state);
|
||||
|
||||
public boolean isPowered();
|
||||
|
||||
public void handlePowerUpdate(boolean powered);
|
||||
|
||||
public void handleConfigUpdate(boolean disable, boolean state);
|
||||
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
public interface ISecureTile {
|
||||
|
||||
public static enum AccessMode {
|
||||
PUBLIC, RESTRICTED, PRIVATE;
|
||||
|
||||
public boolean isPublic() {
|
||||
|
||||
return this == PUBLIC;
|
||||
}
|
||||
|
||||
public boolean isRestricted() {
|
||||
|
||||
return this == RESTRICTED;
|
||||
}
|
||||
|
||||
public boolean isPrivate() {
|
||||
|
||||
return this == PRIVATE;
|
||||
}
|
||||
|
||||
public static AccessMode stepForward(AccessMode curAccess) {
|
||||
|
||||
return curAccess == AccessMode.PUBLIC ? AccessMode.RESTRICTED : curAccess == AccessMode.PRIVATE ? AccessMode.PUBLIC : AccessMode.PRIVATE;
|
||||
}
|
||||
|
||||
public static AccessMode stepBackward(AccessMode curAccess) {
|
||||
|
||||
return curAccess == AccessMode.PUBLIC ? AccessMode.PRIVATE : curAccess == AccessMode.PRIVATE ? AccessMode.RESTRICTED : AccessMode.PUBLIC;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setAccess(AccessMode access);
|
||||
|
||||
public AccessMode getAccess();
|
||||
|
||||
public boolean setOwnerName(String name);
|
||||
|
||||
public String getOwnerName();
|
||||
|
||||
public boolean canPlayerAccess(String name);
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package cofh.api.tileentity;
|
||||
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which can change their block's texture based on the current render pass. The block must defer the call to its Tile
|
||||
* Entity.
|
||||
*
|
||||
* @author Zeldo Kavira
|
||||
*
|
||||
*/
|
||||
public interface ISidedBlockTexture {
|
||||
|
||||
public Icon getBlockTexture(int side, int pass);
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cofh.api.transport;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public interface IEnderAttuned {
|
||||
|
||||
public enum EnderTypes {
|
||||
ITEM, FLUID, REDSTONE_FLUX
|
||||
}
|
||||
|
||||
String getOwnerString();
|
||||
|
||||
int getFrequency();
|
||||
|
||||
public boolean setFrequency(int frequency);
|
||||
|
||||
public boolean clearFrequency();
|
||||
|
||||
boolean canSendItems();
|
||||
|
||||
boolean canSendFluid();
|
||||
|
||||
boolean canSendEnergy();
|
||||
|
||||
boolean canReceiveItems();
|
||||
|
||||
boolean canReceiveFluid();
|
||||
|
||||
boolean canReceiveEnergy();
|
||||
|
||||
boolean currentlyValidToReceiveItems(IEnderAttuned asker);
|
||||
|
||||
boolean currentlyValidToReceiveFluid(IEnderAttuned asker);
|
||||
|
||||
boolean currentlyValidToReceiveEnergy(IEnderAttuned asker);
|
||||
|
||||
boolean currentlyValidToSendItems(IEnderAttuned asker);
|
||||
|
||||
boolean currentlyValidToSendFluid(IEnderAttuned asker);
|
||||
|
||||
boolean currentlyValidToSendEnergy(IEnderAttuned asker);
|
||||
|
||||
ItemStack receiveItem(ItemStack item);
|
||||
|
||||
FluidStack receiveFluid(FluidStack fluid, boolean doFill);
|
||||
|
||||
int receiveEnergy(int energy, boolean simulate);
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package cofh.api.transport;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* This interface is implemented on Item Conduits. Use it to attempt to eject items into an entry point.
|
||||
*
|
||||
* @author Zeldo Kavira, King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IItemConduit {
|
||||
|
||||
/**
|
||||
* Insert an ItemStack into the IItemConduit. Will only accept items if there is a valid destination. This returns what is remaining of the original stack -
|
||||
* a null return means that the entire stack was accepted/routed!
|
||||
*
|
||||
* @param from
|
||||
* Orientation the item is inserted from.
|
||||
* @param item
|
||||
* ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert.
|
||||
* @return An ItemStack representing how much is remaining after the item was inserted (or would have been, if simulated) into the Conduit.
|
||||
*/
|
||||
public ItemStack insertItem(ForgeDirection from, ItemStack item);
|
||||
|
||||
/* THE FOLLOWING WILL BE REMOVED IN 3.0.1.X */
|
||||
@Deprecated
|
||||
public ItemStack insertItem(ForgeDirection from, ItemStack item, boolean simulate);
|
||||
|
||||
@Deprecated
|
||||
public ItemStack sendItems(ItemStack item, ForgeDirection from);
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cofh.api.world;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
/**
|
||||
* This interface should be implemented on classes which define a world feature to be generated in a {@link IFeatureHandler}. It is essentially a more robust
|
||||
* version of {@link WorldGenerator}, and may include one or more WorldGenerators should you wish.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IFeatureGenerator {
|
||||
|
||||
/**
|
||||
* Returns the name of the feature, used for displaying in the World.cfg file.
|
||||
*/
|
||||
public String getFeatureName();
|
||||
|
||||
/**
|
||||
* Generates the world feature.
|
||||
*
|
||||
* @param random
|
||||
* Random derived from the world seed.
|
||||
* @param chunkX
|
||||
* Minimum X chunk-coordinate of the chunk. (x16 for block coordinate)
|
||||
* @param chunkZ
|
||||
* Minimum Z chunk-coordinate of the chunk. (x16 for block coordinate)
|
||||
* @param world
|
||||
* The world to generate in.
|
||||
* @param newGen
|
||||
* True on initial generation, false on retrogen.
|
||||
* @return True if generation happened, false otherwise.
|
||||
*/
|
||||
public boolean generateFeature(Random random, int chunkX, int chunkZ, World world, boolean newGen);
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package cofh.api.world;
|
||||
|
||||
/**
|
||||
* Provides an interface to allow for the addition of Features to world generation.
|
||||
*
|
||||
* See {@link IFeatureGenerator}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IFeatureHandler {
|
||||
|
||||
/**
|
||||
* Register a feature with an IFeatureHandler.
|
||||
*
|
||||
* @param feature
|
||||
* The feature to register.
|
||||
* @return True if the registration was successful, false if a feature with that name existed.
|
||||
*/
|
||||
public boolean registerFeature(IFeatureGenerator feature);
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package cofh.api.world;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomItem;
|
||||
|
||||
/**
|
||||
* This class essentially allows for ores to be generated in clusters, with Features randomly choosing one or more blocks from a weighted list.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public final class WeightedRandomBlock extends WeightedRandomItem {
|
||||
|
||||
public final int blockId;
|
||||
public final int metadata;
|
||||
|
||||
public WeightedRandomBlock(ItemStack ore) {
|
||||
|
||||
super(100);
|
||||
this.blockId = ore.itemID;
|
||||
this.metadata = ore.getItemDamage();
|
||||
}
|
||||
|
||||
public WeightedRandomBlock(ItemStack ore, int weight) {
|
||||
|
||||
super(weight);
|
||||
this.blockId = ore.itemID;
|
||||
this.metadata = ore.getItemDamage();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
This CoFH API for MC 1.6.4 as provided by its author, found in the Misc-Additions mod.
|
||||
Those are only needed for compilation.
|
||||
Do not include those binaries in the mod package!
|
|
@ -1,27 +0,0 @@
|
|||
WarpDrive
|
||||
=========
|
||||
|
||||
A warp drive mod for minecraft
|
||||
|
||||
See mcmod.info for credits
|
||||
|
||||
Minecraft forum:
|
||||
http://www.minecraftforum.net/topic/1938578-164-warpdrive-mod-ships-space-lasers
|
||||
|
||||
Mod Showcase:
|
||||
https://www.youtube.com/watch?v=9pUSZPEMc1g
|
||||
http://www.twitch.tv/pyrostasis/c/4571421
|
||||
|
||||
Wiki:
|
||||
http://wiki.kubach.tk/
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Download fresh build: http://kubach.tk/1.6.4/WarpDrive.zip
|
||||
2. Download fresh Core build: http://kubach.tk/1.6.4/WarpDriveCore.jar
|
||||
3. Install last version of IC2, Applied Energistics, CoFHCore and Computer Craft
|
||||
|
||||
Contact Us
|
||||
==========
|
||||
* Visit our IRC channel on EsperNet: irc://chaos.esper.net/WarpDrive
|
||||
* Or PM me: http://www.minecraftforum.net/user/1133830-anon1644/
|
|
@ -1,42 +0,0 @@
|
|||
package cr0s.serverMods;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
/**
|
||||
* Гашение урона при падении с джетпаком или квантовыми бутсами
|
||||
* @author Cr0s
|
||||
*/
|
||||
public class AntiFallDamage
|
||||
{
|
||||
private final int JETPACK_ID = 29954;
|
||||
private final int ELECTRIC_JETPACK_ID = 29953;
|
||||
private final int QUANTUM_BOOTS_ID = 29915;
|
||||
|
||||
@ForgeSubscribe
|
||||
public void livingFall(LivingFallEvent event)
|
||||
{
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
float distance = event.distance;
|
||||
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
int check = MathHelper.ceiling_float_int(distance - 3.0F);
|
||||
|
||||
if (check > 0) // Падение может нанести урон
|
||||
{
|
||||
// Проверяем наличие защиты
|
||||
if ((player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == QUANTUM_BOOTS_ID) ||
|
||||
(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).itemID == JETPACK_ID) ||
|
||||
(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).itemID == ELECTRIC_JETPACK_ID))
|
||||
{
|
||||
event.setCanceled(true); // Блокируем падение, если защита есть
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package cr0s.serverMods;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
// some code goes here
|
||||
public void setupLoginHook()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,135 +0,0 @@
|
|||
package cr0s.serverMods;
|
||||
|
||||
import cpw.mods.fml.common.network.IConnectionHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import java.io.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.NetLoginHandler;
|
||||
import net.minecraft.network.packet.NetHandler;
|
||||
import net.minecraft.network.packet.Packet1Login;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
public class LoginHookClass implements IConnectionHandler
|
||||
{
|
||||
private String checkLogin(String s) throws FileNotFoundException, IOException
|
||||
{
|
||||
if (s.indexOf(".") == -1 || s.split("\\.").length != 2)
|
||||
return "Никнейм и пароль должны быть разделены точками.";
|
||||
|
||||
if (!s.matches("^[a-zA-Z0-9_.]+$"))
|
||||
return "Имя пользователя или пароль содержат недопустимые символы.";
|
||||
|
||||
String s4 = s.split("\\.")[0].trim();
|
||||
String s5 = s.split("\\.")[1].trim();
|
||||
|
||||
if (s4.length() < 2 && !s4.equals("Q"))
|
||||
return "Имя пользователя слишком короткое.";
|
||||
|
||||
if (s5.length() < 3)
|
||||
return "Пароль слишком короткий.";
|
||||
|
||||
if (s4.length() > 15)
|
||||
return "Слишком длинный логин! (>15)";
|
||||
|
||||
BufferedReader bufferedreader = new BufferedReader(new FileReader(MinecraftServer.getServer().getFile("users.txt")));
|
||||
|
||||
String s1;
|
||||
|
||||
while ((s1 = bufferedreader.readLine()) != null)
|
||||
{
|
||||
String s2;
|
||||
String s3;
|
||||
|
||||
try
|
||||
{
|
||||
s2 = s1.split("\\.")[0];
|
||||
s3 = s1.split("\\.")[1];
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
bufferedreader.close();
|
||||
return "login.password error, database is corrupted.";
|
||||
}
|
||||
|
||||
if (s2.toLowerCase().equals(s4.toLowerCase()))
|
||||
{
|
||||
if (!s3.equals(s5))
|
||||
{
|
||||
System.out.println((new StringBuilder()).append(s).append(" failed to login (pwd: ").append(s3).append(")").toString());
|
||||
bufferedreader.close();
|
||||
return "Неправильный пароль!";
|
||||
}
|
||||
else
|
||||
{
|
||||
bufferedreader.close();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bufferedreader.close();
|
||||
PrintWriter printwriter = new PrintWriter(new FileWriter(MinecraftServer.getServer().getFile("users.txt"), true));
|
||||
printwriter.println(s);
|
||||
printwriter.close();
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)
|
||||
{
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
|
||||
{
|
||||
String kickReason = "";
|
||||
String s = netHandler.clientUsername;
|
||||
|
||||
try
|
||||
{
|
||||
kickReason = checkLogin(s);
|
||||
System.out.println("[SERVER MODS] Logging in user: " + s + " Result: " + kickReason);
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{
|
||||
Logger.getLogger(LoginHookClass.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(LoginHookClass.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
if (Strings.isNullOrEmpty(kickReason))
|
||||
netHandler.clientUsername = s.split("\\.")[0];
|
||||
|
||||
return kickReason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
|
||||
{
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager)
|
||||
{
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionClosed(INetworkManager manager)
|
||||
{
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)
|
||||
{
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package cr0s.serverMods;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cr0s.WarpDrive.SpaceEventHandler;
|
||||
|
||||
@Mod(modid = "ServerMods", name = "ServerMods", version = "0.0.1")
|
||||
@NetworkMod(clientSideRequired = false, serverSideRequired = true, connectionHandler = LoginHookClass.class)
|
||||
|
||||
/**
|
||||
* @author Cr0s
|
||||
*/
|
||||
public class ServerMods
|
||||
{
|
||||
// The instance of your mod that Forge uses.
|
||||
@Instance("ServerMods")
|
||||
public static ServerMods instance;
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
// Stub Method
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
// Включить авторизацию (включается автоматически)
|
||||
//proxy.setupLoginHook();
|
||||
// Снять урон от падения с джетпаком и крузис-тапками
|
||||
MinecraftForge.EVENT_BUS.register(new AntiFallDamage());
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
// Stub Method
|
||||
}
|
||||
}
|
|
@ -1,261 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api;
|
||||
|
||||
import dan200.computercraft.api.filesystem.IMount;
|
||||
import dan200.computercraft.api.filesystem.IWritableMount;
|
||||
import dan200.computercraft.api.media.IMediaProvider;
|
||||
import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
||||
import dan200.computercraft.api.redstone.IBundledRedstoneProvider;
|
||||
import dan200.computercraft.api.turtle.ITurtleUpgrade;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* The static entry point to the ComputerCraft API.
|
||||
* Members in this class must be called after mod_ComputerCraft has been initialised,
|
||||
* but may be called before it is fully loaded.
|
||||
*/
|
||||
public final class ComputerCraftAPI
|
||||
{
|
||||
/**
|
||||
* Creates a numbered directory in a subfolder of the save directory for a given world, and returns that number.<br>
|
||||
* Use in conjuction with createSaveDirMount() to create a unique place for your peripherals or media items to store files.<br>
|
||||
* @param world The world for which the save dir should be created. This should be the serverside world object.
|
||||
* @param parentSubPath The folder path within the save directory where the new directory should be created. eg: "computercraft/disk"
|
||||
* @return The numerical value of the name of the new folder, or -1 if the folder could not be created for some reason.<br>
|
||||
* eg: if createUniqueNumberedSaveDir( world, "computer/disk" ) was called returns 42, then "computer/disk/42" is now available for writing.
|
||||
* @see #createSaveDirMount(World, String, long)
|
||||
*/
|
||||
public static int createUniqueNumberedSaveDir( World world, String parentSubPath )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_createUniqueNumberedSaveDir != null )
|
||||
{
|
||||
try {
|
||||
return ((Integer)computerCraft_createUniqueNumberedSaveDir.invoke( null, world, parentSubPath )).intValue();
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file system mount that maps to a subfolder of the save directory for a given world, and returns it.<br>
|
||||
* Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a folder from the
|
||||
* users save directory onto a computers file system.<br>
|
||||
* @param world The world for which the save dir can be found. This should be the serverside world object.
|
||||
* @param subPath The folder path within the save directory that the mount should map to. eg: "computer/disk/42".<br>
|
||||
* Use createUniqueNumberedSaveDir() to create a new numbered folder to use.
|
||||
* @param capacity The ammount of data that can be stored in the directory before it fills up, in bytes.
|
||||
* @return The mount, or null if it could be created for some reason. Use IComputerAccess.mount() or IComputerAccess.mountWritable()
|
||||
* to mount this on a Computers' file system.
|
||||
* @see #createUniqueNumberedSaveDir(World, String)
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, dan200.computercraft.api.filesystem.IMount)
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount)
|
||||
* @see dan200.computercraft.api.filesystem.IMount
|
||||
* @see IWritableMount
|
||||
*/
|
||||
public static IWritableMount createSaveDirMount( World world, String subPath, long capacity )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_createSaveDirMount != null )
|
||||
{
|
||||
try {
|
||||
return (IWritableMount)computerCraft_createSaveDirMount.invoke( null, world, subPath, capacity );
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file system mount to a resource folder, and returns it.<br>
|
||||
* Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a resource folder onto a computers file system.<br>
|
||||
* The files in this mount will be a combination of files in the specified mod jar, and resource packs that contain resources with the same domain and path.<br>
|
||||
* @param modClass A class in whose jar to look first for the resources to mount. Using your main mod class is recommended. eg: MyMod.class
|
||||
* @param domain The domain under which to look for resources. eg: "mymod"
|
||||
* @param subPath The domain under which to look for resources. eg: "mymod/lua/myfiles"
|
||||
* @return The mount, or null if it could be created for some reason. Use IComputerAccess.mount() or IComputerAccess.mountWritable()
|
||||
* to mount this on a Computers' file system.
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, dan200.computercraft.api.filesystem.IMount)
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, IWritableMount)
|
||||
* @see dan200.computercraft.api.filesystem.IMount
|
||||
*/
|
||||
public static IMount createResourceMount( Class modClass, String domain, String subPath )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_createResourceMount != null )
|
||||
{
|
||||
try {
|
||||
return (IMount)computerCraft_createResourceMount.invoke( null, modClass, domain, subPath );
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a peripheral handler to convert blocks into IPeripheral implementations.
|
||||
* @see dan200.computercraft.api.peripheral.IPeripheral
|
||||
* @see dan200.computercraft.api.peripheral.IPeripheralProvider
|
||||
*/
|
||||
public static void registerPeripheralProvider( IPeripheralProvider handler )
|
||||
{
|
||||
findCC();
|
||||
if ( computerCraft_registerPeripheralProvider != null)
|
||||
{
|
||||
try {
|
||||
computerCraft_registerPeripheralProvider.invoke( null, handler );
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new turtle turtle for use in ComputerCraft. After calling this,
|
||||
* users should be able to craft Turtles with your new turtle. It is recommended to call
|
||||
* this during the load() method of your mod.
|
||||
* @see dan200.computercraft.api.turtle.ITurtleUpgrade
|
||||
*/
|
||||
public static void registerTurtleUpgrade( ITurtleUpgrade upgrade )
|
||||
{
|
||||
if( upgrade != null )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_registerTurtleUpgrade != null )
|
||||
{
|
||||
try {
|
||||
computerCraft_registerTurtleUpgrade.invoke( null, upgrade );
|
||||
} catch( Exception e ) {
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a bundled redstone handler to provide bundled redstone output for blocks
|
||||
* @see dan200.computercraft.api.redstone.IBundledRedstoneProvider
|
||||
*/
|
||||
public static void registerBundledRedstoneProvider( IBundledRedstoneProvider handler )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_registerBundledRedstoneProvider != null )
|
||||
{
|
||||
try {
|
||||
computerCraft_registerBundledRedstoneProvider.invoke( null, handler );
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If there is a Computer or Turtle at a certain position in the world, get it's bundled redstone output.
|
||||
* @see dan200.computercraft.api.redstone.IBundledRedstoneProvider
|
||||
* @return If there is a block capable of emitting bundled redstone at the location, it's signal (0-65535) will be returned.
|
||||
* If there is no block capable of emitting bundled redstone at the location, -1 will be returned.
|
||||
*/
|
||||
public static int getBundledRedstoneOutput( World world, int x, int y, int z, int side )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_getDefaultBundledRedstoneOutput != null )
|
||||
{
|
||||
try {
|
||||
return ((Integer)computerCraft_getDefaultBundledRedstoneOutput.invoke( null, world, x, y, z, side )).intValue();
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a media handler to provide IMedia implementations for Items
|
||||
* @see dan200.computercraft.api.media.IMediaProvider
|
||||
*/
|
||||
public static void registerMediaProvider( IMediaProvider handler )
|
||||
{
|
||||
findCC();
|
||||
if( computerCraft_registerMediaProvider != null )
|
||||
{
|
||||
try {
|
||||
computerCraft_registerMediaProvider.invoke( null, handler );
|
||||
} catch (Exception e){
|
||||
// It failed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The functions below here are private, and are used to interface with the non-API ComputerCraft classes.
|
||||
// Reflection is used here so you can develop your mod in MCP without decompiling ComputerCraft and including
|
||||
// it in your solution.
|
||||
|
||||
private static void findCC()
|
||||
{
|
||||
if( !ccSearched ) {
|
||||
try {
|
||||
computerCraft = Class.forName( "dan200.computercraft.ComputerCraft" );
|
||||
computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{
|
||||
World.class, String.class
|
||||
} );
|
||||
computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] {
|
||||
World.class, String.class, Long.TYPE
|
||||
} );
|
||||
computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] {
|
||||
Class.class, String.class, String.class
|
||||
} );
|
||||
computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] {
|
||||
IPeripheralProvider.class
|
||||
} );
|
||||
computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] {
|
||||
ITurtleUpgrade.class
|
||||
} );
|
||||
computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] {
|
||||
IBundledRedstoneProvider.class
|
||||
} );
|
||||
computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] {
|
||||
World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE
|
||||
} );
|
||||
computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] {
|
||||
IMediaProvider.class
|
||||
} );
|
||||
} catch( Exception e ) {
|
||||
System.out.println( "ComputerCraftAPI: ComputerCraft not found." );
|
||||
} finally {
|
||||
ccSearched = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Method findCCMethod( String name, Class[] args )
|
||||
{
|
||||
try {
|
||||
return computerCraft.getMethod( name, args );
|
||||
} catch( NoSuchMethodException e ) {
|
||||
System.out.println( "ComputerCraftAPI: ComputerCraft method " + name + " not found." );
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean ccSearched = false;
|
||||
private static Class computerCraft = null;
|
||||
private static Method computerCraft_createUniqueNumberedSaveDir = null;
|
||||
private static Method computerCraft_createSaveDirMount = null;
|
||||
private static Method computerCraft_createResourceMount = null;
|
||||
private static Method computerCraft_registerPeripheralProvider = null;
|
||||
private static Method computerCraft_registerTurtleUpgrade = null;
|
||||
private static Method computerCraft_registerBundledRedstoneProvider = null;
|
||||
private static Method computerCraft_getDefaultBundledRedstoneOutput = null;
|
||||
private static Method computerCraft_registerMediaProvider = null;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.filesystem;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a read only part of a virtual filesystem that can be mounted onto a computercraft using IComputerAccess.mount().
|
||||
* Ready made implementations of this interface can be created using ComputerCraftAPI.createSaveDirMount() or ComputerCraftAPI.createResourceMount(), or you're free to implement it yourselves!
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String)
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, IMount)
|
||||
* @see IWritableMount
|
||||
*/
|
||||
public interface IMount
|
||||
{
|
||||
/**
|
||||
* Returns whether a file with a given path exists or not.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
|
||||
* @return true if the file exists, false otherwise
|
||||
*/
|
||||
public boolean exists( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns whether a file with a given path is a directory or not.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms"
|
||||
* @return true if the file exists and is a directory, false otherwise
|
||||
*/
|
||||
public boolean isDirectory( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the file names of all the files in a directory.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms"
|
||||
* @param contents A list of strings. Add all the file names to this list
|
||||
*/
|
||||
public void list( String path, List<String> contents ) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the size of a file with a given path, in bytes
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
|
||||
* @return the size of the file, in bytes
|
||||
*/
|
||||
public long getSize( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Opens a file with a given path, and returns an inputstream representing it's contents.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
|
||||
* @return a stream representing the contents of the file
|
||||
*/
|
||||
public InputStream openForRead( String path ) throws IOException;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.filesystem;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* Represents a part of a virtual filesystem that can be mounted onto a computercraft using IComputerAccess.mount() or IComputerAccess.mountWritable(), that can also be written to.
|
||||
* Ready made implementations of this interface can be created using ComputerCraftAPI.createSaveDirMount(), or you're free to implement it yourselves!
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
|
||||
* @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, dan200.computercraft.api.filesystem.IMount)
|
||||
* @see dan200.computercraft.api.filesystem.IMount
|
||||
*/
|
||||
public interface IWritableMount extends IMount
|
||||
{
|
||||
/**
|
||||
* Creates a directory at a given path inside the virtual file system.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/mynewprograms"
|
||||
*/
|
||||
public void makeDirectory( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Deletes a directory at a given path inside the virtual file system.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myoldprograms"
|
||||
*/
|
||||
public void delete( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Opens a file with a given path, and returns an outputstream for writing to it.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
|
||||
* @return a stream for writing to
|
||||
*/
|
||||
public OutputStream openForWrite( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Opens a file with a given path, and returns an outputstream for appending to it.
|
||||
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
|
||||
* @return a stream for writing to
|
||||
*/
|
||||
public OutputStream openForAppend( String path ) throws IOException;
|
||||
|
||||
/**
|
||||
* Get the ammount of free space on the mount, in bytes. You should decrease this value as the user writes to the mount, and write operations should fail once it reaches zero.
|
||||
* @return The ammount of free space, in bytes.
|
||||
*/
|
||||
public long getRemainingSpace() throws IOException;
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.lua;
|
||||
|
||||
/**
|
||||
* An interface passed to peripherals and ILuaObjects' by computers or turtles, providing methods
|
||||
* that allow the peripheral call to wait for events before returning, just like in lua.
|
||||
* This is very useful if you need to signal work to be performed on the main thread, and don't want to return
|
||||
* until the work has been completed.
|
||||
*/
|
||||
public interface ILuaContext
|
||||
{
|
||||
/**
|
||||
* Wait for an event to occur on the computercraft, suspending the thread until it arises. This method is exactly equivalent to os.pullEvent() in lua.
|
||||
* @param filter A specific event to wait for, or null to wait for any event
|
||||
* @return An object array containing the name of the event that occurred, and any event parameters
|
||||
* @throws Exception If the user presses CTRL+T to terminate the current program while pullEvent() is waiting for an event, a "Terminated" exception will be thrown here.
|
||||
* Do not attempt to common this exception, unless you wish to prevent termination, which is not recommended.
|
||||
* @throws InterruptedException If the user shuts down or reboots the computercraft while pullEvent() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.
|
||||
*/
|
||||
public Object[] pullEvent( String filter ) throws Exception, InterruptedException;
|
||||
|
||||
/**
|
||||
* The same as pullEvent(), except "terminated" events are ignored. Only use this if you want to prevent program termination, which is not recommended. This method is exactly equivalent to os.pullEventRaw() in lua.
|
||||
* @param filter A specific event to wait for, or null to wait for any event
|
||||
* @return An object array containing the name of the event that occurred, and any event parameters
|
||||
* @throws InterruptedException If the user shuts down or reboots the computercraft while pullEventRaw() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.
|
||||
* @see #pullEvent(String)
|
||||
*/
|
||||
public Object[] pullEventRaw( String filter ) throws InterruptedException;
|
||||
|
||||
|
||||
/**
|
||||
* Yield the current coroutine with some arguments until it is resumed. This method is exactly equivalent to coroutine.yield() in lua. Use pullEvent() if you wish to wait for events.
|
||||
* @param arguments An object array containing the arguments to pass to coroutine.yield()
|
||||
* @return An object array containing the return values from coroutine.yield()
|
||||
* @throws InterruptedException If the user shuts down or reboots the computercraft the coroutine is suspended, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.
|
||||
* @see #pullEvent(String)
|
||||
*/
|
||||
public Object[] yield( Object[] arguments ) throws InterruptedException;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.lua;
|
||||
|
||||
/**
|
||||
* An interface for representing custom objects returned by IPeripheral.callMethod() calls.
|
||||
* Return objects implementing this interface to expose objects with methods to lua.
|
||||
*/
|
||||
public interface ILuaObject
|
||||
{
|
||||
/**
|
||||
* Get the names of the methods that this object implements. This works the same as IPeripheral.getMethodNames(). See that method for detailed documentation.
|
||||
* @see dan200.computercraft.api.peripheral.IPeripheral#getMethodNames()
|
||||
*/
|
||||
public String[] getMethodNames();
|
||||
|
||||
/**
|
||||
* Called when a user calls one of the methods that this object implements. This works the same as IPeripheral.callMethod(). See that method for detailed documentation.
|
||||
* @see dan200.computercraft.api.peripheral.IPeripheral#callMethod(dan200.computercraft.api.peripheral.IComputerAccess, ILuaContext, int, Object[])
|
||||
*/
|
||||
public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws Exception;
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.media;
|
||||
|
||||
import dan200.computercraft.api.filesystem.IMount;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Represents an item that can be placed in a disk drive and used by a Computer.
|
||||
* Implement this interface on your Item class to allow it to be used in the drive.
|
||||
*/
|
||||
public interface IMedia
|
||||
{
|
||||
/**
|
||||
* Get a string representing the label of this item. Will be called vi disk.getLabel() in lua.
|
||||
* @param stack The itemstack to inspect
|
||||
* @return The label. ie: "Dan's Programs"
|
||||
*/
|
||||
public String getLabel( ItemStack stack );
|
||||
|
||||
/**
|
||||
* Set a string representing the label of this item. Will be called vi disk.setLabel() in lua.
|
||||
* @param stack The itemstack to modify.
|
||||
* @param label The string to set the label to.
|
||||
* @return true if the label was updated, false if the label may not be modified.
|
||||
*/
|
||||
public boolean setLabel( ItemStack stack, String label );
|
||||
|
||||
/**
|
||||
* If this disk represents an item with audio (like a record), get the readable name of the audio track. ie: "Jonathon Coulton - Still Alive"
|
||||
* @param stack The itemstack to inspect.
|
||||
* @return The name, or null if this item does not represent an item with audio.
|
||||
*/
|
||||
public String getAudioTitle( ItemStack stack );
|
||||
|
||||
/**
|
||||
* If this disk represents an item with audio (like a record), get the resource name of the audio track to play.
|
||||
* @param stack The itemstack to inspect.
|
||||
* @return The name, or null if this item does not represent an item with audio.
|
||||
*/
|
||||
public String getAudioRecordName( ItemStack stack );
|
||||
|
||||
/**
|
||||
* If this disk represents an item with data (like a floppy disk), get a mount representing it's contents. This will be mounted onto the filesystem of the computercraft while the media is in the disk drive.
|
||||
* @param stack The itemstack to inspect.
|
||||
* @param world The world in which the item and disk drive reside.
|
||||
* @return The mount, or null if this item does not represent an item with data. If the IMount returned also implements IWritableMount, it will mounted using mountWritable()
|
||||
* @see dan200.computercraft.api.filesystem.IMount
|
||||
* @see dan200.computercraft.api.filesystem.IWritableMount
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String, long)
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String)
|
||||
*/
|
||||
public IMount createDataMount( ItemStack stack, World world );
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.media;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* This interface is used to provide IMedia implementations for ItemStack
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider)
|
||||
*/
|
||||
public interface IMediaProvider
|
||||
{
|
||||
/**
|
||||
* Produce an IMedia implementation from an ItemStack.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider)
|
||||
* @return an IMedia implementation, or null if the item is not something you wish to handle
|
||||
*/
|
||||
public IMedia getMedia( ItemStack stack );
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.peripheral;
|
||||
|
||||
import dan200.computercraft.api.filesystem.IMount;
|
||||
import dan200.computercraft.api.filesystem.IWritableMount;
|
||||
|
||||
/**
|
||||
* The interface passed to peripherals by computers or turtles, providing methods
|
||||
* that they can call. This should not be implemented by your classes. Do not interact
|
||||
* with computers except via this interface.
|
||||
*/
|
||||
public interface IComputerAccess
|
||||
{
|
||||
/**
|
||||
* Mount a mount onto the computers' file system in a read only mode.<br>
|
||||
* @param desiredLocation The location on the computercraft's file system where you would like the mount to be mounted.
|
||||
* @param mount The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount(), ComputerCraftAPI.createResourceMount() or by creating your own objects that implement the IMount interface.
|
||||
* @return The location on the computercraft's file system where you the mount mounted, or null if there was already a file in the desired location. Store this value if you wish to unmount the mount later.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String)
|
||||
* @see #mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount)
|
||||
* @see #unmount(String)
|
||||
* @see dan200.computercraft.api.filesystem.IMount
|
||||
*/
|
||||
public String mount( String desiredLocation, IMount mount );
|
||||
|
||||
/**
|
||||
* Mount a mount onto the computers' file system in a writable mode.<br>
|
||||
* @param desiredLocation The location on the computercraft's file system where you would like the mount to be mounted.
|
||||
* @param mount The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount() or by creating your own objects that implement the IWritableMount interface.
|
||||
* @return The location on the computercraft's file system where you the mount mounted, or null if there was already a file in the desired location. Store this value if you wish to unmount the mount later.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String)
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String)
|
||||
* @see #mount(String, IMount)
|
||||
* @see #unmount(String)
|
||||
* @see IMount
|
||||
*/
|
||||
public String mountWritable( String desiredLocation, IWritableMount mount );
|
||||
|
||||
/**
|
||||
* Unmounts a directory previously mounted onto the computers file system by mount() or mountWritable().<br>
|
||||
* When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to
|
||||
* access it. All directories mounted by a mount or mountWritable are automatically unmounted when the peripheral
|
||||
* is attached if they have not been explicitly unmounted.
|
||||
* @param location The desired location in the computers file system of the directory to unmount.
|
||||
* This must be the location of a directory previously mounted by mount() or mountWritable(), as
|
||||
* indicated by their return value.
|
||||
* @see #mount(String, IMount)
|
||||
* @see #mountWritable(String, IWritableMount)
|
||||
*/
|
||||
public void unmount( String location );
|
||||
|
||||
/**
|
||||
* Returns the numerical ID of this computercraft.<br>
|
||||
* This is the same number obtained by calling os.getComputerID() or running the "id" program from lua,
|
||||
* and is guarunteed unique. This number will be positive.
|
||||
* @return The identifier.
|
||||
*/
|
||||
public int getID();
|
||||
|
||||
/**
|
||||
* Causes an event to be raised on this computercraft, which the computercraft can respond to by calling
|
||||
* os.pullEvent(). This can be used to notify the computercraft when things happen in the world or to
|
||||
* this peripheral.
|
||||
* @param event A string identifying the type of event that has occurred, this will be
|
||||
* returned as the first value from os.pullEvent(). It is recommended that you
|
||||
* you choose a name that is unique, and recognisable as originating from your
|
||||
* peripheral. eg: If your peripheral type is "button", a suitable event would be
|
||||
* "button_pressed".
|
||||
* @param arguments In addition to a name, you may pass an array of extra arguments to the event, that will
|
||||
* be supplied as extra return values to os.pullEvent(). Objects in the array will be converted
|
||||
* to lua data types in the same fashion as the return values of IPeripheral.callMethod().<br>
|
||||
* You may supply null to indicate that no arguments are to be supplied.
|
||||
* @see dan200.computercraft.api.peripheral.IPeripheral#callMethod
|
||||
*/
|
||||
public void queueEvent( String event, Object[] arguments );
|
||||
|
||||
/**
|
||||
* Get a string, unique to the computercraft, by which the computercraft refers to this peripheral.
|
||||
* For directly attached peripherals this will be "left","right","front","back",etc, but
|
||||
* for peripherals attached remotely it will be different. It is good practice to supply
|
||||
* this string when raising events to the computercraft, so that the computercraft knows from
|
||||
* which peripheral the event came.
|
||||
* @return A string unique to the computercraft, but not globally.
|
||||
*/
|
||||
public String getAttachmentName();
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.peripheral;
|
||||
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
|
||||
/**
|
||||
* The interface that defines a peripheral. This should be implemented by the
|
||||
* TileEntity of any common that you wish to be interacted with by
|
||||
* computercraft or turtle.
|
||||
*/
|
||||
public interface IPeripheral
|
||||
{
|
||||
/**
|
||||
* Should return a string that uniquely identifies this type of peripheral.
|
||||
* This can be queried from lua by calling peripheral.getType()
|
||||
* @return A string identifying the type of peripheral.
|
||||
*/
|
||||
public String getType();
|
||||
|
||||
/**
|
||||
* Should return an array of strings that identify the methods that this
|
||||
* peripheral exposes to Lua. This will be called once before each attachment,
|
||||
* and should not change when called multiple times.
|
||||
* @return An array of strings representing method names.
|
||||
* @see #callMethod
|
||||
*/
|
||||
public String[] getMethodNames();
|
||||
|
||||
/**
|
||||
* This is called when a lua program on an attached computercraft calls peripheral.call() with
|
||||
* one of the methods exposed by getMethodNames().<br>
|
||||
* <br>
|
||||
* Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe
|
||||
* when interacting with minecraft objects.
|
||||
* @param computer The interface to the computercraft that is making the call. Remember that multiple
|
||||
* computers can be attached to a peripheral at once.
|
||||
* @param context The context of the currently running lua thread. This can be used to wait for events
|
||||
* or otherwise yield.
|
||||
* @param method An integer identifying which of the methods from getMethodNames() the computercraft
|
||||
* wishes to call. The integer indicates the index into the getMethodNames() table
|
||||
* that corresponds to the string passed into peripheral.call()
|
||||
* @param arguments An array of objects, representing the arguments passed into peripheral.call().<br>
|
||||
* Lua values of type "string" will be represented by Object type String.<br>
|
||||
* Lua values of type "number" will be represented by Object type Double.<br>
|
||||
* Lua values of type "boolean" will be represented by Object type Boolean.<br>
|
||||
* Lua values of any other type will be represented by a null object.<br>
|
||||
* This array will be empty if no arguments are passed.
|
||||
* @return An array of objects, representing values you wish to return to the lua program.<br>
|
||||
* Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br>
|
||||
* All other types will be converted to nil.<br>
|
||||
* You may return null to indicate no values should be returned.
|
||||
* @throws Exception If you throw any exception from this function, a lua error will be raised with the
|
||||
* same message as your exception. Use this to throw appropriate errors if the wrong
|
||||
* arguments are supplied to your method.
|
||||
* @see #getMethodNames
|
||||
*/
|
||||
public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws Exception;
|
||||
|
||||
/**
|
||||
* Is called when canAttachToSide has returned true, and a computercraft is attaching to the peripheral.
|
||||
* This will occur when a peripheral is placed next to an active computercraft, when a computercraft is turned on next to a peripheral,
|
||||
* or when a turtle travels into a square next to a peripheral.
|
||||
* Between calls to attach() and detach(), the attached computercraft can make method calls on the peripheral using peripheral.call().
|
||||
* This method can be used to keep track of which computers are attached to the peripheral, or to take action when attachment
|
||||
* occurs.<br>
|
||||
* <br>
|
||||
* Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe
|
||||
* when interacting with minecraft objects.
|
||||
* @param computer The interface to the computercraft that is being attached. Remember that multiple
|
||||
* computers can be attached to a peripheral at once.
|
||||
* @see #detach
|
||||
*/
|
||||
public void attach( IComputerAccess computer );
|
||||
|
||||
/**
|
||||
* Is called when a computercraft is detaching from the peripheral.
|
||||
* This will occur when a computercraft shuts down, when the peripheral is removed while attached to computers,
|
||||
* or when a turtle moves away from a square attached to a peripheral.
|
||||
* This method can be used to keep track of which computers are attached to the peripheral, or to take action when detachment
|
||||
* occurs.<br>
|
||||
* <br>
|
||||
* Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe
|
||||
* when interacting with minecraft objects.
|
||||
* @param computer The interface to the computercraft that is being detached. Remember that multiple
|
||||
* computers can be attached to a peripheral at once.
|
||||
* @see #detach
|
||||
*/
|
||||
public void detach( IComputerAccess computer );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public boolean equals( IPeripheral other );
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.peripheral;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* This interface is used to create peripheral implementations for blocks
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider)
|
||||
*/
|
||||
public interface IPeripheralProvider
|
||||
{
|
||||
/**
|
||||
* Produce an peripheral implementation from a block location.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider)
|
||||
* @return a peripheral, or null if there is not a peripheral here you'd like to handle.
|
||||
*/
|
||||
public IPeripheral getPeripheral( World world, int x, int y, int z, int side );
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.redstone;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* This interface is used to provide bundled redstone output for blocks
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider)
|
||||
*/
|
||||
public interface IBundledRedstoneProvider
|
||||
{
|
||||
/**
|
||||
* Produce an bundled redstone output from a block location.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider)
|
||||
* @return a number in the range 0-65535 to indicate this block is providing output, or -1 if you do not wish to handle this block
|
||||
*/
|
||||
public int getBundledRedstoneOutput( World world, int x, int y, int z, int side );
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* The interface passed to turtle by turtles, providing methods that they can call.
|
||||
* This should not be implemented by your classes. Do not interact with turtles except via this interface and ITurtleUpgrade.
|
||||
*/
|
||||
public interface ITurtleAccess
|
||||
{
|
||||
/**
|
||||
* Returns the world in which the turtle resides.
|
||||
* @return the world in which the turtle resides.
|
||||
*/
|
||||
public World getWorld();
|
||||
|
||||
/**
|
||||
* Returns a vector containing the integer co-ordinates at which the turtle resides.
|
||||
* @return a vector containing the integer co-ordinates at which the turtle resides.
|
||||
*/
|
||||
public ChunkCoordinates getPosition();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public boolean teleportTo( World world, int x, int y, int z );
|
||||
|
||||
/**
|
||||
* Returns a vector containing the floating point co-ordinates at which the turtle is rendered.
|
||||
* This will shift when the turtle is moving.
|
||||
* @param f The subframe fraction
|
||||
* @return a vector containing the floating point co-ordinates at which the turtle resides.
|
||||
*/
|
||||
public Vec3 getVisualPosition( float f );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public float getVisualYaw( float f );
|
||||
|
||||
/**
|
||||
* Returns the world direction the turtle is currently facing.
|
||||
* @return the world direction the turtle is currently facing.
|
||||
*/
|
||||
public int getDirection();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void setDirection( int dir );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public int getSelectedSlot();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void setSelectedSlot( int slot );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public IInventory getInventory();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public boolean isFuelNeeded();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public int getFuelLevel();
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void setFuelLevel( int fuel );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public int getFuelLimit();
|
||||
|
||||
/**
|
||||
* Removes some fuel from the turtles fuel supply. Negative numbers can be passed in to INCREASE the fuel level of the turtle.
|
||||
* @return Whether the turtle was able to consume the ammount of fuel specified. Will return false if you supply a number
|
||||
* greater than the current fuel level of the turtle.
|
||||
*/
|
||||
public boolean consumeFuel( int fuel );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void addFuel( int fuel );
|
||||
|
||||
/**
|
||||
* Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed
|
||||
* on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up
|
||||
* with the turtles standard movement and tool commands. An issued command will return an unique integer, which will
|
||||
* be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the
|
||||
* lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality.
|
||||
* @param command an object which will execute the custom command when its point in the queue is reached
|
||||
* @return the objects the command returned when executed. you should probably return these to the player
|
||||
* unchanged if called from a peripheral method.
|
||||
* @see ITurtleCommand
|
||||
*/
|
||||
public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws Exception;
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void playAnimation( TurtleAnimation animation );
|
||||
|
||||
/**
|
||||
* Returns the turtle on the specified side of the turtle, if there is one.
|
||||
* @return the turtle on the specified side of the turtle, if there is one.
|
||||
*/
|
||||
public ITurtleUpgrade getUpgrade( TurtleSide side );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void setUpgrade( TurtleSide side, ITurtleUpgrade upgrade );
|
||||
|
||||
/**
|
||||
* Returns the peripheral created by the upgrade on the specified side of the turtle, if there is one.
|
||||
* @return the peripheral created by the upgrade on the specified side of the turtle, if there is one.
|
||||
*/
|
||||
public IPeripheral getPeripheral( TurtleSide side );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public NBTTagCompound getUpgradeNBTData( TurtleSide side );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void updateUpgradeNBTData( TurtleSide side );
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
/**
|
||||
* An interface for objects executing custom turtle commands, used with ITurtleAccess.issueCommand
|
||||
* @see ITurtleAccess#issueCommand(ITurtleCommand)
|
||||
*/
|
||||
public interface ITurtleCommand
|
||||
{
|
||||
/**
|
||||
* Will be called by the turtle on the main thread when it is time to execute the custom command.
|
||||
* The handler should either perform the work of the command, and return success, or return
|
||||
* failure with an error message to indicate the command cannot be executed at this time.
|
||||
* @param turtle access to the turtle for whom the command was issued
|
||||
* @return TurtleCommandResult.success() or TurtleCommandResult.failure( errorMessage )
|
||||
* @see ITurtleAccess#issueCommand(ITurtleCommand)
|
||||
* @see dan200.computercraft.api.turtle.TurtleCommandResult
|
||||
*/
|
||||
public TurtleCommandResult execute( ITurtleAccess turtle );
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
/**
|
||||
* The primary interface for defining an turtle for Turtles. A turtle turtle
|
||||
* can either be a new tool, or a new peripheral.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerUpgrade( ITurtleUpgrade )
|
||||
*/
|
||||
public interface ITurtleUpgrade
|
||||
{
|
||||
/**
|
||||
* Gets a unique numerical identifier representing this type of turtle turtle.
|
||||
* Like Minecraft common and item IDs, you should strive to make this number unique
|
||||
* among all turtle turtle that have been released for ComputerCraft.
|
||||
* The ID must be in the range 64 to 255, as the ID is stored as an 8-bit value,
|
||||
* and 0-64 is reserved for future use by ComputerCraft. The turtle will
|
||||
* fail registration if an already used ID is specified.
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerUpgrade( ITurtleUpgrade )
|
||||
*/
|
||||
public int getUpgradeID();
|
||||
|
||||
/**
|
||||
* Return a String to describe this type of turtle in turtle item names.
|
||||
* Examples of built-in adjectives are "Wireless", "Mining" and "Crafty".
|
||||
*/
|
||||
public String getAdjective();
|
||||
|
||||
/**
|
||||
* Return whether this turtle adds a tool or a peripheral to the turtle.
|
||||
* Currently, turtle crafting is restricted to one tool & one peripheral per turtle.
|
||||
* @see TurtleUpgradeType for the differences between the two.
|
||||
*/
|
||||
public TurtleUpgradeType getType();
|
||||
|
||||
/**
|
||||
* Return an item stack representing the type of item that a turtle must be crafted
|
||||
* with to create a turtle which holds this turtle.
|
||||
* Currently, turtle crafting is restricted to one tool & one peripheral per turtle.
|
||||
*/
|
||||
public ItemStack getCraftingItem();
|
||||
|
||||
/**
|
||||
* Will only be called for Peripheral turtle. Creates a peripheral for a turtle
|
||||
* being placed using this turtle. The peripheral created will be stored
|
||||
* for the lifetime of the turtle, will have update() called once-per-tick, and will be
|
||||
* attach'd detach'd and have methods called in the same manner as a Computer peripheral.
|
||||
*
|
||||
* @param turtle Access to the turtle that the peripheral is being created for.
|
||||
* @param side Which side of the turtle (left or right) that the turtle resides on.
|
||||
* @return The newly created peripheral. You may return null if this turtle is a Tool
|
||||
* and this method is not expected to be called.
|
||||
*/
|
||||
public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side );
|
||||
|
||||
/**
|
||||
* Will only be called for Tool turtle. Called when turtle.dig() or turtle.attack() is called
|
||||
* by the turtle, and the tool is required to do some work.
|
||||
* @param turtle Access to the turtle that the tool resides on.
|
||||
* @param side Which side of the turtle (left or right) the tool resides on.
|
||||
* @param verb Which action (dig or attack) the turtle is being called on to perform.
|
||||
* @param direction Which world direction the action should be performed in, relative to the turtles
|
||||
* position. This will either be up, down, or the direction the turtle is facing, depending on
|
||||
* whether dig, digUp or digDown was called.
|
||||
* @return Whether the turtle was able to perform the action, and hence whether the turtle.dig()
|
||||
* or turtle.attack() lua method should return true. If true is returned, the tool will perform
|
||||
* a swinging animation. You may return null if this turtle is a Peripheral
|
||||
* and this method is not expected to be called.
|
||||
*/
|
||||
public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, int direction );
|
||||
|
||||
/**
|
||||
* Called to obtain the Icon to be used when rendering a turtle peripheral. Needs to be a "common"
|
||||
* type Icon for now, as there is no way to determine which texture sheet an Icon is from by the
|
||||
* Icon itself.
|
||||
* @param turtle Access to the turtle that the peripheral resides on.
|
||||
* @param side Which side of the turtle (left or right) the peripheral resides on.
|
||||
* @return The Icon that you wish to be used to render your turtle peripheral.
|
||||
*/
|
||||
public Icon getIcon( ITurtleAccess turtle, TurtleSide side );
|
||||
|
||||
/**
|
||||
* TODO: Document me
|
||||
*/
|
||||
public void update( ITurtleAccess turtle, TurtleSide side );
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
public enum TurtleAnimation
|
||||
{
|
||||
None,
|
||||
MoveForward,
|
||||
MoveBack,
|
||||
MoveUp,
|
||||
MoveDown,
|
||||
TurnLeft,
|
||||
TurnRight,
|
||||
SwingLeftTool,
|
||||
SwingRightTool,
|
||||
Wait,
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
public final class TurtleCommandResult
|
||||
{
|
||||
private static final TurtleCommandResult s_success = new TurtleCommandResult( true, null );
|
||||
private static final TurtleCommandResult s_emptyFailure = new TurtleCommandResult( false, null );
|
||||
|
||||
public static TurtleCommandResult success()
|
||||
{
|
||||
return s_success;
|
||||
}
|
||||
|
||||
public static TurtleCommandResult failure()
|
||||
{
|
||||
return failure( null );
|
||||
}
|
||||
|
||||
public static TurtleCommandResult failure( String errorMessage )
|
||||
{
|
||||
if( errorMessage != null )
|
||||
{
|
||||
return new TurtleCommandResult( false, errorMessage );
|
||||
}
|
||||
else
|
||||
{
|
||||
return s_emptyFailure;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean m_success;
|
||||
private final String m_errorMessage;
|
||||
|
||||
private TurtleCommandResult( boolean success, String errorMessage )
|
||||
{
|
||||
m_success = success;
|
||||
m_errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public boolean isSuccess()
|
||||
{
|
||||
return m_success;
|
||||
}
|
||||
|
||||
public String getErrorMessage()
|
||||
{
|
||||
return m_errorMessage;
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
/**
|
||||
* An enum representing the two sides of the turtle that a turtle turtle might reside.
|
||||
*/
|
||||
public enum TurtleSide
|
||||
{
|
||||
/**
|
||||
* The turtles left side (where the pickaxe usually is on a Wireless Mining Turtle)
|
||||
*/
|
||||
Left,
|
||||
|
||||
/**
|
||||
* The turtles right side (where the modem usually is on a Wireless Mining Turtle)
|
||||
*/
|
||||
Right,
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
/**
|
||||
* An enum representing the two different types of turtle that an ITurtleUpgrade
|
||||
* implementation can add to a turtle.
|
||||
* @see ITurtleUpgrade
|
||||
*/
|
||||
public enum TurtleUpgradeType
|
||||
{
|
||||
/**
|
||||
* A tool is rendered as an item on the side of the turtle, and responds to the turtle.dig()
|
||||
* and turtle.attack() methods (Such as pickaxe or sword on Mining and Melee turtles).
|
||||
*/
|
||||
Tool,
|
||||
|
||||
/**
|
||||
* A peripheral adds a special peripheral which is attached to the side of the turtle,
|
||||
* and can be interacted with the peripheral API (Such as the modem on Wireless Turtles).
|
||||
*/
|
||||
Peripheral,
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* This file is part of the public ComputerCraft API - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2014. This API may be redistributed unmodified and in full only.
|
||||
* For help using the API, and posting your mods, visit the forums at computercraft.info.
|
||||
*/
|
||||
|
||||
package dan200.computercraft.api.turtle;
|
||||
|
||||
/**
|
||||
* An enum representing the two different actions that an ITurtleUpgrade of type
|
||||
* Tool may be called on to perform by a turtle.
|
||||
* @see ITurtleUpgrade
|
||||
* @see ITurtleUpgrade#useTool
|
||||
*/
|
||||
public enum TurtleVerb
|
||||
{
|
||||
/**
|
||||
* The turtle called turtle.dig(), turtle.digUp() or turtle.digDown()
|
||||
*/
|
||||
Dig,
|
||||
|
||||
/**
|
||||
* The turtle called turtle.attack(), turtle.attackUp() or turtle.attackDown()
|
||||
*/
|
||||
Attack,
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
This ComputerCraft 1.63 API as provided by its author.
|
||||
Those are only needed for compilation.
|
||||
Do not include those binaries in the mod package!
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
public class BlockMetaRotation
|
||||
{
|
|
@ -1,7 +1,8 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import cr0s.WarpDrive.data.CloakedArea;
|
||||
|
||||
import cr0s.warpdrive.data.CloakedArea;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
|
@ -1,11 +1,11 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cr0s.WarpDrive.data.Vector3;
|
||||
import cr0s.WarpDrive.render.EntityCamera;
|
||||
import cr0s.WarpDrive.world.EntitySphereGen;
|
||||
import cr0s.WarpDrive.world.EntityStarCore;
|
||||
import cr0s.warpdrive.data.Vector3;
|
||||
import cr0s.warpdrive.render.EntityCamera;
|
||||
import cr0s.warpdrive.world.EntitySphereGen;
|
||||
import cr0s.warpdrive.world.EntityStarCore;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
1231
src/java/cr0s/warpdrive/EntityJump.java
Normal file
1231
src/java/cr0s/warpdrive/EntityJump.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import java.util.Stack;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -21,10 +21,10 @@ import cpw.mods.fml.common.network.IPacketHandler;
|
|||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cr0s.WarpDrive.data.Vector3;
|
||||
import cr0s.WarpDrive.machines.TileEntityCamera;
|
||||
import cr0s.WarpDrive.machines.TileEntityLaser;
|
||||
import cr0s.WarpDrive.machines.TileEntityMonitor;
|
||||
import cr0s.warpdrive.data.Vector3;
|
||||
import cr0s.warpdrive.machines.TileEntityCamera;
|
||||
import cr0s.warpdrive.machines.TileEntityLaser;
|
||||
import cr0s.warpdrive.machines.TileEntityMonitor;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
|
||||
public class PacketHandler implements IPacketHandler {
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import ic2.api.item.Items;
|
||||
|
||||
|
@ -6,9 +6,9 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cr0s.WarpDrive.data.CloakedArea;
|
||||
import cr0s.WarpDrive.world.SpaceTeleporter;
|
||||
import cr0s.WarpDrive.api.IBreathingHelmet;
|
||||
import cr0s.warpdrive.api.IBreathingHelmet;
|
||||
import cr0s.warpdrive.data.CloakedArea;
|
||||
import cr0s.warpdrive.world.SpaceTeleporter;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDriveCore;
|
||||
package cr0s.warpdriveCore;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDriveCore;
|
||||
package cr0s.warpdriveCore;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDriveCore;
|
||||
package cr0s.warpdriveCore;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
652
src/java/cr0s/warpdrive/WarpDrive.java
Normal file
652
src/java/cr0s/warpdrive/WarpDrive.java
Normal file
|
@ -0,0 +1,652 @@
|
|||
package cr0s.warpdrive;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import cr0s.warpdrive.block.*;
|
||||
import cr0s.warpdrive.command.*;
|
||||
import cr0s.warpdrive.data.*;
|
||||
import cr0s.warpdrive.item.*;
|
||||
import cr0s.warpdrive.machines.*;
|
||||
import cr0s.warpdrive.render.*;
|
||||
import cr0s.warpdrive.world.*;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.EnumHelper;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
@Mod(modid = "WarpDrive", name = "WarpDrive", version = "1.2.7.0",
|
||||
dependencies = "required-after:IC2;"
|
||||
+ " required-after:CoFHCore;"
|
||||
+ " after:ComputerCraft;"
|
||||
+ " after:OpenComputer;"
|
||||
+ " after:CCTurtle;"
|
||||
+ " after:gregtech_addon;"
|
||||
+ " required-after:AppliedEnergistics;"
|
||||
+ " after:AdvancedSolarPanel;"
|
||||
+ " after:AtomicScience;"
|
||||
+ " after:ICBM|Explosion;"
|
||||
+ " after:MFFS;"
|
||||
+ " after:GraviSuite;"
|
||||
+ " after:UndergroundBiomes;"
|
||||
+ " after:NetherOres")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = true, channels = {
|
||||
"WarpDriveBeam",
|
||||
"WarpDriveFreq",
|
||||
"WarpDriveLaserT",
|
||||
"WarpDriveCloaks" }, packetHandler = PacketHandler.class)
|
||||
/**
|
||||
* @author Cr0s
|
||||
*/
|
||||
public class WarpDrive implements LoadingCallback {
|
||||
public static Block warpCore;
|
||||
public static Block protocolBlock;
|
||||
public static Block radarBlock;
|
||||
public static Block isolationBlock;
|
||||
public static Block airgenBlock;
|
||||
public static Block laserBlock;
|
||||
public static Block laserCamBlock;
|
||||
public static Block cameraBlock;
|
||||
public static Block monitorBlock;
|
||||
public static Block boosterBlock;
|
||||
public static Block miningLaserBlock;
|
||||
public static Block liftBlock;
|
||||
public static Block scannerBlock;
|
||||
public static Block cloakBlock;
|
||||
public static Block cloakCoilBlock;
|
||||
|
||||
public static Block airBlock;
|
||||
public static Block gasBlock;
|
||||
|
||||
public static Block iridiumBlock;
|
||||
|
||||
public static ItemWarpComponent componentItem;
|
||||
|
||||
public static EnumArmorMaterial armorMaterial = EnumHelper.addArmorMaterial("WARP", 5, new int[]{1, 3, 2, 1}, 15);
|
||||
public static ItemWarpArmor helmetItem;
|
||||
public static ItemWarpAirCanister airCanisterItem;
|
||||
|
||||
public static BiomeGenBase spaceBiome;
|
||||
public World space;
|
||||
public SpaceWorldGenerator spaceWorldGenerator;
|
||||
public HyperSpaceWorldGenerator hyperSpaceWorldGenerator;
|
||||
public World hyperSpace;
|
||||
|
||||
// Client settings
|
||||
public static float normalFOV = 70.0F;
|
||||
public static float normalSensitivity = 1.0F;
|
||||
|
||||
public static CreativeTabs warpdriveTab = new WarpDriveCreativeTab("Warpdrive", "Warpdrive").setBackgroundImageName("warpdrive:creativeTab");
|
||||
|
||||
@Instance("WarpDrive")
|
||||
public static WarpDrive instance;
|
||||
@SidedProxy(clientSide = "cr0s.warpdrive.client.ClientProxy", serverSide = "cr0s.warpdrive.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static WarpCoresRegistry warpCores;
|
||||
public static JumpgatesRegistry jumpgates;
|
||||
public static CloakManager cloaks;
|
||||
|
||||
public static CamRegistry cams;
|
||||
public boolean isOverlayEnabled = false;
|
||||
public int overlayType = 0;
|
||||
public String debugMessage = "";
|
||||
|
||||
public static WarpDrivePeripheralHandler peripheralHandler = null;
|
||||
|
||||
public static String defHelpStr = "help(\"functionName\"): returns help for the function specified";
|
||||
public static String defEnergyStr = "getEnergyLevel(): returns currently contained energy, max contained energy";
|
||||
public static String defUpgradeStr = "upgrades(): returns a list of currently installed upgrades";
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
WarpDriveConfig.preInit(new Configuration(event.getSuggestedConfigurationFile()));
|
||||
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
// System.out.println("[WarpDrive] Registering sounds event handler...");
|
||||
MinecraftForge.EVENT_BUS.register(new SoundHandler());
|
||||
|
||||
normalFOV = mc.gameSettings.fovSetting;
|
||||
normalSensitivity = mc.gameSettings.mouseSensitivity;
|
||||
WarpDrive.print("[WarpDrive] FOV is " + normalFOV + " Sensitivity is " + normalSensitivity);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
}
|
||||
|
||||
public static void print(String out) {
|
||||
System.out.println((FMLCommonHandler.instance().getEffectiveSide().isClient() ? "Client ":"Server ") + out);
|
||||
}
|
||||
|
||||
public static void debugPrint(String out) {
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
print(out);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
WarpDriveConfig.load();
|
||||
|
||||
// CORE CONTROLLER
|
||||
protocolBlock = new BlockProtocol(WarpDriveConfig.controllerID,0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(protocolBlock, "protocolBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityProtocol.class, "protocolBlock");
|
||||
|
||||
// WARP CORE
|
||||
warpCore = new BlockReactor(WarpDriveConfig.coreID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(warpCore, "warpCore");
|
||||
GameRegistry.registerTileEntity(TileEntityReactor.class, "warpCore");
|
||||
|
||||
// WARP RADAR
|
||||
radarBlock = new BlockRadar(WarpDriveConfig.radarID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(radarBlock, "radarBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityRadar.class, "radarBlock");
|
||||
|
||||
// WARP ISOLATION
|
||||
isolationBlock = new BlockWarpIsolation( WarpDriveConfig.isolationID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(isolationBlock, "isolationBlock");
|
||||
|
||||
// AIR GENERATOR
|
||||
airgenBlock = new BlockAirGenerator(WarpDriveConfig.airgenID, 0,Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(airgenBlock, "airgenBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityAirGenerator.class, "airgenBlock");
|
||||
|
||||
|
||||
// AIR BLOCK
|
||||
airBlock = (new BlockAir(WarpDriveConfig.airID));
|
||||
|
||||
GameRegistry.registerBlock(airBlock, "airBlock");
|
||||
|
||||
// GAS BLOCK
|
||||
gasBlock = (new BlockGas(WarpDriveConfig.gasID));
|
||||
|
||||
GameRegistry.registerBlock(gasBlock, "gasBlock");
|
||||
|
||||
// LASER EMITTER
|
||||
laserBlock = new BlockLaser(WarpDriveConfig.laserID, 0,Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(laserBlock, "laserBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityLaser.class, "laserBlock");
|
||||
|
||||
// LASER EMITTER WITH CAMERA
|
||||
laserCamBlock = new BlockLaserCam(WarpDriveConfig.laserCamID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(laserCamBlock, "laserCamBlock");
|
||||
|
||||
// CAMERA
|
||||
cameraBlock = new BlockCamera(WarpDriveConfig.camID, 0,Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(cameraBlock, "cameraBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityCamera.class, "cameraBlock");
|
||||
|
||||
// MONITOR
|
||||
monitorBlock = new BlockMonitor(WarpDriveConfig.monitorID);
|
||||
|
||||
GameRegistry.registerBlock(monitorBlock, "monitorBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityMonitor.class, "monitorBlock");
|
||||
|
||||
|
||||
// MINING LASER
|
||||
miningLaserBlock = new BlockMiningLaser(WarpDriveConfig.miningLaserID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(miningLaserBlock, "miningLaserBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityMiningLaser.class, "miningLaserBlock");
|
||||
|
||||
// PARTICLE BOOSTER
|
||||
boosterBlock = new BlockParticleBooster(WarpDriveConfig.particleBoosterID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(boosterBlock, "boosterBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityParticleBooster.class, "boosterBlock");
|
||||
|
||||
// LASER LIFT
|
||||
liftBlock = new BlockLift(WarpDriveConfig.liftID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(liftBlock, "liftBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityLift.class, "liftBlock");
|
||||
|
||||
// IRIDIUM BLOCK
|
||||
iridiumBlock = new BlockIridium(WarpDriveConfig.iridiumBlockID);
|
||||
|
||||
GameRegistry.registerBlock(iridiumBlock, "iridiumBlock");
|
||||
|
||||
// SHIP SCANNER
|
||||
scannerBlock = new BlockShipScanner(WarpDriveConfig.shipScannerID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(scannerBlock, "scannerBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityShipScanner.class, "scannerBlock");
|
||||
|
||||
// CLOAKING DEVICE CORE
|
||||
cloakBlock = new BlockCloakingDeviceCore(WarpDriveConfig.cloakCoreID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(cloakBlock, "cloakBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityCloakingDeviceCore.class, "cloakBlock");
|
||||
|
||||
// CLOAKING DEVICE COIL
|
||||
cloakCoilBlock = new BlockCloakingCoil(WarpDriveConfig.cloakCoilID, 0, Material.rock);
|
||||
|
||||
GameRegistry.registerBlock(cloakCoilBlock, "cloakCoilBlock");
|
||||
|
||||
// COMPONENT ITEMS
|
||||
componentItem = new ItemWarpComponent(WarpDriveConfig.componentID);
|
||||
GameRegistry.registerItem(componentItem, "component");
|
||||
|
||||
helmetItem = new ItemWarpArmor(WarpDriveConfig.helmetID, 0);
|
||||
GameRegistry.registerItem(helmetItem, "helmet");
|
||||
|
||||
airCanisterItem = new ItemWarpAirCanister(WarpDriveConfig.airCanisterID);
|
||||
GameRegistry.registerItem(airCanisterItem, "airCanisterFull");
|
||||
|
||||
proxy.registerEntities();
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, instance);
|
||||
|
||||
spaceWorldGenerator = new SpaceWorldGenerator();
|
||||
GameRegistry.registerWorldGenerator(spaceWorldGenerator);
|
||||
hyperSpaceWorldGenerator = new HyperSpaceWorldGenerator();
|
||||
GameRegistry.registerWorldGenerator(hyperSpaceWorldGenerator);
|
||||
|
||||
registerSpaceDimension();
|
||||
registerHyperSpaceDimension();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new SpaceEventHandler());
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
warpdriveTab.setBackgroundImageName("items.png");
|
||||
MinecraftForge.EVENT_BUS.register(new CameraOverlay(Minecraft.getMinecraft()));
|
||||
}
|
||||
|
||||
if (WarpDriveConfig.isCCLoaded) {
|
||||
peripheralHandler = new WarpDrivePeripheralHandler();
|
||||
ComputerCraftAPI.registerPeripheralProvider(peripheralHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
space = DimensionManager.getWorld(WarpDriveConfig.G_SPACE_DIMENSION_ID);
|
||||
hyperSpace = DimensionManager.getWorld(WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID);
|
||||
|
||||
WarpDriveConfig.postInit();
|
||||
|
||||
if (WarpDriveConfig.isICLoaded && WarpDriveConfig.G_ENABLE_IC2_RECIPES) {
|
||||
initIC2Recipes();
|
||||
}
|
||||
if (WarpDriveConfig.isAppliedEnergisticsLoaded && WarpDriveConfig.isThermalExpansionLoaded && WarpDriveConfig.isAtomicScienceLoaded && WarpDriveConfig.G_ENABLE_TDK_RECIPES) {
|
||||
initAETERecipes();
|
||||
}
|
||||
if (WarpDriveConfig.G_ENABLE_VANILLA_RECIPES) {
|
||||
initVanillaRecipes();
|
||||
}
|
||||
|
||||
warpCores = new WarpCoresRegistry();
|
||||
jumpgates = new JumpgatesRegistry();
|
||||
cams = new CamRegistry();
|
||||
}
|
||||
|
||||
private static void initVanillaRecipes() {
|
||||
componentItem.registerRecipes();
|
||||
|
||||
//WarpCore
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(warpCore), false, "ipi", "ici", "idi",
|
||||
'i', Item.ingotIron,
|
||||
'p', componentItem.getIS(6),
|
||||
'c', componentItem.getIS(2),
|
||||
'd', Item.diamond));
|
||||
|
||||
//Controller
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(protocolBlock), false, "ici", "idi", "iii",
|
||||
'i', Item.ingotIron,
|
||||
'c', componentItem.getIS(5),
|
||||
'd', Item.diamond));
|
||||
|
||||
//Radar
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(radarBlock), false, "ggg", "pdc", "iii",
|
||||
'i', Item.ingotIron,
|
||||
'c', componentItem.getIS(5),
|
||||
'p', componentItem.getIS(6),
|
||||
'g', Block.glass,
|
||||
'd', Item.diamond));
|
||||
|
||||
//Isolation Block
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(isolationBlock), false, "igi", "geg", "igi",
|
||||
'i', Item.ingotIron,
|
||||
'g', Block.glass,
|
||||
'e', Item.enderPearl));
|
||||
|
||||
//Air generator
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(airgenBlock), false, "ibi", "i i", "ipi",
|
||||
'i', Item.ingotIron,
|
||||
'b', Block.fenceIron,
|
||||
'p', componentItem.getIS(6)));
|
||||
|
||||
//Laser
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(laserBlock), false, "ili", "iri", "ici",
|
||||
'i', Item.ingotIron,
|
||||
'r', Item.redstone,
|
||||
'c', componentItem.getIS(5),
|
||||
'l', componentItem.getIS(3),
|
||||
'p', componentItem.getIS(6)));
|
||||
|
||||
//Mining laser
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(miningLaserBlock), false, "ici", "iti", "ili",
|
||||
'i', Item.ingotIron,
|
||||
'r', Item.redstone,
|
||||
't', componentItem.getIS(1),
|
||||
'c', componentItem.getIS(5),
|
||||
'l', componentItem.getIS(3)));
|
||||
|
||||
//Laser Lift
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(liftBlock), false, "ipi", "rtr", "ili",
|
||||
'i', Item.ingotIron,
|
||||
'r', Item.redstone,
|
||||
't', componentItem.getIS(1),
|
||||
'l', componentItem.getIS(3),
|
||||
'p', componentItem.getIS(6)));
|
||||
|
||||
//Particle Booster
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(boosterBlock), false, "ipi", "rgr", "iii",
|
||||
'i', Item.ingotIron,
|
||||
'r', Item.redstone,
|
||||
'g', Block.glass,
|
||||
'p', componentItem.getIS(6)));
|
||||
|
||||
//Camera
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(cameraBlock), false, "ngn", "i i", "ici",
|
||||
'i', Item.ingotIron,
|
||||
'n', Item.goldNugget,
|
||||
'g', Block.glass,
|
||||
'c', componentItem.getIS(5)));
|
||||
|
||||
//LaserCamera
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(laserCamBlock), cameraBlock, laserBlock));
|
||||
|
||||
//Monitor
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(monitorBlock), false, "ggg", "iti", "ici",
|
||||
'i', Item.ingotIron,
|
||||
't', Block.torchWood,
|
||||
'g', Block.glass,
|
||||
'c', componentItem.getIS(5)));
|
||||
|
||||
//Cloaking device
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(cloakBlock), false, "ipi", "lrl", "ici",
|
||||
'i', Item.ingotIron,
|
||||
'r', Item.redstone,
|
||||
'l', componentItem.getIS(3),
|
||||
'c', componentItem.getIS(5),
|
||||
'p', componentItem.getIS(6)));
|
||||
|
||||
//Cloaking coil
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(cloakCoilBlock), false, "ini", "rdr", "ini",
|
||||
'i', Item.ingotIron,
|
||||
'd', Item.diamond,
|
||||
'r', Item.redstone,
|
||||
'n', Item.goldNugget));
|
||||
|
||||
//Helmet
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(helmetItem), false, "iii", "iwi", "gcg",
|
||||
'i', Item.ingotIron,
|
||||
'w', Block.cloth,
|
||||
'g', Block.glass,
|
||||
'c', componentItem.getIS(8)));
|
||||
}
|
||||
|
||||
private static void initAETERecipes() {
|
||||
ItemStack redstoneEnergycell = GameRegistry.findItemStack("ThermalExpansion", "cellReinforced", 1);
|
||||
ItemStack bucketEnder = GameRegistry.findItemStack("ThermalExpansion", "bucketEnder", 1);
|
||||
ItemStack fluixCrystal = WarpDriveConfig.getAEMaterial("matFluxCrystal");
|
||||
ItemStack vibrantQuartzGlass = WarpDriveConfig.getAEBlock("blkQuartzLamp");
|
||||
vibrantQuartzGlass.setItemDamage(4);
|
||||
ItemStack antimatter = GameRegistry.findItemStack("ResonantInduction|Atomic", "antimatter", 1);
|
||||
antimatter.setItemDamage(0);
|
||||
ItemStack floppy = GameRegistry.findItemStack("ComputerCraft", "disk", 1);
|
||||
|
||||
// top = advancedCircuit, redstoneEnergycell, advancedCircuit
|
||||
// middle = fluix crystal, advancedMachine, fluix crystal
|
||||
// bottom = advancedCircuit, bucket Resonant ender, advancedCircuit
|
||||
GameRegistry.addRecipe(new ItemStack(warpCore), "crc", "fmf", "cec",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'r', redstoneEnergycell,
|
||||
'e', bucketEnder,
|
||||
'f', fluixCrystal);
|
||||
|
||||
// top = advancedCircuit, floppy, advancedCircuit
|
||||
// middle = advancedCircuit, advancedMachine, advancedCircuit
|
||||
// bottom = advancedCircuit, fluix crystal, advancedCircuit
|
||||
GameRegistry.addRecipe(new ItemStack(protocolBlock), "coc", "cmc", "cfc",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'o', floppy,
|
||||
'f', fluixCrystal);
|
||||
}
|
||||
|
||||
private static void initIC2Recipes() {
|
||||
GameRegistry.addRecipe(new ItemStack(warpCore), "ici", "cmc", "ici",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(protocolBlock), "iic", "imi", "cii",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(radarBlock), "ifi", "imi", "imi",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'f', WarpDriveConfig.getIC2Item("frequencyTransmitter"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(isolationBlock), "iii", "idi", "iii",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'd', Block.blockDiamond);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(airgenBlock), "lcl", "lml", "lll",
|
||||
'l', Block.leaves,
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(laserBlock), "sss", "ama", "aaa",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"),
|
||||
's', WarpDriveConfig.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(miningLaserBlock), "aaa", "ama", "ccc",
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"),
|
||||
'm', WarpDriveConfig.getIC2Item("miner"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(boosterBlock), "afc", "ama", "cfa",
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"),
|
||||
'f', WarpDriveConfig.getIC2Item("glassFiberCableItem"),
|
||||
'm', WarpDriveConfig.getIC2Item("mfeUnit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(liftBlock), "aca", "ama", "a#a",
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"),
|
||||
'm', WarpDriveConfig.getIC2Item("magnetizer"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(iridiumBlock), "iii", "iii", "iii",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"));
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(WarpDriveConfig.getIC2Item("iridiumPlate").getItem(), 9),
|
||||
new ItemStack(iridiumBlock));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(laserCamBlock), "imi", "cec", "#k#",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'e', laserBlock,
|
||||
'k', cameraBlock);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cameraBlock), "cgc", "gmg", "cgc",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'g', Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(monitorBlock), "gcg", "gmg", "ggg",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'g', Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(scannerBlock), "sgs", "mma", "amm",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"),
|
||||
's', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'g', Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cloakBlock), "imi", "mcm", "imi",
|
||||
'i', iridiumBlock,
|
||||
'c', cloakCoilBlock,
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cloakCoilBlock), "iai", "aca", "iai",
|
||||
'i', WarpDriveConfig.getIC2Item("iridiumPlate"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.getIC2Item("advancedAlloy"));
|
||||
}
|
||||
|
||||
private static void registerSpaceDimension() {
|
||||
spaceBiome = (new BiomeSpace(24))
|
||||
.setColor(0)
|
||||
.setDisableRain()
|
||||
.setBiomeName("Space");
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_SPACE_PROVIDER_ID, SpaceProvider.class, true);
|
||||
DimensionManager.registerDimension(WarpDriveConfig.G_SPACE_DIMENSION_ID, WarpDriveConfig.G_SPACE_PROVIDER_ID);
|
||||
}
|
||||
|
||||
private static void registerHyperSpaceDimension() {
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_HYPERSPACE_PROVIDER_ID, HyperSpaceProvider.class, true);
|
||||
DimensionManager.registerDimension(WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID, WarpDriveConfig.G_HYPERSPACE_PROVIDER_ID);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverLoad(FMLServerStartingEvent event) {
|
||||
cloaks = new CloakManager();
|
||||
MinecraftForge.EVENT_BUS.register(new CloakChunkWatcher());
|
||||
|
||||
event.registerServerCommand(new GenerateCommand());
|
||||
event.registerServerCommand(new SpaceTpCommand());
|
||||
event.registerServerCommand(new InvisibleCommand());
|
||||
event.registerServerCommand(new JumpgateCommand());
|
||||
}
|
||||
|
||||
public Ticket registerChunkLoadTE(WarpChunkTE te, boolean refreshLoading) {
|
||||
World worldObj = te.worldObj;
|
||||
if (ForgeChunkManager.ticketCountAvailableFor(this, worldObj) > 0)
|
||||
{
|
||||
Ticket t = ForgeChunkManager.requestTicket(this, worldObj, Type.NORMAL);
|
||||
if (t != null) {
|
||||
te.giveTicket(t); // FIXME calling the caller is a bad idea
|
||||
if(refreshLoading)
|
||||
te.refreshLoading();
|
||||
return t;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarpDrive.debugPrint("Ticket not granted");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WarpDrive.debugPrint("No tickets left!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Ticket registerChunkLoadTE(WarpChunkTE te)
|
||||
{
|
||||
return registerChunkLoadTE(te, true);
|
||||
}
|
||||
|
||||
public Ticket getTicket(WarpChunkTE te)
|
||||
{
|
||||
return registerChunkLoadTE(te, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
NBTTagCompound data = ticket.getModData();
|
||||
if(data != null)
|
||||
{
|
||||
int w = data.getInteger("ticketWorldObj");
|
||||
int x = data.getInteger("ticketX");
|
||||
int y = data.getInteger("ticketY");
|
||||
int z = data.getInteger("ticketZ");
|
||||
if(w != 0 || x != 0 || y != 0 || z != 0)
|
||||
{
|
||||
WorldServer ws = DimensionManager.getWorld(w);
|
||||
if(ws != null)
|
||||
{
|
||||
TileEntity te = ws.getBlockTileEntity(x, y, z);
|
||||
if(te != null && te instanceof WarpChunkTE)
|
||||
{
|
||||
if(((WarpChunkTE)te).shouldChunkLoad())
|
||||
{
|
||||
WarpDrive.debugPrint("[TicketCallback] Regiving Ticket!");
|
||||
((WarpChunkTE)te).giveTicket(ticket);
|
||||
((WarpChunkTE)te).refreshLoading(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
}
|
||||
}
|
1016
src/java/cr0s/warpdrive/WarpDriveConfig.java
Normal file
1016
src/java/cr0s/warpdrive/WarpDriveConfig.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive;
|
||||
package cr0s.warpdrive;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.api;
|
||||
package cr0s.warpdrive.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.api;
|
||||
package cr0s.warpdrive.api;
|
||||
|
||||
public interface IBlockUpdateDetector
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.api;
|
||||
package cr0s.warpdrive.api;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package cr0s.WarpDrive.api;
|
||||
package cr0s.warpdrive.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import cr0s.WarpDrive.data.EnumUpgradeTypes;
|
||||
import cr0s.warpdrive.data.EnumUpgradeTypes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IUpgradable
|
|
@ -1,8 +1,8 @@
|
|||
package cr0s.WarpDrive.block;
|
||||
package cr0s.warpdrive.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
|
@ -1,8 +1,8 @@
|
|||
package cr0s.WarpDrive.block;
|
||||
package cr0s.warpdrive.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
|
@ -1,8 +1,8 @@
|
|||
package cr0s.WarpDrive.block;
|
||||
package cr0s.warpdrive.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
|
@ -1,11 +1,11 @@
|
|||
package cr0s.WarpDrive.client;
|
||||
package cr0s.warpdrive.client;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cr0s.WarpDrive.CommonProxy;
|
||||
import cr0s.WarpDrive.render.FXBeam;
|
||||
import cr0s.WarpDrive.data.Vector3;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.warpdrive.CommonProxy;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.data.Vector3;
|
||||
import cr0s.warpdrive.render.FXBeam;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
|
@ -1,11 +1,11 @@
|
|||
package cr0s.WarpDrive.command;
|
||||
package cr0s.warpdrive.command;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.WarpDrive.world.JumpgateGenerator;
|
||||
import cr0s.WarpDrive.world.WorldGenSmallShip;
|
||||
import cr0s.WarpDrive.world.WorldGenStation;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.world.JumpgateGenerator;
|
||||
import cr0s.warpdrive.world.WorldGenSmallShip;
|
||||
import cr0s.warpdrive.world.WorldGenStation;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.command;
|
||||
package cr0s.warpdrive.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
|
@ -1,6 +1,6 @@
|
|||
package cr0s.WarpDrive.command;
|
||||
package cr0s.warpdrive.command;
|
||||
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
@ -1,7 +1,7 @@
|
|||
package cr0s.WarpDrive.command;
|
||||
package cr0s.warpdrive.command;
|
||||
|
||||
import cr0s.WarpDrive.world.SpaceTeleporter;
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.world.SpaceTeleporter;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
@ -1,10 +1,10 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
@ -7,9 +7,9 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.FMLNetworkHandler;
|
||||
import cr0s.WarpDrive.PacketHandler;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.WarpDrive.data.CloakedArea;
|
||||
import cr0s.warpdrive.PacketHandler;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.data.CloakedArea;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLeashKnot;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
@ -7,8 +7,8 @@ import java.util.List;
|
|||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.FMLNetworkHandler;
|
||||
import cr0s.WarpDrive.PacketHandler;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.warpdrive.PacketHandler;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
public enum EnumUpgradeTypes
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.WarpDrive.WarpDriveConfig;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDriveConfig;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
|
@ -1,6 +1,6 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import cr0s.WarpDrive.world.JumpgateGenerator;
|
||||
import cr0s.warpdrive.world.JumpgateGenerator;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class Jumpgate
|
|
@ -1,4 +1,4 @@
|
|||
package cr0s.WarpDrive.data;
|
||||
package cr0s.warpdrive.data;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
|
@ -10,7 +10,7 @@ import java.util.ArrayList;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
|
||||
public final class JumpgatesRegistry {
|
||||
private File db;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue