mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb119dde15 | ||
|
|
4927757ee6 | ||
|
|
e9f605f243 | ||
|
|
fc15fb492a | ||
|
|
b3a23f53db | ||
|
|
28f4def938 | ||
|
|
5e12defde0 | ||
|
|
e4c8acdd4f | ||
|
|
470601170a | ||
|
|
40c0ea5f53 | ||
|
|
18c787153c | ||
|
|
dc9e4688a3 | ||
|
|
853ad538df | ||
|
|
d8b69c4311 | ||
|
|
c8d5cf92d2 | ||
|
|
a0f95ee27b | ||
|
|
c27af147bf | ||
|
|
c101bb2e6d | ||
|
|
6c25bcee2a | ||
|
|
1f3e772def | ||
|
|
a6047ee7ec | ||
|
|
85189235ce | ||
|
|
964d3391e4 | ||
|
|
92b212d5e0 | ||
|
|
1972b9ab2b | ||
|
|
99e23607f5 | ||
|
|
63423b8913 | ||
|
|
0d3d390e22 | ||
|
|
96ffb23eae | ||
|
|
d5b1802379 | ||
|
|
a4a4af3087 | ||
|
|
c1d71d767e | ||
|
|
ef9221265d | ||
|
|
cedfe231c3 | ||
|
|
f64efe15c8 | ||
|
|
0905f7b806 | ||
|
|
425af1d868 | ||
|
|
3ec494d713 | ||
|
|
744c39aba8 | ||
|
|
f297a522a9 | ||
|
|
7be29e459e | ||
|
|
c8f7742df5 | ||
|
|
bbe1e7f50f | ||
|
|
8ff5a8cf52 | ||
|
|
b9e61335e3 | ||
|
|
0272517b10 | ||
|
|
8782f7c6a7 | ||
|
|
58676ab46d | ||
|
|
2127d30d16 | ||
|
|
5268737e2e | ||
|
|
c075644243 | ||
|
|
e95d6c870c | ||
|
|
6d278db79d | ||
|
|
4f2618d03b | ||
|
|
c2cbc66645 | ||
|
|
df4a8cfca9 | ||
|
|
00e831c20f | ||
|
|
7fbffb3aa7 | ||
|
|
7b02309128 | ||
|
|
c9be818502 | ||
|
|
3e96d49fef | ||
|
|
64d179543c | ||
|
|
e1d8a847a9 | ||
|
|
38fb7fc71f | ||
|
|
6479b0b635 | ||
|
|
5b388b5cba | ||
|
|
3cc1026704 | ||
|
|
2a548be7d8 | ||
|
|
dce00bbc74 | ||
|
|
63bf13c964 | ||
|
|
2151886e83 | ||
|
|
aeb6392d52 | ||
|
|
c221b7b03b | ||
|
|
bf664d00c8 | ||
|
|
7f7c4083cc | ||
|
|
d3f9b102d6 | ||
|
|
0f74be83ac | ||
|
|
a61d4b6d9f | ||
|
|
e4d716addb | ||
|
|
393eec213c | ||
|
|
40ce1b4c61 | ||
|
|
292be28f00 | ||
|
|
3809971825 | ||
|
|
db796ae830 | ||
|
|
d92266f5e3 | ||
|
|
304fed71dd | ||
|
|
bd2506a479 | ||
|
|
62a9677326 | ||
|
|
b259785bbc | ||
|
|
d4191557af | ||
|
|
6670fcdb5f | ||
|
|
2058c309d4 | ||
|
|
2633f752f3 | ||
|
|
8ce7293034 | ||
|
|
0432ff0d30 | ||
|
|
180509a1a9 | ||
|
|
1f27b14054 | ||
|
|
22e8c36aae | ||
|
|
0212dd084a | ||
|
|
d54311fb11 | ||
|
|
4a20fa3b06 | ||
|
|
97e8cdf407 | ||
|
|
0c75584ccb | ||
|
|
47ffee8cd3 | ||
|
|
3660fb23b5 | ||
|
|
b1388aeb80 | ||
|
|
d922bfbdbf | ||
|
|
7c2c6b7966 | ||
|
|
acbc864d76 | ||
|
|
c762ad9915 | ||
|
|
f8fb442525 | ||
|
|
3bb2edda24 | ||
|
|
587027c24e | ||
|
|
a8259fe5cc | ||
|
|
2e906240da | ||
|
|
d79f97397a | ||
|
|
613094698d | ||
|
|
044e31d3c7 | ||
|
|
0bc9b741e3 | ||
|
|
08d1d924a0 | ||
|
|
481ec1cf32 | ||
|
|
80a42e74a1 | ||
|
|
88a211f55e | ||
|
|
f872ef50b1 | ||
|
|
508457c10a | ||
|
|
2f5c71014a | ||
|
|
be56bf2675 | ||
|
|
bd8e2d9b69 | ||
|
|
6b6b6f152c | ||
|
|
df27528048 | ||
|
|
94129319ab | ||
|
|
2ee65a298c | ||
|
|
73bf026fc0 | ||
|
|
0aad75919e | ||
|
|
d87599e38d | ||
|
|
edcac6b16d | ||
|
|
e11de173f8 | ||
|
|
dc69ee1728 | ||
|
|
13166986e3 | ||
|
|
903f158d38 | ||
|
|
9a0ffdee8c | ||
|
|
52d1767fea | ||
|
|
7ddb0889c8 | ||
|
|
caf6c961f6 | ||
|
|
acd53891c1 | ||
|
|
18d51d40f9 | ||
|
|
e3f18c365b | ||
|
|
a32b0c1dc3 | ||
|
|
28c0a749c8 |
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# This is the universal Text Editor Configuration
|
||||
# for all GTNewHorizons projects
|
||||
# See: https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{bat,ini}]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.{dtd,json,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
|
||||
indent_size = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
# Ignore spotlessApply reformat
|
||||
481ec1cf3284555e0df0eb5cfcf5cd0b84461093
|
||||
@@ -0,0 +1,44 @@
|
||||
* text eol=lf
|
||||
|
||||
*.[jJ][aA][rR] binary
|
||||
|
||||
*.[pP][nN][gG] binary
|
||||
*.[jJ][pP][gG] binary
|
||||
*.[jJ][pP][eE][gG] binary
|
||||
*.[gG][iI][fF] binary
|
||||
*.[tT][iI][fF] binary
|
||||
*.[tT][iI][fF][fF] binary
|
||||
*.[iI][cC][oO] binary
|
||||
*.[sS][vV][gG] text
|
||||
*.[eE][pP][sS] binary
|
||||
*.[xX][cC][fF] binary
|
||||
|
||||
*.[kK][aA][rR] binary
|
||||
*.[mM]4[aA] binary
|
||||
*.[mM][iI][dD] binary
|
||||
*.[mM][iI][dD][iI] binary
|
||||
*.[mM][pP]3 binary
|
||||
*.[oO][gG][gG] binary
|
||||
*.[rR][aA] binary
|
||||
|
||||
*.7[zZ] binary
|
||||
*.[gG][zZ] binary
|
||||
*.[tT][aA][rR] binary
|
||||
*.[tT][gG][zZ] binary
|
||||
*.[zZ][iI][pP] binary
|
||||
|
||||
*.[tT][cC][nN] binary
|
||||
*.[sS][oO] binary
|
||||
*.[dD][lL][lL] binary
|
||||
*.[dD][yY][lL][iI][bB] binary
|
||||
*.[pP][sS][dD] binary
|
||||
*.[tT][tT][fF] binary
|
||||
*.[oO][tT][fF] binary
|
||||
|
||||
*.[pP][aA][tT][cC][hH] -text
|
||||
|
||||
*.[bB][aA][tT] text eol=crlf
|
||||
*.[cC][mM][dD] text eol=crlf
|
||||
*.[pP][sS]1 text eol=crlf
|
||||
|
||||
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
|
||||
Regular → Executable
+11
-5
@@ -1,22 +1,28 @@
|
||||
if [[ -d "run/crash-reports" ]]; then
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUNDIR="run"
|
||||
CRASH="crash-reports"
|
||||
SERVERLOG="server.log"
|
||||
|
||||
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $directory/*
|
||||
cat $RUNDIR/$CRASH/crash*.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" server.log; then
|
||||
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
|
||||
echo "Fatal errors detected:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then
|
||||
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
|
||||
@@ -1,45 +1,13 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Run server for 1.5 minutes
|
||||
run: |
|
||||
mkdir run
|
||||
echo "eula=true" > run/eula.txt
|
||||
timeout 90 ./gradlew runServer | tee --append server.log || true
|
||||
|
||||
- name: Test no errors reported during server run
|
||||
run: |
|
||||
chmod +x .github/scripts/test-no-error-reports.sh
|
||||
.github/scripts/test-no-error-reports.sh
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -1,51 +1,14 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Release tagged build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
tags: [ '*' ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set release version
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Release under current tag
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
||||
prerelease: false
|
||||
title: "${{ env.RELEASE_VERSION }}"
|
||||
files: build/libs/*.jar
|
||||
|
||||
- name: Publish to Maven
|
||||
run: ./gradlew publish
|
||||
env:
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
release-tags:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
|
||||
secrets: inherit
|
||||
+3
-1
@@ -1,6 +1,7 @@
|
||||
.gradle
|
||||
.settings
|
||||
/.idea/
|
||||
/.vscode/
|
||||
/run/
|
||||
/build/
|
||||
/eclipse/
|
||||
@@ -25,7 +26,8 @@ whitelist.json
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
layout.json
|
||||
+360
@@ -0,0 +1,360 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
Attribution-NonCommercial-ShareAlike 3.0 Unported
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
|
||||
DAMAGES RESULTING FROM ITS USE.
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
|
||||
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
|
||||
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
|
||||
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
|
||||
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
|
||||
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
|
||||
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
|
||||
CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
a. "Adaptation" means a work based upon the Work, or upon the Work and
|
||||
other pre-existing works, such as a translation, adaptation,
|
||||
derivative work, arrangement of music or other alterations of a
|
||||
literary or artistic work, or phonogram or performance and includes
|
||||
cinematographic adaptations or any other form in which the Work may be
|
||||
recast, transformed, or adapted including in any form recognizably
|
||||
derived from the original, except that a work that constitutes a
|
||||
Collection will not be considered an Adaptation for the purpose of
|
||||
this License. For the avoidance of doubt, where the Work is a musical
|
||||
work, performance or phonogram, the synchronization of the Work in
|
||||
timed-relation with a moving image ("synching") will be considered an
|
||||
Adaptation for the purpose of this License.
|
||||
b. "Collection" means a collection of literary or artistic works, such as
|
||||
encyclopedias and anthologies, or performances, phonograms or
|
||||
broadcasts, or other works or subject matter other than works listed
|
||||
in Section 1(g) below, which, by reason of the selection and
|
||||
arrangement of their contents, constitute intellectual creations, in
|
||||
which the Work is included in its entirety in unmodified form along
|
||||
with one or more other contributions, each constituting separate and
|
||||
independent works in themselves, which together are assembled into a
|
||||
collective whole. A work that constitutes a Collection will not be
|
||||
considered an Adaptation (as defined above) for the purposes of this
|
||||
License.
|
||||
c. "Distribute" means to make available to the public the original and
|
||||
copies of the Work or Adaptation, as appropriate, through sale or
|
||||
other transfer of ownership.
|
||||
d. "License Elements" means the following high-level license attributes
|
||||
as selected by Licensor and indicated in the title of this License:
|
||||
Attribution, Noncommercial, ShareAlike.
|
||||
e. "Licensor" means the individual, individuals, entity or entities that
|
||||
offer(s) the Work under the terms of this License.
|
||||
f. "Original Author" means, in the case of a literary or artistic work,
|
||||
the individual, individuals, entity or entities who created the Work
|
||||
or if no individual or entity can be identified, the publisher; and in
|
||||
addition (i) in the case of a performance the actors, singers,
|
||||
musicians, dancers, and other persons who act, sing, deliver, declaim,
|
||||
play in, interpret or otherwise perform literary or artistic works or
|
||||
expressions of folklore; (ii) in the case of a phonogram the producer
|
||||
being the person or legal entity who first fixes the sounds of a
|
||||
performance or other sounds; and, (iii) in the case of broadcasts, the
|
||||
organization that transmits the broadcast.
|
||||
g. "Work" means the literary and/or artistic work offered under the terms
|
||||
of this License including without limitation any production in the
|
||||
literary, scientific and artistic domain, whatever may be the mode or
|
||||
form of its expression including digital form, such as a book,
|
||||
pamphlet and other writing; a lecture, address, sermon or other work
|
||||
of the same nature; a dramatic or dramatico-musical work; a
|
||||
choreographic work or entertainment in dumb show; a musical
|
||||
composition with or without words; a cinematographic work to which are
|
||||
assimilated works expressed by a process analogous to cinematography;
|
||||
a work of drawing, painting, architecture, sculpture, engraving or
|
||||
lithography; a photographic work to which are assimilated works
|
||||
expressed by a process analogous to photography; a work of applied
|
||||
art; an illustration, map, plan, sketch or three-dimensional work
|
||||
relative to geography, topography, architecture or science; a
|
||||
performance; a broadcast; a phonogram; a compilation of data to the
|
||||
extent it is protected as a copyrightable work; or a work performed by
|
||||
a variety or circus performer to the extent it is not otherwise
|
||||
considered a literary or artistic work.
|
||||
h. "You" means an individual or entity exercising rights under this
|
||||
License who has not previously violated the terms of this License with
|
||||
respect to the Work, or who has received express permission from the
|
||||
Licensor to exercise rights under this License despite a previous
|
||||
violation.
|
||||
i. "Publicly Perform" means to perform public recitations of the Work and
|
||||
to communicate to the public those public recitations, by any means or
|
||||
process, including by wire or wireless means or public digital
|
||||
performances; to make available to the public Works in such a way that
|
||||
members of the public may access these Works from a place and at a
|
||||
place individually chosen by them; to perform the Work to the public
|
||||
by any means or process and the communication to the public of the
|
||||
performances of the Work, including by public digital performance; to
|
||||
broadcast and rebroadcast the Work by any means including signs,
|
||||
sounds or images.
|
||||
j. "Reproduce" means to make copies of the Work by any means including
|
||||
without limitation by sound or visual recordings and the right of
|
||||
fixation and reproducing fixations of the Work, including storage of a
|
||||
protected performance or phonogram in digital form or other electronic
|
||||
medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
|
||||
limit, or restrict any uses free from copyright or rights arising from
|
||||
limitations or exceptions that are provided for in connection with the
|
||||
copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License,
|
||||
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
||||
perpetual (for the duration of the applicable copyright) license to
|
||||
exercise the rights in the Work as stated below:
|
||||
|
||||
a. to Reproduce the Work, to incorporate the Work into one or more
|
||||
Collections, and to Reproduce the Work as incorporated in the
|
||||
Collections;
|
||||
b. to create and Reproduce Adaptations provided that any such Adaptation,
|
||||
including any translation in any medium, takes reasonable steps to
|
||||
clearly label, demarcate or otherwise identify that changes were made
|
||||
to the original Work. For example, a translation could be marked "The
|
||||
original work was translated from English to Spanish," or a
|
||||
modification could indicate "The original work has been modified.";
|
||||
c. to Distribute and Publicly Perform the Work including as incorporated
|
||||
in Collections; and,
|
||||
d. to Distribute and Publicly Perform Adaptations.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now
|
||||
known or hereafter devised. The above rights include the right to make
|
||||
such modifications as are technically necessary to exercise the rights in
|
||||
other media and formats. Subject to Section 8(f), all rights not expressly
|
||||
granted by Licensor are hereby reserved, including but not limited to the
|
||||
rights described in Section 4(e).
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made
|
||||
subject to and limited by the following restrictions:
|
||||
|
||||
a. You may Distribute or Publicly Perform the Work only under the terms
|
||||
of this License. You must include a copy of, or the Uniform Resource
|
||||
Identifier (URI) for, this License with every copy of the Work You
|
||||
Distribute or Publicly Perform. You may not offer or impose any terms
|
||||
on the Work that restrict the terms of this License or the ability of
|
||||
the recipient of the Work to exercise the rights granted to that
|
||||
recipient under the terms of the License. You may not sublicense the
|
||||
Work. You must keep intact all notices that refer to this License and
|
||||
to the disclaimer of warranties with every copy of the Work You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Work, You may not impose any effective technological
|
||||
measures on the Work that restrict the ability of a recipient of the
|
||||
Work from You to exercise the rights granted to that recipient under
|
||||
the terms of the License. This Section 4(a) applies to the Work as
|
||||
incorporated in a Collection, but this does not require the Collection
|
||||
apart from the Work itself to be made subject to the terms of this
|
||||
License. If You create a Collection, upon notice from any Licensor You
|
||||
must, to the extent practicable, remove from the Collection any credit
|
||||
as required by Section 4(d), as requested. If You create an
|
||||
Adaptation, upon notice from any Licensor You must, to the extent
|
||||
practicable, remove from the Adaptation any credit as required by
|
||||
Section 4(d), as requested.
|
||||
b. You may Distribute or Publicly Perform an Adaptation only under: (i)
|
||||
the terms of this License; (ii) a later version of this License with
|
||||
the same License Elements as this License; (iii) a Creative Commons
|
||||
jurisdiction license (either this or a later license version) that
|
||||
contains the same License Elements as this License (e.g.,
|
||||
Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License").
|
||||
You must include a copy of, or the URI, for Applicable License with
|
||||
every copy of each Adaptation You Distribute or Publicly Perform. You
|
||||
may not offer or impose any terms on the Adaptation that restrict the
|
||||
terms of the Applicable License or the ability of the recipient of the
|
||||
Adaptation to exercise the rights granted to that recipient under the
|
||||
terms of the Applicable License. You must keep intact all notices that
|
||||
refer to the Applicable License and to the disclaimer of warranties
|
||||
with every copy of the Work as included in the Adaptation You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Adaptation, You may not impose any effective technological
|
||||
measures on the Adaptation that restrict the ability of a recipient of
|
||||
the Adaptation from You to exercise the rights granted to that
|
||||
recipient under the terms of the Applicable License. This Section 4(b)
|
||||
applies to the Adaptation as incorporated in a Collection, but this
|
||||
does not require the Collection apart from the Adaptation itself to be
|
||||
made subject to the terms of the Applicable License.
|
||||
c. You may not exercise any of the rights granted to You in Section 3
|
||||
above in any manner that is primarily intended for or directed toward
|
||||
commercial advantage or private monetary compensation. The exchange of
|
||||
the Work for other copyrighted works by means of digital file-sharing
|
||||
or otherwise shall not be considered to be intended for or directed
|
||||
toward commercial advantage or private monetary compensation, provided
|
||||
there is no payment of any monetary compensation in con-nection with
|
||||
the exchange of copyrighted works.
|
||||
d. If You Distribute, or Publicly Perform the Work or any Adaptations or
|
||||
Collections, You must, unless a request has been made pursuant to
|
||||
Section 4(a), keep intact all copyright notices for the Work and
|
||||
provide, reasonable to the medium or means You are utilizing: (i) the
|
||||
name of the Original Author (or pseudonym, if applicable) if supplied,
|
||||
and/or if the Original Author and/or Licensor designate another party
|
||||
or parties (e.g., a sponsor institute, publishing entity, journal) for
|
||||
attribution ("Attribution Parties") in Licensor's copyright notice,
|
||||
terms of service or by other reasonable means, the name of such party
|
||||
or parties; (ii) the title of the Work if supplied; (iii) to the
|
||||
extent reasonably practicable, the URI, if any, that Licensor
|
||||
specifies to be associated with the Work, unless such URI does not
|
||||
refer to the copyright notice or licensing information for the Work;
|
||||
and, (iv) consistent with Section 3(b), in the case of an Adaptation,
|
||||
a credit identifying the use of the Work in the Adaptation (e.g.,
|
||||
"French translation of the Work by Original Author," or "Screenplay
|
||||
based on original Work by Original Author"). The credit required by
|
||||
this Section 4(d) may be implemented in any reasonable manner;
|
||||
provided, however, that in the case of a Adaptation or Collection, at
|
||||
a minimum such credit will appear, if a credit for all contributing
|
||||
authors of the Adaptation or Collection appears, then as part of these
|
||||
credits and in a manner at least as prominent as the credits for the
|
||||
other contributing authors. For the avoidance of doubt, You may only
|
||||
use the credit required by this Section for the purpose of attribution
|
||||
in the manner set out above and, by exercising Your rights under this
|
||||
License, You may not implicitly or explicitly assert or imply any
|
||||
connection with, sponsorship or endorsement by the Original Author,
|
||||
Licensor and/or Attribution Parties, as appropriate, of You or Your
|
||||
use of the Work, without the separate, express prior written
|
||||
permission of the Original Author, Licensor and/or Attribution
|
||||
Parties.
|
||||
e. For the avoidance of doubt:
|
||||
|
||||
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme cannot be waived, the Licensor
|
||||
reserves the exclusive right to collect such royalties for any
|
||||
exercise by You of the rights granted under this License;
|
||||
ii. Waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme can be waived, the Licensor reserves
|
||||
the exclusive right to collect such royalties for any exercise by
|
||||
You of the rights granted under this License if Your exercise of
|
||||
such rights is for a purpose or use which is otherwise than
|
||||
noncommercial as permitted under Section 4(c) and otherwise waives
|
||||
the right to collect royalties through any statutory or compulsory
|
||||
licensing scheme; and,
|
||||
iii. Voluntary License Schemes. The Licensor reserves the right to
|
||||
collect royalties, whether individually or, in the event that the
|
||||
Licensor is a member of a collecting society that administers
|
||||
voluntary licensing schemes, via that society, from any exercise
|
||||
by You of the rights granted under this License that is for a
|
||||
purpose or use which is otherwise than noncommercial as permitted
|
||||
under Section 4(c).
|
||||
f. Except as otherwise agreed in writing by the Licensor or as may be
|
||||
otherwise permitted by applicable law, if You Reproduce, Distribute or
|
||||
Publicly Perform the Work either by itself or as part of any
|
||||
Adaptations or Collections, You must not distort, mutilate, modify or
|
||||
take other derogatory action in relation to the Work which would be
|
||||
prejudicial to the Original Author's honor or reputation. Licensor
|
||||
agrees that in those jurisdictions (e.g. Japan), in which any exercise
|
||||
of the right granted in Section 3(b) of this License (the right to
|
||||
make Adaptations) would be deemed to be a distortion, mutilation,
|
||||
modification or other derogatory action prejudicial to the Original
|
||||
Author's honor and reputation, the Licensor will waive or not assert,
|
||||
as appropriate, this Section, to the fullest extent permitted by the
|
||||
applicable national law, to enable You to reasonably exercise Your
|
||||
right under Section 3(b) of this License (right to make Adaptations)
|
||||
but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE
|
||||
FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS
|
||||
AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
|
||||
WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT
|
||||
LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
|
||||
WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
|
||||
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
|
||||
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
|
||||
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
a. This License and the rights granted hereunder will terminate
|
||||
automatically upon any breach by You of the terms of this License.
|
||||
Individuals or entities who have received Adaptations or Collections
|
||||
from You under this License, however, will not have their licenses
|
||||
terminated provided such individuals or entities remain in full
|
||||
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
|
||||
survive any termination of this License.
|
||||
b. Subject to the above terms and conditions, the license granted here is
|
||||
perpetual (for the duration of the applicable copyright in the Work).
|
||||
Notwithstanding the above, Licensor reserves the right to release the
|
||||
Work under different license terms or to stop distributing the Work at
|
||||
any time; provided, however that any such election will not serve to
|
||||
withdraw this License (or any other license that has been, or is
|
||||
required to be, granted under the terms of this License), and this
|
||||
License will continue in full force and effect unless terminated as
|
||||
stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
a. Each time You Distribute or Publicly Perform the Work or a Collection,
|
||||
the Licensor offers to the recipient a license to the Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
|
||||
offers to the recipient a license to the original Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
c. If any provision of this License is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this License, and without further action
|
||||
by the parties to this agreement, such provision shall be reformed to
|
||||
the minimum extent necessary to make such provision valid and
|
||||
enforceable.
|
||||
d. No term or provision of this License shall be deemed waived and no
|
||||
breach consented to unless such waiver or consent shall be in writing
|
||||
and signed by the party to be charged with such waiver or consent.
|
||||
e. This License constitutes the entire agreement between the parties with
|
||||
respect to the Work licensed here. There are no understandings,
|
||||
agreements or representations with respect to the Work not specified
|
||||
here. Licensor shall not be bound by any additional provisions that
|
||||
may appear in any communication from You. This License may not be
|
||||
modified without the mutual written agreement of the Licensor and You.
|
||||
f. The rights granted under, and the subject matter referenced, in this
|
||||
License were drafted utilizing the terminology of the Berne Convention
|
||||
for the Protection of Literary and Artistic Works (as amended on
|
||||
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
|
||||
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
|
||||
and the Universal Copyright Convention (as revised on July 24, 1971).
|
||||
These rights and subject matter take effect in the relevant
|
||||
jurisdiction in which the License terms are sought to be enforced
|
||||
according to the corresponding provisions of the implementation of
|
||||
those treaty provisions in the applicable national law. If the
|
||||
standard suite of rights granted under applicable copyright law
|
||||
includes additional rights not granted under this License, such
|
||||
additional rights are deemed to be included in the License; this
|
||||
License is not intended to restrict the license of any rights under
|
||||
applicable law.
|
||||
|
||||
|
||||
Creative Commons Notice
|
||||
|
||||
Creative Commons is not a party to this License, and makes no warranty
|
||||
whatsoever in connection with the Work. Creative Commons will not be
|
||||
liable to You or any party on any legal theory for any damages
|
||||
whatsoever, including without limitation any general, special,
|
||||
incidental or consequential damages arising in connection to this
|
||||
license. Notwithstanding the foregoing two (2) sentences, if Creative
|
||||
Commons has expressly identified itself as the Licensor hereunder, it
|
||||
shall have all rights and obligations of Licensor.
|
||||
|
||||
Except for the limited purpose of indicating to the public that the
|
||||
Work is licensed under the CCPL, Creative Commons does not authorize
|
||||
the use by either party of the trademark "Creative Commons" or any
|
||||
related trademark or logo of Creative Commons without the prior
|
||||
written consent of Creative Commons. Any permitted use will be in
|
||||
compliance with Creative Commons' then-current trademark usage
|
||||
guidelines, as may be published on its website or otherwise made
|
||||
available upon request from time to time. For the avoidance of doubt,
|
||||
this trademark restriction does not form part of this License.
|
||||
|
||||
Creative Commons may be contacted at https://creativecommons.org/.
|
||||
@@ -1,21 +1,22 @@
|
||||

|
||||

|
||||
|
||||
Welcome to the Thaumic Tinkerer Github Repo.
|
||||
|
||||
Thaumic Tinkerer is a Thaumcraft addon, it's intention is to add new content to Thaumcraft, and bring back some oldies, but goodies.
|
||||
|
||||
[Thaumic Tinkerer MCF Thread](http://www.minecraftforum.net/topic/1813058-)
|
||||
[Thaumic Tinkerer MCF Thread](https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1289299-thaumic-tinkerer-thaumcraft-addon-evolve-knowledge-)
|
||||
|
||||
Thaumcraft © Azanor 2012
|
||||
[Thaumcraft MCF Thread](http://www.minecraftforum.net/topic/1585216-)
|
||||
Thaumcraft © Azanor 2012-2015
|
||||
[Thaumcraft Curseforge Page](https://www.curseforge.com/minecraft/mc-mods/thaumcraft)
|
||||
|
||||
This mod is made with a Deobfuscated version of Thaumcraft, loaded as a Library. You can get a deobfuscated version of Thaumcraft using immibis' [Bearded Octo Nemesis](https://github.com/immibis/bearded-octo-nemesis).
|
||||

|
||||
This mod is made with a Deobfuscated version of Thaumcraft, loaded as a Library, and will automatically get one for you via `gradlew`.
|
||||
|
||||

|
||||
|
||||
Thaumic Tinkerer Was originally by Vazkii and is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
|
||||
|
||||
# Fork
|
||||
This mod was forked by the GT:NH Team to continue the development of the 1.7.10 Branch.
|
||||
The up-to-date Master branch can be found on our Jenkins:
|
||||
http://jenkins.usrv.de
|
||||
This mod was forked by the GTNH Team to continue the development of the 1.7.10 Branch.
|
||||
|
||||
The up-to-date Master branch can be found on our [Jenkins](http://jenkins.usrv.eu:8080/job/Thaumic-Tinker/).
|
||||
-594
@@ -1,594 +0,0 @@
|
||||
//version: 1642484596
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
||||
*/
|
||||
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "https://maven.minecraftforge.net"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven {
|
||||
name = "Scala CI dependencies"
|
||||
url = "https://repo1.maven.org/maven2/"
|
||||
}
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'idea'
|
||||
id 'scala'
|
||||
id("org.ajoberstar.grgit") version("3.1.1")
|
||||
id("com.github.johnrengelman.shadow") version("4.0.4")
|
||||
id("com.palantir.git-version") version("0.12.3")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(projectJavaVersion)
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
|
||||
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
||||
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
|
||||
}
|
||||
|
||||
checkPropertyExists("modName")
|
||||
checkPropertyExists("modId")
|
||||
checkPropertyExists("modGroup")
|
||||
checkPropertyExists("autoUpdateBuildScript")
|
||||
checkPropertyExists("minecraftVersion")
|
||||
checkPropertyExists("forgeVersion")
|
||||
checkPropertyExists("replaceGradleTokenInFile")
|
||||
checkPropertyExists("gradleTokenModId")
|
||||
checkPropertyExists("gradleTokenModName")
|
||||
checkPropertyExists("gradleTokenVersion")
|
||||
checkPropertyExists("gradleTokenGroupName")
|
||||
checkPropertyExists("apiPackage")
|
||||
checkPropertyExists("accessTransformersFile")
|
||||
checkPropertyExists("usesMixins")
|
||||
checkPropertyExists("mixinPlugin")
|
||||
checkPropertyExists("mixinsPackage")
|
||||
checkPropertyExists("coreModClass")
|
||||
checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
||||
checkPropertyExists("usesShadowedDependencies")
|
||||
checkPropertyExists("developmentEnvironmentUserName")
|
||||
|
||||
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
|
||||
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
|
||||
if(apiPackage) {
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
||||
if(getFile(targetFile).exists() == false) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
}
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
|
||||
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
|
||||
}
|
||||
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
|
||||
}
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
|
||||
|
||||
// Make sure GregTech build won't time out
|
||||
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
|
||||
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
|
||||
}
|
||||
|
||||
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
|
||||
'git config core.fileMode false'.execute()
|
||||
|
||||
// Pulls version first from the VERSION env and then git tag
|
||||
String identifiedVersion
|
||||
try {
|
||||
String versionOverride = System.getenv("VERSION") ?: null
|
||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
||||
version = minecraftVersion + "-" + identifiedVersion
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!");
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
}
|
||||
else {
|
||||
archivesBaseName = modId
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
|
||||
runDir = "run"
|
||||
|
||||
if (replaceGradleTokenInFile) {
|
||||
replaceIn replaceGradleTokenInFile
|
||||
if(gradleTokenModId) {
|
||||
replace gradleTokenModId, modId
|
||||
}
|
||||
if(gradleTokenModName) {
|
||||
replace gradleTokenModName, modName
|
||||
}
|
||||
if(gradleTokenVersion) {
|
||||
replace gradleTokenVersion, versionDetails().lastTag
|
||||
}
|
||||
if(gradleTokenGroupName) {
|
||||
replace gradleTokenGroupName, modGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(file("addon.gradle").exists()) {
|
||||
apply from: "addon.gradle"
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
configurations {
|
||||
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
|
||||
implementation.extendsFrom(shadowCompile)
|
||||
implementation.extendsFrom(shadeCompile)
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Overmind forge repo mirror"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
if(usesMixins.toBoolean()) {
|
||||
maven {
|
||||
name = "sponge"
|
||||
url = "https://repo.spongepowered.org/repository/maven-public"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
if(usesMixins.toBoolean()) {
|
||||
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
|
||||
annotationProcessor("com.google.guava:guava:24.1.1-jre")
|
||||
annotationProcessor("com.google.code.gson:gson:2.8.6")
|
||||
annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT")
|
||||
// using 0.8 to workaround a issue in 0.7 which fails mixin application
|
||||
compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: "launchwrapper"
|
||||
exclude module: "guava"
|
||||
exclude module: "gson"
|
||||
exclude module: "commons-io"
|
||||
exclude module: "log4j-core"
|
||||
}
|
||||
compile("com.github.GTNewHorizons:SpongeMixins:1.5.0")
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
|
||||
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
|
||||
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
|
||||
|
||||
task generateAssets {
|
||||
if(usesMixins.toBoolean()) {
|
||||
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
|
||||
"required": true,
|
||||
"minVersion": "0.7.11",
|
||||
"package": "${modGroup}.${mixinsPackage}",
|
||||
"plugin": "${modGroup}.${mixinPlugin}",
|
||||
"refmap": "${mixingConfigRefMap}",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8"
|
||||
}
|
||||
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
|
||||
jar {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
reobf {
|
||||
if(usesMixins.toBoolean()) {
|
||||
addExtraSrgFile mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if(usesMixins.toBoolean()) {
|
||||
tasks.compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
||||
"-AoutSrgFile=${mixinSrg}",
|
||||
"-AoutRefMapFile=${refMap}",
|
||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
||||
"-XDenableSunApiLintControl",
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runClient {
|
||||
def arguments = []
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--mods=../build/libs/$modId-${version}.jar",
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
}
|
||||
|
||||
if(developmentEnvironmentUserName) {
|
||||
arguments += [
|
||||
"--username",
|
||||
developmentEnvironmentUserName
|
||||
]
|
||||
}
|
||||
|
||||
args(arguments)
|
||||
}
|
||||
|
||||
runServer {
|
||||
def arguments = []
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--mods=../build/libs/$modId-${version}.jar",
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
}
|
||||
|
||||
args(arguments)
|
||||
}
|
||||
|
||||
tasks.withType(JavaExec).configureEach {
|
||||
javaLauncher.set(
|
||||
javaToolchains.launcherFor {
|
||||
languageVersion = projectJavaVersion
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
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 "minecraftVersion": project.minecraft.version,
|
||||
"modVersion": versionDetails().lastTag,
|
||||
"modId": modId,
|
||||
"modName": modName
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
|
||||
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
manifestAttributes += [
|
||||
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
|
||||
"MixinConfigs" : "mixins." + modId + ".json",
|
||||
"ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false
|
||||
]
|
||||
}
|
||||
return manifestAttributes
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from (sourceSets.main.allJava)
|
||||
from (file("$projectDir/LICENSE"))
|
||||
getArchiveClassifier().set('sources')
|
||||
}
|
||||
|
||||
task shadowDevJar(type: ShadowJar) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
}
|
||||
|
||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowDevJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
task circularResolverJar(type: Jar) {
|
||||
dependsOn(relocateShadowDevJar)
|
||||
dependsOn(shadowDevJar)
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(circularResolverJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from (sourceSets.main.allJava) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.output) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.resources.srcDirs) {
|
||||
include("LICENSE")
|
||||
}
|
||||
|
||||
getArchiveClassifier().set('api')
|
||||
}
|
||||
|
||||
artifacts {
|
||||
if(!noPublishedSources) {
|
||||
archives sourcesJar
|
||||
}
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// publishing
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: ""
|
||||
if(!noPublishedSources) {
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
}
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
|
||||
if (apiPackage) {
|
||||
artifact source: apiJar, classifier: "api"
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
if (performBuildScriptUpdate(projectDir.toString())) return
|
||||
|
||||
print("Build script already up-to-date!")
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
if (autoUpdateBuildScript.toBoolean()) {
|
||||
performBuildScriptUpdate(projectDir.toString())
|
||||
} else {
|
||||
println("Build script update available! Run 'gradle updateBuildScript'")
|
||||
}
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
|
||||
}
|
||||
|
||||
boolean performBuildScriptUpdate(String projectDir) {
|
||||
if (isNewBuildScriptVersionAvailable(projectDir)) {
|
||||
def buildscriptFile = getFile("build.gradle")
|
||||
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
|
||||
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isNewBuildScriptVersionAvailable(String projectDir) {
|
||||
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
|
||||
|
||||
String currentBuildScript = getFile("build.gradle").getText()
|
||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
|
||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
||||
return !isUpToDate
|
||||
}
|
||||
|
||||
static String getVersionHash(String buildScriptContent) {
|
||||
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
|
||||
if(versionLine != null) {
|
||||
return versionLine.split(": ").last()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
configure(updateBuildScript) {
|
||||
group = 'forgegradle'
|
||||
description = 'Updates the build script to the latest version'
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
if (project.hasProperty(propertyName) == false) {
|
||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
|
||||
}
|
||||
}
|
||||
|
||||
def getFile(String relativePath) {
|
||||
return new File(projectDir, relativePath)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhconvention")
|
||||
}
|
||||
+20
-42
@@ -1,49 +1,27 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
|
||||
compile("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:api")
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.25-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false}
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-NH:1.0.2:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.13:dev') {transitive=false}
|
||||
|
||||
compile("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.39-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.15:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.49:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.9:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.19.34:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.120-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:2.0.0:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.22:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.64-GTNH:api') {transitive=false}
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api') {transitive=false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.242:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:EnderCore:0.2.6:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:EnderStorage:1.4.11:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:waila:1.5.18:api") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.9.0.10-GTNH:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.20-GTNH:api") {
|
||||
transitive = false
|
||||
}
|
||||
// For testing purposes
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.25:dev")
|
||||
|
||||
compileOnly("curse.maven:computercraft-67504:2269339") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("curse.maven:cofh-lib-220333:2388748") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("curse.maven:cofh-core-69162:2388751") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:api") {
|
||||
transitive = false
|
||||
}
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.5:dev')
|
||||
}
|
||||
+204
-28
@@ -1,64 +1,240 @@
|
||||
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||
# LOCAL to test local config updates.
|
||||
gtnh.settings.blowdryerTag = 0.2.0
|
||||
|
||||
# Human-readable mod name, available for mcmod.info population.
|
||||
modName = Thaumic Tinkerer
|
||||
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||
# Conventionally lowercase.
|
||||
modId = ThaumicTinkerer
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = thaumic.tinkerer
|
||||
|
||||
# WHY is there no version field?
|
||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
# Version of Minecraft to target
|
||||
minecraftVersion = 1.7.10
|
||||
|
||||
# Version of Minecraft Forge to target
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
developmentEnvironmentUserName = "Developer"
|
||||
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||
channel = stable
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile = LibMisc.java
|
||||
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||
mappingsVersion = 12
|
||||
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a default username for testing your mod. You can always override this per-run by running
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = true
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||
generateGradleTokenClass = thaumic.tinkerer.Tags
|
||||
|
||||
# Name of the token containing the project's current version to generate/replace.
|
||||
gradleTokenVersion = VERSION
|
||||
|
||||
# [DEPRECATED] Mod ID replacement token.
|
||||
gradleTokenModId =
|
||||
|
||||
# [DEPRECATED] Mod name replacement token.
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName =
|
||||
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...]).
|
||||
# Leave these properties empty to skip individual token replacements.
|
||||
replaceGradleTokenInFile =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||
apiPackage = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
accessTransformersFile = ThaumicTinkerer_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
usesMixins = true
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage = mixins
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass = preloader.ThaumicTLoaderContainer
|
||||
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins = false
|
||||
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||
# responsibility to check the license and request permission for distribution if required.
|
||||
usesShadowedDependencies = false
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
||||
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||
# their own classes, making the minimization unreliable.
|
||||
minimizeShadowedDependencies = true
|
||||
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
usesMavenPublishing = true
|
||||
|
||||
# Maven repository to publish the mod to.
|
||||
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||
|
||||
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||
#
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish to Modrinth.
|
||||
modrinthProjectId =
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
#
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||
curseForgeEnvironments = client,server
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
curseForgeRelations =
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
#customArchiveBaseName =
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||
# versionPattern =
|
||||
|
||||
# Uncomment to prevent the source code from being published.
|
||||
# noPublishedSources = true
|
||||
|
||||
# Uncomment this to disable Spotless checks.
|
||||
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||
# disableSpotless = true
|
||||
|
||||
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||
# disableCheckstyle = true
|
||||
|
||||
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||
# (force use delegated build).
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||
# ideaOverrideBuildType = idea
|
||||
|
||||
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+5
-1
@@ -1,5 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,80 +15,114 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# 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
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
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"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -97,92 +131,118 @@ 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.
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
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
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "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 or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# 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" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+32
-50
@@ -13,22 +13,28 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@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="-Xmx64m" "-Xms64m"
|
||||
|
||||
@@ -37,64 +43,40 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
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.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
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.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_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=%*
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
: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
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
: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
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
+9
-16
@@ -1,22 +1,15 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "GTNH Maven"
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
}
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = "https://maven.ic2.player.to/"
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name = 'glease'
|
||||
url = 'https://maven.glease.net/repos/releases/'
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup('net.glease')
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name = "GTNH Maven"
|
||||
url = uri("https://nexus.gtnewhorizons.com/repository/public/")
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.34"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 01:21:51 (GMT)]
|
||||
@@ -15,5 +12,4 @@
|
||||
package thaumic.tinkerer.api;
|
||||
|
||||
public interface INoRemoveEnchant {
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ package thaumic.tinkerer.api;
|
||||
* Created by Katrina on 16/04/14.
|
||||
*/
|
||||
public class InterModCommsOperations {
|
||||
|
||||
public static final String ADD_RESEARCH_BLACKLIST = "AddResearchBlacklist";
|
||||
public static final String ADD_CC_BLACKLIST = "AddCCBlacklist";
|
||||
}
|
||||
@@ -1,23 +1,21 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [13 Sep 2013, 15:00:40 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
@@ -33,9 +31,12 @@ public class ClientTickHandler {
|
||||
public void tickEnd(TickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
Minecraft mc = ClientHelper.minecraft();
|
||||
if (mc.currentScreen != null && mc.currentScreen instanceof GuiResearchRecipe && !(mc.currentScreen instanceof GuiResearchPeripheral)) {
|
||||
ResearchItem research = ReflectionHelper.getPrivateValue(GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9);
|
||||
if (research.key.equals(LibResearch.KEY_PERIPHERALS) || research.key.equals(LibResearch.KEY_GOLEMCONNECTOR))
|
||||
if (mc.currentScreen != null && mc.currentScreen instanceof GuiResearchRecipe
|
||||
&& !(mc.currentScreen instanceof GuiResearchPeripheral)) {
|
||||
ResearchItem research = ReflectionHelper
|
||||
.getPrivateValue(GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9);
|
||||
if (research.key.equals(LibResearch.KEY_PERIPHERALS)
|
||||
|| research.key.equals(LibResearch.KEY_GOLEMCONNECTOR))
|
||||
mc.displayGuiScreen(new GuiResearchPeripheral(research));
|
||||
}
|
||||
|
||||
@@ -44,5 +45,4 @@ public class ClientTickHandler {
|
||||
++elapsedTicks;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
package thaumic.tinkerer.client.core.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
|
||||
@@ -19,7 +21,7 @@ import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GemArmorKeyHandler {
|
||||
|
||||
static KeyBinding SpecialAbility = new KeyBinding("ttmisc.toggleArmor", Keyboard.KEY_U, "ttmisc.keyCategory");
|
||||
static KeyBinding SpecialAbility = new KeyBinding("ttmisc.toggleArmor", Keyboard.KEY_NONE, "ttmisc.keyCategory");
|
||||
|
||||
public GemArmorKeyHandler() {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
@@ -29,10 +31,20 @@ public class GemArmorKeyHandler {
|
||||
@SubscribeEvent
|
||||
public void keyUp(InputEvent.KeyInputEvent event) {
|
||||
if (SpecialAbility.isPressed()) {
|
||||
if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(0).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(1).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(2).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(3).getItem() instanceof ItemIchorclothArmorAdv)) {
|
||||
KamiArmorClientHandler.SetStatus(!ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer()));
|
||||
if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null && Minecraft.getMinecraft().thePlayer
|
||||
.getCurrentArmor(0).getItem() instanceof ItemIchorclothArmorAdv)
|
||||
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) != null
|
||||
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(1)
|
||||
.getItem() instanceof ItemIchorclothArmorAdv)
|
||||
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) != null
|
||||
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(2)
|
||||
.getItem() instanceof ItemIchorclothArmorAdv)
|
||||
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null
|
||||
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(3)
|
||||
.getItem() instanceof ItemIchorclothArmorAdv)) {
|
||||
KamiArmorClientHandler
|
||||
.SetStatus(!ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,16 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [10 Sep 2013, 12:16:36 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.handler;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
@@ -26,6 +22,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
@@ -73,10 +71,20 @@ public final class HUDHandler {
|
||||
}
|
||||
|
||||
if (new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a).getItem() != null)
|
||||
renderItem.renderItemIntoGUI(font, ClientHelper.minecraft().renderEngine, new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a), xpos, ypos);
|
||||
renderItem.renderItemIntoGUI(
|
||||
font,
|
||||
ClientHelper.minecraft().renderEngine,
|
||||
new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a),
|
||||
xpos,
|
||||
ypos);
|
||||
else {
|
||||
if (((ItemBlock) pickedBlock.getItem()).field_150939_a == Blocks.reeds)
|
||||
renderItem.renderItemIntoGUI(font, ClientHelper.minecraft().renderEngine, new ItemStack(Items.reeds), xpos, ypos);
|
||||
renderItem.renderItemIntoGUI(
|
||||
font,
|
||||
ClientHelper.minecraft().renderEngine,
|
||||
new ItemStack(Items.reeds),
|
||||
xpos,
|
||||
ypos);
|
||||
}
|
||||
font.setUnicodeFlag(unicode);
|
||||
}
|
||||
@@ -84,5 +92,4 @@ public final class HUDHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package thaumic.tinkerer.client.core.handler.kami;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor;
|
||||
|
||||
@@ -14,10 +15,8 @@ public class KamiArmorClientHandler {
|
||||
|
||||
public static void SetStatus(boolean status) {
|
||||
if (FMLClientHandler.instance().getClient().currentScreen == null) {
|
||||
if (status)
|
||||
ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.enableAllArmor"));
|
||||
else
|
||||
ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.disableAllArmor"));
|
||||
if (status) ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.enableAllArmor"));
|
||||
else ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.disableAllArmor"));
|
||||
ArmorEnabled = status;
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketToggleArmor(status));
|
||||
}
|
||||
|
||||
+29
-30
@@ -1,70 +1,69 @@
|
||||
package thaumic.tinkerer.client.core.handler.kami;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
|
||||
import java.util.List;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
|
||||
public final class PlacementMirrorPredictionRenderer {
|
||||
|
||||
RenderBlocks blockRender = new RenderBlocks();
|
||||
private final RenderBlocks blockRender;
|
||||
|
||||
public PlacementMirrorPredictionRenderer() {
|
||||
this.blockRender = new RenderBlocks();
|
||||
blockRender.useInventoryTint = false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldRenderLast(RenderWorldLastEvent event) {
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
List<EntityPlayer> playerEntities = world.playerEntities;
|
||||
for (EntityPlayer player : playerEntities) {
|
||||
ItemStack currentStack = player.getCurrentEquippedItem();
|
||||
if (currentStack != null && currentStack.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class) && ItemPlacementMirror.getBlock(currentStack) != Blocks.air) {
|
||||
if (currentStack != null && currentStack.getItem() == TTRegistry.itemPlacementMirror) {
|
||||
renderPlayerLook(player, currentStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderPlayerLook(EntityPlayer player, ItemStack stack) {
|
||||
ChunkCoordinates[] coords = ItemPlacementMirror.getBlocksToPlace(stack, player);
|
||||
if (ItemPlacementMirror.hasBlocks(stack, player, coords)) {
|
||||
ItemStack block = new ItemStack(ItemPlacementMirror.getBlock(stack), 1, ItemPlacementMirror.getBlockMeta(stack));
|
||||
ChunkCoordinates lastCoords = new ChunkCoordinates(0, 0, 0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Block requiredBlock = ItemPlacementMirror.getBlock(stack);
|
||||
if (requiredBlock == null) return;
|
||||
int requiredMetadata = ItemPlacementMirror.getBlockMeta(stack);
|
||||
List<ChunkCoordinates> coords = ItemPlacementMirror.getBlocksToPlace(stack, player);
|
||||
if (ItemPlacementMirror.hasBlocks(player, requiredBlock, requiredMetadata, coords.size())) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.6F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
for (ChunkCoordinates coord : coords) {
|
||||
renderBlockAt(block, coord, lastCoords);
|
||||
lastCoords = coord;
|
||||
renderBlockAt(requiredBlock, requiredMetadata, coord);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderBlockAt(ItemStack block, ChunkCoordinates pos, ChunkCoordinates last) {
|
||||
if (block.getItem() == null)
|
||||
return;
|
||||
private void renderBlockAt(Block block, int metadata, ChunkCoordinates pos) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(pos.posX + 0.5 - RenderManager.renderPosX, pos.posY + 0.5 - RenderManager.renderPosY, pos.posZ + 0.5 - RenderManager.renderPosZ);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.6F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
blockRender.useInventoryTint = false;
|
||||
blockRender.renderBlockAsItem(Block.getBlockFromItem(block.getItem()), block.getItemDamage(), 1F);
|
||||
|
||||
GL11.glTranslated(
|
||||
pos.posX + 0.5 - RenderManager.renderPosX,
|
||||
pos.posY + 0.5 - RenderManager.renderPosY,
|
||||
pos.posZ + 0.5 - RenderManager.renderPosZ);
|
||||
blockRender.renderBlockAsItem(block, metadata, 1F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
+38
-65
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 29, 2013, 9:35:38 PM (GMT)]
|
||||
@@ -22,12 +19,13 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
public final class SoulHeartClientHandler {
|
||||
|
||||
@@ -56,60 +54,38 @@ public final class SoulHeartClientHandler {
|
||||
}
|
||||
|
||||
/*
|
||||
* @SideOnly(Side.CLIENT)
|
||||
* @SubscribeEvent public void renderHealthBar(RenderGameOverlayEvent event) { if (event.type == ElementType.FOOD &&
|
||||
* clientPlayerHP > 0) { if (event instanceof RenderGameOverlayEvent.Post) { Minecraft mc =
|
||||
* Minecraft.getMinecraft(); int x = event.resolution.getScaledWidth() / 2 + 10; int y =
|
||||
* event.resolution.getScaledHeight() - 39; //GL11.glTranslatef(0F, 10F, 0F);
|
||||
* mc.renderEngine.bindTexture(heartsResource); int it = 0; for (int i = 0; i < clientPlayerHP; i++) { boolean half
|
||||
* = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0; if (half || i % 2 == 0) { renderHeart(x + it * 8, y,
|
||||
* !half); it++; } } mc.renderEngine.bindTexture(iconsResource); } //GL11.glTranslatef(0F, -10F, 0F); } //if
|
||||
* (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0)
|
||||
* //GL11.glTranslatef(0F, 10F, 0F); }
|
||||
*/
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.HEALTH) {
|
||||
renderHUD(event.resolution, mc.thePlayer, null);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void renderHealthBar(RenderGameOverlayEvent event) {
|
||||
if (event.type == ElementType.FOOD && clientPlayerHP > 0) {
|
||||
if (event instanceof RenderGameOverlayEvent.Post) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
|
||||
|
||||
int x = event.resolution.getScaledWidth() / 2 + 10;
|
||||
int y = event.resolution.getScaledHeight() - 39;
|
||||
|
||||
//GL11.glTranslatef(0F, 10F, 0F);
|
||||
mc.renderEngine.bindTexture(heartsResource);
|
||||
int it = 0;
|
||||
for (int i = 0; i < clientPlayerHP; i++) {
|
||||
boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0;
|
||||
if (half || i % 2 == 0) {
|
||||
renderHeart(x + it * 8, y, !half);
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
mc.renderEngine.bindTexture(iconsResource);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef(0F, -10F, 0F);
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.renderEngine.bindTexture(heartsResource);
|
||||
int x = resolution.getScaledWidth() / 2 + 10;
|
||||
int y = resolution.getScaledHeight() - ConfigHandler.soulHeartHeight;
|
||||
if (player.getAir() < 300) {
|
||||
y = resolution.getScaledHeight() - (ConfigHandler.soulHeartHeight + 10);
|
||||
}
|
||||
|
||||
//if (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0)
|
||||
//GL11.glTranslatef(0F, 10F, 0F);
|
||||
}*/
|
||||
|
||||
@SubscribeEvent(priority=EventPriority.HIGHEST)
|
||||
public void onDrawScreenPre(RenderGameOverlayEvent.Pre event)
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.HEALTH)
|
||||
{
|
||||
renderHUD(event.resolution, mc.thePlayer, null);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.renderEngine.bindTexture(heartsResource);
|
||||
int x = resolution.getScaledWidth() / 2 + 10;
|
||||
int y = resolution.getScaledHeight() - ConfigHandler.soulHeartHeight;
|
||||
if (player.getAir() < 300) {
|
||||
y = resolution.getScaledHeight() - (ConfigHandler.soulHeartHeight + 10);
|
||||
}
|
||||
|
||||
mc.renderEngine.bindTexture(heartsResource);
|
||||
mc.renderEngine.bindTexture(heartsResource);
|
||||
int it = 0;
|
||||
for (int i = 0; i < clientPlayerHP; i++) {
|
||||
boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0;
|
||||
@@ -119,9 +95,6 @@ public final class SoulHeartClientHandler {
|
||||
}
|
||||
}
|
||||
|
||||
//GL11.glEnable(3008);
|
||||
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
}
|
||||
mc.renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,31 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 29, 2013, 11:38:29 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.handler.kami;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
|
||||
import java.awt.*;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
|
||||
public final class ToolModeHUDHandler {
|
||||
|
||||
@@ -42,14 +41,14 @@ public final class ToolModeHUDHandler {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void clientTick() {
|
||||
if (tooltipDisplayTicks > 0)
|
||||
--tooltipDisplayTicks;
|
||||
if (tooltipDisplayTicks > 0) --tooltipDisplayTicks;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawDislocationFocusHUD(RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == ElementType.ALL && tooltipDisplayTicks > 0 && !MathHelper.stringNullOrLengthZero(currentTooltip)) {
|
||||
if (event.type == ElementType.ALL && tooltipDisplayTicks > 0
|
||||
&& !MathHelper.stringNullOrLengthZero(currentTooltip)) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution var5 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
int var6 = var5.getScaledWidth();
|
||||
@@ -61,19 +60,18 @@ public final class ToolModeHUDHandler {
|
||||
|
||||
int opacity = (int) (tooltipDisplayTicks * 256.0F / 10.0F);
|
||||
|
||||
if (opacity > 160)
|
||||
opacity = 160;
|
||||
if (opacity > 160) opacity = 160;
|
||||
|
||||
if (opacity > 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
int color = Color.getHSBColor((float) Math.cos(ClientTickHandler.elapsedTicks / 250D), 0.6F, 1F).getRGB();
|
||||
int color = Color.getHSBColor((float) Math.cos(ClientTickHandler.elapsedTicks / 250D), 0.6F, 1F)
|
||||
.getRGB();
|
||||
var8.drawStringWithShadow(currentTooltip, tooltipStartX, tooltipStartY, color + (opacity << 24));
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +1,26 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 18:11:25 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.helper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class ClientHelper {
|
||||
|
||||
public static Minecraft minecraft() {
|
||||
@@ -53,14 +51,12 @@ public final class ClientHelper {
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
for (var6 = 0; var6 < tooltipData.size(); ++var6) {
|
||||
var7 = fontRenderer.getStringWidth(tooltipData.get(var6));
|
||||
if (var7 > var5)
|
||||
var5 = var7;
|
||||
if (var7 > var5) var5 = var7;
|
||||
}
|
||||
var6 = x + 12;
|
||||
var7 = y - 12;
|
||||
int var9 = 8;
|
||||
if (tooltipData.size() > 1)
|
||||
var9 += 2 + (tooltipData.size() - 1) * 10;
|
||||
if (tooltipData.size() > 1) var9 += 2 + (tooltipData.size() - 1) * 10;
|
||||
float z = 300.0F;
|
||||
drawGradientRect(var6 - 3, var7 - 4, z, var6 + var5 + 3, var7 - 3, color2, color2);
|
||||
drawGradientRect(var6 - 3, var7 + var9 + 3, z, var6 + var5 + 3, var7 + var9 + 4, color2, color2);
|
||||
@@ -75,8 +71,7 @@ public final class ClientHelper {
|
||||
for (int var13 = 0; var13 < tooltipData.size(); ++var13) {
|
||||
String var14 = tooltipData.get(var13);
|
||||
fontRenderer.drawStringWithShadow(var14, var6, var7, -1);
|
||||
if (var13 == 0)
|
||||
var7 += 2;
|
||||
if (var13 == 0) var7 += 2;
|
||||
var7 += 10;
|
||||
}
|
||||
}
|
||||
@@ -110,5 +105,4 @@ public final class ClientHelper {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 15:47:08 (GMT)]
|
||||
@@ -18,6 +15,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class IconHelper {
|
||||
@@ -55,5 +53,4 @@ public class IconHelper {
|
||||
public static IIcon forItem(IIconRegister ir, Item item, String s) {
|
||||
return forName(ir, item.getUnlocalizedName().replaceAll("item.", "") + s);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,16 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [4 Sep 2013, 16:33:54 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.core.proxy;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -29,11 +19,19 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.EnumHelperClient;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
import thaumic.tinkerer.client.core.handler.GemArmorKeyHandler;
|
||||
import thaumic.tinkerer.client.core.handler.HUDHandler;
|
||||
|
||||
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
|
||||
import thaumic.tinkerer.client.core.handler.kami.PlacementMirrorPredictionRenderer;
|
||||
import thaumic.tinkerer.client.core.handler.kami.SoulHeartClientHandler;
|
||||
@@ -47,7 +45,11 @@ import thaumic.tinkerer.client.render.block.kami.RenderWarpGate;
|
||||
import thaumic.tinkerer.client.render.item.RenderGenericSeeds;
|
||||
import thaumic.tinkerer.client.render.item.RenderMobDisplay;
|
||||
import thaumic.tinkerer.client.render.item.kami.RenderPlacementMirror;
|
||||
import thaumic.tinkerer.client.render.tile.*;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileAnimationTablet;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileEnchanter;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileFunnel;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileRepairer;
|
||||
import thaumic.tinkerer.client.render.tile.kami.RenderTileWarpGate;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileEnchanter;
|
||||
@@ -57,14 +59,18 @@ import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
|
||||
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.compat.FumeTool;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.proxy.TTCommonProxy;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam;
|
||||
import thaumic.tinkerer.common.potion.PotionEffectHandlerClient;
|
||||
|
||||
public class TTClientProxy extends TTCommonProxy {
|
||||
public final class TTClientProxy extends TTCommonProxy {
|
||||
|
||||
private PotionEffectHandlerClient potionHandlerClient;
|
||||
|
||||
public static EntityPlayer getPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
@@ -73,13 +79,21 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
if (Loader.isModLoaded("ComputerCraft")) {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
if (LoadedMods.computerCraftLoaded) {
|
||||
MinecraftForge.EVENT_BUS.register(new FumeTool());
|
||||
}
|
||||
|
||||
if (ConfigHandler.enableKami)
|
||||
//kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
|
||||
kamiRarity = EnumHelperClient.addEnum(new Class[][]{{EnumRarity.class, EnumChatFormatting.class, String.class}}, EnumRarity.class, "KAMI", EnumChatFormatting.LIGHT_PURPLE, "Kami");
|
||||
|
||||
if (ConfigHandler.enableKami) {
|
||||
// kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
|
||||
|
||||
kamiRarity = EnumHelperClient.addEnum(
|
||||
new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } },
|
||||
EnumRarity.class,
|
||||
"KAMI",
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
"Kami");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,6 +116,21 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
|
||||
this.potionHandlerClient = new PotionEffectHandlerClient();
|
||||
MinecraftForge.EVENT_BUS.register(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().register(potionHandlerClient);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
|
||||
if (this.potionHandlerClient != null) {
|
||||
MinecraftForge.EVENT_BUS.unregister(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().unregister(potionHandlerClient);
|
||||
this.potionHandlerClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void registerTiles() {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAnimationTablet.class, new RenderTileAnimationTablet());
|
||||
@@ -125,22 +154,39 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderMagnet());
|
||||
RenderingRegistry.registerBlockHandler(new RenderRepairer());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class), new RenderMobDisplay());
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class), new RenderGenericSeeds());
|
||||
RenderMobDisplay mobDisplayRenderer = new RenderMobDisplay();
|
||||
MinecraftForge.EVENT_BUS.register(mobDisplayRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class),
|
||||
mobDisplayRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class),
|
||||
new RenderGenericSeeds());
|
||||
|
||||
if (ConfigHandler.enableKami) {
|
||||
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class), new RenderPlacementMirror());
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class),
|
||||
new RenderPlacementMirror());
|
||||
|
||||
LibRenderIDs.idWarpGate = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderWarpGate());
|
||||
//KeyBindingRegistry.registerKeyBinding(new GemArmorKeyHandler());
|
||||
// KeyBindingRegistry.registerKeyBinding(new GemArmorKeyHandler());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shadowSparkle(World world, float x, float y, float z, int size) {
|
||||
ItemFocusShadowbeam.Particle fx = new ItemFocusShadowbeam.Particle(world, (double)x, (double)y, (double)z, size, 0.001f, 0.001f, 0.001f, 5);
|
||||
ItemFocusShadowbeam.Particle fx = new ItemFocusShadowbeam.Particle(
|
||||
world,
|
||||
(double) x,
|
||||
(double) y,
|
||||
(double) z,
|
||||
size,
|
||||
0.001f,
|
||||
0.001f,
|
||||
0.001f,
|
||||
5);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
|
||||
@@ -161,7 +207,6 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
@Override
|
||||
public boolean armorStatus(EntityPlayer player) {
|
||||
return KamiArmorClientHandler.ArmorEnabled;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -176,5 +221,4 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return ClientHelper.clientPlayer();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +1,27 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 16:31:14 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonAT;
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonATRadio;
|
||||
import thaumic.tinkerer.client.gui.button.IRadioButton;
|
||||
@@ -29,9 +31,6 @@ import thaumic.tinkerer.common.block.tile.container.ContainerAnimationTablet;
|
||||
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.network.packet.PacketTabletButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiAnimationTablet extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ANIMATION_TABLET);
|
||||
@@ -39,8 +38,7 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
int x, y;
|
||||
|
||||
TileAnimationTablet tablet;
|
||||
List<GuiButtonAT> buttonListAT = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
|
||||
super(new ContainerAnimationTablet(tablet, playerInv));
|
||||
@@ -52,27 +50,26 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListAT.clear();
|
||||
addButton(new GuiButtonAT(0, x + xSize / 2 - 7, y + 60, tablet.redstone));
|
||||
addButton(new GuiButtonATRadio(1, x + 52, y + 15, tablet.leftClick, radioButtons));
|
||||
addButton(new GuiButtonATRadio(2, x + 111, y + 15, !tablet.leftClick, radioButtons));
|
||||
buttonList = buttonListAT;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonAT button) {
|
||||
buttonListAT.add(button);
|
||||
if (button instanceof IRadioButton)
|
||||
radioButtons.add((IRadioButton) button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton)
|
||||
((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListAT.get(0).buttonEnabled = !buttonListAT.get(0).buttonEnabled;
|
||||
var button0 = (GuiButtonAT) buttonList.get(0);
|
||||
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else {
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
tablet.leftClick = buttonListAT.get(1).buttonEnabled;
|
||||
tablet.redstone = buttonListAT.get(0).buttonEnabled;
|
||||
tablet.leftClick = ((GuiButtonAT) buttonList.get(1)).buttonEnabled;
|
||||
tablet.redstone = button0.buttonEnabled;
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketTabletButton(tablet));
|
||||
}
|
||||
@@ -88,7 +85,8 @@ public class GuiAnimationTablet extends GuiContainer {
|
||||
|
||||
fontRendererObj.drawString(left, x + 48 - fontRendererObj.getStringWidth(left), y + 18, 0x999999);
|
||||
fontRendererObj.drawString(right, x + 128, y + 18, 0x999999);
|
||||
fontRendererObj.drawString(redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999);
|
||||
fontRendererObj
|
||||
.drawString(redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,27 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 11, 2013, 10:46:14 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
@@ -31,9 +33,6 @@ import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer;
|
||||
import thaumic.tinkerer.common.block.tile.container.ContainerAspectAnalyzer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiAspectAnalyzer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
|
||||
@@ -66,7 +65,8 @@ public class GuiAspectAnalyzer extends GuiContainer {
|
||||
if (stack != null) {
|
||||
int h = ScanManager.generateItemHash(stack.getItem(), stack.getItemDamage());
|
||||
|
||||
List<String> list = Thaumcraft.proxy.getScannedObjects().get(ClientHelper.clientPlayer().getGameProfile().getName());
|
||||
List<String> list = Thaumcraft.proxy.getScannedObjects()
|
||||
.get(ClientHelper.clientPlayer().getGameProfile().getName());
|
||||
if (list != null && (list.contains("@" + h) || list.contains("#" + h))) {
|
||||
AspectList tags = ThaumcraftCraftingManager.getObjectTags(stack);
|
||||
tags = ThaumcraftCraftingManager.getBonusTags(stack, tags);
|
||||
@@ -77,8 +77,7 @@ public class GuiAspectAnalyzer extends GuiContainer {
|
||||
int y = this.y + 58;
|
||||
UtilsFX.drawTag(x, y, aspect, tags.getAmount(aspect), 0, zLevel);
|
||||
|
||||
if (mx > x && mx < x + 16 && my > y && my < y + 16)
|
||||
aspectHovered = aspect;
|
||||
if (mx > x && mx < x + 16 && my > y && my < y + 16) aspectHovered = aspect;
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -89,10 +88,13 @@ public class GuiAspectAnalyzer extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mx, int my) {
|
||||
if (aspectHovered != null)
|
||||
ClientHelper.renderTooltip(mx - x, my - y, Arrays.asList(EnumChatFormatting.AQUA + aspectHovered.getName(), EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription()));
|
||||
if (aspectHovered != null) ClientHelper.renderTooltip(
|
||||
mx - x,
|
||||
my - y,
|
||||
Arrays.asList(
|
||||
EnumChatFormatting.AQUA + aspectHovered.getName(),
|
||||
EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription()));
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mx, my);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,29 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [15 Sep 2013, 00:58:22 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonEnchant;
|
||||
@@ -36,15 +39,11 @@ import thaumic.tinkerer.common.lib.LibFeatures;
|
||||
import thaumic.tinkerer.common.network.packet.PacketEnchanterAddEnchant;
|
||||
import thaumic.tinkerer.common.network.packet.PacketEnchanterStartWorking;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiEnchanting extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
|
||||
public TileEnchanter enchanter;
|
||||
public List<String> tooltip = new ArrayList();
|
||||
public List<String> tooltip = new ArrayList<>();
|
||||
int x, y;
|
||||
GuiButtonEnchantment[] enchantButtons = new GuiButtonEnchantment[16];
|
||||
List<Integer> lastTickEnchants;
|
||||
@@ -57,8 +56,8 @@ public class GuiEnchanting extends GuiContainer {
|
||||
this.enchanter = enchanter;
|
||||
lastTickStack = enchanter.getStackInSlot(0);
|
||||
currentStack = enchanter.getStackInSlot(0);
|
||||
lastTickEnchants = new ArrayList(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList(enchanter.levels);
|
||||
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList<>(enchanter.levels);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,54 +105,53 @@ public class GuiEnchanting extends GuiContainer {
|
||||
enchantButtons[i].enabled = false;
|
||||
}
|
||||
|
||||
if (currentStack == null || currentStack.isItemEnchanted())
|
||||
return;
|
||||
if (currentStack == null || currentStack.isItemEnchanted()) return;
|
||||
|
||||
int it = 0;
|
||||
|
||||
for (int enchant : EnchantmentManager.enchantmentData.keySet()) {
|
||||
if (currentStack.getItem().getItemEnchantability() != 0 && EnchantmentManager.canApply(currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments) && EnchantmentManager.canEnchantmentBeUsed(ClientHelper.clientPlayer().getGameProfile().getName(), Enchantment.enchantmentsList[enchant])) {
|
||||
if (currentStack.getItem().getItemEnchantability() != 0
|
||||
&& EnchantmentManager
|
||||
.canApply(currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments)
|
||||
&& EnchantmentManager.canEnchantmentBeUsed(
|
||||
ClientHelper.clientPlayer().getGameProfile().getName(),
|
||||
Enchantment.enchantmentsList[enchant])) {
|
||||
enchantButtons[it].enchant = Enchantment.enchantmentsList[enchant];
|
||||
enchantButtons[it].enabled = true;
|
||||
it++;
|
||||
if (it >= 16)
|
||||
break;
|
||||
if (it >= 16) break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton.id == 0) {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterStartWorking(enchanter));
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterStartWorking());
|
||||
} else if (par1GuiButton.id <= 16) {
|
||||
GuiButtonEnchantment button = enchantButtons[par1GuiButton.id - 1];
|
||||
if (button != null && button.enchant != null)
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0));
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(button.enchant.effectId, 0));
|
||||
} else {
|
||||
int type = (par1GuiButton.id - 17) % 3;
|
||||
int index = (par1GuiButton.id - 17) / 3;
|
||||
|
||||
if (index >= enchanter.enchantments.size() || index >= enchanter.levels.size())
|
||||
return;
|
||||
if (index >= enchanter.enchantments.size() || index >= enchanter.levels.size()) return;
|
||||
|
||||
int level = enchanter.levels.get(index);
|
||||
|
||||
Enchantment enchant = Enchantment.enchantmentsList[enchanter.enchantments.get(index)];
|
||||
|
||||
switch (type) {
|
||||
case 0: {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1));
|
||||
break;
|
||||
case 0 -> {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchant.effectId, -1));
|
||||
}
|
||||
case 1: {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level == 1 ? -1 : level - 1));
|
||||
break;
|
||||
case 1 -> {
|
||||
ThaumicTinkerer.netHandler
|
||||
.sendToServer(new PacketEnchanterAddEnchant(enchant.effectId, level == 1 ? -1 : level - 1));
|
||||
}
|
||||
case 2: {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1));
|
||||
break;
|
||||
case 2 -> {
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchant.effectId, level + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,12 +163,13 @@ public class GuiEnchanting extends GuiContainer {
|
||||
public void updateScreen() {
|
||||
currentStack = enchanter.getStackInSlot(0);
|
||||
buildButtonList();
|
||||
if (currentStack != lastTickStack || !lastTickEnchants.equals(enchanter.enchantments) || !lastTickLevels.equals(enchanter.levels))
|
||||
if (currentStack != lastTickStack || !lastTickEnchants.equals(enchanter.enchantments)
|
||||
|| !lastTickLevels.equals(enchanter.levels))
|
||||
buildButtonList();
|
||||
|
||||
lastTickStack = currentStack;
|
||||
lastTickEnchants = new ArrayList(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList(enchanter.enchantments);
|
||||
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
|
||||
lastTickLevels = new ArrayList<>(enchanter.enchantments);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,8 +192,7 @@ public class GuiEnchanting extends GuiContainer {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
int xo = 15;
|
||||
int z = 50;
|
||||
if (enchantButtons[8].enabled)
|
||||
z = 26;
|
||||
if (enchantButtons[8].enabled) z = 26;
|
||||
for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) {
|
||||
drawAspectBar(aspect, x + xo, y + z, i, j);
|
||||
xo += 15;
|
||||
@@ -205,8 +203,7 @@ public class GuiEnchanting extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
if (!tooltip.isEmpty())
|
||||
ClientHelper.renderTooltip(par1 - x, par2 - y, tooltip);
|
||||
if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1 - x, par2 - y, tooltip);
|
||||
tooltip.clear();
|
||||
}
|
||||
|
||||
@@ -229,11 +226,10 @@ public class GuiEnchanting extends GuiContainer {
|
||||
}
|
||||
|
||||
if (mx > x && mx <= x + 10 && my > y - size && my <= y) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add('\u00a7' + aspect.getChatcolor() + aspect.getName());
|
||||
tooltip.add(current + "/" + totalCost);
|
||||
this.tooltip = tooltip;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,28 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 18:37:02 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonMM;
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonMMRadio;
|
||||
import thaumic.tinkerer.client.gui.button.IRadioButton;
|
||||
@@ -31,20 +33,15 @@ import thaumic.tinkerer.common.block.tile.container.ContainerMobMagnet;
|
||||
import thaumic.tinkerer.common.item.ItemSoulMould;
|
||||
import thaumic.tinkerer.common.network.packet.PacketMobMagnetButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiMobMagnet extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_MOB_MAGNET);
|
||||
|
||||
int x, y;
|
||||
private int x, y;
|
||||
|
||||
ItemStack stack = null;
|
||||
TileMobMagnet mobMagnet;
|
||||
|
||||
List<GuiButtonMM> buttonListMM = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
|
||||
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
|
||||
super(new ContainerMobMagnet(tile, playerInv));
|
||||
@@ -56,25 +53,24 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListMM.clear();
|
||||
addButton(new GuiButtonMMRadio(0, x + 100, y + 28, mobMagnet.adult, radioButtons));
|
||||
addButton(new GuiButtonMMRadio(1, x + 100, y + 48, !mobMagnet.adult, radioButtons));
|
||||
buttonList = buttonListMM;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonMM button) {
|
||||
buttonListMM.add(button);
|
||||
if (button instanceof IRadioButton)
|
||||
radioButtons.add((IRadioButton) button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton)
|
||||
((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button instanceof IRadioButton rButton) {
|
||||
rButton.enableFromClick();
|
||||
} else {
|
||||
buttonList.get(0).enabled = !buttonList.get(0).enabled;
|
||||
}
|
||||
|
||||
mobMagnet.adult = buttonListMM.get(0).enabled;
|
||||
mobMagnet.setAdult(buttonList.get(0).enabled);
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketMobMagnetButton(mobMagnet));
|
||||
}
|
||||
@@ -86,21 +82,20 @@ public class GuiMobMagnet extends GuiContainer {
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
String adult = StatCollector.translateToLocal("ttmisc.adult");
|
||||
String child = StatCollector.translateToLocal("ttmisc.child");
|
||||
stack = mobMagnet.getStackInSlot(0);
|
||||
ItemStack stack = mobMagnet.getStackInSlot(0);
|
||||
|
||||
String filter;
|
||||
|
||||
if (stack != null) {
|
||||
String name = ItemSoulMould.getPatternName(stack);
|
||||
if (name.isEmpty())
|
||||
filter = StatCollector.translateToLocal("ttmisc.none");
|
||||
if (name.isEmpty()) filter = StatCollector.translateToLocal("ttmisc.none");
|
||||
else filter = StatCollector.translateToLocal("entity." + name + ".name");
|
||||
} else filter = StatCollector.translateToLocal("ttmisc.all");
|
||||
|
||||
fontRendererObj.drawString(filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999);
|
||||
fontRendererObj
|
||||
.drawString(filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999);
|
||||
fontRendererObj.drawString(adult, x + 120, y + 30, 0x999999);
|
||||
fontRendererObj.drawString(child, x + 120, y + 50, 0x999999);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonRP;
|
||||
import thaumic.tinkerer.client.gui.button.GuiButtonRPRadio;
|
||||
import thaumic.tinkerer.client.gui.button.IRadioButton;
|
||||
@@ -15,20 +19,16 @@ import thaumic.tinkerer.common.block.tile.TileRPlacer;
|
||||
import thaumic.tinkerer.common.block.tile.container.ContainerRemotePlacer;
|
||||
import thaumic.tinkerer.common.network.packet.PacketPlacerButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by nekosune on 30/06/14.
|
||||
*/
|
||||
public class GuiRemotePlacer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
|
||||
|
||||
int x, y;
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
List<GuiButtonRP> buttonListRP = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList<>();
|
||||
TileRPlacer placer;
|
||||
Aspect aspectHovered = null;
|
||||
|
||||
public GuiRemotePlacer(TileRPlacer placer, InventoryPlayer inv) {
|
||||
super(new ContainerRemotePlacer(placer, inv));
|
||||
@@ -40,26 +40,24 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListRP.clear();
|
||||
addButton(new GuiButtonRPRadio(0, x + 100, y + 0, placer.blocks == 1, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(1, x + 100, y + 13, placer.blocks == 2, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(2, x + 100, y + 26, placer.blocks == 3, radioButtons));
|
||||
addButton(new GuiButtonRPRadio(3, x + 100, y + 39, placer.blocks == 4, radioButtons));
|
||||
buttonList = buttonListRP;
|
||||
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonRP button) {
|
||||
buttonListRP.add(button);
|
||||
if (button instanceof IRadioButton)
|
||||
radioButtons.add((IRadioButton) button);
|
||||
buttonList.add(button);
|
||||
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton instanceof IRadioButton)
|
||||
((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListRP.get(0).buttonEnabled = !buttonListRP.get(0).buttonEnabled;
|
||||
if (par1GuiButton instanceof IRadioButton iRadioButton) iRadioButton.enableFromClick();
|
||||
else {
|
||||
var button0 = (GuiButtonRP) buttonList.get(0);
|
||||
button0.buttonEnabled = !button0.buttonEnabled;
|
||||
}
|
||||
|
||||
placer.blocks = par1GuiButton.id + 1;
|
||||
|
||||
@@ -77,6 +75,4 @@ public class GuiRemotePlacer extends GuiContainer {
|
||||
fontRendererObj.drawString("4", x + 120, y + 41, 0x999999);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +1,26 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [13 Sep 2013, 14:50:41 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.net.URI;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
|
||||
import java.awt.*;
|
||||
import java.net.URI;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiResearchPeripheral extends GuiResearchRecipe {
|
||||
|
||||
@@ -41,5 +39,4 @@ public class GuiResearchPeripheral extends GuiResearchRecipe {
|
||||
}
|
||||
} else super.keyTyped(par1, par2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 16:33:24 (GMT)]
|
||||
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class GuiButtonAT extends GuiButton {
|
||||
@@ -38,4 +36,4 @@ public class GuiButtonAT extends GuiButton {
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 16:33:43 (GMT)]
|
||||
@@ -28,15 +25,12 @@ public class GuiButtonATRadio extends GuiButtonAT implements IRadioButton {
|
||||
@Override
|
||||
public void enableFromClick() {
|
||||
setEnabled(true);
|
||||
for (IRadioButton button : linkedButtons)
|
||||
if (button != this)
|
||||
button.updateStatus(this);
|
||||
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(IRadioButton otherButton) {
|
||||
if (otherButton.isEnabled())
|
||||
setEnabled(false);
|
||||
if (otherButton.isEnabled()) setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,4 +42,4 @@ public class GuiButtonATRadio extends GuiButtonAT implements IRadioButton {
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.buttonEnabled = enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,30 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [14 Sep 2013, 21:56:21 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui.button;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.gui.GuiEnchanting;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.block.tile.TileEnchanter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiButtonEnchant extends GuiButton {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
|
||||
@@ -41,8 +39,7 @@ public class GuiButtonEnchant extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (!enabled)
|
||||
return;
|
||||
if (!enabled) return;
|
||||
|
||||
final int x = 176;
|
||||
final int y = enchanter.working ? 39 : 24;
|
||||
@@ -50,11 +47,13 @@ public class GuiButtonEnchant extends GuiButton {
|
||||
ClientHelper.minecraft().renderEngine.bindTexture(gui);
|
||||
drawTexturedModalRect(xPosition, yPosition, x, y, 15, 15);
|
||||
|
||||
if (par2 >= xPosition && par2 < xPosition + 15 && par3 >= yPosition && par3 < yPosition + 15 && !enchanter.working) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
if (par2 >= xPosition && par2 < xPosition + 15
|
||||
&& par3 >= yPosition
|
||||
&& par3 < yPosition + 15
|
||||
&& !enchanter.working) {
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("ttmisc.startEnchant"));
|
||||
parent.tooltip = tooltip;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [16 Sep 2013, 16:13:50 (GMT)]
|
||||
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class GuiButtonEnchanterLevel extends GuiButton {
|
||||
@@ -32,13 +30,11 @@ public class GuiButtonEnchanterLevel extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (!enabled)
|
||||
return;
|
||||
if (!enabled) return;
|
||||
|
||||
int x = 218 + (plus ? 7 : 0);
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
drawTexturedModalRect(xPosition, yPosition, x, 0, 7, 7);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +1,34 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [15 Sep 2013, 00:13:10 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui.button;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.gui.GuiEnchanting;
|
||||
import thaumic.tinkerer.common.enchantment.core.EnchantmentData;
|
||||
import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiButtonEnchantment extends GuiButton {
|
||||
|
||||
public Enchantment enchant;
|
||||
@@ -46,8 +45,7 @@ public class GuiButtonEnchantment extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (dontRender())
|
||||
return;
|
||||
if (dontRender()) return;
|
||||
|
||||
EnchantmentData data = EnchantmentManager.enchantmentData.get(enchant.effectId).get(1);
|
||||
ClientHelper.minecraft().renderEngine.bindTexture(data.texture);
|
||||
@@ -56,12 +54,21 @@ public class GuiButtonEnchantment extends GuiButton {
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
if (par2 >= xPosition && par2 < xPosition + 16 && par3 >= yPosition && par3 < yPosition + 16) {
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(enchant.getName()));
|
||||
for (Aspect aspect : data.aspects.getAspectsSorted())
|
||||
tooltip.add(" \u00a7" + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + data.aspects.getAmount(aspect) + " " + StatCollector.translateToLocal("ttmisc.baseCost"));
|
||||
if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working)
|
||||
tooltip.add(EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + " " + StatCollector.translateToLocal("ttmisc.clickToRemove"));
|
||||
for (Aspect aspect : data.aspects.getAspectsSorted()) tooltip.add(
|
||||
" \u00a7" + aspect.getChatcolor()
|
||||
+ aspect.getName()
|
||||
+ '\u00a7'
|
||||
+ "r x "
|
||||
+ data.aspects.getAmount(aspect)
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("ttmisc.baseCost"));
|
||||
if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working) tooltip.add(
|
||||
EnumChatFormatting.GRAY + ""
|
||||
+ EnumChatFormatting.ITALIC
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("ttmisc.clickToRemove"));
|
||||
|
||||
parent.tooltip = tooltip;
|
||||
}
|
||||
@@ -78,5 +85,4 @@ public class GuiButtonEnchantment extends GuiButton {
|
||||
tessellator.addVertexWithUV(par1, par2, zLevel, (par3) * f, (par4) * f1);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [16 Sep 2013, 15:31:55 (GMT)]
|
||||
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.gui.GuiEnchanting;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
@@ -31,8 +29,7 @@ public class GuiButtonFramedEnchantment extends GuiButtonEnchantment {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (dontRender() || parent.enchanter.enchantments.isEmpty() || parent.enchanter.levels.isEmpty())
|
||||
return;
|
||||
if (dontRender() || parent.enchanter.enchantments.isEmpty() || parent.enchanter.levels.isEmpty()) return;
|
||||
|
||||
ClientHelper.minecraft().renderEngine.bindTexture(gui);
|
||||
drawTexturedModalRect(xPosition - 4, yPosition - 4, 176, 0, 24, 24);
|
||||
@@ -40,10 +37,13 @@ public class GuiButtonFramedEnchantment extends GuiButtonEnchantment {
|
||||
int index = parent.enchanter.enchantments.indexOf(enchant.effectId);
|
||||
if (index != -1) {
|
||||
int level = parent.enchanter.levels.get(index);
|
||||
par1Minecraft.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("enchantment.level." + level), xPosition + 26, yPosition + 8, 0xFFFFFF);
|
||||
par1Minecraft.fontRenderer.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("enchantment.level." + level),
|
||||
xPosition + 26,
|
||||
yPosition + 8,
|
||||
0xFFFFFF);
|
||||
}
|
||||
|
||||
super.drawButton(par1Minecraft, par2, par3);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 18:39:55 (GMT)]
|
||||
@@ -17,25 +14,24 @@ package thaumic.tinkerer.client.gui.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class GuiButtonMM extends GuiButton {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_MOB_MAGNET);
|
||||
|
||||
public boolean enabled = false;
|
||||
|
||||
public GuiButtonMM(int par1, int par2, int par3, boolean enabled) {
|
||||
super(par1, par2, par3, 13, 13, "");
|
||||
public GuiButtonMM(int buttonId, int x, int y, boolean enabled) {
|
||||
super(buttonId, x, y, 13, 13, "");
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (enabled) {
|
||||
if (visible) {
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
int y = enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 18:40:22 (GMT)]
|
||||
@@ -20,23 +17,20 @@ public class GuiButtonMMRadio extends GuiButtonMM implements IRadioButton {
|
||||
|
||||
List<IRadioButton> linkedButtons;
|
||||
|
||||
public GuiButtonMMRadio(int par1, int par2, int par3, boolean enabled, List<IRadioButton> linkedButtons) {
|
||||
super(par1, par2, par3, enabled);
|
||||
public GuiButtonMMRadio(int buttonId, int x, int y, boolean enabled, List<IRadioButton> linkedButtons) {
|
||||
super(buttonId, x, y, enabled);
|
||||
this.linkedButtons = linkedButtons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableFromClick() {
|
||||
setEnabled(true);
|
||||
for (IRadioButton button : linkedButtons)
|
||||
if (button != this)
|
||||
button.updateStatus(this);
|
||||
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(IRadioButton otherButton) {
|
||||
if (otherButton.isEnabled())
|
||||
setEnabled(false);
|
||||
if (otherButton.isEnabled()) setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,4 +42,4 @@ public class GuiButtonMMRadio extends GuiButtonMM implements IRadioButton {
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,14 @@ package thaumic.tinkerer.client.gui.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
/**
|
||||
* Created by nekosune on 30/06/14.
|
||||
*/
|
||||
public class GuiButtonRP extends GuiButton {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_REMOTE_PLACER);
|
||||
|
||||
public boolean buttonEnabled = false;
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
* Created by nekosune on 30/06/14.
|
||||
*/
|
||||
public class GuiButtonRPRadio extends GuiButtonRP implements IRadioButton {
|
||||
|
||||
List<IRadioButton> linkedButtons;
|
||||
|
||||
public GuiButtonRPRadio(int par1, int par2, int par3, boolean enabled, List<IRadioButton> linkedButtons) {
|
||||
@@ -16,15 +17,12 @@ public class GuiButtonRPRadio extends GuiButtonRP implements IRadioButton {
|
||||
@Override
|
||||
public void enableFromClick() {
|
||||
setEnabled(true);
|
||||
for (IRadioButton button : linkedButtons)
|
||||
if (button != this)
|
||||
button.updateStatus(this);
|
||||
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(IRadioButton otherButton) {
|
||||
if (otherButton.isEnabled())
|
||||
setEnabled(false);
|
||||
if (otherButton.isEnabled()) setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 16:32:08 (GMT)]
|
||||
@@ -23,5 +20,4 @@ public interface IRadioButton {
|
||||
public boolean isEnabled();
|
||||
|
||||
public void setEnabled(boolean enabled);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 5:58:46 PM (GMT)]
|
||||
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button.kami;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class GuiButtonWG extends GuiButton {
|
||||
@@ -32,10 +30,8 @@ public class GuiButtonWG extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if (enabled) {
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
int y = !enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
par1Minecraft.renderEngine.bindTexture(gui);
|
||||
int y = !enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 29, 2013, 10:54:58 PM (GMT)]
|
||||
@@ -17,7 +14,9 @@ package thaumic.tinkerer.client.gui.kami;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
|
||||
public class GuiIchorPouch extends GuiContainer {
|
||||
@@ -30,8 +29,9 @@ public class GuiIchorPouch extends GuiContainer {
|
||||
super(par1Container);
|
||||
}
|
||||
|
||||
//Overridden to prevent a dupe
|
||||
//See issue 367
|
||||
// Overridden to prevent a dupe
|
||||
// See issue 367
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int slot) {
|
||||
if (this.mc.gameSettings.keyBindsHotbar[this.mc.thePlayer.inventory.currentItem].getKeyCode() != slot) {
|
||||
super.checkHotbarKeys(slot);
|
||||
@@ -57,5 +57,4 @@ public class GuiIchorPouch extends GuiContainer {
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 5:43:53 PM (GMT)]
|
||||
@@ -19,7 +16,9 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.gui.button.kami.GuiButtonWG;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
@@ -42,7 +41,7 @@ public class GuiWarpGate extends GuiContainer {
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
((GuiButtonWG) par1GuiButton).enabled = !((GuiButtonWG) par1GuiButton).enabled;
|
||||
warpGate.locked = ((GuiButtonWG) par1GuiButton).enabled;
|
||||
warpGate.setLocked(((GuiButtonWG) par1GuiButton).enabled);
|
||||
|
||||
ThaumicTinkerer.netHandler.sendToServer(new PacketWarpGateButton(warpGate));
|
||||
}
|
||||
@@ -62,7 +61,7 @@ public class GuiWarpGate extends GuiContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture(gui);
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999);
|
||||
fontRendererObj
|
||||
.drawStringWithShadow(StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 6:08:23 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.gui.kami;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -23,8 +24,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
@@ -32,20 +35,16 @@ import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
|
||||
import thaumic.tinkerer.common.item.kami.ItemSkyPearl;
|
||||
import thaumic.tinkerer.common.network.packet.kami.PacketWarpGateTeleport;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiWarpGateDestinations extends GuiScreen {
|
||||
|
||||
private static ResourceLocation enderField = new ResourceLocation("textures/entity/end_portal.png");
|
||||
private static final ResourceLocation enderField = new ResourceLocation("textures/entity/end_portal.png");
|
||||
TileWarpGate warpGate;
|
||||
RenderItem render = new RenderItem();
|
||||
|
||||
int lastMouseX, lastMouseY;
|
||||
int x, y;
|
||||
int ticks;
|
||||
List<String> tooltip = new ArrayList();
|
||||
List<String> tooltip = new ArrayList<>();
|
||||
|
||||
public GuiWarpGateDestinations(TileWarpGate warpGate) {
|
||||
this.warpGate = warpGate;
|
||||
@@ -92,7 +91,8 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
if (par2 >= 2 && par2 < 12) {
|
||||
int num = par2 - 2;
|
||||
ItemStack stack = warpGate.getStackInSlot(num);
|
||||
if (stack != null && ItemSkyPearl.isAttuned(stack) && ItemSkyPearl.getDim(stack) == warpGate.getWorldObj().provider.dimensionId) {
|
||||
if (stack != null && ItemSkyPearl.isAttuned(stack)
|
||||
&& ItemSkyPearl.getDim(stack) == warpGate.getWorldObj().provider.dimensionId) {
|
||||
int x = ItemSkyPearl.getX(stack);
|
||||
int z = ItemSkyPearl.getZ(stack);
|
||||
|
||||
@@ -113,21 +113,19 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
int gateY = warpGate.zCoord - y;
|
||||
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
|
||||
List<Object[]> coords = new ArrayList();
|
||||
List<Object[]> coords = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < warpGate.getSizeInventory(); i++) {
|
||||
ItemStack stack = warpGate.getStackInSlot(i);
|
||||
if (stack != null && ItemSkyPearl.isAttuned(stack)) {
|
||||
int dim = ItemSkyPearl.getDim(stack);
|
||||
if (warpGate.getWorldObj().provider.dimensionId != dim)
|
||||
continue;
|
||||
if (warpGate.getWorldObj().provider.dimensionId != dim) continue;
|
||||
|
||||
int x = ItemSkyPearl.getX(stack);
|
||||
int y = ItemSkyPearl.getY(stack);
|
||||
int z = ItemSkyPearl.getZ(stack);
|
||||
|
||||
if (y != -1)
|
||||
coords.add(new Object[]{x - this.x, z - this.y, stack, i});
|
||||
if (y != -1) coords.add(new Object[] { x - this.x, z - this.y, stack, i });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,17 +146,35 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
fontRendererObj.drawStringWithShadow(EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), 3, 40, 0xFFFFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"),
|
||||
3,
|
||||
40,
|
||||
0xFFFFFF);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
drawPearlAt(0, null, gateX, gateY, par1, par2);
|
||||
for (Object[] coords_ : coords)
|
||||
drawPearlAt((Integer) coords_[3], (ItemStack) coords_[2], (Integer) coords_[0], (Integer) coords_[1], par1, par2);
|
||||
for (Object[] coords_ : coords) drawPearlAt(
|
||||
(Integer) coords_[3],
|
||||
(ItemStack) coords_[2],
|
||||
(Integer) coords_[0],
|
||||
(Integer) coords_[1],
|
||||
par1,
|
||||
par2);
|
||||
|
||||
if (!tooltip.isEmpty())
|
||||
ClientHelper.renderTooltip(par1, par2, tooltip);
|
||||
if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1, par2, tooltip);
|
||||
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.numberKeys"), width / 2, 5, 0xFFFFFF);
|
||||
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.spaceToReset"), width / 2, 16, 0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("ttmisc.numberKeys"),
|
||||
width / 2,
|
||||
5,
|
||||
0xFFFFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("ttmisc.spaceToReset"),
|
||||
width / 2,
|
||||
16,
|
||||
0xFFFFFF);
|
||||
}
|
||||
|
||||
public void drawPearlAt(int index, ItemStack stack, int xp, int yp, int mx, int my) {
|
||||
@@ -171,22 +187,31 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(xp, yp, 0);
|
||||
GL11.glScalef(0.5F, 0.5F, 1F);
|
||||
render.renderIcon(-8, -8, ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class).getIconFromDamage(0), 16, 16);
|
||||
render.renderIcon(
|
||||
-8,
|
||||
-8,
|
||||
ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class).getIconFromDamage(0),
|
||||
16,
|
||||
16);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
String destNum = " " + EnumChatFormatting.ITALIC + String.format(StatCollector.translateToLocal("ttmisc.destinationInd"), index + 1);
|
||||
if (stack != null && stack.hasDisplayName())
|
||||
destName = stack.getDisplayName();
|
||||
String destNum = " " + EnumChatFormatting.ITALIC
|
||||
+ String.format(StatCollector.translateToLocal("ttmisc.destinationInd"), index + 1);
|
||||
if (stack != null && stack.hasDisplayName()) destName = stack.getDisplayName();
|
||||
else destName = StatCollector.translateToLocal(stack == null ? "ttmisc.entrancePoint" : "ttmisc.destination");
|
||||
|
||||
if (stack != null)
|
||||
fontRendererObj.drawString((index + 1) + ": " + destName, 5, 54 + index * 11, 0xFFFFFF);
|
||||
if (stack != null) fontRendererObj.drawString((index + 1) + ": " + destName, 5, 54 + index * 11, 0xFFFFFF);
|
||||
|
||||
if (mx >= xp - 4 && mx <= xp + 4 && my >= yp - 4 && my < yp + 4) {
|
||||
tooltip.add(EnumChatFormatting.AQUA + destName + destNum);
|
||||
|
||||
if (stack != null) {
|
||||
ItemSkyPearl.addInfo(stack, warpGate.getWorldObj().provider.dimensionId, Vector3.fromTileEntity(warpGate), tooltip, true);
|
||||
ItemSkyPearl.addInfo(
|
||||
stack,
|
||||
warpGate.getWorldObj().provider.dimensionId,
|
||||
Vector3.fromTileEntity(warpGate),
|
||||
tooltip,
|
||||
true);
|
||||
tooltip.add(StatCollector.translateToLocal("ttmisc.clickToTeleport"));
|
||||
} else {
|
||||
tooltip.add("X: " + x);
|
||||
@@ -218,5 +243,4 @@ public class GuiWarpGateDestinations extends GuiScreen {
|
||||
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, par1);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:43:34 (GMT)]
|
||||
@@ -23,6 +20,5 @@ public final class LibRenderIDs {
|
||||
|
||||
public static int idFire = -1;
|
||||
|
||||
|
||||
public static int idGrain = -1;
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [4 Sep 2013, 17:38:36 (GMT)]
|
||||
@@ -35,6 +32,7 @@ public final class LibResources {
|
||||
public static final String GUI_ICHOR_POUCH = PREFIX_GUI + "ichorPouch.png";
|
||||
public static final String GUI_WARP_GATE = PREFIX_GUI + "warpGate.png";
|
||||
public static final String GUI_REMOTE_PLACER = PREFIX_GUI + "remotePlacer.png";
|
||||
public static final String NEI_RECIPE_ARROW = PREFIX_GUI + "neiRecipeArrow.png";
|
||||
|
||||
public static final String MISC_R_ENCHANTING = PREFIX_MISC + "r_enchanting.png";
|
||||
public static final String MISC_AT_CENTER = PREFIX_MISC + "atCenter.png";
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:56:17 (GMT)]
|
||||
@@ -85,4 +82,4 @@ public class ModelMagnet extends ModelBase {
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:56:17 (GMT)]
|
||||
@@ -85,4 +82,4 @@ public class ModelRelay extends ModelBase {
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:18:53 (GMT)]
|
||||
@@ -150,7 +147,6 @@ public class ModelRepairer extends ModelBase {
|
||||
Opening2.render(scale);
|
||||
Opening3.render(scale);
|
||||
Opening4.render(scale);
|
||||
|
||||
}
|
||||
|
||||
public void renderGlass() {
|
||||
@@ -168,5 +164,4 @@ public class ModelRepairer extends ModelBase {
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 4:41:02 PM (GMT)]
|
||||
@@ -17,7 +14,9 @@ package thaumic.tinkerer.client.model.kami;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
|
||||
public class ModelSpinningCubes extends ModelBase {
|
||||
@@ -79,8 +78,7 @@ public class ModelSpinningCubes extends ModelBase {
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
|
||||
spinningCube.render(1F / 16F);
|
||||
|
||||
if (repeat < origRepeat)
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
if (repeat < origRepeat) GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -88,8 +86,6 @@ public class ModelSpinningCubes extends ModelBase {
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
if (repeat != 0)
|
||||
renderSpinningCubes(cubes, repeat - 1, origRepeat);
|
||||
if (repeat != 0) renderSpinningCubes(cubes, repeat - 1, origRepeat);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 25, 2013, 00:18:06 PM (GMT)]
|
||||
@@ -70,10 +67,8 @@ public class ModelWings extends ModelBiped {
|
||||
if (itemstack != null && player.getItemInUseCount() > 0) {
|
||||
EnumAction enumaction = itemstack.getItemUseAction();
|
||||
|
||||
if (enumaction == EnumAction.block)
|
||||
heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow)
|
||||
aimedBow = true;
|
||||
if (enumaction == EnumAction.block) heldItemRight = 3;
|
||||
else if (enumaction == EnumAction.bow) aimedBow = true;
|
||||
}
|
||||
|
||||
if (player.capabilities.isFlying) {
|
||||
@@ -90,5 +85,4 @@ public class ModelWings extends ModelBiped {
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
if (!LoadedMods.aspectRecipeIndexLoaded) return;
|
||||
AspectRecipeIndexIntegration.register();
|
||||
|
||||
NEIInfusedSeedRecipeHandler seedHandler = new NEIInfusedSeedRecipeHandler();
|
||||
API.registerRecipeHandler(seedHandler);
|
||||
API.registerUsageHandler(seedHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Thaumic Tinkerer NEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
// This needs to be an inner class to prevent a NoClassDefFoundError from class loading when ARI isn't loaded.
|
||||
private static class AspectRecipeIndexIntegration {
|
||||
|
||||
public static void register() {
|
||||
TemplateRecipeHandler handler = new NEINecromancyHandler();
|
||||
GuiCraftingRecipe.craftinghandlers.add(handler);
|
||||
GuiUsageRecipe.usagehandlers.add(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import static thaumic.tinkerer.client.lib.LibResources.NEI_RECIPE_ARROW;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager.LootEntry;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
|
||||
public class NEIInfusedSeedRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public static final String OVERLAY = "thaumictinkerer.infusedseeds";
|
||||
private static final int SLOT_NUM_X = 9;
|
||||
private static final int SLOT_TEXTURE_U = 7;
|
||||
private static final int SLOT_TEXTURE_V = 17;
|
||||
private static final DecimalFormat CHANCE_FORMAT = new DecimalFormat("#.##");
|
||||
|
||||
public static class DropInfo {
|
||||
|
||||
public final ItemStack stack;
|
||||
public final float chance;
|
||||
|
||||
public DropInfo(ItemStack stack, float chance) {
|
||||
this.stack = stack;
|
||||
this.chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
public static class SeedDropRecipeWrapper {
|
||||
|
||||
public final ItemStack seed;
|
||||
public final List<DropInfo> drops;
|
||||
|
||||
public SeedDropRecipeWrapper(ItemStack seed, List<DropInfo> drops) {
|
||||
this.seed = seed;
|
||||
this.drops = drops;
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedSeedRecipe extends CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
public final SeedDropRecipeWrapper wrapper;
|
||||
public int rows = 0;
|
||||
|
||||
public CachedSeedRecipe(SeedDropRecipeWrapper recipe) {
|
||||
this.wrapper = recipe;
|
||||
this.input.add(new PositionedStack(recipe.seed, 74, 4));
|
||||
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
int xPos = 3 + 18 * col;
|
||||
int yPos = 36 + 18 * row;
|
||||
|
||||
this.outputs.add(new PositionedStack(drop.stack, xPos, yPos));
|
||||
|
||||
col++;
|
||||
if (col >= SLOT_NUM_X) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
this.rows = col == 0 ? row - 1 : row;
|
||||
if (this.rows < 0) this.rows = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return outputs;
|
||||
}
|
||||
}
|
||||
|
||||
private List<SeedDropRecipeWrapper> getSeedRecipes() {
|
||||
List<SeedDropRecipeWrapper> recipes = new ArrayList<>();
|
||||
Map<Aspect, List<LootEntry>> allLoot = AspectCropLootManager.getAllLoot();
|
||||
|
||||
for (Map.Entry<Aspect, List<LootEntry>> entry : allLoot.entrySet()) {
|
||||
Aspect aspect = entry.getKey();
|
||||
List<LootEntry> lootList = entry.getValue();
|
||||
|
||||
if (lootList == null || lootList.isEmpty()) continue;
|
||||
|
||||
int totalWeight = 0;
|
||||
for (LootEntry loot : lootList) {
|
||||
totalWeight += loot.weight;
|
||||
}
|
||||
|
||||
List<DropInfo> drops = new ArrayList<>();
|
||||
for (LootEntry loot : lootList) {
|
||||
if (loot.stack != null) {
|
||||
float chance = ((float) loot.weight / totalWeight) * 100f;
|
||||
drops.add(new DropInfo(loot.stack.copy(), chance));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack seedStack = ItemInfusedSeeds.getStackFromAspect(aspect);
|
||||
|
||||
recipes.add(new SeedDropRecipeWrapper(seedStack, drops));
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(73, 22, 18, 12), getOverlayIdentifier()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIInfusedSeedRecipeHandler.class) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(result, drop.stack)) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
if (ingredient != null && ingredient.getItem() instanceof ItemInfusedSeeds) {
|
||||
Aspect aspectIn = ItemInfusedSeeds.getAspect(ingredient);
|
||||
|
||||
if (aspectIn != null) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
Aspect aspectRecipe = ItemInfusedSeeds.getAspect(recipe.seed);
|
||||
if (aspectIn == aspectRecipe || aspectIn.getTag().equals(aspectRecipe.getTag())) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeHeight(int recipeIndex) {
|
||||
return 36 + 18 * (((CachedSeedRecipe) this.arecipes.get(recipeIndex)).rows + 1) + 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 3, SLOT_TEXTURE_U, SLOT_TEXTURE_V, 18, 18);
|
||||
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
int totalDrops = recipe.outputs.size();
|
||||
|
||||
int rows = Math.max(1, (totalDrops + SLOT_NUM_X - 1) / SLOT_NUM_X);
|
||||
|
||||
int totalSlotsToDraw = rows * SLOT_NUM_X;
|
||||
|
||||
for (int i = 0; i < totalSlotsToDraw; i++) {
|
||||
int col = i % SLOT_NUM_X;
|
||||
int row = i / SLOT_NUM_X;
|
||||
int xPos = 2 + 18 * col;
|
||||
int yPos = 35 + 18 * row;
|
||||
|
||||
GuiDraw.drawTexturedModalRect(xPos, yPos, SLOT_TEXTURE_U, SLOT_TEXTURE_V, 18, 18);
|
||||
}
|
||||
|
||||
GuiDraw.changeTexture(NEI_RECIPE_ARROW);
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 20, 0, 0, 18, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipeIndex) {
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
|
||||
for (DropInfo drop : recipe.wrapper.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(stack, drop.stack)) {
|
||||
|
||||
String chancePrefix = StatCollector.translateToLocal("tt.nei.chance");
|
||||
|
||||
String chanceStr = CHANCE_FORMAT.format(drop.chance) + "%";
|
||||
currenttip.add(EnumChatFormatting.GRAY + chancePrefix + ": " + EnumChatFormatting.YELLOW + chanceStr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "minecraft:textures/gui/container/generic_54.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return OVERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHandlerId() {
|
||||
return NEIInfusedSeedRecipeHandler.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tt.nei.category.infusedseeds");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.glease.tc4tweak.api.infusionrecipe.RecipeIngredient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.gtnewhorizons.aspectrecipeindex.nei.InfusionRecipeHandler;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
|
||||
public class NEINecromancyHandler extends InfusionRecipeHandler {
|
||||
|
||||
public static final String OVERLAY = "thaumictinkerer.necromancy";
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tile.spawner.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return OVERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeHeight(int recipe) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getOverlayIdentifier())) {
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
}
|
||||
} else if (outputId.equals("item")) {
|
||||
this.loadCraftingRecipes((ItemStack) results[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
if (result.getItem() instanceof ItemMobDisplay display) {
|
||||
EnumMobAspect type = display.getEntityType(result);
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
if (value == type) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
loadUsageRecipes(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
if (!(ingredient.getItem() instanceof ItemMobAspect)) {
|
||||
return;
|
||||
}
|
||||
Aspect target = ItemMobAspect.getAspect(ingredient);
|
||||
if (target == null) return;
|
||||
for (EnumMobAspect value : EnumMobAspect.values()) {
|
||||
for (Aspect aspect : value.aspects) {
|
||||
if (aspect == target) {
|
||||
new NecromancyCachedRecipe(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
loadCraftingRecipes(inputId, ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glPushMatrix();
|
||||
GuiDraw.changeTexture(THAUM_OVERLAYS);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glScalef(1.75F, 1.75F, 1.0F);
|
||||
GL11.glTranslatef(-0.5F, -1F, 0);
|
||||
GuiDraw.drawTexturedModalRect(27, 8, 207, 78, 42, 42); // Runic matrix drawing
|
||||
GL11.glTranslatef(0.5F, 1F, 0);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInstability(int recipeIndex) {}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipeIndex) {
|
||||
drawSeeAllRecipesLabel(2);
|
||||
}
|
||||
|
||||
protected class NecromancyCachedRecipe extends InfusionCachedRecipe {
|
||||
|
||||
public NecromancyCachedRecipe(EnumMobAspect enumMobAspect) {
|
||||
super(0, true);
|
||||
setIngredients(enumMobAspect.aspects);
|
||||
setResult(enumMobAspect);
|
||||
this.aspects = new AspectList();
|
||||
addIfValid();
|
||||
}
|
||||
|
||||
private void setResult(EnumMobAspect enumMobAspect) {
|
||||
ItemStack result = new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class));
|
||||
((ItemMobDisplay) result.getItem()).setEntityType(result, enumMobAspect);
|
||||
this.result = new PositionedStack(result, OUTPUT_X, 39, false);
|
||||
}
|
||||
|
||||
private void setIngredients(Aspect[] aspects) {
|
||||
if (aspects.length < 3) return;
|
||||
addSurroundingItems(
|
||||
Arrays.asList(
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[0])),
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[1])),
|
||||
RecipeIngredient.item(true, ItemMobAspect.getStackFromAspect(aspects[2]))));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int itemOffset() {
|
||||
return -24;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package thaumic.tinkerer.client.render.block;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.BlockInfusedGrain;
|
||||
@@ -15,33 +17,32 @@ import thaumic.tinkerer.common.block.BlockInfusedGrain;
|
||||
*/
|
||||
public class RenderInfusedCrops implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
Aspect aspect = BlockInfusedGrain.getAspect(world, x, y, z);
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
if (aspect != null && !aspect.isPrimal()) {
|
||||
//Hex to RGB code from vanilla tesselator
|
||||
// Hex to RGB code from vanilla tesselator
|
||||
float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
|
||||
float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
|
||||
float b = (aspect.getColor() & 0xFF) / 255.0F;
|
||||
|
||||
GL11.glColor4f(r, g, b, 1F);
|
||||
Tessellator.instance.setColorRGBA_I(aspect.getColor(), 255);
|
||||
tess.setColorRGBA_I(aspect.getColor(), 255);
|
||||
}
|
||||
|
||||
renderer.setOverrideBlockTexture(block.getIcon(world, x, y, z, world.getBlockMetadata(x, y, z)));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tess.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
renderer.renderBlockCropsImpl(block, world.getBlockMetadata(x, y, z), x, y - 0.0625F, z);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
//Tessellator.instance.setColorOpaque_I(0xFFFFFF);
|
||||
// tess.setColorOpaque_I(0xFFFFFF);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 18:08:42 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.block;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
|
||||
import thaumic.tinkerer.common.block.tile.TileMagnet;
|
||||
@@ -37,7 +36,8 @@ public class RenderMagnet implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,4 @@ public class RenderMagnet implements ISimpleBlockRenderingHandler {
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idMagnet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,24 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Nov 30, 2013, 5:50:21 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.block;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
|
||||
@@ -34,7 +33,8 @@ public class RenderRepairer implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,5 +47,4 @@ public class RenderRepairer implements ISimpleBlockRenderingHandler {
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idRepairer;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,25 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 4:03:03 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.block.kami;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import thaumcraft.client.renderers.block.BlockRenderer;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.kami.BlockWarpGate;
|
||||
@@ -47,7 +46,8 @@ public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderi
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
@@ -73,5 +73,4 @@ public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderi
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idWarpGate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,12 +3,13 @@ package thaumic.tinkerer.client.render.item;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
|
||||
@@ -17,16 +18,11 @@ import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
*/
|
||||
public class RenderGenericSeeds implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderItem = new RenderItem();
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
if (type == ItemRenderType.INVENTORY)
|
||||
return true;
|
||||
if (type == ItemRenderType.EQUIPPED)
|
||||
return true;
|
||||
if (type == ItemRenderType.ENTITY)
|
||||
return true;
|
||||
if (type == ItemRenderType.INVENTORY) return true;
|
||||
if (type == ItemRenderType.EQUIPPED) return true;
|
||||
if (type == ItemRenderType.ENTITY) return true;
|
||||
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
return true;
|
||||
}
|
||||
@@ -35,10 +31,8 @@ public class RenderGenericSeeds implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
if (helper == ItemRendererHelper.ENTITY_BOBBING)
|
||||
return true;
|
||||
if (helper == ItemRendererHelper.ENTITY_ROTATION)
|
||||
return true;
|
||||
if (helper == ItemRendererHelper.ENTITY_BOBBING) return true;
|
||||
if (helper == ItemRendererHelper.ENTITY_ROTATION) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,7 +76,15 @@ public class RenderGenericSeeds implements IItemRenderer {
|
||||
private void renderItemInEquipped(ItemStack itemstack, Aspect aspect, IIcon icon) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
setColorForAspect(aspect);
|
||||
ItemRenderer.renderItemIn2D(tessellator, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tessellator,
|
||||
icon.getMaxU(),
|
||||
icon.getMinV(),
|
||||
icon.getMinU(),
|
||||
icon.getMaxV(),
|
||||
icon.getIconWidth(),
|
||||
icon.getIconHeight(),
|
||||
0.0625F);
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -99,7 +101,15 @@ public class RenderGenericSeeds implements IItemRenderer {
|
||||
float scale = 0.7F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
ItemRenderer.renderItemIn2D(tesselator, texture.getMaxU(), texture.getMinV(), texture.getMinU(), texture.getMaxV(), texture.getIconWidth(), texture.getIconHeight(), .05F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tesselator,
|
||||
texture.getMaxU(),
|
||||
texture.getMinV(),
|
||||
texture.getMinU(),
|
||||
texture.getMaxV(),
|
||||
texture.getIconWidth(),
|
||||
texture.getIconHeight(),
|
||||
.05F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -113,12 +123,5 @@ public class RenderGenericSeeds implements IItemRenderer {
|
||||
tesselator.draw();
|
||||
}
|
||||
|
||||
private void setColorForAspect(Aspect aspect) {
|
||||
//if(!aspect.isPrimal()){
|
||||
// float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
|
||||
// float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
|
||||
// float b = (aspect.getColor() & 0xFF) / 255.0F;
|
||||
// GL11.glColor3f(r, g, b);
|
||||
//}
|
||||
}
|
||||
private void setColorForAspect(Aspect aspect) {}
|
||||
}
|
||||
@@ -1,20 +1,42 @@
|
||||
package thaumic.tinkerer.client.render.item;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
|
||||
public class RenderMobDisplay implements IItemRenderer {
|
||||
|
||||
private static RenderItem renderItem = new RenderItem();
|
||||
private static final int ATTRIB_MASK = GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT
|
||||
| GL11.GL_DEPTH_BUFFER_BIT
|
||||
| GL11.GL_COLOR_BUFFER_BIT
|
||||
| GL11.GL_LIGHTING_BIT
|
||||
| GL11.GL_TEXTURE_BIT;
|
||||
|
||||
private final EnumMap<EnumMobAspect, EntityLiving> cache = new EnumMap<>(EnumMobAspect.class);
|
||||
private World cachedWorld;
|
||||
|
||||
private void setCachedWorld(World world) {
|
||||
cache.clear();
|
||||
cachedWorld = world;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world == cachedWorld) setCachedWorld(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack itemStack, ItemRenderType itemRenderType) {
|
||||
@@ -22,77 +44,41 @@ public class RenderMobDisplay implements IItemRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType itemRenderType, ItemStack itemStack, ItemRendererHelper itemRendererHelper) {
|
||||
public boolean shouldUseRenderHelper(ItemRenderType itemRenderType, ItemStack itemStack,
|
||||
ItemRendererHelper itemRendererHelper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType itemRenderType, ItemStack itemStack, Object... objects) {
|
||||
ItemMobDisplay item = (ItemMobDisplay) itemStack.getItem();
|
||||
if (!(itemStack.getItem() instanceof ItemMobDisplay item)) return;
|
||||
EnumMobAspect aspect = item.getEntityType(itemStack);
|
||||
Entity entity = null;
|
||||
float f1 = 0.4f;
|
||||
float verticalOffset = 0.0f;
|
||||
if (aspect != null) {
|
||||
entity = EnumMobAspect.getEntityFromCache(aspect, null);
|
||||
f1 = aspect.getScale();
|
||||
verticalOffset = aspect.getVerticalOffset();
|
||||
if (aspect == null) return;
|
||||
|
||||
final World world = Minecraft.getMinecraft().theWorld;
|
||||
if (world != cachedWorld) setCachedWorld(world);
|
||||
if (world == null) return;
|
||||
|
||||
EntityLiving entity = cache.get(aspect);
|
||||
if (entity == null || entity.worldObj != world) {
|
||||
entity = aspect.createEntity(world);
|
||||
cache.put(aspect, entity);
|
||||
}
|
||||
switch (itemRenderType) {
|
||||
|
||||
case ENTITY:
|
||||
final Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
if (renderer == null || renderer.getFontRendererFromRenderManager() == null) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
|
||||
GL11.glScalef(f1, f1, f1);
|
||||
EntityItem eItem = (EntityItem) objects[1];
|
||||
if (entity != null) {
|
||||
entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
|
||||
if (entity.worldObj != null) {
|
||||
Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
entity.setWorld(eItem.worldObj);
|
||||
entity.copyLocationAndAnglesFrom(eItem);
|
||||
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
//if (renderWithLighting) RenderUtils.enableLightmap();
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
}
|
||||
entity.worldObj = null;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
case EQUIPPED:
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
|
||||
GL11.glScalef(f1, f1, f1);
|
||||
if (entity != null) {
|
||||
entity.worldObj = (Minecraft.getMinecraft() != null) ? Minecraft.getMinecraft().theWorld : null;
|
||||
if (entity.worldObj != null) {
|
||||
Render renderer = RenderManager.instance.getEntityRenderObject(entity);
|
||||
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
//if (renderWithLighting) RenderUtils.enableLightmap();
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
}
|
||||
entity.worldObj = null;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
case FIRST_PERSON_MAP:
|
||||
break;
|
||||
float scale = aspect.getScale();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(ATTRIB_MASK);
|
||||
try {
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glTranslatef(0, (-entity.height / 2) + aspect.getVerticalOffset(), 0.0F);
|
||||
renderer.doRender(entity, 0, 0, 0, 0, 0);
|
||||
} finally {
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,20 @@
|
||||
package thaumic.tinkerer.client.render.item.kami;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
|
||||
public class RenderPlacementMirror implements IItemRenderer {
|
||||
|
||||
RenderItem render = new RenderItem();
|
||||
ItemRenderer renderer = new ItemRenderer(Minecraft.getMinecraft());
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
//return type != ItemRenderType.INVENTORY && type!=ItemRenderType.ENTITY;
|
||||
//return type != ItemRenderType.INVENTORY ;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,7 +35,8 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
}
|
||||
case EQUIPPED: {
|
||||
for (int i = 1; i >= 0; i--) {
|
||||
IIcon icon = ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class).getIconFromDamageForRenderPass(0, i);
|
||||
IIcon icon = ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class)
|
||||
.getIconFromDamageForRenderPass(0, i);
|
||||
if (i == 0) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -50,7 +46,15 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
float f3 = icon.getMaxV();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
Tessellator.instance,
|
||||
f1,
|
||||
f2,
|
||||
f,
|
||||
f3,
|
||||
icon.getIconWidth(),
|
||||
icon.getIconHeight(),
|
||||
1F / 16F);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
break;
|
||||
@@ -60,6 +64,7 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
break;
|
||||
}
|
||||
case INVENTORY: {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(45f, 0f, 1f, 0f);
|
||||
GL11.glScalef(1.5f, 1.8f, 1.8f);
|
||||
@@ -68,11 +73,11 @@ public class RenderPlacementMirror implements IItemRenderer {
|
||||
|
||||
renderItem(ItemRenderType.EQUIPPED, item, data);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 17:12:26 (GMT)]
|
||||
@@ -24,7 +21,9 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
@@ -36,30 +35,30 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
private static final ResourceLocation overlayRight = new ResourceLocation(LibResources.MISC_AT_RIGHT);
|
||||
private static final ResourceLocation overlayIndent = new ResourceLocation(LibResources.MISC_AT_INDENT);
|
||||
|
||||
private static final float[][] TRANSLATIONS = new float[][]{
|
||||
{0F, 0F, -1F},
|
||||
{-1F, 0F, 0F},
|
||||
{0F, 0F, 0F},
|
||||
{-1F, 0F, -1F}
|
||||
};
|
||||
private static final float[][] TRANSLATIONS = new float[][] { { 0F, 0F, -1F }, { -1F, 0F, 0F }, { 0F, 0F, 0F },
|
||||
{ -1F, 0F, -1F } };
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float partialTicks) {
|
||||
TileAnimationTablet tile = (TileAnimationTablet) tileentity;
|
||||
|
||||
int meta = tile.getBlockMetadata() & 7;
|
||||
if (meta < 2)
|
||||
meta = 2; // Just in case
|
||||
if (meta < 2) meta = 2; // Just in case
|
||||
|
||||
int rotation = meta == 2 ? 270 : meta == 3 ? 90 : meta == 4 ? 0 : 180;
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(d0, d1, d2);
|
||||
renderOverlay(tile, overlayCenter, -1, false, false, 0.65, 0.13F, 0F);
|
||||
if (tile.leftClick)
|
||||
renderOverlay(tile, overlayLeft, 1, false, true, 1, 0.13F, 0F);
|
||||
else renderOverlay(tile, overlayRight, 1, false, true, 1, 0.131F, 0F);
|
||||
renderOverlay(tile, overlayIndent, 0, false, false, 0.5F, 0.13F, rotation + 90F);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
renderOverlay(tile, overlayCenter, -1, false, 0.65, 0.13F, partialTicks);
|
||||
if (tile.leftClick) renderOverlay(tile, overlayLeft, 1, true, 1, 0.13F, partialTicks);
|
||||
else renderOverlay(tile, overlayRight, 1, true, 1, 0.131F, partialTicks);
|
||||
renderIndents(tile, rotation + 90F);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glRotatef(rotation, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.1, 0.2 + Math.cos(System.currentTimeMillis() / 600D) / 18F, 0.5);
|
||||
@@ -67,9 +66,10 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(translations[0], translations[1], translations[2]);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslatef(0.5F, 0F, 0.5F);
|
||||
GL11.glRotatef(tile.swingProgress, 0F, 0F, 1F);
|
||||
float swingProgress = tile.getRenderSwingProgress(partialTicks);
|
||||
GL11.glRotatef(swingProgress, 0F, 0F, 1F);
|
||||
GL11.glTranslatef(-0.5F, 0F, -0.5F);
|
||||
GL11.glTranslatef(-tile.swingProgress / 250F, tile.swingProgress / 1000F, 0F);
|
||||
GL11.glTranslatef(-swingProgress / 250F, swingProgress / 1000F, 0F);
|
||||
GL11.glRotatef((float) Math.cos(System.currentTimeMillis() / 400F) * 5F, 1F, 0F, 1F);
|
||||
renderItem(tile);
|
||||
GL11.glPopMatrix();
|
||||
@@ -79,36 +79,35 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
ItemStack stack = tablet.getStackInSlot(0);
|
||||
if (stack != null) {
|
||||
EntityItem entityitem = new EntityItem(tablet.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
|
||||
entityitem.worldObj = tablet.getWorldObj();
|
||||
int stackSize = entityitem.getEntityItem().stackSize;
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
entityitem.hoverStart = 0.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, 0.55F, 0F);
|
||||
if (stack.getItem() instanceof ItemBlock)
|
||||
GL11.glScalef(2.5F, 2.5F, 2.5F);
|
||||
else
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
if (stack.getItem() instanceof ItemBlock) GL11.glScalef(2.5F, 2.5F, 2.5F);
|
||||
else GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
entityitem.getEntityItem().stackSize = stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, boolean useLighting, boolean useBlend, double size, float height, float forceDeg) {
|
||||
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, boolean useBlend,
|
||||
double size, float height, float partialTicks) {
|
||||
Minecraft mc = ClientHelper.minecraft();
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
if (!useLighting)
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
if (useBlend) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
GL11.glTranslatef(0.5F, height, 0.5F);
|
||||
float deg = rotationMod == 0 ? forceDeg : (float) (tablet.ticksExisted * rotationMod % 360F);
|
||||
float deg = (tablet.getTicksExisted(partialTicks) * rotationMod % 360F);
|
||||
GL11.glRotatef(deg, 0F, 1F, 0F);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
double size1 = size / 2;
|
||||
double size2 = -size1;
|
||||
@@ -118,9 +117,33 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
|
||||
tess.addVertexWithUV(size1, 0, size2, 1, 0);
|
||||
tess.addVertexWithUV(size2, 0, size2, 0, 0);
|
||||
tess.draw();
|
||||
GL11.glDepthMask(true);
|
||||
if (!useLighting)
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void renderIndents(TileAnimationTablet tablet, float forceDeg) {
|
||||
Minecraft mc = ClientHelper.minecraft();
|
||||
mc.renderEngine.bindTexture(overlayIndent);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, (float) 0.13, 0.5F);
|
||||
GL11.glRotatef(forceDeg, 0F, 1F, 0F);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
final double size1 = 0.25;
|
||||
final double size2 = -0.25;
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(size2, 0, size1, 0, 1);
|
||||
tess.addVertexWithUV(size1, 0, size1, 1, 1);
|
||||
tess.addVertexWithUV(size1, 0, size2, 1, 0);
|
||||
tess.addVertexWithUV(size2, 0, size2, 0, 0);
|
||||
tess.draw();
|
||||
int acceleration = tablet.getWorldAcceleratorBonus();
|
||||
if (acceleration != 0) {
|
||||
GL11.glRotatef(90, -1, 0, 0);
|
||||
GL11.glScalef(0.02f, -0.02f, 0.02f);
|
||||
final String s = 'x' + Integer.toString(acceleration);
|
||||
final int width = mc.fontRenderer.getStringWidth(s);
|
||||
GL11.glTranslatef(-width / 2f, 10f + mc.fontRenderer.FONT_HEIGHT / 2f, 0);
|
||||
mc.fontRenderer.drawString(s, 0, 0, 0xFFFFFF);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [16 Sep 2013, 22:39:36 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -22,13 +21,13 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.client.renderers.item.ItemWandRenderer;
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.common.block.tile.TileEnchanter;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
|
||||
ItemWandRenderer wandRenderer = new ItemWandRenderer();
|
||||
@@ -61,7 +60,15 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
float f3 = icon.getMaxV();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
Tessellator.instance,
|
||||
f1,
|
||||
f2,
|
||||
f,
|
||||
f3,
|
||||
icon.getIconWidth(),
|
||||
icon.getIconHeight(),
|
||||
1F / 16F);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
renderPass++;
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [28 Sep 2013, 20:24:39 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.client.renderers.block.BlockJarRenderer;
|
||||
import thaumcraft.client.renderers.tile.ItemJarFilledRenderer;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumic.tinkerer.common.block.tile.TileFunnel;
|
||||
|
||||
public class RenderTileFunnel extends TileEntitySpecialRenderer {
|
||||
@@ -35,14 +37,13 @@ public class RenderTileFunnel extends TileEntitySpecialRenderer {
|
||||
if (stack != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(d0 + 0.5, d1 + 0.365, d2 + 0.5);
|
||||
//if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) {
|
||||
// GL11.glTranslatef(0F, 0.25F, 0F);
|
||||
// jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks());
|
||||
//}
|
||||
// else
|
||||
jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null);
|
||||
if (Block.getBlockFromItem(stack.getItem()) == ConfigBlocks.blockJar) {
|
||||
GL11.glTranslatef(0F, 0.25F, 0F);
|
||||
jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, stack.getItemDamage(), 0, new RenderBlocks());
|
||||
} else {
|
||||
jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:55:04 (GMT)]
|
||||
@@ -19,8 +16,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.armor.ItemHoverHarness;
|
||||
@@ -44,14 +43,21 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
boolean blue = tileentity.getWorldObj() == null || (tileentity.getBlockMetadata() & 1) == 0;
|
||||
boolean mob = tileentity.getWorldObj() == null ? RenderTileMagnet.mob : (tileentity.getBlockMetadata() & 2) == 2;
|
||||
boolean mob = tileentity.getWorldObj() == null ? RenderTileMagnet.mob
|
||||
: (tileentity.getBlockMetadata() & 2) == 2;
|
||||
|
||||
ClientHelper.minecraft().renderEngine.bindTexture(mob ? blue ? blueMob : redMob : blue ? RenderTileMagnet.blue : red);
|
||||
ClientHelper.minecraft().renderEngine
|
||||
.bindTexture(mob ? blue ? blueMob : redMob : blue ? RenderTileMagnet.blue : red);
|
||||
|
||||
int redstone = 0;
|
||||
if (tileentity.getWorldObj() != null) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
redstone = Math.max(redstone, tileentity.getWorldObj().getIndirectPowerLevelTo(tileentity.xCoord + dir.offsetX, tileentity.yCoord + dir.offsetY, tileentity.zCoord + dir.offsetZ, dir.ordinal()));
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) redstone = Math.max(
|
||||
redstone,
|
||||
tileentity.getWorldObj().getIndirectPowerLevelTo(
|
||||
tileentity.xCoord + dir.offsetX,
|
||||
tileentity.yCoord + dir.offsetY,
|
||||
tileentity.zCoord + dir.offsetZ,
|
||||
dir.ordinal()));
|
||||
} else redstone = 15;
|
||||
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
@@ -65,7 +71,16 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
GL11.glScalef(1F, -1F, 1F);
|
||||
UtilsFX.renderQuadCenteredFromIcon(false, icon, redstone / 15F * 0.7F + (redstone == 0 ? 0 : 0.4F), blue ? 0F : 1F, 0F, blue ? 1F : 0F, 225, GL11.GL_ONE_MINUS_SRC_ALPHA, 0.9F);
|
||||
UtilsFX.renderQuadCenteredFromIcon(
|
||||
false,
|
||||
icon,
|
||||
redstone / 15F * 0.7F + (redstone == 0 ? 0 : 0.4F),
|
||||
blue ? 0F : 1F,
|
||||
0F,
|
||||
blue ? 1F : 0F,
|
||||
225,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA,
|
||||
0.9F);
|
||||
}
|
||||
|
||||
GL11.glTranslated(0, 0, -(Math.cos(System.currentTimeMillis() / 500F) + 1) * 0.09 - 0.1);
|
||||
@@ -74,4 +89,4 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:55:04 (GMT)]
|
||||
@@ -17,8 +14,10 @@ package thaumic.tinkerer.client.render.tile;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.client.model.ModelRelay;
|
||||
@@ -41,4 +40,4 @@ public class RenderTileRelay extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Nov 30, 2013, 5:27:39 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -23,15 +22,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import thaumic.tinkerer.client.core.helper.ClientHelper;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.client.model.ModelRepairer;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class RenderTileRepairer extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation modelTex = new ResourceLocation(LibResources.MODEL_REPAIRER);
|
||||
@@ -85,7 +84,15 @@ public class RenderTileRepairer extends TileEntitySpecialRenderer {
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
float f3 = icon.getMaxV();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
Tessellator.instance,
|
||||
f1,
|
||||
f2,
|
||||
f,
|
||||
f3,
|
||||
icon.getIconWidth(),
|
||||
icon.getIconHeight(),
|
||||
1F / 16F);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
renderPass++;
|
||||
@@ -131,5 +138,4 @@ public class RenderTileRepairer extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Jan 10, 2014, 4:44:15 PM (GMT)]
|
||||
@@ -16,7 +13,9 @@ package thaumic.tinkerer.client.render.tile.kami;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumic.tinkerer.client.model.kami.ModelSpinningCubes;
|
||||
|
||||
public class RenderTileWarpGate extends TileEntitySpecialRenderer {
|
||||
@@ -33,5 +32,4 @@ public class RenderTileWarpGate extends TileEntitySpecialRenderer {
|
||||
cubes.renderSpinningCubes(12, repeat, repeat);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +1,39 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [4 Sep 2013, 16:01:28 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
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.Optional;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
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.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraft.command.ICommandManager;
|
||||
import net.minecraft.command.ServerCommandManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import thaumcraft.common.CommonProxy;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumic.tinkerer.api.InterModCommsOperations;
|
||||
import thaumic.tinkerer.common.core.commands.KamiUnlockedCommand;
|
||||
import thaumic.tinkerer.common.core.commands.MaxResearchCommand;
|
||||
import thaumic.tinkerer.common.core.commands.SetTendencyCommand;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.proxy.TTCommonProxy;
|
||||
import thaumic.tinkerer.common.dim.WorldProviderBedrock;
|
||||
@@ -43,8 +42,6 @@ import thaumic.tinkerer.common.peripheral.PeripheralHandler;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
import thaumic.tinkerer.common.research.KamiResearchItem;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES)
|
||||
public class ThaumicTinkerer {
|
||||
|
||||
@@ -66,41 +63,12 @@ public class ThaumicTinkerer {
|
||||
log = event.getModLog();
|
||||
tcProxy = Thaumcraft.proxy;
|
||||
proxy.preInit(event);
|
||||
if (Loader.isModLoaded("Waila")) {
|
||||
FMLInterModComms.sendMessage("Waila", "register", "thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister");
|
||||
if (LoadedMods.wailaLoaded) {
|
||||
FMLInterModComms.sendMessage(
|
||||
"Waila",
|
||||
"register",
|
||||
"thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStart(FMLServerStartingEvent event) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
ICommandManager command = server.getCommandManager();
|
||||
ServerCommandManager manager = (ServerCommandManager) command;
|
||||
manager.registerCommand(new SetTendencyCommand());
|
||||
manager.registerCommand(new MaxResearchCommand());
|
||||
manager.registerCommand(new KamiUnlockedCommand());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void HandleIMCMessages(FMLInterModComms.IMCEvent messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages.getMessages()) {
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_RESEARCH_BLACKLIST)) {
|
||||
String[] values = message.getStringValue().split(",");
|
||||
KamiResearchItem.Blacklist.addAll(Arrays.asList(values));
|
||||
}
|
||||
if(message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST))
|
||||
{
|
||||
if(Loader.isModLoaded("ComputerCraft"))
|
||||
blackListCCDevices(message.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void blackListCCDevices(String classname)
|
||||
{
|
||||
PeripheralHandler.Blacklist.add(classname);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -115,6 +83,33 @@ public class ThaumicTinkerer {
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
proxy.serverStarting(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
proxy.serverStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void HandleIMCMessages(FMLInterModComms.IMCEvent messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages.getMessages()) {
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_RESEARCH_BLACKLIST)) {
|
||||
String[] values = message.getStringValue().split(",");
|
||||
KamiResearchItem.Blacklist.addAll(Arrays.asList(values));
|
||||
}
|
||||
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST)) {
|
||||
if (LoadedMods.computerCraftLoaded) blackListCCDevices(message.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void blackListCCDevices(String classname) {
|
||||
PeripheralHandler.Blacklist.add(classname);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 15:52:53 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -32,6 +29,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -43,15 +43,13 @@ import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibGuiIDs;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.TTRegistry;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAnimationTablet extends BlockModContainer {
|
||||
|
||||
IIcon iconBottom;
|
||||
@@ -79,27 +77,20 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||
ItemStack par6ItemStack) {
|
||||
byte b0 = 0;
|
||||
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (l1 == 0)
|
||||
b0 = 2;
|
||||
if (l1 == 0) b0 = 2;
|
||||
|
||||
if (l1 == 1)
|
||||
b0 = 5;
|
||||
if (l1 == 1) b0 = 5;
|
||||
|
||||
if (l1 == 2)
|
||||
b0 = 3;
|
||||
if (l1 == 2) b0 = 3;
|
||||
|
||||
if (l1 == 3)
|
||||
b0 = 4;
|
||||
if (l1 == 3) b0 = 4;
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
|
||||
//TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
|
||||
//if(par5EntityLiving instanceof EntityPlayer) {
|
||||
// tablet.Owner = ((EntityPlayer) par5EntityLiving).username;
|
||||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,39 +98,36 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (tablet != null) {
|
||||
if (tablet.getIsBreaking()) {
|
||||
//ChunkCoordinates coords = tablet.getTargetLoc();
|
||||
//par1World.destroyBlockInWorldPartially(tablet.getFakePlayer().entityId, coords.posX, coords.posY, coords.posZ, -1);
|
||||
}
|
||||
ItemStack itemstack = tablet.heldItem;
|
||||
if (itemstack != null) {
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (int j1 = 0; j1 < tablet.getSizeInventory(); ++j1) {
|
||||
ItemStack itemstack = tablet.getStackInSlot(j1);
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (itemstack != null) {
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
|
||||
//Look here if something breaks in 1.7
|
||||
// Look here if something breaks in 1.7
|
||||
par1World.func_147453_f(par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@@ -148,18 +136,20 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
if (par1World.isRemote)
|
||||
return;
|
||||
if (par1World.isRemote) return;
|
||||
TileEntity te = par1World.getTileEntity(par2, par3, par4);
|
||||
if (!(te instanceof TileAnimationTablet tablet) || !tablet.redstone) return;
|
||||
|
||||
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)
|
||||
|| par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean on = (meta & 8) != 0;
|
||||
|
||||
if (power && !on) {
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 8, 4);
|
||||
} else if (!power && on)
|
||||
} else if (!power && on) {
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,39 +158,26 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null && tile instanceof TileAnimationTablet) {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) tile;
|
||||
if (tablet.redstone && tablet.swingProgress == 0) {
|
||||
tablet.findEntities(tablet.getTargetLoc());
|
||||
tablet.initiateSwing();
|
||||
par1World.addBlockEvent(par2, par3, par4, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
if (!par1World.isRemote) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null) {
|
||||
TileAnimationTablet tablet = (TileAnimationTablet) tile;
|
||||
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
if (tile instanceof TileAnimationTablet tablet) {
|
||||
if (par5EntityPlayer.getCurrentEquippedItem() != null
|
||||
&& par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean activated = (meta & 8) != 0;
|
||||
if (!activated && !tablet.getIsBreaking() && tablet.swingProgress == 0) {
|
||||
if (!activated && !tablet.getIsBreaking() && tablet.isIdle()) {
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 5 ? 2 : meta + 1, 1 | 2);
|
||||
par1World.playSoundEffect(par2, par3, par4, "thaumcraft:tool", 0.6F, 1F);
|
||||
} else
|
||||
par5EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.animationTablet.notRotatable"));
|
||||
} else par5EntityPlayer
|
||||
.addChatMessage(new ChatComponentTranslation("ttmisc.animationTablet.notRotatable"));
|
||||
// Rare chance this might happen, but better to cope for it.
|
||||
|
||||
return true;
|
||||
} else {
|
||||
//if(tablet.Owner==null || tablet.Owner.equals(""))
|
||||
// tablet.Owner=par5EntityPlayer.username;
|
||||
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
|
||||
par5EntityPlayer
|
||||
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,7 +188,8 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop
|
||||
: par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,11 +207,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return new TileAnimationTablet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ANIMATION_TABLET;
|
||||
@@ -261,18 +234,32 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ANIMATION_TABLET, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1), -8, 2, 4, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))).setWarp(1).setParents(LibResearch.KEY_MAGNETS)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_ANIMATION_TABLET,
|
||||
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1).add(Aspect.MOTION, 1)
|
||||
.add(Aspect.ENERGY, 1),
|
||||
-8,
|
||||
2,
|
||||
4,
|
||||
new ItemStack(TTRegistry.dynamismTablet)).setWarp(1).setParents(LibResearch.KEY_MAGNETS).setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_ANIMATION_TABLET, LibResearch.KEY_ANIMATION_TABLET, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class)), new AspectList().add(Aspect.AIR, 25).add(Aspect.ORDER, 15).add(Aspect.FIRE, 10),
|
||||
"GIG", "ICI",
|
||||
'G', new ItemStack(Items.gold_ingot),
|
||||
'I', new ItemStack(Items.iron_ingot),
|
||||
'C', new ItemStack(ConfigItems.itemGolemCore, 1, 100));
|
||||
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_ANIMATION_TABLET,
|
||||
LibResearch.KEY_ANIMATION_TABLET,
|
||||
new ItemStack(TTRegistry.dynamismTablet),
|
||||
new AspectList().add(Aspect.AIR, 25).add(Aspect.ORDER, 15).add(Aspect.FIRE, 10),
|
||||
"GIG",
|
||||
"ICI",
|
||||
'G',
|
||||
new ItemStack(Items.gold_ingot),
|
||||
'I',
|
||||
new ItemStack(Items.iron_ingot),
|
||||
'C',
|
||||
new ItemStack(ConfigItems.itemGolemCore, 1, 100));
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 11, 2013, 10:31:09 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -26,6 +24,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -34,6 +33,7 @@ import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibGuiIDs;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
@@ -43,9 +43,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
IIcon[] icons = new IIcon[5];
|
||||
@@ -61,11 +58,18 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
if (!par1World.isRemote) {
|
||||
TileAspectAnalyzer tile = (TileAspectAnalyzer) par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null) {
|
||||
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ASPECT_ANALYZER, par1World, par2, par3, par4);
|
||||
par5EntityPlayer.openGui(
|
||||
ThaumicTinkerer.instance,
|
||||
LibGuiIDs.GUI_ID_ASPECT_ANALYZER,
|
||||
par1World,
|
||||
par2,
|
||||
par3,
|
||||
par4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,21 +89,26 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,8 +121,7 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
for (int i = 0; i < 5; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
for (int i = 0; i < 5; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,11 +134,6 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
return new TileAspectAnalyzer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ASPECT_ANALYZER;
|
||||
@@ -138,7 +141,7 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return Loader.isModLoaded("ComputerCraft");
|
||||
return LoadedMods.computerCraftLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,16 +161,33 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ASPECT_ANALYZER, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.SENSES, 1).add(Aspect.MIND, 1), 0, 1, 2, new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOGGLES", "THAUMIUM").setConcealed().setRound()
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER));
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_ASPECT_ANALYZER,
|
||||
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.SENSES, 1).add(Aspect.MIND, 1),
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOGGLES", "THAUMIUM")
|
||||
.setConcealed().setRound().setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_ASPECT_ANALYZER, LibResearch.KEY_ASPECT_ANALYZER, new ItemStack(this), new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
|
||||
"TWT", "WMW", "TWT",
|
||||
'W', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
|
||||
'M', new ItemStack(ConfigItems.itemThaumometer),
|
||||
'T', new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_ASPECT_ANALYZER,
|
||||
LibResearch.KEY_ASPECT_ANALYZER,
|
||||
new ItemStack(this),
|
||||
new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
|
||||
"TWT",
|
||||
"WMW",
|
||||
"TWT",
|
||||
'W',
|
||||
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
|
||||
'M',
|
||||
new ItemStack(ConfigItems.itemThaumometer),
|
||||
'T',
|
||||
new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 27, 2013, 6:25:36 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -28,10 +26,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
|
||||
public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
|
||||
@@ -49,8 +47,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
if (tile instanceof TileCamo) {
|
||||
TileCamo camo = (TileCamo) tile;
|
||||
Block block = camo.camo;
|
||||
if (block != null && isValidRenderType(block.getRenderType()))
|
||||
return block.getIcon(side, camo.camoMeta);
|
||||
if (block != null && isValidRenderType(block.getRenderType())) return block.getIcon(side, camo.camoMeta);
|
||||
}
|
||||
|
||||
return getIconFromSideAfterCheck(tile, meta, side);
|
||||
@@ -61,7 +58,8 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (tile instanceof TileCamo) {
|
||||
@@ -70,8 +68,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
|
||||
boolean doChange = true;
|
||||
Block block = null;
|
||||
checkChange:
|
||||
{
|
||||
checkChange: {
|
||||
if (currentStack != null) {
|
||||
if (Item.getIdFromItem(currentStack.getItem()) == 0) {
|
||||
doChange = false;
|
||||
@@ -79,7 +76,9 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
}
|
||||
|
||||
block = Block.getBlockFromItem(currentStack.getItem());
|
||||
if (block == null || !isValidRenderType(block.getRenderType()) || block instanceof BlockCamo || block.getMaterial() == Material.air)
|
||||
if (block == null || !isValidRenderType(block.getRenderType())
|
||||
|| block instanceof BlockCamo
|
||||
|| block.getMaterial() == Material.air)
|
||||
doChange = false;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +134,6 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
Block block = camo.camo;
|
||||
if (block != null)
|
||||
return block instanceof BlockCamo ? 0xFFFFFF : block.colorMultiplier(par1World, par2, par3, par4);
|
||||
|
||||
}
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [14 Sep 2013, 01:13:25 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -29,6 +26,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -47,9 +47,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockEnchanter extends BlockModContainer {
|
||||
|
||||
Random random;
|
||||
@@ -68,12 +65,14 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
if (!par1World.isRemote) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null) {
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4);
|
||||
par5EntityPlayer
|
||||
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,21 +92,26 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +133,8 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop
|
||||
: par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,11 +152,6 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
return new TileEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ENCHANTER;
|
||||
@@ -179,14 +179,36 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ENCHANTER, new AspectList().add(Aspect.MAGIC, 2).add(Aspect.AURA, 1).add(Aspect.ELDRITCH, 1).add(Aspect.DARKNESS, 1).add(Aspect.MIND, 1), 5, 4, 5, new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH)
|
||||
.setPages(new ResearchPage("0"), new ResearchPage("1"), new ResearchPage("2"), ResearchHelper.infusionPage(LibResearch.KEY_ENCHANTER));
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_ENCHANTER,
|
||||
new AspectList().add(Aspect.MAGIC, 2).add(Aspect.AURA, 1).add(Aspect.ELDRITCH, 1)
|
||||
.add(Aspect.DARKNESS, 1).add(Aspect.MIND, 1),
|
||||
5,
|
||||
4,
|
||||
5,
|
||||
new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH).setPages(
|
||||
new ResearchPage("0"),
|
||||
new ResearchPage("1"),
|
||||
new ResearchPage("2"),
|
||||
ResearchHelper.infusionPage(LibResearch.KEY_ENCHANTER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_ENCHANTER, new ItemStack(this), 15, new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20).add(Aspect.VOID, 20).add(Aspect.MIND, 10), new ItemStack(Blocks.enchanting_table),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSpellCloth.class)));
|
||||
return new ThaumicTinkererInfusionRecipe(
|
||||
LibResearch.KEY_ENCHANTER,
|
||||
new ItemStack(this),
|
||||
15,
|
||||
new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20)
|
||||
.add(Aspect.VOID, 20).add(Aspect.MIND, 10),
|
||||
new ItemStack(Blocks.enchanting_table),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 2),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 2),
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSpellCloth.class)));
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,22 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumic.tinkerer.common.block.tile.TileForcefield;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 4/19/14.
|
||||
*/
|
||||
public class BlockForcefield extends BlockMod {
|
||||
|
||||
public BlockForcefield() {
|
||||
super(Material.air);
|
||||
}
|
||||
@@ -26,7 +28,7 @@ public class BlockForcefield extends BlockMod {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return new ArrayList<ItemStack>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [28 Sep 2013, 19:33:05 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -30,6 +27,9 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -44,9 +44,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockFunnel extends BlockModContainer {
|
||||
|
||||
IIcon sideIcon, topIcon;
|
||||
@@ -118,21 +115,26 @@ public class BlockFunnel extends BlockModContainer {
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,7 +146,8 @@ public class BlockFunnel extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4);
|
||||
ItemStack stack = funnel.getStackInSlot(0);
|
||||
|
||||
@@ -175,11 +178,6 @@ public class BlockFunnel extends BlockModContainer {
|
||||
return new TileFunnel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.FUNNEL;
|
||||
@@ -207,16 +205,29 @@ public class BlockFunnel extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_FUNNEL, new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2), 0, -7, 1, new ItemStack(this)).setParentsHidden("DISTILESSENTIA").setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL)).setSecondary();
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_FUNNEL,
|
||||
new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2),
|
||||
0,
|
||||
-7,
|
||||
1,
|
||||
new ItemStack(this)).setParentsHidden("DISTILESSENTIA").setParents(LibResearch.KEY_BRIGHT_NITOR)
|
||||
.setConcealed()
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL))
|
||||
.setSecondary();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_FUNNEL, LibResearch.KEY_FUNNEL, new ItemStack(this), new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_FUNNEL,
|
||||
LibResearch.KEY_FUNNEL,
|
||||
new ItemStack(this),
|
||||
new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
|
||||
"STS",
|
||||
'S', new ItemStack(Blocks.stone),
|
||||
'T', new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
'S',
|
||||
new ItemStack(Blocks.stone),
|
||||
'T',
|
||||
new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 22:13:36 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -26,14 +24,14 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
|
||||
public BlockGas() {
|
||||
@@ -83,8 +81,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
|
||||
private void setAt(World world, int x, int y, int z, int meta) {
|
||||
if (world.isAirBlock(x, y, z) && world.getBlock(x, y, z) != this) {
|
||||
if (!world.isRemote)
|
||||
world.setBlock(x, y, z, this, meta, 2);
|
||||
if (!world.isRemote) world.setBlock(x, y, z, this, meta, 2);
|
||||
world.scheduleBlockUpdate(x, y, z, this, 10);
|
||||
}
|
||||
}
|
||||
@@ -121,7 +118,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return new ArrayList(); // Empty List
|
||||
return new ArrayList<>(); // Empty List
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,11 +136,6 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 22:20:30 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockGaseousLight extends BlockGas {
|
||||
|
||||
public BlockGaseousLight() {
|
||||
@@ -57,4 +55,4 @@ public class BlockGaseousLight extends BlockGas {
|
||||
public Class<? extends TileEntity> getTileEntity() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,27 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 22:21:13 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockGaseousShadow extends BlockGas {
|
||||
|
||||
public BlockGaseousShadow() {
|
||||
@@ -34,8 +32,8 @@ public class BlockGaseousShadow extends BlockGas {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
if (par5Random.nextFloat() < 0.0075F)
|
||||
ThaumicTinkerer.tcProxy.wispFX2(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F);
|
||||
if (par5Random.nextFloat() < 0.0075F) ThaumicTinkerer.tcProxy
|
||||
.wispFX2(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,4 +55,4 @@ public class BlockGaseousShadow extends BlockGas {
|
||||
public Class<? extends TileEntity> getTileEntity() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -8,6 +7,7 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -15,6 +15,7 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.common.block.tile.TileCamo;
|
||||
import thaumic.tinkerer.common.block.tile.TileGolemConnector;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
||||
@@ -23,8 +24,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class BlockGolemConnector extends BlockCamo {
|
||||
|
||||
public BlockGolemConnector() {
|
||||
@@ -47,11 +46,6 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.GOLEMCONNECTOR;
|
||||
@@ -59,7 +53,7 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return Loader.isModLoaded("ComputerCraft");
|
||||
return LoadedMods.computerCraftLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,17 +73,39 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_GOLEMCONNECTOR, new AspectList().add(Aspect.ORDER, 1).add(Aspect.TRAVEL, 2).add(Aspect.TOOL, 1), 1, 0, 0, new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOLEMBELL").setConcealed().setRound()
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), new ResearchPage("2"), new ResearchPage("3"));
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_GOLEMCONNECTOR,
|
||||
new AspectList().add(Aspect.ORDER, 1).add(Aspect.TRAVEL, 2).add(Aspect.TOOL, 1),
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOLEMBELL")
|
||||
.setConcealed().setRound().setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR),
|
||||
new ResearchPage("1"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"),
|
||||
new ResearchPage("2"),
|
||||
new ResearchPage("3"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_GOLEMCONNECTOR, LibResearch.KEY_GOLEMCONNECTOR, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.ENTROPY, 15),
|
||||
"WFW", "sIs", "WFW",
|
||||
'I', new ItemStack(ConfigItems.itemGolemBell),
|
||||
's', new ItemStack(Items.ender_pearl),
|
||||
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F', new ItemStack(Blocks.redstone_block));
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_GOLEMCONNECTOR,
|
||||
LibResearch.KEY_GOLEMCONNECTOR,
|
||||
new ItemStack(this),
|
||||
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.ENTROPY, 15),
|
||||
"WFW",
|
||||
"sIs",
|
||||
"WFW",
|
||||
'I',
|
||||
new ItemStack(ConfigItems.itemGolemBell),
|
||||
's',
|
||||
new ItemStack(Items.ender_pearl),
|
||||
'W',
|
||||
new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F',
|
||||
new ItemStack(Blocks.redstone_block));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -13,6 +13,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.block.tile.TileInfusedFarmland;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
@@ -20,17 +23,14 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 8/4/14.
|
||||
*/
|
||||
public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlock {
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconWet;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconDry;
|
||||
|
||||
@@ -52,11 +52,6 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
return new TileInfusedFarmland();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_INFUSED_FARMLAND;
|
||||
@@ -83,7 +78,8 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
|
||||
IPlantable plantable) {
|
||||
return plantable instanceof BlockInfusedGrain;
|
||||
}
|
||||
|
||||
@@ -102,24 +98,24 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
return null;
|
||||
}
|
||||
|
||||
//Prevent farmland degrading
|
||||
// Prevent farmland degrading
|
||||
|
||||
@Override
|
||||
public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_, float p_149746_6_) {
|
||||
}
|
||||
public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_,
|
||||
float p_149746_6_) {}
|
||||
|
||||
@Override
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
|
||||
}
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return p_149691_1_ == 1 ? (iconWet) : Blocks.dirt.getBlockTextureFromSide(p_149691_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.iconWet = IconHelper.forBlock(p_149651_1_, this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
@@ -25,23 +29,17 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 4/14/14.
|
||||
*/
|
||||
public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
|
||||
|
||||
//Code based off vanilla potato code
|
||||
|
||||
// Code based off vanilla potato code
|
||||
|
||||
public static final int BREEDING_CHANCE = 10;
|
||||
private IIcon[][] icons;
|
||||
private TileInfusedGrain tileEntity;
|
||||
|
||||
//Returns 0-5 for primal aspects, or 6 if compound aspect
|
||||
// Returns 0-5 for primal aspects, or 6 if compound aspect
|
||||
public static int getNumberFromAspectForTexture(Aspect aspect) {
|
||||
if (aspect == Aspect.AIR) {
|
||||
return 0;
|
||||
@@ -65,7 +63,9 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
public static Aspect getAspect(IBlockAccess world, int x, int y, int z) {
|
||||
return world.getTileEntity(x, y, z) instanceof TileInfusedGrain ? ((TileInfusedGrain) world.getTileEntity(x, y, z)).aspect : null;
|
||||
return world.getTileEntity(x, y, z) instanceof TileInfusedGrain
|
||||
? ((TileInfusedGrain) world.getTileEntity(x, y, z)).aspect
|
||||
: null;
|
||||
}
|
||||
|
||||
public static void setAspect(IBlockAccess world, int x, int y, int z, Aspect aspect) {
|
||||
@@ -86,7 +86,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
}
|
||||
|
||||
//Override BlockCrop's getIcon to prevent a crash with mods such as WAILA
|
||||
// Override BlockCrop's getIcon to prevent a crash with mods such as WAILA
|
||||
@Override
|
||||
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
|
||||
return this.icons[1][0];
|
||||
@@ -105,7 +105,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[7][4];
|
||||
String[] names = {"aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic"};
|
||||
String[] names = { "aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic" };
|
||||
for (int j = 0; j < names.length; j++) {
|
||||
String s = names[j];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@@ -116,26 +116,21 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int metadata) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileInfusedGrain) {
|
||||
tileEntity = (TileInfusedGrain)tile;
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
if(world==null)
|
||||
return ret;
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
if (world == null) return ret;
|
||||
Random rand = new Random();
|
||||
int count = 1;
|
||||
for (int i = 0; i < count; i++) {
|
||||
TileInfusedGrain tileGrain = getTileEntitySafe(world, x, y, z);
|
||||
TileEntity tileGrain = world.getTileEntity(x, y, z);
|
||||
ItemStack seedStack = new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class));
|
||||
ItemInfusedSeeds.setAspect(seedStack, getAspectDropped(world, x, y, z, metadata));
|
||||
if (tileGrain != null) {
|
||||
ItemInfusedSeeds.setAspectTendencies(seedStack, tileGrain.primalTendencies);
|
||||
ItemInfusedSeeds.setAspectTendencies(seedStack, ((TileInfusedGrain) tileGrain).primalTendencies);
|
||||
}
|
||||
while (rand.nextInt(10000) < Math.pow(getPrimalTendencyCount(world, x, y, z, Aspect.ENTROPY), 2)) {
|
||||
seedStack.stackSize++;
|
||||
@@ -145,28 +140,42 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
if (metadata >= 7) {
|
||||
do {
|
||||
Aspect aspect = getAspectSafe(world, x, y, z);
|
||||
ItemStack retItem=AspectCropLootManager.getLootForAspect(aspect);
|
||||
if(retItem!=null)
|
||||
ret.add(retItem);
|
||||
Aspect aspect = getAspect(world, x, y, z);
|
||||
ItemStack retItem = AspectCropLootManager.getLootForAspect(aspect);
|
||||
if (retItem != null) ret.add(retItem);
|
||||
|
||||
} while (world.rand.nextInt(75) < getPrimalTendencyCount(world, x, y, z, Aspect.ORDER));
|
||||
}
|
||||
tileEntity = null;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
if (willHarvest) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.removedByPlayer(world, player, x, y, z, willHarvest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
super.harvestBlock(world, player, x, y, z, meta);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
public int getPrimalTendencyCount(World world, int x, int y, int z, Aspect aspect) {
|
||||
TileInfusedGrain tileGrain = getTileEntitySafe(world, x, y, z);
|
||||
return tileGrain != null ? tileGrain.primalTendencies.getAmount(aspect) : 0;
|
||||
TileEntity tileGrain = world.getTileEntity(x, y, z);
|
||||
return tileGrain instanceof TileInfusedGrain ? ((TileInfusedGrain) tileGrain).primalTendencies.getAmount(aspect)
|
||||
: 0;
|
||||
}
|
||||
|
||||
private void fertilizeSoil(World world, int x, int y, int z, int metadata) {
|
||||
if (metadata >= 7) {
|
||||
do {
|
||||
if (world.getTileEntity(x, y - 1, z) instanceof TileInfusedFarmland) {
|
||||
Aspect currentAspect = getAspectSafe(world, x, y, z);
|
||||
Aspect currentAspect = getAspect(world, x, y, z);
|
||||
((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList.add(currentAspect, 1);
|
||||
((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).reduceSaturatedAspects();
|
||||
world.markBlockForUpdate(x, y - 1, z);
|
||||
@@ -175,21 +184,23 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
//Prevent normal growth from occuring
|
||||
//Growth takes place in the tile entity
|
||||
// Prevent normal growth from occuring
|
||||
// Growth takes place in the tile entity
|
||||
checkAndDropBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
public Aspect getAspectDropped(World world, int x, int y, int z, int metadata) {
|
||||
Aspect currentAspect = getAspectSafe(world, x, y, z);
|
||||
Aspect currentAspect = getAspect(world, x, y, z);
|
||||
if (metadata >= 7 && currentAspect != null) {
|
||||
if (world.getTileEntity(x, y - 1, z) instanceof TileInfusedFarmland) {
|
||||
AspectList farmlandAspectList = ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList;
|
||||
for (Aspect aspect : farmlandAspectList.getAspects()) {
|
||||
Random rand = new Random();
|
||||
if (rand.nextInt(BREEDING_CHANCE) < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1) * farmlandAspectList.getAmount(aspect) * farmlandAspectList.getAmount(aspect)) {
|
||||
if (rand.nextInt(BREEDING_CHANCE) < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1)
|
||||
* farmlandAspectList.getAmount(aspect)
|
||||
* farmlandAspectList.getAmount(aspect)) {
|
||||
if (ResearchManager.getCombinationResult(aspect, currentAspect) != null) {
|
||||
return ResearchManager.getCombinationResult(aspect, currentAspect);
|
||||
}
|
||||
@@ -200,11 +211,6 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
return currentAspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.INFUSED_GRAIN_BLOCK;
|
||||
@@ -250,35 +256,4 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
return null;
|
||||
}
|
||||
|
||||
private TileInfusedGrain getTileEntitySafe(World world, int x, int y, int z)
|
||||
{
|
||||
if (tileEntity != null) {
|
||||
return tileEntity;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile != null && tile instanceof TileInfusedGrain)
|
||||
{
|
||||
return (TileInfusedGrain)tile;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Aspect getAspectSafe(World world, int x, int y, int z) {
|
||||
if (tileEntity != null) {
|
||||
return tileEntity.aspect;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile != null && tile instanceof TileInfusedGrain)
|
||||
{
|
||||
return ((TileInfusedGrain)tile).aspect;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,20 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Sep 2013, 17:01:27 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -29,6 +28,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -53,11 +55,6 @@ import thaumic.tinkerer.common.research.RecipeHelper;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBlock {
|
||||
|
||||
Random random;
|
||||
@@ -73,12 +70,19 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
if (par5EntityPlayer.getCurrentEquippedItem() != null) {
|
||||
if (par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null && tile instanceof TileMobMagnet) {
|
||||
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_MOB_MAGNET, par1World, par2, par3, par4);
|
||||
par5EntityPlayer.openGui(
|
||||
ThaumicTinkerer.instance,
|
||||
LibGuiIDs.GUI_ID_MOB_MAGNET,
|
||||
par1World,
|
||||
par2,
|
||||
par3,
|
||||
par4);
|
||||
if (!par1World.isRemote) {
|
||||
par1World.playSoundEffect(par2, par3, par4, "thaumcraft:key", 1F, 0.5F);
|
||||
}
|
||||
@@ -109,21 +113,26 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,11 +190,6 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
return (metadata & 2) == 2 ? new TileMobMagnet() : new TileMagnet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.MAGNET;
|
||||
@@ -213,36 +217,68 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_MAGNETS, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), -6, 3, 3, new ItemStack(this)).setParents(LibResearch.KEY_INTERFACE).setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS).setConcealed()
|
||||
.setPages(new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET), ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET), ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS));
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_MAGNETS,
|
||||
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1),
|
||||
-6,
|
||||
3,
|
||||
3,
|
||||
new ItemStack(this)).setParents(LibResearch.KEY_INTERFACE)
|
||||
.setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS).setConcealed().setPages(
|
||||
new ResearchPage("0"),
|
||||
new ResearchPage("1"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET),
|
||||
ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
|
||||
return new ThaumicTinkererRecipeMulti(
|
||||
new ThaumicTinkererArcaneRecipe(LibResearch.KEY_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
|
||||
" I ", "SIs", "WFW",
|
||||
'I', new ItemStack(Items.iron_ingot),
|
||||
's', new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
'S', new ItemStack(ConfigItems.itemShard),
|
||||
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F', new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))),
|
||||
new ThaumicTinkererArcaneRecipe(LibResearch.KEY_MOB_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this, 1, 1), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
|
||||
" G ", "SGs", "WFW",
|
||||
'G', RecipeHelper.oreDictOrStack(new ItemStack(Items.gold_ingot), "ingotCopper"),
|
||||
's', new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
'S', new ItemStack(ConfigItems.itemShard),
|
||||
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F', new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class)))
|
||||
|
||||
);
|
||||
new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_MAGNET,
|
||||
LibResearch.KEY_MAGNETS,
|
||||
new ItemStack(this),
|
||||
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15)
|
||||
.add(Aspect.ENTROPY, 5),
|
||||
" I ",
|
||||
"SIs",
|
||||
"WFW",
|
||||
'I',
|
||||
new ItemStack(Items.iron_ingot),
|
||||
's',
|
||||
new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
'S',
|
||||
new ItemStack(ConfigItems.itemShard),
|
||||
'W',
|
||||
new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F',
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))),
|
||||
new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_MOB_MAGNET,
|
||||
LibResearch.KEY_MAGNETS,
|
||||
new ItemStack(this, 1, 1),
|
||||
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15)
|
||||
.add(Aspect.ENTROPY, 5),
|
||||
" G ",
|
||||
"SGs",
|
||||
"WFW",
|
||||
'G',
|
||||
RecipeHelper.oreDictOrStack(new ItemStack(Items.gold_ingot), "ingotCopper"),
|
||||
's',
|
||||
new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
'S',
|
||||
new ItemStack(ConfigItems.itemShard),
|
||||
'W',
|
||||
new ItemStack(ConfigBlocks.blockMagicalLog),
|
||||
'F',
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<Class<? extends TileEntity>, String> getAdditionalTileEntities() {
|
||||
HashMap<Class<? extends TileEntity>, String> r = new HashMap<Class<? extends TileEntity>, String>();
|
||||
HashMap<Class<? extends TileEntity>, String> r = new HashMap<>();
|
||||
r.put(TileMobMagnet.class, LibBlockNames.MOB_MAGNET);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1,38 +1,33 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 15:57:04 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class BlockMod extends Block implements ITTinkererBlock {
|
||||
|
||||
public BlockMod(Material par2Material) {
|
||||
super(par2Material);
|
||||
if (registerInCreative())
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
if (registerInCreative()) setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,11 +40,6 @@ public abstract class BlockMod extends Block implements ITTinkererBlock {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [8 Sep 2013, 18:57:45 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.client.core.helper.IconHelper;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
@@ -30,8 +28,7 @@ public abstract class BlockModContainer<T extends TileEntity> extends BlockConta
|
||||
|
||||
protected BlockModContainer(Material par2Material) {
|
||||
super(par2Material);
|
||||
if (registerInCreative())
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
if (registerInCreative()) setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [11 Sep 2013, 17:47:28 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.item.ItemBrightNitor;
|
||||
import thaumic.tinkerer.common.item.kami.armor.ItemGemLegs;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockNitorGas extends BlockGas {
|
||||
|
||||
public BlockNitorGas() {
|
||||
@@ -52,30 +50,37 @@ public class BlockNitorGas extends BlockGas {
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
if (!par1World.isRemote) {
|
||||
boolean remove=false;
|
||||
boolean remove = false;
|
||||
int dist = par1World.getBlockMetadata(par2, par3, par4) == 1 ? 6 : 1;
|
||||
List<EntityPlayer> players = par1World.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(par2 - dist, par3 - dist, par4 - dist, par2 + dist, par3 + dist, par4 + dist));
|
||||
if (players.isEmpty())
|
||||
{
|
||||
List<EntityPlayer> players = par1World.getEntitiesWithinAABB(
|
||||
EntityPlayer.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
par2 - dist,
|
||||
par3 - dist,
|
||||
par4 - dist,
|
||||
par2 + dist,
|
||||
par3 + dist,
|
||||
par4 + dist));
|
||||
if (players.isEmpty()) {
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
remove=true;
|
||||
}
|
||||
else {
|
||||
remove = true;
|
||||
} else {
|
||||
boolean has = false;
|
||||
for (EntityPlayer player : players)
|
||||
if (player.inventory.hasItem(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)) || (ConfigHandler.enableKami && player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemLegs.class))) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
if (player.inventory.hasItem(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class))
|
||||
|| (ConfigHandler.enableKami && player.getCurrentArmor(1) != null
|
||||
&& player.getCurrentArmor(1).getItem()
|
||||
== ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemLegs.class))) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!has)
|
||||
{
|
||||
if (!has) {
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
remove=true;
|
||||
remove = true;
|
||||
}
|
||||
}
|
||||
if(!remove)
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
if (!remove) par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +96,7 @@ public class BlockNitorGas extends BlockGas {
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
|
||||
if (!par1World.isRemote)
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
if (!par1World.isRemote) par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,4 +113,4 @@ public class BlockNitorGas extends BlockGas {
|
||||
public Class<? extends TileEntity> getTileEntity() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Dec 27, 2013, 6:36:19 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -24,6 +23,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -37,9 +37,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPlatform extends BlockCamo {
|
||||
|
||||
public BlockPlatform() {
|
||||
@@ -50,8 +47,10 @@ public class BlockPlatform extends BlockCamo {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {
|
||||
if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0) && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
||||
List par6List, Entity par7Entity) {
|
||||
if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0)
|
||||
&& (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@@ -65,11 +64,6 @@ public class BlockPlatform extends BlockCamo {
|
||||
return new TileCamo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.PLATFORM;
|
||||
@@ -97,16 +91,29 @@ public class BlockPlatform extends BlockCamo {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_PLATFORM, new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1), -2, 6, 3, new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM)).setSecondary();
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_PLATFORM,
|
||||
new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1),
|
||||
-2,
|
||||
6,
|
||||
3,
|
||||
new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM))
|
||||
.setSecondary();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_PLATFORM, LibResearch.KEY_PLATFORM, new ItemStack(this, 2), new AspectList().add(Aspect.AIR, 2).add(Aspect.ENTROPY, 4),
|
||||
" S ", "G G",
|
||||
'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
|
||||
'S', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 7));
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_PLATFORM,
|
||||
LibResearch.KEY_PLATFORM,
|
||||
new ItemStack(this, 2),
|
||||
new AspectList().add(Aspect.AIR, 2).add(Aspect.ENTROPY, 4),
|
||||
" S ",
|
||||
"G G",
|
||||
'G',
|
||||
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
|
||||
'S',
|
||||
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 7));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -13,6 +15,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -32,13 +35,11 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by nekosune on 28/06/14.
|
||||
*/
|
||||
public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
|
||||
IIcon[] icons = new IIcon[2];
|
||||
|
||||
public BlockRPlacer() {
|
||||
@@ -46,7 +47,8 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
TileRPlacer dislocator = (TileRPlacer) tile;
|
||||
@@ -58,7 +60,6 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,11 +82,6 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
return new TileRPlacer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REMOTE_PLACER;
|
||||
@@ -103,13 +99,34 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_REMOTE_PLACER, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), -6, 3, 3, new ItemStack(this)).setParents(LibResearch.KEY_ANIMATION_TABLET).setConcealed()
|
||||
.setPages(new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_REMOTE_PLACER));
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_REMOTE_PLACER,
|
||||
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1),
|
||||
-6,
|
||||
3,
|
||||
3,
|
||||
new ItemStack(this)).setParents(LibResearch.KEY_ANIMATION_TABLET).setConcealed().setPages(
|
||||
new ResearchPage("0"),
|
||||
new ResearchPage("1"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_REMOTE_PLACER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_REMOTE_PLACER, LibResearch.KEY_REMOTE_PLACER, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5), "ses", "sds", "sss", 's', ConfigBlocks.blockStoneDevice, 'e', Items.ender_pearl, 'd', Blocks.dispenser);
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_REMOTE_PLACER,
|
||||
LibResearch.KEY_REMOTE_PLACER,
|
||||
new ItemStack(this),
|
||||
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
|
||||
"ses",
|
||||
"sds",
|
||||
"sss",
|
||||
's',
|
||||
ConfigBlocks.blockStoneDevice,
|
||||
'e',
|
||||
Items.ender_pearl,
|
||||
'd',
|
||||
Blocks.dispenser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,14 +140,17 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase,
|
||||
ItemStack par6ItemStack) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
((TileRPlacer) tile).orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||||
((TileRPlacer) tile).orientation = BlockPistonBase
|
||||
.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3, int i4, int i5) {
|
||||
public int onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3,
|
||||
int i4, int i5) {
|
||||
if (!world.isRemote) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
entityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_REMOTE_PLACER, world, i, i2, i3);
|
||||
@@ -142,35 +162,28 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
@Override
|
||||
public ItemStack onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer) {
|
||||
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingWandTick(ItemStack itemStack, EntityPlayer entityPlayer, int i) {
|
||||
|
||||
}
|
||||
public void onUsingWandTick(ItemStack itemStack, EntityPlayer entityPlayer, int i) {}
|
||||
|
||||
@Override
|
||||
public void onWandStoppedUsing(ItemStack itemStack, World world, EntityPlayer entityPlayer, int i) {
|
||||
|
||||
}
|
||||
|
||||
public void onWandStoppedUsing(ItemStack itemStack, World world, EntityPlayer entityPlayer, int i) {}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
if (par1World.isRemote)
|
||||
return;
|
||||
if (par1World.isRemote) return;
|
||||
|
||||
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)
|
||||
|| par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean on = meta != 0;
|
||||
|
||||
if (power && !on) {
|
||||
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 4);
|
||||
} else if (!power && on)
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
|
||||
} else if (!power && on) par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,8 +199,7 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
if (tile != null && tile instanceof TileRPlacer) {
|
||||
TileRPlacer placer = (TileRPlacer) tile;
|
||||
if (tile instanceof TileRPlacer placer) {
|
||||
placer.receiveRedstonePulse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [Nov 30, 2013, 5:36:26 PM (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -32,6 +28,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -39,6 +38,7 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumic.tinkerer.client.lib.LibRenderIDs;
|
||||
import thaumic.tinkerer.common.block.tile.TileRepairer;
|
||||
import thaumic.tinkerer.common.compat.LoadedMods;
|
||||
import thaumic.tinkerer.common.compat.TinkersConstructCompat;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
@@ -48,9 +48,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockRepairer extends BlockModContainer {
|
||||
|
||||
Random random;
|
||||
@@ -64,7 +61,8 @@ public class BlockRepairer extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
|
||||
int par6, float par7, float par8, float par9) {
|
||||
TileRepairer repairer = (TileRepairer) par1World.getTileEntity(par2, par3, par4);
|
||||
ItemStack stack = repairer.getStackInSlot(0);
|
||||
|
||||
@@ -92,21 +90,18 @@ public class BlockRepairer extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||
ItemStack par6ItemStack) {
|
||||
byte b0 = 0;
|
||||
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (l1 == 0)
|
||||
b0 = 2;
|
||||
if (l1 == 0) b0 = 2;
|
||||
|
||||
if (l1 == 1)
|
||||
b0 = 5;
|
||||
if (l1 == 1) b0 = 5;
|
||||
|
||||
if (l1 == 2)
|
||||
b0 = 3;
|
||||
if (l1 == 2) b0 = 3;
|
||||
|
||||
if (l1 == 3)
|
||||
b0 = 4;
|
||||
if (l1 == 3) b0 = 4;
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
|
||||
}
|
||||
@@ -124,29 +119,32 @@ public class BlockRepairer extends BlockModContainer {
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
|
||||
.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
int dmg;
|
||||
if (Loader.isModLoaded("TConstruct")) {
|
||||
if (LoadedMods.TConstructLoaded) {
|
||||
if (TinkersConstructCompat.isTConstructTool(itemstack)) {
|
||||
dmg = TinkersConstructCompat.getDamage(itemstack);
|
||||
} else
|
||||
dmg = itemstack.getItemDamage();
|
||||
} else
|
||||
dmg = itemstack.getItemDamage();
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, dmg));
|
||||
} else dmg = itemstack.getItemDamage();
|
||||
} else dmg = itemstack.getItemDamage();
|
||||
entityitem = new EntityItem(
|
||||
par1World,
|
||||
par2 + f,
|
||||
par3 + f1,
|
||||
par4 + f2,
|
||||
new ItemStack(itemstack.getItem(), k1, dmg));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
|
||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,11 +181,6 @@ public class BlockRepairer extends BlockModContainer {
|
||||
return new TileRepairer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REPAIRER;
|
||||
@@ -215,14 +208,33 @@ public class BlockRepairer extends BlockModContainer {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_REPAIRER, new AspectList().add(Aspect.TOOL, 2).add(Aspect.CRAFT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1), -1, -9, 3, new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FUNNEL).setParentsHidden("THAUMIUM", "ENCHFABRIC")
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER));
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_REPAIRER,
|
||||
new AspectList().add(Aspect.TOOL, 2).add(Aspect.CRAFT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1),
|
||||
-1,
|
||||
-9,
|
||||
3,
|
||||
new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FUNNEL)
|
||||
.setParentsHidden("THAUMIUM", "ENCHFABRIC")
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_REPAIRER, new ItemStack(this), 8, new AspectList().add(Aspect.TOOL, 15).add(Aspect.CRAFT, 20).add(Aspect.ORDER, 10).add(Aspect.MAGIC, 15), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4),
|
||||
new ItemStack(Items.iron_ingot), new ItemStack(Items.gold_ingot), new ItemStack(Items.diamond), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.planks), new ItemStack(Items.leather), new ItemStack(ConfigItems.itemResource, 1, 7), new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
return new ThaumicTinkererInfusionRecipe(
|
||||
LibResearch.KEY_REPAIRER,
|
||||
new ItemStack(this),
|
||||
8,
|
||||
new AspectList().add(Aspect.TOOL, 15).add(Aspect.CRAFT, 20).add(Aspect.ORDER, 10).add(Aspect.MAGIC, 15),
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4),
|
||||
new ItemStack(Items.iron_ingot),
|
||||
new ItemStack(Items.gold_ingot),
|
||||
new ItemStack(Items.diamond),
|
||||
new ItemStack(Blocks.cobblestone),
|
||||
new ItemStack(Blocks.planks),
|
||||
new ItemStack(Items.leather),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 7),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
|
||||
* Thaumcraft 4 (c) Azanor 2012
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [9 Sep 2013, 15:52:53 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -26,6 +23,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
@@ -42,9 +42,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
import thaumic.tinkerer.common.research.TTResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
|
||||
IIcon iconTop;
|
||||
@@ -92,12 +89,8 @@ public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int meta) {
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
return par1 == ForgeDirection.UP.ordinal() ? iconTop
|
||||
: par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,13 +120,33 @@ public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
|
||||
@Override
|
||||
public IRegisterableResearch getResearchItem() {
|
||||
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_SUMMON, new AspectList().add(Aspect.WEAPON, 1).add(Aspect.BEAST, 3).add(Aspect.MAGIC, 3), -5, 8, 3, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))).setWarp(3).setParents(LibResearch.KEY_BLOOD_SWORD)
|
||||
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"), ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"), ResearchHelper.infusionPage(LibResearch.KEY_SUMMON), new ResearchPage("1"));
|
||||
|
||||
return (IRegisterableResearch) new TTResearchItem(
|
||||
LibResearch.KEY_SUMMON,
|
||||
new AspectList().add(Aspect.WEAPON, 1).add(Aspect.BEAST, 3).add(Aspect.MAGIC, 3),
|
||||
-5,
|
||||
8,
|
||||
3,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))).setWarp(3)
|
||||
.setParents(LibResearch.KEY_BLOOD_SWORD).setPages(
|
||||
new ResearchPage("0"),
|
||||
ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"),
|
||||
ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"),
|
||||
ResearchHelper.infusionPage(LibResearch.KEY_SUMMON),
|
||||
new ResearchPage("1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_SUMMON + "0", LibResearch.KEY_SUMMON, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class)), new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), "WWW", "SSS", 'S', new ItemStack(Blocks.stone), 'W', new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_SUMMON + "0",
|
||||
LibResearch.KEY_SUMMON,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class)),
|
||||
new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50),
|
||||
"WWW",
|
||||
"SSS",
|
||||
'S',
|
||||
new ItemStack(Blocks.stone),
|
||||
'W',
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -15,23 +16,20 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.item.ItemTravelSlab;
|
||||
import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab;
|
||||
import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
import thaumic.tinkerer.common.lib.LibResearch;
|
||||
import thaumic.tinkerer.common.registry.ITTinkererBlock;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
|
||||
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by Katrina on 13/04/2015.
|
||||
*/
|
||||
@@ -58,7 +56,7 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return ConfigBlocks.blockCosmeticSolid.getIcon(par1,2);
|
||||
return ConfigBlocks.blockCosmeticSolid.getIcon(par1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,11 +64,6 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
|
||||
}
|
||||
|
||||
//@Override
|
||||
//public int idDropped(int par1, Random par2Random, int par3) {
|
||||
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
|
||||
//}
|
||||
|
||||
@Override
|
||||
public ItemStack createStackedBlock(int par1) {
|
||||
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
|
||||
@@ -88,10 +81,8 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockTravelSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,26 +120,27 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
if (isOpaqueCube()) {
|
||||
return null;
|
||||
}
|
||||
return new ThaumicTinkererCraftingBenchRecipe("PAVETRAVEL", new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class), 6),
|
||||
return new ThaumicTinkererCraftingBenchRecipe(
|
||||
"PAVETRAVEL",
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class), 6),
|
||||
"QQQ",
|
||||
'Q', new ItemStack(ConfigBlocks.blockCosmeticSolid,1,2));
|
||||
'Q',
|
||||
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity e) {
|
||||
if(world.getBlock(x, y, z) == this) {
|
||||
if(e instanceof EntityLivingBase) {
|
||||
if(world.isRemote) {
|
||||
if (world.getBlock(x, y, z) == this) {
|
||||
if (e instanceof EntityLivingBase) {
|
||||
if (world.isRemote) {
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, '?', 5);
|
||||
}
|
||||
|
||||
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
|
||||
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
|
||||
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
|
||||
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
|
||||
}
|
||||
|
||||
super.onEntityWalking(world, x, y, z, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loaded 100 of 641 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user