mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 17:14:44 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3effde4f1f | ||
|
|
4d0705370f | ||
|
|
25c661a7f0 | ||
|
|
dbd6c296f2 | ||
|
|
d3f01843f7 | ||
|
|
8cc1e13a28 | ||
|
|
adb7f0d836 | ||
|
|
d9986ac035 | ||
|
|
2169e9d0d7 | ||
|
|
a8b9abcb17 | ||
|
|
87a63bc5e0 | ||
|
|
0683971741 | ||
|
|
49bdd556b5 | ||
|
|
24c659dfa1 | ||
|
|
54f9ca540e | ||
|
|
db6ab2a19e | ||
|
|
863ab2ca18 | ||
|
|
45da4f6910 | ||
|
|
c2630d2a79 | ||
|
|
05f4f5ec77 | ||
|
|
a5d0a86760 | ||
|
|
7b4a01703b | ||
|
|
3b99c80636 | ||
|
|
20efd7150a | ||
|
|
c56377e4ee | ||
|
|
3e98e16f39 | ||
|
|
d41cb552a1 | ||
|
|
ae2cb06d2c | ||
|
|
9de9193062 | ||
|
|
f8d32a8525 | ||
|
|
dac053415b | ||
|
|
7a52116665 | ||
|
|
9ba67cedf1 | ||
|
|
5aac0beba9 | ||
|
|
7849aebab0 | ||
|
|
ea26df0174 | ||
|
|
3a62514e60 | ||
|
|
9a636e3c76 | ||
|
|
fa35f30e86 | ||
|
|
633fd9bd2e | ||
|
|
3c426a2e66 | ||
|
|
25375f63cc | ||
|
|
45cadab7c5 | ||
|
|
75788f63ee | ||
|
|
3e7b8809b6 | ||
|
|
6162f438f1 | ||
|
|
1752e57ea0 | ||
|
|
e91ef7f56b | ||
|
|
24f7be2f37 | ||
|
|
208ed997d4 | ||
|
|
1f12642a05 | ||
|
|
e7beed4875 | ||
|
|
69a44e6414 | ||
|
|
3870951a37 | ||
|
|
af4fcd73a4 | ||
|
|
04a6b6c2d0 | ||
|
|
1b15c127a6 | ||
|
|
8670abca57 | ||
|
|
f3d364397d | ||
|
|
cc95c40b5b | ||
|
|
e6fbf39591 | ||
|
|
8cbac6af97 | ||
|
|
87cbf735a2 | ||
|
|
bcbf184915 | ||
|
|
965d872856 | ||
|
|
41a098e2f7 | ||
|
|
41d07e7aae | ||
|
|
d1adf00158 | ||
|
|
ed67b6fd31 | ||
|
|
d5ff207fab | ||
|
|
da7c299f7e | ||
|
|
204ebdc6dd | ||
|
|
be565d2ddc | ||
|
|
21f7c31f62 | ||
|
|
4e11c95d0e | ||
|
|
d1478ca529 | ||
|
|
359d4fe2d5 | ||
|
|
d3f27cf6fb | ||
|
|
3dd8c8ae6f | ||
|
|
54882f2564 | ||
|
|
c5402d50fa | ||
|
|
a5f29570a3 | ||
|
|
dd27209565 | ||
|
|
f1d1e8853b | ||
|
|
5ef199f6d7 | ||
|
|
2a5268c699 | ||
|
|
32c24be6b4 | ||
|
|
5f56b7cd09 | ||
|
|
7f337cf230 | ||
|
|
7731e1cd75 | ||
|
|
f8879b1316 | ||
|
|
3dfe47944d | ||
|
|
c11a712e2f | ||
|
|
5771c8ffea | ||
|
|
9587f08ece | ||
|
|
73b6d10e5a | ||
|
|
90c244acb4 | ||
|
|
3cf97f43fe | ||
|
|
0b47ccc015 | ||
|
|
8d372f95f2 | ||
|
|
d16472d0ba | ||
|
|
896db6398f | ||
|
|
e406137b19 | ||
|
|
16f4903285 | ||
|
|
84d322da34 | ||
|
|
3a64cb8985 | ||
|
|
2fef75c1de | ||
|
|
c040a8865f | ||
|
|
4931fc1907 | ||
|
|
607da1bd9b | ||
|
|
ebc4eaddac | ||
|
|
10dbbf9c19 | ||
|
|
f9c2f715fd | ||
|
|
4e1f7138ee | ||
|
|
5ae5d81609 | ||
|
|
947a004138 | ||
|
|
e4ca526d5b | ||
|
|
1ba084f131 | ||
|
|
857573f10f | ||
|
|
76c138c400 | ||
|
|
55a7c6d64b | ||
|
|
0fb8844623 | ||
|
|
6337466735 | ||
|
|
214275baba | ||
|
|
82262e462e | ||
|
|
ee0d43bbde | ||
|
|
93b704b459 | ||
|
|
10036aa764 | ||
|
|
fcd00bd4af | ||
|
|
c20a5e8805 |
No files matched your search
@@ -13,4 +13,3 @@
|
||||
*.pyd binary
|
||||
*.cfg text eol=lf
|
||||
*.py text eol=lf
|
||||
*.jks binary
|
||||
@@ -0,0 +1,4 @@
|
||||
<!-- Thank you for reporting! -->
|
||||
|
||||
<!-- Please go to the forum first for support with crashes and issues. -->
|
||||
<!-- http://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Want to request a feature?
|
||||
title: ''
|
||||
labels: Feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please note, feature requests that are submitted as GitHub issues here are rarely implemented. -->
|
||||
<!-- If you'd like to see something in Forge, you should be ready to implement it as a PR. -->
|
||||
<!-- If you're not sure, open a Draft PR or discuss it in the Discord server. -->
|
||||
<!-- Discord: https://discord.gg/UvedJ9m -->
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Issue report
|
||||
about: Visit the forum first for issues with crashes.
|
||||
title: ''
|
||||
labels: Triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Thank you for reporting! -->
|
||||
|
||||
<!-- For support with crashes and issues, please create a post on the forum instead: -->
|
||||
<!-- https://www.minecraftforge.net/forum/forum/18-support-bug-reports/ -->
|
||||
|
||||
**Minecraft Version:** {Minecraft version}
|
||||
|
||||
**Forge Version:** {Forge version. *Version number, not latest/rb*}
|
||||
|
||||
**Logs:** {Link(s) to GitHub Gist with full latest.log and/or crash report}
|
||||
|
||||
**Steps to Reproduce:**
|
||||
1. Do this
|
||||
2. Then do that
|
||||
3. ...
|
||||
|
||||
**Description of issue:**
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '1.12.x' ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
|
||||
with:
|
||||
java: 8
|
||||
gradle_tasks: 'ciWriteBuildNumber setup build publish'
|
||||
legacy_prefix: 14
|
||||
legacy_build_number: 2848
|
||||
artifact_name: 'forge'
|
||||
secrets:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
|
||||
PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
|
||||
PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
# Unused for now until we upgrade gradle
|
||||
# SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
|
||||
# SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
|
||||
# SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}
|
||||
# SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
|
||||
+17
-18
@@ -1,8 +1,7 @@
|
||||
#eclipse
|
||||
**/bin
|
||||
**/.settings
|
||||
**/.classpath
|
||||
*.project
|
||||
/bin
|
||||
/.settings
|
||||
/.classpath
|
||||
|
||||
#In case people make their workspace in the repo
|
||||
/eclipse/
|
||||
@@ -15,20 +14,11 @@
|
||||
#gradle
|
||||
/build
|
||||
/.gradle
|
||||
/mdk/.gradle
|
||||
/mdk/build
|
||||
|
||||
#occupational hazards
|
||||
/projects/mcp/
|
||||
/projects/clean/
|
||||
/projects/forge/
|
||||
/projects/**/build/
|
||||
/projects/**/out/
|
||||
/projects/**/run/
|
||||
/projects/**/*.launch
|
||||
/projects/
|
||||
/repo/
|
||||
/buildSrc
|
||||
src/generated/resources/.cache/
|
||||
|
||||
#Patch rejects
|
||||
/patches-/
|
||||
@@ -36,9 +26,18 @@ src/generated/resources/.cache/
|
||||
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
/patches_old/
|
||||
/patches_old_bak/
|
||||
*.py
|
||||
*.7z
|
||||
/logs/
|
||||
|
||||
gradle.properties
|
||||
!/mdk/gradle.properties
|
||||
.project
|
||||
/mdk/.gradle/
|
||||
/mdk/.settings/
|
||||
/mdk/bin/
|
||||
/mdk/build/
|
||||
/mdk/crash-reports/
|
||||
/mdk/logs/
|
||||
/mdk/resourcepacks/
|
||||
/mdk/run/
|
||||
*.launch
|
||||
*.classpath
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
language: java
|
||||
jdk: oraclejdk8
|
||||
|
||||
env:
|
||||
- BUILD_NUMBER=9999
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar
|
||||
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
- $TRAVIS_BUILD_DIR/build/localCache/Forge/
|
||||
|
||||
before_install: chmod +x gradlew
|
||||
install:
|
||||
- ./gradlew --refresh-dependencies
|
||||
- ./gradlew ciWriteBuildNumber
|
||||
script:
|
||||
- travis_wait ./gradlew build -x createExe -S
|
||||
- ./gradlew -p projects/Forge test -S -i
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
# skip building travis on 1.13+ - it doesn't work there
|
||||
branches:
|
||||
except:
|
||||
- 1.13-pre
|
||||
- 1.13.x
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
- /^noci-.*$/
|
||||
File renamed without changes.
+1
-1
@@ -10,7 +10,7 @@ alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptian
|
||||
of me taking over the project, who knows what Minecraft modding would be today.
|
||||
|
||||
Secondly, someone who has worked with me, and developed some of the core features
|
||||
that allow modding to be as functional, and as simple as it is, cpw. For developing
|
||||
that allow modding to he as functional, and as simple as it is, cpw. For developing
|
||||
FML, which stabelized the client and server modding ecosystem. As well as the base
|
||||
loading system that allows us to modify Minecraft's code as elegently as possible.
|
||||
|
||||
|
||||
File renamed without changes.
Vendored
-110
@@ -1,110 +0,0 @@
|
||||
@Library('forge-shared-library')_
|
||||
|
||||
pipeline {
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'gradlewrapper:latest'
|
||||
args '-v gradlecache:/gradlecache'
|
||||
}
|
||||
}
|
||||
environment {
|
||||
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
|
||||
DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
|
||||
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('fetch') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
stage('notify_start') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Started",
|
||||
successful: true,
|
||||
result: 'ABORTED', //White border
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
stage('setup') {
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
|
||||
script {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('changelog') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
environment {
|
||||
FORGE_MAVEN = credentials('forge-maven-forge-user')
|
||||
CROWDIN = credentials('forge-crowdin')
|
||||
KEYSTORE = credentials('forge-jenkins-keystore-old')
|
||||
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
}
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
|
||||
}
|
||||
}
|
||||
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
|
||||
when {
|
||||
changeRequest()
|
||||
}
|
||||
environment {
|
||||
CROWDIN = credentials('forge-crowdin')
|
||||
}
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
|
||||
//junit 'build/test-results/*/*.xml'
|
||||
//jacoco sourcePattern: '**/src/*/java'
|
||||
|
||||
if (env.CHANGE_ID == null) { // This is unset for non-PRs
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
|
||||
description: '```\n' + getChanges(currentBuild) + '\n```',
|
||||
successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"),
|
||||
result: currentBuild.currentResult,
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
SoundSystem CodecIBXM Class License:
|
||||
|
||||
You are free to use this class for any purpose, commercial or otherwise.
|
||||
You may modify this class or source code, and distribute it any way you
|
||||
like, provided the following conditions are met:
|
||||
|
||||
1) You may not falsely claim to be the author of this class or any
|
||||
unmodified portion of it.
|
||||
2) You may not copyright this class or a modified version of it and then
|
||||
sue me for copyright infringement.
|
||||
3) If you modify the source code, you must clearly document the changes
|
||||
made before redistributing the modified source code, so other users know
|
||||
it is not the original code.
|
||||
4) You are not required to give me credit for this class in any derived
|
||||
work, but if you do, you must also mention my website:
|
||||
http://www.paulscode.com
|
||||
5) I the author will not be responsible for any damages (physical,
|
||||
financial, or otherwise) caused by the use if this class or any
|
||||
portion of it.
|
||||
6) I the author do not guarantee, warrant, or make any representations,
|
||||
either expressed or implied, regarding the use of this class or any
|
||||
portion of it.
|
||||
|
||||
Author: Paul Lamb
|
||||
http://www.paulscode.com
|
||||
|
||||
|
||||
This software is based on or using the IBXM library available from
|
||||
http://www.geocities.com/sunet2000/
|
||||
|
||||
|
||||
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
Minecraft Forge
|
||||
Copyright (c) 2016-2019.
|
||||
Copyright (c) 2016-2020.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -13,4 +13,4 @@ Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+8
-2
@@ -3,8 +3,8 @@ parts herein are licensed under the terms of the LGPL 2.1 found
|
||||
here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and
|
||||
copied below.
|
||||
|
||||
Homepage: http://minecraftforge.net/
|
||||
https://github.com/MinecraftForge/MinecraftForge
|
||||
Homepage: http://MinecraftForge.net/
|
||||
http://github.com/MinecraftForge/MinecraftForge
|
||||
|
||||
|
||||
A note on authorship:
|
||||
@@ -57,6 +57,12 @@ This software contains a partial repackaging of javaxdelta, a BSD licensed progr
|
||||
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
|
||||
authored by genman, heikok, pivot.
|
||||
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
|
||||
|
||||
This software contains potions of Paulscodee IBXM library, a BSD liceensed library for
|
||||
loading and playing IBXM formated auto. No modifications havee beeen made. The associated
|
||||
licenses can be found along side this one, or at
|
||||
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20IBXM%20Library.txt
|
||||
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/LICENSE-Paulscode%20SoundSystem%20CodecIBXM.txt
|
||||
=========================================================================
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# How to install Forge: For Players
|
||||
|
||||
Go to [the Forge website](http://files.minecraftforge.net)
|
||||
and select the minecraft version you wish to get forge for from the list.
|
||||
|
||||
You can download the installer for the *Recommended Build* or the
|
||||
*Latest build* there. Latest builds may have newer features but may be
|
||||
more unstable as a result. The installer will attempt to install forge
|
||||
into your vanilla launcher environment, where you can then create a new
|
||||
profile using that version and play the game!
|
||||
|
||||
For support and questions, visit [the Support Forum](http://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
|
||||
|
||||
Here is a short video from Rorax showing how to install and setup Forge:
|
||||
|
||||
[](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
|
||||
|
||||
# How to install Forge: For Modders
|
||||
|
||||
[See the "Getting Started" section in the Forge Documentation](http://mcforge.readthedocs.io/en/latest/gettingstarted/).
|
||||
|
||||
# How to install Forge: For those wishing to work on Forge itself
|
||||
|
||||
If you wish to actually inspect Forge, submit PRs or otherwise work
|
||||
with Forge itself, you're in the right place!
|
||||
|
||||
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
|
||||
|
||||
## Pull requests
|
||||
|
||||
[See the "Making Changes and Pull Requests" section in the Forge documentation](http://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
|
||||
|
||||
### Contributor License Agreement
|
||||
We require all contributors to acknowledge the [Forge Contributor
|
||||
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
|
||||
associated with your github account to do this. If you have previously
|
||||
signed it, you should be OK.
|
||||
File renamed without changes.
+248
-579
File diff suppressed because it is too large.
Load diff
-127
@@ -1,127 +0,0 @@
|
||||
# FML
|
||||
|
||||
Entrypoint : ```FMLServiceProvider.onLoad```
|
||||
|
||||
- Verify environment
|
||||
-- Check all libraries are present: ```accesstransformer```, ```coremod```, ```deobfuscator```
|
||||
-- Check versions are suitable: ```modlauncher```, ```accesstransformer```, ```coremod```, ```deobfuscator```
|
||||
- Find deobfuscated and patched MC
|
||||
-- If not found, trigger job to generate that (loaded later at FMLLaunchProvider.launch)
|
||||
|
||||
Injected arguments:
|
||||
|
||||
- ```mods``` : CSV list of mod files to load
|
||||
- ```modlist``` : JSON formatted list of mod files in a maven-like repository format
|
||||
|
||||
Entrypoint : ```FMLServiceProvider.initializer```
|
||||
- Setup paths
|
||||
-- ```mods``` folder
|
||||
-- ```config``` folder
|
||||
- FML config file read (JSON?)
|
||||
- Trigger initial loading
|
||||
|
||||
Entrypoint : ```FMLLaunchProvider.launch```
|
||||
- Launches the patched and deobfuscated game
|
||||
- - If that wasn't found it'll be generated from the vanilla jar and patch/deobf files (see above)
|
||||
- Possible we'll use an alternative launch for the development environment
|
||||
|
||||
(A goal is that we pre-generate this JAR during forge installation or modpack installation)
|
||||
|
||||
## Loading
|
||||
|
||||
- First we discover all mods
|
||||
- - IModLocator instances present in system are found and queried to compile a master list of all mod artifacts of the three types
|
||||
- LANGPROVIDERs are added to the supported language system : IModLanguageProvider
|
||||
- The MODS from the list have their META-INF/mods.json file queried for mod instances to load
|
||||
- - MODS are cross-referenced for their language being available
|
||||
- - MODS are cross-referenced for their libraries being available
|
||||
- - MODS are cross-referenced for their MOD dependencies being available
|
||||
- - MODS with META-INF/coremods.json specification are loaded into the COREMOD system
|
||||
- - MODS with META-INF/accesstransformer.json are loaded into the ACCESSTRANSFORMER system
|
||||
- - MODS are enqueued to the background loading system
|
||||
- FMLLaunchProvider will be triggered from the ModLauncher to start the game
|
||||
|
||||
## Game loading
|
||||
|
||||
- Events triggered from loadGame will launch various phases of modloading as before
|
||||
-- Deprecation of old "FML" events in favour of Forge events
|
||||
-- If a mod hasn't completed scanning there might be a pause waiting for it to complete before loading (testing indicates this should be a very rare occurrence and isn't worse than existing status quo where all scanning and loading is on-thread)
|
||||
|
||||
### ```IModLocator```
|
||||
|
||||
Finds mods from various sources of various types
|
||||
manifest is queried for type: FMLModType
|
||||
|
||||
- MOD : this file will be scanned as a mod. This is default if nothing is present
|
||||
- LIBRARY : this file will be added to the classpath and no further processing is done
|
||||
- LANGPROVIDER : this file will be loaded as a language provider
|
||||
|
||||
#### ```ModsFolderLocator```
|
||||
|
||||
- scans for jar files from mods folder
|
||||
-- able to load all types
|
||||
-- loads in all environments
|
||||
-- maybe able to do runtime name transformation for dev time?
|
||||
|
||||
Standard mechanism to find and load mods
|
||||
|
||||
#### ```ExplodedDirectoryLocator```
|
||||
|
||||
- loads a directory as a mod
|
||||
-- only able to load mods
|
||||
-- should only load in dev env
|
||||
|
||||
Intended as a mechanism to allow development of mods easily by pointing at a compiled output directory
|
||||
|
||||
#### ```ArgumentModsLocator``` : NYI
|
||||
|
||||
- loads mods from the arguments on the command line
|
||||
-- able to load all types
|
||||
-- loads in all environments
|
||||
|
||||
### ```IModLanguageProvider```
|
||||
|
||||
Provides mod and language provider services
|
||||
|
||||
- Provides a means to transform a Mod File (from the IModLocator) into a list of modcontainer objects based on mods.json
|
||||
- Scanning work will be done in background threads
|
||||
- Language providers can be provided as JARs via the modlocator for ease of distribution
|
||||
|
||||
#### ```FMLModLanguageProvider```
|
||||
|
||||
This is the standard Java @Mod implementation provider
|
||||
|
||||
- provided by default (always supported)
|
||||
- All scanning for @Mod will be done in the background thread
|
||||
|
||||
#### ```ScalaModLanguageProvider```
|
||||
|
||||
This is the scala language provider. It'll be provided separately as a JAR mod download.
|
||||
|
||||
- API contract will need definition
|
||||
|
||||
Other languages? Kotlin? Alternative Scala versions? Javascript?
|
||||
|
||||
## Coremods
|
||||
|
||||
Coremods are now forcefully separated into _injection_ and _runtime_ phases.
|
||||
|
||||
### Injection
|
||||
|
||||
Injection is the act of intercepting the loading of a class and modifying the inbound class with alterations such as additions, replacements and deletions
|
||||
|
||||
Injections will be written using Javascript. Two functions are required: a function providing the list of injection sites, and the function to transform the injection site.
|
||||
|
||||
All injection sites will need to be pre-specified by the coremod in their metadata. Lookup services should be provided in the Javascript API.
|
||||
|
||||
Javascript API for common coremod injection tasks needs to be developed, to allow common best-practice tooling for these complex tasks.
|
||||
|
||||
Runtime coremod code (code that has been injected) is Java as usual.
|
||||
|
||||
## Background loading thread
|
||||
|
||||
Early in loading, a background thread is triggered which will perform scanning tasks for common resources, such as @Mod instances and other annotations. This thread will also be responsible for loading any cached resources, either those defined at build time or pre-computed from previous runs. It may also be tasked with writing those precomputed resources.
|
||||
|
||||
There will be a IPreLoaderJobProvider that will allow extension of the scope of these tasks
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<img src="assets/Forge_logo.svg">
|
||||
|
||||
MinecraftForge
|
||||
=============
|
||||
[](https://files.minecraftforge.net)
|
||||
[](https://files.minecraftforge.net) [](https://discord.gg/UvedJ9m) [](https://www.patreon.com/LexManos) [](https://forgedev.flocker.tv/)
|
||||
|
||||
Forge is a free, open-source modding API all of your favourite mods use!
|
||||
|
||||
| Version | Support |
|
||||
| ------------- | ------------- |
|
||||
| 1.14.x | Active |
|
||||
| 1.12.x | Legacy |
|
||||
|
||||
* [Download]
|
||||
* [Forum]
|
||||
* [Discord]
|
||||
* [Documentation]
|
||||
|
||||
#### Notes:
|
||||
- Introduced in 1.13 was a new FML, information found [here](NewFML.md).
|
||||
|
||||
# Installing Forge
|
||||
|
||||
Go to [the Forge website](https://files.minecraftforge.net)
|
||||
and select the Minecraft version you wish to get Forge for from the list.
|
||||
|
||||
You can download the installer for the *Recommended Build* or the
|
||||
*Latest build* there. Latest builds may have newer features but may be
|
||||
more unstable as a result. The installer will attempt to install Forge
|
||||
into your vanilla launcher environment, where you can then create a new
|
||||
profile using that version and play the game!
|
||||
|
||||
For support and questions, visit [the Support Forum](https://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
|
||||
|
||||
[Here is a short video from Rorax showing how to install and setup Forge.](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
|
||||
|
||||
# Creating Mods
|
||||
|
||||
[See the "Getting Started" section in the Forge Documentation](https://mcforge.readthedocs.io/en/latest/gettingstarted/).
|
||||
|
||||
# Contribute to Forge
|
||||
|
||||
If you wish to actually inspect Forge, submit PRs or otherwise work
|
||||
with Forge itself, you're in the right place!
|
||||
|
||||
[See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
|
||||
|
||||
### Pull requests
|
||||
|
||||
[See the "Making Changes and Pull Requests" section in the Forge documentation](https://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
|
||||
|
||||
Please read the contributing guidelines found [here](CONTRIBUTING.md) before making a pull request.
|
||||
|
||||
### Contributor License Agreement
|
||||
We require all contributors to acknowledge the [Forge Contributor
|
||||
License Agreement](https://cla-assistant.io/MinecraftForge/MinecraftForge). Please ensure you have a valid email address
|
||||
associated with your GitHub account to do this. If you have previously
|
||||
signed it, you should be OK.
|
||||
|
||||
#### Donate
|
||||
*Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider [becoming a patron](https://www.patreon.com/LexManos) or buying some [cool merch](https://forgedev.flocker.tv/).*
|
||||
|
||||
[Download]: https://files.minecraftforge.net/
|
||||
[Forum]: https://www.minecraftforge.net/forum/
|
||||
[Discord]: https://discord.gg/UvedJ9m
|
||||
[Documentation]: https://mcforge.readthedocs.io
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg enable-background="new 164.072 372.466 294.41 46.56" version="1.1" viewBox="164.072 372.466 294.41 46.56" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="#DFA86A">
|
||||
<polygon points="266.16 417.99 277.12 417.99 277.12 401.05 295.09 401.05 295.09 390.78 277.12 390.78 277.12 383.77 296.18 383.77 296.18 373.5 266.16 373.5"/>
|
||||
<path d="m337.33 378.7c-2.103-2.057-4.629-3.64-7.51-4.704-2.743-1.015-5.786-1.528-9.041-1.528l-0.356 2e-3c-3.362 0-6.503 0.556-9.338 1.651-2.857 1.106-5.357 2.707-7.434 4.761-2.073 2.052-3.714 4.559-4.877 7.45-1.158 2.876-1.748 6.104-1.748 9.59 0 3.417 0.59 6.582 1.753 9.403 1.163 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.834 1.096 5.975 1.651 9.339 1.651h0.023c3.402-0.043 6.57-0.639 9.42-1.772 2.863-1.142 5.375-2.757 7.465-4.804 2.091-2.051 3.742-4.524 4.91-7.358 1.162-2.823 1.75-5.987 1.75-9.402 0-3.487-0.588-6.705-1.748-9.568-1.168-2.874-2.82-5.371-4.913-7.425zm-4.644 16.762c0 1.96-0.302 3.782-0.896 5.413-0.587 1.607-1.42 3.011-2.479 4.167-1.05 1.147-2.335 2.065-3.821 2.728-1.479 0.656-3.164 0.99-5.008 0.99-1.84 0-3.514-0.333-4.973-0.988-1.47-0.662-2.747-1.578-3.799-2.729-1.062-1.156-1.895-2.559-2.479-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.298-3.497 0.887-5.044 0.584-1.536 1.419-2.894 2.479-4.037 1.048-1.132 2.323-2.03 3.792-2.674 1.465-0.642 3.145-0.968 4.988-0.968 1.848 0 3.539 0.326 5.025 0.971 1.481 0.643 2.766 1.541 3.812 2.671 1.062 1.143 1.896 2.501 2.479 4.036 0.589 1.548 0.889 3.245 0.889 5.044z"/>
|
||||
<path d="m376.27 395.65c1.902-2.327 2.867-5.221 2.867-8.603 0-2.614-0.508-4.84-1.506-6.613-0.997-1.762-2.354-3.188-4.035-4.234-1.603-0.995-3.445-1.705-5.482-2.114-1.938-0.388-3.969-0.583-6.037-0.583h-16.021v44.487h10.961v-17.282h2.35l9.447 17.282h13.127l-11.199-18.646c2.262-0.728 4.116-1.964 5.528-3.694zm-19.254-12.223h4.426c0.844 0 1.73 0.054 2.636 0.16 0.784 0.094 1.503 0.283 2.132 0.568 0.496 0.225 0.888 0.553 1.193 0.998 0.283 0.415 0.428 1.031 0.428 1.836 0 0.931-0.16 1.643-0.459 2.06-0.34 0.472-0.771 0.813-1.32 1.046-0.686 0.289-1.459 0.477-2.301 0.554-0.975 0.089-1.963 0.136-2.938 0.136h-3.795l-2e-3 -7.358z"/>
|
||||
<path d="m394.82 386.38c1.05-1.132 2.325-2.03 3.793-2.674 1.464-0.642 3.144-0.968 4.988-0.968 1.843 0 3.611 0.311 5.26 0.921 1.609 0.599 2.992 1.449 4.107 2.531l1.314 1.278 8.019-8.105-1.454-1.298c-2.355-2.103-5.066-3.586-8.058-4.407-2.879-0.789-5.987-1.189-9.247-1.189-3.361 0-6.503 0.556-9.339 1.651-2.856 1.106-5.355 2.707-7.431 4.761-2.074 2.052-3.716 4.559-4.88 7.45-1.158 2.876-1.746 6.104-1.746 9.59 0 3.417 0.59 6.582 1.752 9.403 1.164 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.832 1.096 5.975 1.651 9.339 1.651 6.501 0 12.475-1.432 17.751-4.25l0.979-0.522v-23.814h-19.313v10.27h8.354v6.639c-0.871 0.397-1.834 0.709-2.881 0.933-1.5 0.314-3.127 0.478-4.83 0.478-1.841 0-3.514-0.333-4.973-0.988-1.472-0.662-2.748-1.578-3.801-2.729-1.06-1.156-1.893-2.559-2.478-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.299-3.497 0.887-5.044 0.586-1.54 1.421-2.897 2.479-4.041z"/>
|
||||
<polygon points="437.69 407.72 437.69 400.36 456.41 400.36 456.41 390.09 437.69 390.09 437.69 383.77 457.44 383.77 457.44 373.5 426.72 373.5 426.72 417.99 458.48 417.99 458.48 407.72"/>
|
||||
</g>
|
||||
<path d="m243.63 379.09l-37.842-1.852 46.229-0.034v-3.727h-52.125l-1e-3 7.798v6.201c0 0.115-1.52-9.144-1.87-11.734h-4.098v13.029c0 0.123-1.753-10.888-1.939-12.264h-27.914c1.902 1.648 12.401 10.598 19.865 14.28 3.741 1.846 8.33 1.86 12.414 1.974 2.075 0.06 4.25 0.217 5.803 1.754 2.255 2.236 2.758 5.704 0.814 8.33-1.922 2.594-7.335 3.156-7.335 3.156l-4.509 5.531v6.424h10.251l0.319-6.348 8.863-6.285c-0.946 0.757-3.058 2.783-6.229 7.666-0.717 1.102-1.275 2.306-1.711 3.49 2.238-1.896 6.84-3.194 12.153-3.194 5.307 0 9.903 1.295 12.146 3.188-0.437-1.185-0.994-2.385-1.709-3.483-3.172-4.883-5.284-6.909-6.229-7.666l8.863 6.285 0.32 6.348h9.565v-6.424l-4.507-5.531s-6.675-0.425-8.423-3.156c-5.032-7.869 2.115-20.082 18.836-23.756z" fill="#1E2D41"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB |
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,430 @@
|
||||
|
||||
Build 2838:
|
||||
bs2609: Fix vanilla handling of options file (MC-117449, MC-151173) (#5725)
|
||||
|
||||
Build 2837:
|
||||
clienthax: Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712)
|
||||
|
||||
Build 2836:
|
||||
tterrag:
|
||||
Revert "Invalidate tile entities that are queued for removal (#5512)"
|
||||
This reverts commit 75788f63eea6c33ccef7e5cbcab27ad9ad2c2a04.
|
||||
This solution is invalid as TEs are free to modify the world
|
||||
tileEntities list, usually indirectly via chunkloading, from inside
|
||||
invalidate().
|
||||
This happens in vanilla, in TileEntityChest#invalidate, where it calls
|
||||
checkForAdjacentChests(), which has the potential to load neighboring
|
||||
chunks and cause a CME.
|
||||
A more sophisticated solution is needed.
|
||||
|
||||
Build 2835:
|
||||
bs2609: Fix some vertex format changes not being handled correctly (#5368)
|
||||
|
||||
Build 2834:
|
||||
bs2609:
|
||||
Transform vertex normals as well as positions when generating quads
|
||||
(#5242)
|
||||
|
||||
Build 2833:
|
||||
rseifert.phone: Fix for SidedInvWrapper isItemValid using wrong slot (#5642)
|
||||
|
||||
Build 2832:
|
||||
bs2609: Invalidate tile entities that are queued for removal (#5512)
|
||||
|
||||
Build 2831:
|
||||
lclc98: Added Wool to OreDictionary (#5414)
|
||||
|
||||
Build 2830:
|
||||
CreativeMD: Fixed boat not taking care of block-liquid hooks (#5086)
|
||||
|
||||
Build 2829:
|
||||
bs2609: Add Forge dimension-changing hooks to spectator handling code (#5212)
|
||||
|
||||
Build 2828:
|
||||
ichttt:
|
||||
Minor performace improvement when building chunks and rendering blocks
|
||||
(#5286)
|
||||
|
||||
Build 2827:
|
||||
bs2609: Catch json parsing errors from constants/factories files (#5258)
|
||||
|
||||
Build 2826:
|
||||
bs2609: Allow custom DataSerializers to be registered safely (#5245)
|
||||
|
||||
Build 2825:
|
||||
cpw:
|
||||
Try and make 1.13 mods more obviously wrong in 1.12..
|
||||
Signed-off-by: cpw <[email protected]>
|
||||
|
||||
Build 2824:
|
||||
tterrag: Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace
|
||||
|
||||
Build 2823:
|
||||
Pokechu022:
|
||||
Fail fast when null is used with setTag instead of crashing in
|
||||
writeEntry (#5257)
|
||||
|
||||
Build 2822:
|
||||
tterrag: Fix block placement not checking for player collision
|
||||
|
||||
Build 2821:
|
||||
wynprice999: Added more Constants (#5323)
|
||||
|
||||
Build 2820:
|
||||
python0429: [1.12.2] Add a few events pertaining to villages (#5302)
|
||||
|
||||
Build 2819:
|
||||
Tyler Hancock: [1.12] Fix special spawn event not firing in many cases. (#5389)
|
||||
|
||||
Build 2818:
|
||||
bs2609: Only prompt for missing registries on local worlds (#5348)
|
||||
|
||||
Build 2817:
|
||||
ckrier.3000: Add EntityPlaceEvent (#5057)
|
||||
|
||||
Build 2816:
|
||||
bs2609: Generalise EnumRarity to an interface (#5182)
|
||||
|
||||
Build 2815:
|
||||
bs2609: Apply access-level changes to inner class attributes (#5468)
|
||||
|
||||
Build 2814:
|
||||
bs2609: Fix small logic error in ItemTextureQuadConverter (#5463)
|
||||
|
||||
Build 2813:
|
||||
bs2609: Better support for custom bows (#5209)
|
||||
|
||||
Build 2812:
|
||||
CovertJaguar: Remove FluidStack amount from hashcode calculation (#5272)
|
||||
molecularphylo:
|
||||
Fixed incorrect string representation of string list config property
|
||||
default values in their comments.
|
||||
bs2609:
|
||||
Improve tracking of used dimension IDs (#5249)
|
||||
Closes #5378 Large dimension IDs bloat level.data
|
||||
|
||||
Build 2811:
|
||||
bs2609:
|
||||
Fix up torch placement logic to handle more vanilla special-casing
|
||||
(#5426)
|
||||
|
||||
Build 2810:
|
||||
LexManos: Written size does not include int bytes.
|
||||
|
||||
Build 2809:
|
||||
LexManos:
|
||||
Extend Region files to support >1MB per chunk. If the 'sector count' is
|
||||
255, ask the compressed data header for the proper length.
|
||||
|
||||
Build 2808:
|
||||
tterrag1098: Add default impl to IConfigElement#getValidValuesDisplay
|
||||
|
||||
Build 2807:
|
||||
tterrag: Simplify custom item rendering by removing GL emissivity hacks
|
||||
|
||||
Build 2806:
|
||||
tterrag: Support diffuse lighting flag in item rendering
|
||||
|
||||
Build 2805:
|
||||
bs2609:
|
||||
Add a hook to allow continuously using items through stack changes
|
||||
(#4834)
|
||||
* Add a hook to allow continuously using items through stack changes
|
||||
|
||||
* Update licences
|
||||
|
||||
Build 2804:
|
||||
oOMitchOo:
|
||||
Added an additional constructor to every implementation of IFluidBlock.
|
||||
It is now possible to create a fluid block with a Fluid, Material and
|
||||
MapColor, so that the Material's MapColor isn't used for the blocks
|
||||
MapColor. (#5293)
|
||||
|
||||
Build 2803:
|
||||
bs2609: Add redirects to PotionEffect to respect registry replacement (#5213)
|
||||
|
||||
Build 2802:
|
||||
alexiy.ov:
|
||||
Add an annotation for @Config elements which will automatically create a
|
||||
slider control (#5026)
|
||||
|
||||
Build 2801:
|
||||
bs2609: Fix small logic error in emissive item rendering code (#5320)
|
||||
|
||||
Build 2800:
|
||||
molecularphylo:
|
||||
Allow config GUI cycling button elements generated from enums to display
|
||||
toString return values, rather than actual values. (#5125)
|
||||
|
||||
Build 2799:
|
||||
bs2609: Fix incorrect indexing in mipmap generation code (#5201)
|
||||
|
||||
Build 2798:
|
||||
bs2609:
|
||||
Ensure slave maps are cleaned up when handling registry overrides
|
||||
(#5250)
|
||||
|
||||
Build 2797:
|
||||
d_scalzi: Fix issue with --modListFile. (#5316)
|
||||
|
||||
Build 2796:
|
||||
LexManos:
|
||||
Fix potential issues with the Minecraft FakePlayer lingering around
|
||||
after world unloads.
|
||||
|
||||
Build 2795:
|
||||
tterrag: Fix potion remove event not always firing, add expiry event
|
||||
|
||||
Build 2794:
|
||||
tterrag: Clean up CraftingHelper constants loading API
|
||||
|
||||
Build 2793:
|
||||
tterrag: Fix crash from CraftingHelper due to FileSystem being closed early
|
||||
|
||||
Build 2792:
|
||||
tterrag:
|
||||
added PotionHooks, closes #3867, #4375 (#4614)
|
||||
* solved merge confilct
|
||||
|
||||
* improved var names & removed tabs
|
||||
|
||||
* Added spaces around !=
|
||||
|
||||
* fixed typo
|
||||
|
||||
Build 2791:
|
||||
tterrag:
|
||||
Add a hook for farmland watering (#4891)
|
||||
* Add a FarmlandWaterCheckEvent to allow mods to override when Farmland
|
||||
is watered or not
|
||||
|
||||
* revert 1.12.2 json
|
||||
|
||||
* Move the farmland patch to a ticket based instead of a event based
|
||||
system
|
||||
|
||||
* Minor changes
|
||||
|
||||
* Faster isValid checks, faster validation/invalidation if the state did
|
||||
not change, expand test mod to include a test for the validation system
|
||||
|
||||
* remove isValid boolean flag, we can express it with the tick counter
|
||||
|
||||
* Fix test mod resource warnings
|
||||
|
||||
* Remove tick timeout, add a javadoc note to invalidate on chunk unload,
|
||||
cleaned up test mod
|
||||
|
||||
* Allow mods to provide custom handling to determine if a pos is valid
|
||||
or not
|
||||
|
||||
* Make SimpleTicket more simple, make register public so custom tickets
|
||||
can be registered
|
||||
|
||||
* Fixes for review
|
||||
|
||||
* Add missing license headers
|
||||
|
||||
* Use a weak hash set
|
||||
|
||||
* Split up the map into smaller chunk based maps
|
||||
|
||||
* Add missing license headers
|
||||
|
||||
* Make MultiTicketManager more universal for custom implementations,
|
||||
cleanup imports
|
||||
|
||||
Build 2790:
|
||||
tterrag:
|
||||
Add methods to allow loading json constants outside of _constants
|
||||
(#4975)
|
||||
* add interface methods for loading json constants from an arbitary file
|
||||
|
||||
|
||||
* use try-with-resources
|
||||
|
||||
* don't make modders create jsoncontext, clean up resource use
|
||||
|
||||
* very minor cleanup
|
||||
|
||||
Build 2789:
|
||||
tterrag:
|
||||
Compute ASMDataTable submaps parallel, speeds up contructing mods
|
||||
(#5246)
|
||||
* Compute submaps parallel, speeds up contructing mods by a lot
|
||||
|
||||
* Use stream API better
|
||||
|
||||
Build 2788:
|
||||
mezz: Add logging for data manager key registration errors (#5129)
|
||||
|
||||
Build 2787:
|
||||
mezz: Improve support for custom block path types (#5203)
|
||||
|
||||
Build 2786:
|
||||
mezz: Fix missing comments in configs created with annotations (#5189)
|
||||
|
||||
Build 2785:
|
||||
mezz: Allow items to control the rate of repair from mending (#5102)
|
||||
|
||||
Build 2784:
|
||||
mezz: Improve exception handling from server starting events (#5226)
|
||||
|
||||
Build 2783:
|
||||
mezz: Improve context provided by potion icon rendering hooks (#5111)
|
||||
|
||||
Build 2782:
|
||||
mezz: Fix an ObjectHolderRef internal error message (#5214)
|
||||
|
||||
Build 2781:
|
||||
mezz: Implement rendering for item models with emissive quads (#5047)
|
||||
|
||||
Build 2780:
|
||||
mezz: Clean up logged mod states (#5227)
|
||||
mezz: Fix minor issue in getFilledPercentage for Fluid rendering (#5206)
|
||||
|
||||
Build 2779:
|
||||
mezz: Improve reflection helper methods (#4853)
|
||||
mezz: Fix inaccurate main thread name shown in client log (#5078)
|
||||
|
||||
Build 2778:
|
||||
mezz: Fix Baked Item models with transformations (#5241)
|
||||
|
||||
Build 2777:
|
||||
mezz:
|
||||
Re-add some missing villager profession patches (#5200)
|
||||
* Fix zombie villagers only spawning with vanilla professions
|
||||
* Fix spawning modded villagers that do not have their own building
|
||||
mezz: Fix missing string parameters in some log messages (#5210)
|
||||
mezz: Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217)
|
||||
mezz: Prevent RecipeBook from crashing on empty modded ingredients (#5234)
|
||||
|
||||
Build 2776:
|
||||
mezz: Fix the bed position given to the SleepingTimeCheck event (#5107)
|
||||
|
||||
Build 2775:
|
||||
LexManos: Fix some null returns from defaulted registries (#5235)
|
||||
|
||||
Build 2774:
|
||||
LexManos:
|
||||
Only remove synthetic lambda methods referenced in body of SideOnly
|
||||
methods (#5127)
|
||||
|
||||
Build 2773:
|
||||
LexManos:
|
||||
A different approach to my changes in
|
||||
https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e
|
||||
to fix #5207
|
||||
LexManos: Fix patches from #5160 setting rotation as well as position (#5233)
|
||||
LexManos: Use HTTPS for files website.
|
||||
|
||||
Build 2772:
|
||||
tterrag: Make Forge-provided default transforms accessible to custom models
|
||||
tterrag:
|
||||
Make Forge blockstate variants correctly inherit AO setting from vanilla
|
||||
models (#5190)
|
||||
* Make Forge blockstate variants correctly inherit AO setting
|
||||
|
||||
* Move variant format checks into variant, check for added properties
|
||||
|
||||
* Small code cleanup
|
||||
tterrag: fixed visual bug with guislider
|
||||
tterrag:
|
||||
Allow IModel to express itself as a vanilla parent (#5195)
|
||||
* Fix errors caused by fancy missing model being non-vanilla parent
|
||||
|
||||
* Switch instanceof checks to a default IModel method
|
||||
|
||||
* Small code tweaks
|
||||
|
||||
Build 2771:
|
||||
tterrag: Add CreativeTabs#getLabelColor
|
||||
|
||||
Build 2770:
|
||||
tterrag:
|
||||
Allow providing a BufferedImage for banner render generation (#5041)
|
||||
* Adds an Event to allow providing a BufferedImage for the banner render
|
||||
generation (cached)
|
||||
textures, since banners don't use an atlas.
|
||||
implementation.
|
||||
|
||||
* Missed some copyright; might as well absolut text match, I guess
|
||||
|
||||
* Remove unneeded patch change
|
||||
|
||||
* Fix event variable access convention
|
||||
|
||||
* Formatting fix
|
||||
|
||||
* Improve event handling registration
|
||||
|
||||
* Import cleanup
|
||||
|
||||
* Replace event approach with Supplier approach
|
||||
|
||||
* Better name for test mod (now that it's no longer an event); adds
|
||||
ENABLE flag
|
||||
|
||||
* Moves MC code into
|
||||
net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify
|
||||
patch
|
||||
|
||||
* Generalize naming
|
||||
|
||||
Build 2769:
|
||||
mezz: Fix Mesa biome entry tags in the BiomeDictionary (#5177)
|
||||
|
||||
Build 2768:
|
||||
LexManos: Bump version number for RB.
|
||||
|
||||
Build 2767:
|
||||
LexManos:
|
||||
Change biome spawn list entries to use factory method where possible
|
||||
(#5075)
|
||||
LexManos: Prevent some texture loading errors from crashing the game (#5121)
|
||||
LexManos: Patch PotionHelper to use registry delegates (#5142)
|
||||
LexManos: Add a notification event for handling game rule changes (#5152)
|
||||
|
||||
Build 2766:
|
||||
LexManos:
|
||||
Change universal bucket support to use fluid names instead of instances
|
||||
(#5031)
|
||||
|
||||
Build 2765:
|
||||
LexManos: Fix NPE on clientside entities constructed with null world (#5170)
|
||||
|
||||
Build 2764:
|
||||
tterrag: Fix patches from #5160 running on the client and causing stutter
|
||||
|
||||
Build 2763:
|
||||
LexManos:
|
||||
Class transformer optimizations (#5159)
|
||||
* Filter packages for deobf transformation
|
||||
* Only serialize transformed class with TerminalTransformer if bytecode
|
||||
changed
|
||||
|
||||
Build 2762:
|
||||
github: Update github stale so issues can be Assigned
|
||||
|
||||
Build 2761:
|
||||
LexManos:
|
||||
Fix MC-136995 - Chunk loading and unloading issue with entities placed
|
||||
in exact positions. (#5160)
|
||||
Scatter gun patches to improve entity tracking and position tracking.
|
||||
Provided by Aikar through the Paper project, this commit of patches
|
||||
combines the following patches:
|
||||
|
||||
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch
|
||||
|
||||
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch
|
||||
|
||||
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch
|
||||
|
||||
https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch
|
||||
|
||||
Build 2760:
|
||||
LexManos: Fix --mods and --modListFile arguments not making it past LaunchWrapper.
|
||||
|
||||
Build 2759:
|
||||
LexManos: Remove BlamingTransformer (#5115)
|
||||
|
||||
+21
-44
@@ -1,13 +1,13 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
||||
jcenter()
|
||||
maven { url = 'https://maven.minecraftforge.net/' }
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
apply plugin: 'eclipse'
|
||||
@@ -25,7 +25,8 @@ minecraft {
|
||||
// stable_# Stables are built at the discretion of the MCP team.
|
||||
// Use non-default mappings at your own risk. they may not always work.
|
||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
|
||||
//mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
|
||||
mappings channel: 'snapshot', version: '20171003-1.12'
|
||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||
|
||||
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||
@@ -41,46 +42,15 @@ minecraft {
|
||||
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,18 +97,15 @@ jar {
|
||||
}
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish task
|
||||
// we define a custom artifact that is sourced from the reobfJar output task
|
||||
// and then declare that to be published
|
||||
// Note you'll need to add a repository here
|
||||
def reobfFile = file("$buildDir/reobfJar/output.jar")
|
||||
def reobfArtifact = artifacts.add('default', reobfFile) {
|
||||
type 'jar'
|
||||
builtBy 'reobfJar'
|
||||
}
|
||||
// This is the preferred method to reobfuscate your jar file
|
||||
jar.finalizedBy('reobfJar')
|
||||
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
|
||||
//publish.dependsOn('reobfJar')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact reobfArtifact
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
@@ -146,4 +113,14 @@ publishing {
|
||||
url "file:///${project.projectDir}/mcmodsrepo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FML does not support loading exploded directories as mods.
|
||||
// Eclipse works fine because it merges classes and resources when debugging
|
||||
// IntelliJ used to work because FG2 forced the files to be jared during debugging.
|
||||
// Since FG3+ doesn't do that, we need to merge the sourcesets from gradle's side.
|
||||
sourceSets.each {
|
||||
def dir = layout.buildDirectory.file("sourcesSets/$it.name").get().asFile
|
||||
it.output.resourcesDir = dir
|
||||
it.java.outputDir = dir
|
||||
}
|
||||
@@ -1,84 +1,31 @@
|
||||
package com.example.examplemod;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
@Mod("examplemod")
|
||||
@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
|
||||
public class ExampleMod
|
||||
{
|
||||
// Directly reference a log4j logger.
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
public static final String MODID = "examplemod";
|
||||
public static final String NAME = "Example Mod";
|
||||
public static final String VERSION = "1.0";
|
||||
|
||||
public ExampleMod() {
|
||||
// Register the setup method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
|
||||
// Register the enqueueIMC method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
|
||||
// Register the processIMC method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
|
||||
// Register the doClientStuff method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
|
||||
private static Logger logger;
|
||||
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
private void setup(final FMLCommonSetupEvent event)
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
// some preinit code
|
||||
LOGGER.info("HELLO FROM PREINIT");
|
||||
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||
logger = event.getModLog();
|
||||
}
|
||||
|
||||
private void doClientStuff(final FMLClientSetupEvent event) {
|
||||
// do something that can only be done on the client
|
||||
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
|
||||
}
|
||||
|
||||
private void enqueueIMC(final InterModEnqueueEvent event)
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
// some example code to dispatch IMC to another mod
|
||||
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
|
||||
}
|
||||
|
||||
private void processIMC(final InterModProcessEvent event)
|
||||
{
|
||||
// some example code to receive and process InterModComms from other mods
|
||||
LOGGER.info("Got IMC {}", event.getIMCStream().
|
||||
map(m->m.getMessageSupplier().get()).
|
||||
collect(Collectors.toList()));
|
||||
}
|
||||
// You can use SubscribeEvent and let the Event Bus discover methods to call
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
// do something when the server starts
|
||||
LOGGER.info("HELLO from server starting");
|
||||
}
|
||||
|
||||
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
|
||||
// Event bus for receiving Registry Events)
|
||||
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
|
||||
public static class RegistryEvents {
|
||||
@SubscribeEvent
|
||||
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
}
|
||||
// some example code
|
||||
logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
||||
# The overall format is standard TOML format, v0.5.0.
|
||||
# Note that there are a couple of TOML lists in this file.
|
||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId="examplemod" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
version="${file.jarVersion}" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="Example Mod" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
logoFile="examplemod.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
credits="Thanks for this example mod goes to Java" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors="Love, Cheese and small house plants" #optional
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description='''
|
||||
This is a long form description of the mod. You can write whatever you want here
|
||||
|
||||
Have some lorem ipsum.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
'''
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies.examplemod]] #optional
|
||||
# the modid of the dependency
|
||||
modId="forge" #mandatory
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[31,)" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
[[dependencies.examplemod]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.15.2]"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"modid": "examplemod",
|
||||
"name": "Example Mod",
|
||||
"description": "Example placeholder mod.",
|
||||
"version": "${version}",
|
||||
"mcversion": "${mcversion}",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
"authorList": ["ExampleDude"],
|
||||
"credits": "The Forge and FML guys, for making this example",
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "examplemod resources",
|
||||
"pack_format": 5,
|
||||
"_comment": "A pack_format of 5 requires json lang files and some texture changes from 1.15. Note: we require v5 pack meta for all mods."
|
||||
"pack_format": 3,
|
||||
"_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
# The name of the mod loader type to load
|
||||
modLoader="javafml"
|
||||
# A version range to match for said mod loader
|
||||
loaderVersion="[2.0,)"
|
||||
# A URL to query for updates
|
||||
updateJSONURL="http://myurl.me/"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="http://my.issue.tracker/"
|
||||
# Extra mod loader property
|
||||
randomScalaProperty="fishy"
|
||||
# Arbitrary key-value property pairs available to mods
|
||||
[properties]
|
||||
key="value"
|
||||
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]]
|
||||
# The modid of the mod
|
||||
modId="inventorysorter"
|
||||
# The version number of the mod
|
||||
version="1.1"
|
||||
# A display name for the mod
|
||||
displayName="Inventory Sorter"
|
||||
# The description text for the mod (multi line!)
|
||||
description='''
|
||||
This is my mod, there may be
|
||||
others, but this one is mine
|
||||
'''
|
||||
# Override the default resourcelocation namespace with this instead
|
||||
# Currently not implemented
|
||||
namespace="invsorter"
|
||||
# A random extra property for a mod loader
|
||||
randomExtraProperty="somevalue"
|
||||
# Arbitrary key-value pairs
|
||||
[modproperties.inventorysorter]
|
||||
key="value"
|
||||
# A list of dependencies
|
||||
[[dependencies.inventorysorter]]
|
||||
# the modid of the dependency
|
||||
modid="forge"
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true
|
||||
# The version range of the dependency
|
||||
versionRange="[14.23.2.0,)"
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
[[dependencies.inventorysorter]]
|
||||
modid="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.12.2]"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
# Here's another mod in this jar
|
||||
[[mods]]
|
||||
# Note that other mod types may want to add additional key-value pairs in here
|
||||
modId="inventorysortertoo"
|
||||
# ${file.jarVersion} will read the Implementation-Version of the jar file
|
||||
version="${file.jarVersion}"
|
||||
displayName="Inventory Sorter as well"
|
||||
description='''
|
||||
This is also my mod, there may be
|
||||
others, but this one is mine
|
||||
'''
|
||||
@@ -1,20 +0,0 @@
|
||||
--- a/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
@@ -578,10 +578,17 @@
|
||||
GL13.glClientActiveTexture(p_227747_0_);
|
||||
}
|
||||
|
||||
+ /* Stores the last values sent into glMultiTexCoord2f */
|
||||
+ public static float lastBrightnessX = 0.0f;
|
||||
+ public static float lastBrightnessY = 0.0f;
|
||||
@Deprecated
|
||||
public static void func_227640_a_(int p_227640_0_, float p_227640_1_, float p_227640_2_) {
|
||||
RenderSystem.assertThread(RenderSystem::isOnRenderThread);
|
||||
GL13.glMultiTexCoord2f(p_227640_0_, p_227640_1_, p_227640_2_);
|
||||
+ if (p_227640_0_ == GL13.GL_TEXTURE1) {
|
||||
+ lastBrightnessX = p_227640_1_;
|
||||
+ lastBrightnessY = p_227640_2_;
|
||||
+ }
|
||||
}
|
||||
|
||||
public static void func_227706_d_(int p_227706_0_, int p_227706_1_, int p_227706_2_, int p_227706_3_) {
|
||||
@@ -1,25 +0,0 @@
|
||||
--- a/com/mojang/blaze3d/vertex/IVertexBuilder.java
|
||||
+++ b/com/mojang/blaze3d/vertex/IVertexBuilder.java
|
||||
@@ -17,7 +17,7 @@
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
-public interface IVertexBuilder {
|
||||
+public interface IVertexBuilder extends net.minecraftforge.client.extensions.IForgeVertexBuilder {
|
||||
Logger field_227884_f_ = LogManager.getLogger();
|
||||
|
||||
IVertexBuilder func_225582_a_(double p_225582_1_, double p_225582_3_, double p_225582_5_);
|
||||
@@ -95,11 +95,12 @@
|
||||
f5 = p_227890_3_[k] * p_227890_6_;
|
||||
}
|
||||
|
||||
- int l = p_227890_7_[k];
|
||||
+ int l = applyBakedLighting(p_227890_7_[k], bytebuffer);
|
||||
float f9 = bytebuffer.getFloat(16);
|
||||
float f10 = bytebuffer.getFloat(20);
|
||||
Vector4f vector4f = new Vector4f(f, f1, f2, 1.0F);
|
||||
vector4f.func_229372_a_(matrix4f);
|
||||
+ applyBakedNormals(vector3f, bytebuffer, p_227890_1_.func_227872_b_());
|
||||
this.func_225588_a_(vector4f.func_195910_a(), vector4f.func_195913_b(), vector4f.func_195914_c(), f3, f4, f5, 1.0F, f9, f10, p_227890_8_, l, vector3f.func_195899_a(), vector3f.func_195900_b(), vector3f.func_195902_c());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
--- a/net/minecraft/advancements/AdvancementManager.java
|
||||
+++ b/net/minecraft/advancements/AdvancementManager.java
|
||||
@@ -36,7 +36,11 @@
|
||||
Map<ResourceLocation, Advancement.Builder> map = Maps.newHashMap();
|
||||
p_212853_1_.forEach((p_223387_1_, p_223387_2_) -> {
|
||||
try {
|
||||
- Advancement.Builder advancement$builder = field_192783_b.fromJson(p_223387_2_, Advancement.Builder.class);
|
||||
+ Advancement.Builder advancement$builder = net.minecraftforge.common.crafting.ConditionalAdvancement.read(field_192783_b, p_223387_1_, p_223387_2_);
|
||||
+ if (advancement$builder == null) {
|
||||
+ field_192782_a.info("Skipping loading advancement {} as it's conditions were not met", p_223387_1_);
|
||||
+ return;
|
||||
+ }
|
||||
map.put(p_223387_1_, advancement$builder);
|
||||
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
||||
field_192782_a.error("Parsing error loading custom advancement {}: {}", p_223387_1_, jsonparseexception.getMessage());
|
||||
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementManager.java
|
||||
@@ -66,6 +66,7 @@
|
||||
field_192784_c.func_192087_a();
|
||||
Map<ResourceLocation, Advancement.Builder> map = this.func_192781_c();
|
||||
this.func_192777_a(map);
|
||||
+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map);
|
||||
field_192784_c.func_192083_a(map);
|
||||
|
||||
for (Advancement advancement : field_192784_c.func_192088_b())
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/advancements/AdvancementRewards.java
|
||||
+++ b/net/minecraft/advancements/AdvancementRewards.java
|
||||
@@ -43,7 +43,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/advancements/AdvancementRewards.java
|
||||
+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementRewards.java
|
||||
@@ -49,7 +49,7 @@
|
||||
public void func_192113_a(final EntityPlayerMP p_192113_1_)
|
||||
{
|
||||
p_192113_1_.func_71023_q(this.field_192115_b);
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186471_a();
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // Forge: add player & luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
|
||||
p_192113_1_.func_195068_e(this.field_192115_b);
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
for(ResourceLocation resourcelocation : this.field_192116_c) {
|
||||
for (ResourceLocation resourcelocation : this.field_192116_c)
|
||||
@@ -0,0 +1,13 @@
|
||||
--- ../src-base/minecraft/net/minecraft/advancements/DisplayInfo.java
|
||||
+++ ../src-work/minecraft/net/minecraft/advancements/DisplayInfo.java
|
||||
@@ -132,7 +132,9 @@
|
||||
{
|
||||
Item item = JsonUtils.func_188180_i(p_193221_0_, "item");
|
||||
int i = JsonUtils.func_151208_a(p_193221_0_, "data", 0);
|
||||
- return new ItemStack(item, 1, i);
|
||||
+ ItemStack ret = new ItemStack(item, 1, i);
|
||||
+ ret.func_77982_d(net.minecraftforge.common.util.JsonUtils.readNBT(p_193221_0_, "nbt"));
|
||||
+ return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -187,6 +187,8 @@
|
||||
}
|
||||
--- ../src-base/minecraft/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ ../src-work/minecraft/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -196,6 +196,9 @@
|
||||
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
|
||||
+ // Forge: don't grant advancements for fake players
|
||||
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
|
||||
boolean flag = false;
|
||||
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
|
||||
boolean flag1 = advancementprogress.func_192105_a();
|
||||
@@ -199,6 +201,7 @@
|
||||
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_)
|
||||
{
|
||||
+ // Forge: don't grant advancements for fake players
|
||||
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
|
||||
+
|
||||
boolean flag = false;
|
||||
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
|
||||
boolean flag1 = advancementprogress.func_192105_a();
|
||||
@@ -214,6 +217,8 @@
|
||||
{
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[] {this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()}));
|
||||
}
|
||||
+
|
||||
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--- ../src-base/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
|
||||
+++ ../src-work/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java
|
||||
@@ -104,6 +104,13 @@
|
||||
if (p_192492_0_ != null && !p_192492_0_.isJsonNull())
|
||||
{
|
||||
JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item");
|
||||
+ if (jsonobject.has("type"))
|
||||
+ {
|
||||
+ final ResourceLocation rl = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "type"));
|
||||
+ final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> map = net.minecraftforge.advancements.critereon.ItemPredicates.getPredicates();
|
||||
+ if (map.containsKey(rl)) return map.get(rl).apply(jsonobject);
|
||||
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
|
||||
+ }
|
||||
MinMaxBounds minmaxbounds = MinMaxBounds.func_192515_a(jsonobject.get("count"));
|
||||
MinMaxBounds minmaxbounds1 = MinMaxBounds.func_192515_a(jsonobject.get("durability"));
|
||||
Integer integer = jsonobject.has("data") ? JsonUtils.func_151203_m(jsonobject, "data") : null;
|
||||
@@ -1,38 +0,0 @@
|
||||
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
@@ -26,6 +26,8 @@
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
public class ItemPredicate {
|
||||
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> custom_predicates = new java.util.HashMap<>();
|
||||
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates);
|
||||
public static final ItemPredicate field_192495_a = new ItemPredicate();
|
||||
@Nullable
|
||||
private final Tag<Item> field_200018_b;
|
||||
@@ -105,6 +107,11 @@
|
||||
public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) {
|
||||
if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) {
|
||||
JsonObject jsonobject = JSONUtils.func_151210_l(p_192492_0_, "item");
|
||||
+ if (jsonobject.has("type")) {
|
||||
+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type"));
|
||||
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
|
||||
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
|
||||
+ }
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
|
||||
if (jsonobject.has("data")) {
|
||||
@@ -204,6 +211,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) {
|
||||
+ custom_predicates.put(name, deserializer);
|
||||
+ }
|
||||
+
|
||||
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
|
||||
+ return unmod_predicates;
|
||||
+ }
|
||||
+
|
||||
public static class Builder {
|
||||
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
|
||||
private final List<EnchantmentPredicate> field_226657_b_ = Lists.newArrayList();
|
||||
@@ -1,96 +0,0 @@
|
||||
--- a/net/minecraft/block/AbstractRailBlock.java
|
||||
+++ b/net/minecraft/block/AbstractRailBlock.java
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
|
||||
- RailShape railshape = p_220053_1_.func_177230_c() == this ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
|
||||
+ RailShape railshape = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
|
||||
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
|
||||
if (!p_220069_2_.field_72995_K) {
|
||||
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
|
||||
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
|
||||
boolean flag = false;
|
||||
BlockPos blockpos = p_220069_3_.func_177977_b();
|
||||
if (!func_220064_c(p_220069_2_, blockpos)) {
|
||||
@@ -115,7 +115,7 @@
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
if (!p_196243_5_) {
|
||||
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
|
||||
- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) {
|
||||
+ if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) {
|
||||
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
|
||||
}
|
||||
|
||||
@@ -134,5 +134,66 @@
|
||||
return blockstate.func_206870_a(this.func_176560_l(), flag ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH);
|
||||
}
|
||||
|
||||
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
|
||||
public abstract IProperty<RailShape> func_176560_l();
|
||||
+
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
|
||||
+ {
|
||||
+ return !this.field_196277_c;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's direction.
|
||||
+ * Can be used to make the cart think the rail is a different shape,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @param state The BlockState
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @return The direction.
|
||||
+ */
|
||||
+ public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @javax.annotation.Nullable net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return state.func_177229_b(func_176560_l());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pos Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) { }
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
--- a/net/minecraft/block/BedBlock.java
|
||||
+++ b/net/minecraft/block/BedBlock.java
|
||||
@@ -88,7 +88,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_225533_2_.field_73011_w.func_76567_e() && p_225533_2_.func_226691_t_(p_225533_3_) != Biomes.field_76778_j) {
|
||||
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_225533_2_.field_73011_w.canSleepAt(p_225533_4_, p_225533_3_);
|
||||
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
|
||||
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return ActionResultType.SUCCESS;
|
||||
if (p_225533_1_.func_177229_b(field_176471_b)) {
|
||||
if (!this.func_226861_a_(p_225533_2_, p_225533_3_)) {
|
||||
p_225533_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,43 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBanner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java
|
||||
@@ -90,16 +90,9 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_);
|
||||
-
|
||||
- if (itemstack.func_190926_b())
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, itemstack);
|
||||
- }
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -126,6 +119,23 @@
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ TileEntity te = world.func_175625_s(pos);
|
||||
+
|
||||
+ if (te instanceof TileEntityBanner)
|
||||
+ {
|
||||
+ TileEntityBanner tileentitybanner = (TileEntityBanner)te;
|
||||
+ ItemStack itemstack = tileentitybanner.func_190615_l();
|
||||
+ drops.add(itemstack);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ drops.add(new ItemStack(Items.field_179564_cE, 1, 0));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public static class BlockBannerHanging extends BlockBanner
|
||||
{
|
||||
protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D);
|
||||
@@ -0,0 +1,14 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBed.java
|
||||
@@ -84,8 +84,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_180639_1_.field_73011_w.func_76567_e() && p_180639_1_.func_180494_b(p_180639_2_) != Biomes.field_76778_j)
|
||||
+ net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = p_180639_1_.field_73011_w.canSleepAt(p_180639_4_, p_180639_2_);
|
||||
+ if (sleepResult != net.minecraft.world.WorldProvider.WorldSleepResult.BED_EXPLODES)
|
||||
{
|
||||
+ if (sleepResult == net.minecraft.world.WorldProvider.WorldSleepResult.DENY) return true;
|
||||
if (((Boolean)p_180639_3_.func_177229_b(field_176471_b)).booleanValue())
|
||||
{
|
||||
EntityPlayer entityplayer = this.func_176470_e(p_180639_1_, p_180639_2_);
|
||||
@@ -0,0 +1,70 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
||||
@@ -17,7 +17,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockBush extends Block
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()));
|
||||
+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
protected boolean func_185514_i(IBlockState p_185514_1_)
|
||||
@@ -70,6 +71,11 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
+ if (p_180671_3_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
+ {
|
||||
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
|
||||
+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
+ }
|
||||
return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
|
||||
}
|
||||
|
||||
@@ -94,6 +100,36 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_185773_cZ) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
|
||||
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
|
||||
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ }
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer func_180664_k()
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
if (p_181088_2_ == EnumFacing.UP)
|
||||
{
|
||||
- return block == Blocks.field_150438_bZ || !func_193384_b(block) && flag;
|
||||
+ return iblockstate.func_185896_q() || !func_193384_b(block) && flag;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -0,0 +1,67 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
|
||||
@@ -20,7 +20,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockCactus extends Block
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D);
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
{
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update
|
||||
BlockPos blockpos = p_180650_2_.func_177984_a();
|
||||
|
||||
if (p_180650_1_.func_175623_d(blockpos))
|
||||
@@ -51,6 +52,8 @@
|
||||
{
|
||||
int j = ((Integer)p_180650_3_.func_177229_b(field_176587_a)).intValue();
|
||||
|
||||
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, true))
|
||||
+ {
|
||||
if (j == 15)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
|
||||
@@ -62,6 +65,8 @@
|
||||
{
|
||||
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176587_a, Integer.valueOf(j + 1)), 4);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,8 +117,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
|
||||
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
|
||||
+ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b());
|
||||
+ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
|
||||
}
|
||||
|
||||
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
|
||||
@@ -137,6 +142,18 @@
|
||||
return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
+
|
||||
protected BlockStateContainer func_180661_e()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176587_a});
|
||||
@@ -0,0 +1,31 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -470,7 +470,7 @@
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
- if (this.func_176457_m(p_189418_1_, blockpos))
|
||||
+ if (!p_189418_3_ && this.func_176457_m(p_189418_1_, blockpos)) // Forge: fix MC-99321
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -538,7 +538,7 @@
|
||||
|
||||
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
|
||||
{
|
||||
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l();
|
||||
+ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).doesSideBlockChestOpening(p_176456_1_, p_176456_2_.func_177984_a(), EnumFacing.DOWN);
|
||||
}
|
||||
|
||||
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
|
||||
@@ -608,4 +608,10 @@
|
||||
BASIC,
|
||||
TRAP;
|
||||
}
|
||||
+
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ return !func_176454_e(world, pos) && super.rotateBlock(world, pos, axis);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChorusFlower.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChorusFlower.java
|
||||
@@ -55,7 +55,7 @@
|
||||
{
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_185607_a)).intValue();
|
||||
|
||||
- if (i < 5 && p_180650_4_.nextInt(1) == 0)
|
||||
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, p_180650_4_.nextInt(1) == 0))
|
||||
{
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
@@ -144,6 +144,7 @@
|
||||
{
|
||||
this.func_185605_c(p_180650_1_, p_180650_2_);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
@@ -44,13 +44,14 @@
|
||||
{
|
||||
this.func_176500_f(p_180650_1_, p_180650_2_, p_180650_3_);
|
||||
}
|
||||
- else if (p_180650_1_.field_73012_v.nextInt(5) == 0)
|
||||
+ else
|
||||
{
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_176501_a)).intValue();
|
||||
|
||||
- if (i < 2)
|
||||
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(5) == 0))
|
||||
{
|
||||
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176501_a, Integer.valueOf(i + 1)), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +133,14 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- int i = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ super.getDrops(drops, world, pos, state, fortune);
|
||||
+ int i = ((Integer)state.func_177229_b(field_176501_a)).intValue();
|
||||
int j = 1;
|
||||
|
||||
if (i >= 2)
|
||||
@@ -142,7 +150,7 @@
|
||||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
+ drops.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -70,6 +70,7 @@
|
||||
{
|
||||
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9)
|
||||
{
|
||||
int i = this.func_185527_x(p_180650_3_);
|
||||
@@ -78,9 +79,10 @@
|
||||
{
|
||||
float f = func_180672_a(this, p_180650_1_, p_180650_2_);
|
||||
|
||||
- if (p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0)
|
||||
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0))
|
||||
{
|
||||
p_180650_1_.func_180501_a(p_180650_2_, this.func_185528_e(i + 1), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,11 +118,11 @@
|
||||
float f1 = 0.0F;
|
||||
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
|
||||
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
|
||||
+ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
|
||||
{
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
|
||||
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j)))
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -161,7 +163,8 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
|
||||
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
|
||||
+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
protected Item func_149866_i()
|
||||
@@ -174,11 +177,32 @@
|
||||
return Items.field_151015_O;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ super.getDrops(drops, world, pos, state, 0);
|
||||
+ int age = func_185527_x(state);
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+
|
||||
+ if (age >= func_185526_g())
|
||||
+ {
|
||||
+ int k = 3 + fortune;
|
||||
+
|
||||
+ for (int i = 0; i < 3 + fortune; ++i)
|
||||
+ {
|
||||
+ if (rand.nextInt(2 * func_185526_g()) <= age)
|
||||
+ {
|
||||
+ drops.add(new ItemStack(this.func_149866_i(), 1, 0));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this.
|
||||
{
|
||||
int i = this.func_185527_x(p_180653_3_);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -17,7 +17,7 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
|
||||
|
||||
@@ -68,4 +68,11 @@
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -203,7 +203,7 @@
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
|
||||
+ if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
p_189540_2_.func_175698_g(p_189540_3_);
|
||||
flag1 = true;
|
||||
@@ -247,13 +247,14 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- if (p_176196_2_.func_177956_o() >= 255)
|
||||
+ if (p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return (state.func_185896_q() || state.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -24,7 +24,7 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> field_176493_a = PropertyEnum.<BlockDoublePlant.EnumPlantType>func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> field_176492_b = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
@@ -87,6 +87,8 @@
|
||||
Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c());
|
||||
Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this);
|
||||
|
||||
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
|
||||
+
|
||||
if (block == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2);
|
||||
@@ -95,17 +97,13 @@
|
||||
if (block1 == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
|
||||
-
|
||||
- if (!flag)
|
||||
- {
|
||||
- this.func_176226_b(p_176475_1_, blockpos1, p_176475_3_, 0);
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
|
||||
@@ -160,7 +158,6 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_)
|
||||
{
|
||||
- if (p_180657_1_.field_72995_K || p_180657_6_.func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
|
||||
{
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
@@ -220,8 +217,6 @@
|
||||
else
|
||||
{
|
||||
p_176489_4_.func_71029_a(StatList.func_188055_a(this));
|
||||
- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a();
|
||||
- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -290,6 +285,24 @@
|
||||
return Block.EnumOffsetType.XZ;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
|
||||
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
|
||||
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
|
||||
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
public static enum EnumBlockHalf implements IStringSerializable
|
||||
{
|
||||
UPPER,
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_)
|
||||
{
|
||||
- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
|
||||
+ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
|
||||
{
|
||||
int i = 32;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
p_180683_1_.func_175698_g(p_180683_2_);
|
||||
BlockPos blockpos;
|
||||
|
||||
- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
|
||||
+ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
|
||||
{
|
||||
;
|
||||
}
|
||||
@@ -95,7 +95,7 @@
|
||||
{
|
||||
BlockPos blockpos = p_180684_2_.func_177982_a(p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16), p_180684_1_.field_73012_v.nextInt(8) - p_180684_1_.field_73012_v.nextInt(8), p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16));
|
||||
|
||||
- if (p_180684_1_.func_180495_p(blockpos).func_177230_c().field_149764_J == Material.field_151579_a)
|
||||
+ if (p_180684_1_.func_175623_d(blockpos))
|
||||
{
|
||||
if (p_180684_1_.field_72995_K)
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDropper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDropper.java
|
||||
@@ -43,7 +43,7 @@
|
||||
{
|
||||
ItemStack itemstack = tileentitydispenser.func_70301_a(i);
|
||||
|
||||
- if (!itemstack.func_190926_b())
|
||||
+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, tileentitydispenser, i, itemstack))
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
|
||||
BlockPos blockpos = p_176439_2_.func_177972_a(enumfacing);
|
||||
@@ -0,0 +1,60 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
{
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
|
||||
int j = 1;
|
||||
|
||||
@@ -67,7 +68,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
|
||||
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
|
||||
{
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
|
||||
|
||||
@@ -118,7 +119,7 @@
|
||||
{
|
||||
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
|
||||
{
|
||||
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
|
||||
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
|
||||
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
|
||||
return;
|
||||
}
|
||||
@@ -166,6 +167,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
|
||||
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
|
||||
}
|
||||
}
|
||||
@@ -187,7 +189,7 @@
|
||||
|
||||
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
|
||||
{
|
||||
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
|
||||
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
|
||||
{
|
||||
return p_176374_3_;
|
||||
}
|
||||
@@ -254,11 +256,12 @@
|
||||
|
||||
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
|
||||
{
|
||||
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
|
||||
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
|
||||
+ Material mat = p_176372_3_.func_185904_a();
|
||||
|
||||
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
|
||||
{
|
||||
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
|
||||
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockEnchantmentTable.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockEnchantmentTable.java
|
||||
@@ -64,7 +64,7 @@
|
||||
{
|
||||
BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j);
|
||||
|
||||
- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X)
|
||||
+ if (net.minecraftforge.common.ForgeHooks.getEnchantPower(p_180655_2_, blockpos) > 0)
|
||||
{
|
||||
if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2)))
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockEnderChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockEnderChest.java
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
|
||||
{
|
||||
- if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).func_185915_l())
|
||||
+ if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).doesSideBlockChestOpening(p_180639_1_, p_180639_2_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_)
|
||||
{
|
||||
- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0)
|
||||
+ if ((p_176503_1_.func_175623_d(p_176503_2_.func_177977_b()) || func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b()))) && p_176503_2_.func_177956_o() >= 0)
|
||||
{
|
||||
int i = 32;
|
||||
|
||||
@@ -62,17 +62,18 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ IBlockState state = p_176503_1_.func_180495_p(p_176503_2_);
|
||||
p_176503_1_.func_175698_g(p_176503_2_);
|
||||
BlockPos blockpos;
|
||||
|
||||
- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
|
||||
+ for (blockpos = p_176503_2_.func_177977_b(); (p_176503_1_.func_175623_d(blockpos) || func_185759_i(p_176503_1_.func_180495_p(blockpos))) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
if (blockpos.func_177956_o() > 0)
|
||||
{
|
||||
- p_176503_1_.func_175656_a(blockpos.func_177984_a(), this.func_176223_P());
|
||||
+ p_176503_1_.func_175656_a(blockpos.func_177984_a(), state); //Forge: Fix loss of state information during world gen.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_)
|
||||
{
|
||||
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof EntityLivingBase && (p_180658_3_ instanceof EntityPlayer || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.field_70130_N * p_180658_3_.field_70130_N * p_180658_3_.field_70131_O > 0.512F)
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) // Forge: Move logic to Entity#canTrample
|
||||
{
|
||||
func_190970_b(p_180658_1_, p_180658_2_);
|
||||
}
|
||||
@@ -95,7 +95,7 @@
|
||||
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
|
||||
{
|
||||
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
|
||||
- return block instanceof BlockCrops || block instanceof BlockStem;
|
||||
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
|
||||
}
|
||||
|
||||
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
|
||||
@@ -108,7 +108,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return false;
|
||||
+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_1_, p_176530_2_);
|
||||
}
|
||||
|
||||
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_)
|
||||
@@ -0,0 +1,38 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFence.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFence.java
|
||||
@@ -165,7 +165,10 @@
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
{
|
||||
- return p_176221_1_.func_177226_a(field_176526_a, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176525_b, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))).func_177226_a(field_176527_M, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176528_N, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST)));
|
||||
+ return p_176221_1_.func_177226_a(field_176526_a, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176525_b, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST))
|
||||
+ .func_177226_a(field_176527_M, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176528_N, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST));
|
||||
}
|
||||
|
||||
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
|
||||
@@ -201,6 +204,23 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176526_a, field_176525_b, field_176528_N, field_176527_M});
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START ======================================== */
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ return func_176524_e(world, pos.func_177972_a(facing), facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ BlockPos other = pos.func_177972_a(facing);
|
||||
+ Block block = world.func_180495_p(other).func_177230_c();
|
||||
+ return block.canBeConnectedTo(world, other, facing.func_176734_d()) || func_176524_e(world, other, facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END ======================================== */
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER;
|
||||
@@ -0,0 +1,35 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFenceGate.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFenceGate.java
|
||||
@@ -59,7 +59,7 @@
|
||||
{
|
||||
EnumFacing.Axis enumfacing$axis = ((EnumFacing)p_176221_1_.func_177229_b(field_185512_D)).func_176740_k();
|
||||
|
||||
- if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() == Blocks.field_150463_bK) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() == Blocks.field_150463_bK))
|
||||
+ if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() instanceof BlockWall))
|
||||
{
|
||||
p_176221_1_ = p_176221_1_.func_177226_a(field_176467_M, Boolean.valueOf(true));
|
||||
}
|
||||
@@ -192,6 +192,23 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_185512_D, field_176466_a, field_176465_b, field_176467_M});
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START ======================================== */
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() instanceof BlockFenceGate &&
|
||||
+ state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE)
|
||||
+ {
|
||||
+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return connector instanceof BlockFence || connector instanceof BlockWall;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END ======================================== */
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
if (p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN)
|
||||
@@ -0,0 +1,218 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -39,7 +39,15 @@
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
{
|
||||
- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P();
|
||||
+ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
|
||||
+ {
|
||||
+ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))
|
||||
+ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST))
|
||||
+ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN));
|
||||
+ }
|
||||
+ return this.func_176223_P();
|
||||
}
|
||||
|
||||
protected BlockFire()
|
||||
@@ -92,6 +100,7 @@
|
||||
|
||||
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
|
||||
{
|
||||
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
|
||||
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
|
||||
}
|
||||
@@ -126,19 +135,15 @@
|
||||
{
|
||||
if (p_180650_1_.func_82736_K().func_82766_b("doFireTick"))
|
||||
{
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
|
||||
if (!this.func_176196_c(p_180650_1_, p_180650_2_))
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
}
|
||||
|
||||
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
|
||||
- boolean flag = block == Blocks.field_150424_aL || block == Blocks.field_189877_df;
|
||||
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
|
||||
|
||||
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue();
|
||||
|
||||
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F)
|
||||
@@ -159,7 +164,7 @@
|
||||
{
|
||||
if (!this.func_176533_e(p_180650_1_, p_180650_2_))
|
||||
{
|
||||
- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3)
|
||||
+ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3)
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
}
|
||||
@@ -167,7 +172,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
return;
|
||||
@@ -182,12 +187,12 @@
|
||||
j = -50;
|
||||
}
|
||||
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i, EnumFacing.WEST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i, EnumFacing.EAST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i, EnumFacing.UP);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i, EnumFacing.DOWN);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i, EnumFacing.SOUTH);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i, EnumFacing.NORTH);
|
||||
|
||||
for (int k = -1; k <= 1; ++k)
|
||||
{
|
||||
@@ -246,22 +251,30 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFlammability
|
||||
public int func_176532_c(Block p_176532_1_)
|
||||
{
|
||||
Integer integer = this.field_149848_b.get(p_176532_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFireSpreadSpeed
|
||||
public int func_176534_d(Block p_176534_1_)
|
||||
{
|
||||
Integer integer = this.field_149849_a.get(p_176534_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use tryCatchFire with face below
|
||||
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
|
||||
{
|
||||
- int i = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
|
||||
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
|
||||
+ }
|
||||
|
||||
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
|
||||
+ {
|
||||
+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
|
||||
+
|
||||
if (p_176536_4_.nextInt(p_176536_3_) < i)
|
||||
{
|
||||
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
|
||||
@@ -293,7 +306,7 @@
|
||||
{
|
||||
for (EnumFacing enumfacing : EnumFacing.values())
|
||||
{
|
||||
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
|
||||
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -314,7 +327,7 @@
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values())
|
||||
{
|
||||
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
|
||||
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
|
||||
}
|
||||
|
||||
return i;
|
||||
@@ -326,9 +339,10 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use canCatchFire with face sensitive version below
|
||||
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
|
||||
{
|
||||
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
|
||||
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -372,9 +386,9 @@
|
||||
p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false);
|
||||
}
|
||||
|
||||
- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b()))
|
||||
+ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST))
|
||||
{
|
||||
for (int j = 0; j < 2; ++j)
|
||||
{
|
||||
@@ -385,7 +399,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST))
|
||||
{
|
||||
for (int k = 0; k < 2; ++k)
|
||||
{
|
||||
@@ -396,7 +410,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH))
|
||||
{
|
||||
for (int l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -407,7 +421,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH))
|
||||
{
|
||||
for (int i1 = 0; i1 < 2; ++i1)
|
||||
{
|
||||
@@ -418,7 +432,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; ++j1)
|
||||
{
|
||||
@@ -462,6 +476,21 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R});
|
||||
}
|
||||
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param pos Block position
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
+ {
|
||||
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
|
||||
+ }
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
@@ -0,0 +1,64 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -152,12 +152,14 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
|
||||
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID);
|
||||
}
|
||||
|
||||
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_)
|
||||
{
|
||||
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
|
||||
+ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b());
|
||||
+ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID)
|
||||
{
|
||||
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
|
||||
p_189540_2_.func_175698_g(p_189540_3_);
|
||||
@@ -166,13 +168,6 @@
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
{
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
|
||||
-
|
||||
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
|
||||
- {
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- }
|
||||
-
|
||||
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
|
||||
@@ -398,6 +393,30 @@
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
+
|
||||
+ /*============================FORGE START=====================================*/
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ super.getDrops(drops, world, pos, state, fortune);
|
||||
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
|
||||
+ if (te != null && te.func_145965_a() != null)
|
||||
+ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
|
||||
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
|
||||
+ }
|
||||
+ @Override
|
||||
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool)
|
||||
+ {
|
||||
+ super.func_180657_a(world, player, pos, state, te, tool);
|
||||
+ world.func_175698_g(pos);
|
||||
+ }
|
||||
+ /*===========================FORGE END==========================================*/
|
||||
+
|
||||
public static enum EnumFlowerType implements IStringSerializable
|
||||
{
|
||||
EMPTY("empty"),
|
||||
@@ -0,0 +1,42 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -38,7 +38,8 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
|
||||
}
|
||||
@@ -58,7 +59,7 @@
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a());
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2)
|
||||
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P());
|
||||
}
|
||||
@@ -96,18 +97,11 @@
|
||||
{
|
||||
if (j >= i / 16)
|
||||
{
|
||||
- if (p_176474_1_.func_180495_p(blockpos1).func_177230_c().field_149764_J == Material.field_151579_a)
|
||||
+ if (p_176474_1_.func_175623_d(blockpos1))
|
||||
{
|
||||
if (p_176474_2_.nextInt(8) == 0)
|
||||
{
|
||||
- BlockFlower.EnumFlowerType blockflower$enumflowertype = p_176474_1_.func_180494_b(blockpos1).func_180623_a(p_176474_2_, blockpos1);
|
||||
- BlockFlower blockflower = blockflower$enumflowertype.func_176964_a().func_180346_a();
|
||||
- IBlockState iblockstate = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), blockflower$enumflowertype);
|
||||
-
|
||||
- if (blockflower.func_180671_f(p_176474_1_, blockpos1, iblockstate))
|
||||
- {
|
||||
- p_176474_1_.func_180501_a(blockpos1, iblockstate, 3);
|
||||
- }
|
||||
+ p_176474_1_.func_180494_b(blockpos1).plantFlower(p_176474_1_, p_176474_2_, blockpos1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -0,0 +1,23 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
||||
@@ -222,6 +222,20 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176380_a});
|
||||
}
|
||||
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ for (IProperty prop : (java.util.Set<IProperty<?>>)state.func_177228_b().keySet())
|
||||
+ {
|
||||
+ if (prop.func_177701_a().equals("variant"))
|
||||
+ {
|
||||
+ world.func_175656_a(pos, state.func_177231_a(prop));
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
public static enum EnumType implements IStringSerializable
|
||||
{
|
||||
NORTH_WEST(1, "north_west"),
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
||||
@@ -41,9 +41,14 @@
|
||||
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
|
||||
p_180657_2_.func_71020_j(0.005F);
|
||||
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
|
||||
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
|
||||
{
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
|
||||
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
|
||||
+ items.add(this.func_180643_i(p_180657_4_));
|
||||
+
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
|
||||
+ for (ItemStack is : items)
|
||||
+ func_180635_a(p_180657_1_, p_180657_3_, is);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -54,7 +59,9 @@
|
||||
}
|
||||
|
||||
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
+ harvesters.set(p_180657_2_);
|
||||
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
|
||||
+ harvesters.set(null);
|
||||
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a();
|
||||
|
||||
if (material.func_76230_c() || material.func_76224_d())
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
||||
@@ -158,6 +158,8 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176382_a});
|
||||
}
|
||||
|
||||
+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
@@ -0,0 +1,139 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
@@ -17,7 +17,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public abstract class BlockLeaves extends Block
|
||||
+public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
|
||||
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
|
||||
@@ -53,9 +53,9 @@
|
||||
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
|
||||
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
|
||||
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,8 @@
|
||||
this.field_150128_a = new int[32768];
|
||||
}
|
||||
|
||||
- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5)))
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks
|
||||
+ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt
|
||||
{
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
|
||||
@@ -96,9 +97,9 @@
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
|
||||
Block block = iblockstate.func_177230_c();
|
||||
|
||||
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
|
||||
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
|
||||
{
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j)
|
||||
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
|
||||
{
|
||||
this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2;
|
||||
}
|
||||
@@ -205,40 +206,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- {
|
||||
- int i = this.func_176232_d(p_180653_3_);
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- {
|
||||
- i -= 2 << p_180653_5_;
|
||||
-
|
||||
- if (i < 10)
|
||||
- {
|
||||
- i = 10;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (p_180653_1_.field_73012_v.nextInt(i) == 0)
|
||||
- {
|
||||
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
|
||||
- }
|
||||
-
|
||||
- i = 200;
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- {
|
||||
- i -= 10 << p_180653_5_;
|
||||
-
|
||||
- if (i < 40)
|
||||
- {
|
||||
- i = 40;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, i);
|
||||
- }
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
}
|
||||
|
||||
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
|
||||
@@ -274,6 +242,51 @@
|
||||
|
||||
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
|
||||
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
|
||||
+ {
|
||||
+ if (!(Boolean)state.func_177229_b(field_176236_b))
|
||||
+ {
|
||||
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ int chance = this.func_176232_d(state);
|
||||
+
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 2 << fortune;
|
||||
+ if (chance < 10) chance = 10;
|
||||
+ }
|
||||
+
|
||||
+ if (rand.nextInt(chance) == 0)
|
||||
+ {
|
||||
+ ItemStack drop = new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state));
|
||||
+ if (!drop.func_190926_b())
|
||||
+ drops.add(drop);
|
||||
+ }
|
||||
+
|
||||
+ chance = 200;
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 10 << fortune;
|
||||
+ if (chance < 40) chance = 40;
|
||||
+ }
|
||||
+
|
||||
+ this.captureDrops(true);
|
||||
+ if (world instanceof World)
|
||||
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
|
||||
+ drops.addAll(this.captureDrops(false));
|
||||
+ }
|
||||
+
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_)
|
||||
{
|
||||
@@ -0,0 +1,59 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
@@ -284,14 +284,14 @@
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P());
|
||||
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P()));
|
||||
this.func_180688_d(p_176365_1_, p_176365_2_);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (integer.intValue() <= 4)
|
||||
{
|
||||
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P());
|
||||
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P()));
|
||||
this.func_180688_d(p_176365_1_, p_176365_2_);
|
||||
return true;
|
||||
}
|
||||
@@ -448,8 +448,39 @@
|
||||
return (float)p_190972_2_.func_177956_o() + func_190973_f(p_190972_0_, p_190972_1_, p_190972_2_);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public float getBlockLiquidHeight(World world, BlockPos pos, IBlockState state, Material material)
|
||||
+ {
|
||||
+ return BlockLiquid.func_190973_f(state, world, pos);
|
||||
+ }
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ @SideOnly (Side.CLIENT)
|
||||
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
|
||||
+ {
|
||||
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks);
|
||||
+
|
||||
+ if (state.func_185904_a().func_76224_d())
|
||||
+ {
|
||||
+ float height = 0.0F;
|
||||
+ if (state.func_177230_c() instanceof BlockLiquid)
|
||||
+ {
|
||||
+ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F;
|
||||
+ }
|
||||
+ float f1 = (float) (pos.func_177956_o() + 1) - height;
|
||||
+ if (viewport.field_72448_b > (double)f1)
|
||||
+ {
|
||||
+ BlockPos upPos = pos.func_177984_a();
|
||||
+ IBlockState upState = world.func_180495_p(upPos);
|
||||
+ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -34,9 +34,9 @@
|
||||
{
|
||||
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
|
||||
|
||||
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
|
||||
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
public static enum EnumAxis implements IStringSerializable
|
||||
{
|
||||
X("x"),
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -40,10 +40,14 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
- int i = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public boolean func_149662_c(IBlockState p_149662_1_)
|
||||
{
|
||||
return false;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -89,7 +89,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate);
|
||||
+ return p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -0,0 +1,21 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -39,7 +39,8 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
|
||||
}
|
||||
@@ -53,7 +54,7 @@
|
||||
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos);
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a());
|
||||
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2)
|
||||
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -42,25 +42,28 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
|
||||
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
|
||||
}
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
{
|
||||
int i = ((Integer)p_180650_3_.func_177229_b(field_176486_a)).intValue();
|
||||
|
||||
- if (i < 3 && p_180650_4_.nextInt(10) == 0)
|
||||
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(10) == 0))
|
||||
{
|
||||
- p_180650_3_ = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
|
||||
- p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_, 2);
|
||||
+ IBlockState newState = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1));
|
||||
+ p_180650_1_.func_180501_a(p_180650_2_, newState, 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, newState);
|
||||
}
|
||||
|
||||
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ if (false && !p_180653_1_.field_72995_K)
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
@@ -106,6 +109,23 @@
|
||||
return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ int count = 1;
|
||||
+
|
||||
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
|
||||
+ {
|
||||
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < count; i++)
|
||||
+ {
|
||||
+ drops.add(new ItemStack(Items.field_151075_bm));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
protected BlockStateContainer func_180661_e()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176486_a});
|
||||
@@ -0,0 +1,13 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
@@ -106,4 +106,10 @@
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
||||
@@ -63,7 +63,9 @@
|
||||
if (tileentity instanceof TileEntityNote)
|
||||
{
|
||||
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
||||
+ int old = tileentitynote.field_145879_a;
|
||||
tileentitynote.func_145877_a();
|
||||
+ if (old == tileentitynote.field_145879_a) return false;
|
||||
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
|
||||
p_180639_4_.func_71029_a(StatList.field_188087_U);
|
||||
}
|
||||
@@ -103,6 +105,10 @@
|
||||
|
||||
public boolean func_189539_a(IBlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_)
|
||||
{
|
||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_5_, p_189539_4_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
||||
+ p_189539_4_ = e.getInstrument().ordinal();
|
||||
+ p_189539_5_ = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(p_189539_5_ - 12) / 12.0D);
|
||||
p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, this.func_185576_e(p_189539_4_), SoundCategory.RECORDS, 3.0F, f);
|
||||
p_189539_2_.func_175688_a(EnumParticleTypes.NOTE, (double)p_189539_3_.func_177958_n() + 0.5D, (double)p_189539_3_.func_177956_o() + 1.2D, (double)p_189539_3_.func_177952_p() + 0.5D, (double)p_189539_5_ / 24.0D, 0.0D, 0.0D);
|
||||
@@ -0,0 +1,15 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java
|
||||
@@ -145,4 +145,12 @@
|
||||
{
|
||||
return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7));
|
||||
}
|
||||
+
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ @Override
|
||||
+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
|
||||
+ {
|
||||
+ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos);
|
||||
+ }
|
||||
+ /* ========================================= FORGE END ======================================*/
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
@@ -101,11 +101,16 @@
|
||||
if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a()));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public NonNullList<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a()));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
||||
@@ -78,34 +78,39 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
-
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
+ }
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (this == Blocks.field_150365_q)
|
||||
{
|
||||
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
|
||||
+ i = MathHelper.func_76136_a(rand, 0, 2);
|
||||
}
|
||||
else if (this == Blocks.field_150482_ag)
|
||||
{
|
||||
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150412_bA)
|
||||
{
|
||||
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150369_x)
|
||||
{
|
||||
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
else if (this == Blocks.field_150449_bY)
|
||||
{
|
||||
- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
|
||||
+ return i;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
|
||||
@@ -0,0 +1,39 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -112,7 +112,10 @@
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
{
|
||||
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()), p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()), p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()), p_176221_3_.func_177976_e(), EnumFacing.EAST))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()), p_176221_3_.func_177974_f(), EnumFacing.WEST)));
|
||||
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
|
||||
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -197,6 +200,24 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START ======================================== */
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
+ {
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ return func_193393_b(world, world.func_180495_p(offset), offset, facing.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
||||
+ {
|
||||
+ BlockPos other = pos.func_177972_a(dir);
|
||||
+ IBlockState state = world.func_180495_p(other);
|
||||
+ return state.func_177230_c().canBeConnectedTo(world, other, dir.func_176734_d()) || func_193393_b(world, state, other, dir.func_176734_d());
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END ======================================== */
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THIN : BlockFaceShape.CENTER_SMALL;
|
||||
@@ -0,0 +1,45 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -241,7 +241,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
+ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_189539_2_, blockpos) && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
{
|
||||
this.func_176319_a(p_189539_2_, p_189539_3_, enumfacing, false);
|
||||
}
|
||||
@@ -307,7 +307,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !block.func_149716_u();
|
||||
+ return !block.hasTileEntity(p_185646_0_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -353,7 +353,9 @@
|
||||
{
|
||||
BlockPos blockpos1 = list2.get(j);
|
||||
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1);
|
||||
- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0);
|
||||
+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
|
||||
+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f;
|
||||
+ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0);
|
||||
p_176319_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 4);
|
||||
--k;
|
||||
aiblockstate[k] = iblockstate;
|
||||
@@ -434,6 +436,13 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176387_N, field_176320_b});
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ return !state.func_177229_b(field_176320_b) && super.rotateBlock(world, pos, axis);
|
||||
+ }
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
p_193383_2_ = this.func_176221_a(p_193383_2_, p_193383_1_, p_193383_3_);
|
||||
@@ -0,0 +1,37 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out
|
||||
{
|
||||
TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_);
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0);
|
||||
}
|
||||
}
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, 1, p_180653_5_); // mimic vanilla behavior from above and ignore chance
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -210,6 +211,17 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b});
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos);
|
||||
+ if (tileentitypiston != null)
|
||||
+ {
|
||||
+ IBlockState pushed = tileentitypiston.func_174927_b();
|
||||
+ drops.addAll(pushed.func_177230_c().getDrops(world, pos, pushed, fortune)); // use the old method until it gets removed, for backward compatibility
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
@@ -0,0 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPortal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPortal.java
|
||||
@@ -111,7 +111,7 @@
|
||||
{
|
||||
BlockPortal.Size blockportal$size = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.X);
|
||||
|
||||
- if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0)
|
||||
+ if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size))
|
||||
{
|
||||
blockportal$size.func_150859_c();
|
||||
return true;
|
||||
@@ -120,7 +120,7 @@
|
||||
{
|
||||
BlockPortal.Size blockportal$size1 = new BlockPortal.Size(p_176548_1_, p_176548_2_, EnumFacing.Axis.Z);
|
||||
|
||||
- if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0)
|
||||
+ if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0 && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size1))
|
||||
{
|
||||
blockportal$size1.func_150859_c();
|
||||
return true;
|
||||
@@ -0,0 +1,24 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops
|
||||
{
|
||||
if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0)
|
||||
{
|
||||
@@ -40,4 +40,12 @@
|
||||
{
|
||||
return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()];
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ super.getDrops(drops, world, pos, state, fortune);
|
||||
+ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0)
|
||||
+ drops.add(new ItemStack(Items.field_151170_bI));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
|
||||
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP);
|
||||
}
|
||||
|
||||
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java
|
||||
@@ -108,6 +108,26 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176335_a});
|
||||
}
|
||||
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ for (IProperty prop : state.func_177228_b().keySet())
|
||||
+ {
|
||||
+ if (prop.func_177701_a().equals("variant") && prop.func_177699_b() == EnumType.class)
|
||||
+ {
|
||||
+ EnumType current = (EnumType)state.func_177229_b(prop);
|
||||
+ EnumType next = current == EnumType.LINES_X ? EnumType.LINES_Y :
|
||||
+ current == EnumType.LINES_Y ? EnumType.LINES_Z :
|
||||
+ current == EnumType.LINES_Z ? EnumType.LINES_X : current;
|
||||
+ if (next == current)
|
||||
+ return false;
|
||||
+ world.func_175656_a(pos, state.func_177226_a(prop, next));
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
public static enum EnumType implements IStringSerializable
|
||||
{
|
||||
DEFAULT(0, "default", "default"),
|
||||
@@ -0,0 +1,237 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -34,7 +34,7 @@
|
||||
public static boolean func_176563_d(IBlockState p_176563_0_)
|
||||
{
|
||||
Block block = p_176563_0_.func_177230_c();
|
||||
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
|
||||
+ return block instanceof BlockRailBase;
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean p_i45389_1_)
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_)
|
||||
{
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? (BlockRailBase.EnumRailDirection)p_185496_1_.func_177229_b(this.func_176560_l()) : null;
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? getRailDirection(p_185496_2_, p_185496_3_, p_185496_1_, null) : null;
|
||||
return blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.func_177018_c() ? field_190959_b : field_185590_a;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
|
||||
+ return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP);
|
||||
}
|
||||
|
||||
public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_)
|
||||
@@ -93,32 +93,33 @@
|
||||
{
|
||||
if (!p_189540_2_.field_72995_K)
|
||||
{
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_189540_1_.func_177229_b(this.func_176560_l());
|
||||
+ final IBlockState currentState = p_189540_2_.func_180495_p(p_189540_3_);
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = getRailDirection(p_189540_2_, p_189540_3_, currentState.func_177230_c() == this ? currentState : p_189540_1_, null);
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
|
||||
+ if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q())
|
||||
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).isSideSolid(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q())
|
||||
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).isSideSolid(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q())
|
||||
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).isSideSolid(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q())
|
||||
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).isSideSolid(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (flag && !p_189540_2_.func_175623_d(p_189540_3_))
|
||||
+ if (flag && !currentState.func_177230_c().isAir(currentState, p_189540_2_, p_189540_3_))
|
||||
{
|
||||
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
|
||||
p_189540_2_.func_175698_g(p_189540_3_);
|
||||
@@ -154,7 +155,7 @@
|
||||
{
|
||||
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
|
||||
- if (((BlockRailBase.EnumRailDirection)p_180663_3_.func_177229_b(this.func_176560_l())).func_177018_c())
|
||||
+ if (getRailDirection(p_180663_1_, p_180663_2_, p_180663_3_, null).func_177018_c())
|
||||
{
|
||||
p_180663_1_.func_175685_c(p_180663_2_.func_177984_a(), this, false);
|
||||
}
|
||||
@@ -166,8 +167,101 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability
|
||||
public abstract IProperty<BlockRailBase.EnumRailDirection> func_176560_l();
|
||||
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return !this.field_150053_a;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's direction.
|
||||
+ * Can be used to make the cart think the rail is a different shape,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @param state The BlockState
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @return The direction.
|
||||
+ */
|
||||
+ public EnumRailDirection getRailDirection(IBlockAccess world, BlockPos pos, IBlockState state, @javax.annotation.Nullable net.minecraft.entity.item.EntityMinecart cart)
|
||||
+ {
|
||||
+ return state.func_177229_b(func_176560_l());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pos Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit).
|
||||
+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the
|
||||
+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations.
|
||||
+ * The method should return true if the rotation was successful though.
|
||||
+ *
|
||||
+ * @param world The world
|
||||
+ * @param pos Block position in world
|
||||
+ * @param axis The axis to rotate around
|
||||
+ * @return True if the rotation was successful, False if the rotation failed, or is not possible
|
||||
+ */
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ for (IProperty prop : state.func_177228_b().keySet())
|
||||
+ {
|
||||
+ if (prop.func_177701_a().equals("shape"))
|
||||
+ {
|
||||
+ world.func_175656_a(pos, state.func_177231_a(prop));
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END =====================================*/
|
||||
+
|
||||
public static enum EnumRailDirection implements IStringSerializable
|
||||
{
|
||||
NORTH_SOUTH(0, "north_south"),
|
||||
@@ -238,6 +332,7 @@
|
||||
private IBlockState field_180366_e;
|
||||
private final boolean field_150656_f;
|
||||
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
|
||||
{
|
||||
@@ -245,8 +340,9 @@
|
||||
this.field_180367_c = p_i45739_3_;
|
||||
this.field_180366_e = p_i45739_4_;
|
||||
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(this.field_180365_d.func_176560_l());
|
||||
- this.field_150656_f = this.field_180365_d.field_150053_a;
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = field_180365_d.getRailDirection(p_i45739_2_, p_i45739_3_, p_i45739_4_, null);
|
||||
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
|
||||
+ this.canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
|
||||
this.func_180360_a(blockrailbase$enumraildirection);
|
||||
}
|
||||
|
||||
@@ -438,7 +534,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -451,7 +547,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
{
|
||||
@@ -594,7 +690,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -607,7 +703,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailDetector.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailDetector.java
|
||||
@@ -163,6 +163,8 @@
|
||||
{
|
||||
if (((Boolean)p_180641_1_.func_177229_b(field_176574_M)).booleanValue())
|
||||
{
|
||||
+ List<EntityMinecart> carts = this.func_176571_a(p_180641_2_, p_180641_3_, EntityMinecart.class);
|
||||
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
|
||||
List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>func_176571_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class);
|
||||
|
||||
if (!list.isEmpty())
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailPowered.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailPowered.java
|
||||
@@ -23,9 +23,17 @@
|
||||
});
|
||||
public static final PropertyBool field_176569_M = PropertyBool.func_177716_a("powered");
|
||||
|
||||
+ private final boolean isActivator;
|
||||
+
|
||||
protected BlockRailPowered()
|
||||
{
|
||||
+ this(false);
|
||||
+ }
|
||||
+
|
||||
+ protected BlockRailPowered(boolean isActivator)
|
||||
+ {
|
||||
super(true);
|
||||
+ this.isActivator = isActivator;
|
||||
this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH).func_177226_a(field_176569_M, Boolean.valueOf(false)));
|
||||
}
|
||||
|
||||
@@ -146,7 +154,7 @@
|
||||
{
|
||||
IBlockState iblockstate = p_176567_1_.func_180495_p(p_176567_2_);
|
||||
|
||||
- if (iblockstate.func_177230_c() != this)
|
||||
+ if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -319,6 +319,21 @@
|
||||
return this.func_176223_P().func_177226_a(field_185512_D, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
|
||||
+ {
|
||||
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World) world).field_72995_K)
|
||||
+ {
|
||||
+ func_189540_a(world.func_180495_p(pos), (World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
public static enum Mode implements IStringSerializable
|
||||
{
|
||||
COMPARE("compare"),
|
||||
@@ -0,0 +1,54 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
||||
@@ -39,12 +39,14 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() ? super.func_176196_c(p_176196_1_, p_176196_2_) : false;
|
||||
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) ? super.func_176196_c(p_176196_1_, p_176196_2_) : false;
|
||||
}
|
||||
|
||||
public boolean func_176409_d(World p_176409_1_, BlockPos p_176409_2_)
|
||||
{
|
||||
- return p_176409_1_.func_180495_p(p_176409_2_.func_177977_b()).func_185896_q();
|
||||
+ IBlockState downState = p_176409_1_.func_180495_p(p_176409_2_.func_177977_b());
|
||||
+ return downState.func_185896_q() || downState.func_193401_d(p_176409_1_, p_176409_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
|
||||
}
|
||||
|
||||
public void func_180645_a(World p_180645_1_, BlockPos p_180645_2_, IBlockState p_180645_3_, Random p_180645_4_)
|
||||
@@ -227,6 +229,8 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D);
|
||||
BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d());
|
||||
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d()), false).isCanceled())
|
||||
+ return;
|
||||
p_176400_1_.func_190524_a(blockpos, this, p_176400_2_);
|
||||
p_176400_1_.func_175695_a(blockpos, this, enumfacing);
|
||||
}
|
||||
@@ -307,6 +311,25 @@
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ @Override
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ if (super.rotateBlock(world, pos, axis))
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ state = func_180675_k(state);
|
||||
+ world.func_175656_a(pos, state);
|
||||
+
|
||||
+ if (func_176404_e(world, pos, state))
|
||||
+ {
|
||||
+ world.func_175684_a(pos, this, 1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
|
||||
{
|
||||
return p_193383_4_ == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED;
|
||||
@@ -0,0 +1,22 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -92,12 +92,16 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ if (this.func_180660_a(state, RANDOM, fortune) != Item.func_150898_a(this))
|
||||
{
|
||||
- int i = 1 + p_180653_1_.field_73012_v.nextInt(5);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, i);
|
||||
+ return 1 + RANDOM.nextInt(5);
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneTorch.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneTorch.java
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
public class BlockRedstoneTorch extends BlockTorch
|
||||
{
|
||||
- private static final Map<World, List<BlockRedstoneTorch.Toggle>> field_150112_b = Maps.<World, List<BlockRedstoneTorch.Toggle>>newHashMap();
|
||||
+ private static final Map<World, List<BlockRedstoneTorch.Toggle>> field_150112_b = new java.util.WeakHashMap<World, List<Toggle>>(); // FORGE - fix vanilla MC-101233
|
||||
private final boolean field_150113_a;
|
||||
|
||||
private boolean func_176598_a(World p_176598_1_, BlockPos p_176598_2_, boolean p_176598_3_)
|
||||
@@ -0,0 +1,68 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -99,15 +99,15 @@
|
||||
BlockPos blockpos = p_176341_2_.func_177972_a(p_176341_3_);
|
||||
IBlockState iblockstate = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_));
|
||||
|
||||
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b()))))
|
||||
+ if (!canConnectTo(p_176341_1_.func_180495_p(blockpos), p_176341_3_, p_176341_1_, blockpos) && (iblockstate.func_185915_l() || !func_176340_e(p_176341_1_, blockpos.func_177977_b())))
|
||||
{
|
||||
IBlockState iblockstate1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a());
|
||||
|
||||
if (!iblockstate1.func_185915_l())
|
||||
{
|
||||
- boolean flag = p_176341_1_.func_180495_p(blockpos).func_185896_q() || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
|
||||
+ boolean flag = p_176341_1_.func_180495_p(blockpos).isSideSolid(p_176341_1_, blockpos, EnumFacing.UP) || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
|
||||
|
||||
- if (flag && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a())))
|
||||
+ if (flag && func_176340_e(p_176341_1_, blockpos.func_177984_a()))
|
||||
{
|
||||
if (iblockstate.func_185898_k())
|
||||
{
|
||||
@@ -144,7 +144,8 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() || p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c() == Blocks.field_150426_aN;
|
||||
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ return downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID || p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c() == Blocks.field_150426_aN;
|
||||
}
|
||||
|
||||
private IBlockState func_176338_e(World p_176338_1_, BlockPos p_176338_2_, IBlockState p_176338_3_)
|
||||
@@ -414,7 +415,7 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- else if (func_176343_a(iblockstate, p_176339_3_))
|
||||
+ else if (canConnectTo(iblockstate, p_176339_3_, p_176339_1_, p_176339_2_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -430,16 +431,11 @@
|
||||
|
||||
protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
|
||||
{
|
||||
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
|
||||
+ return canConnectTo(p_176340_0_.func_180495_p(p_176340_1_), null, p_176340_0_, p_176340_1_);
|
||||
}
|
||||
|
||||
- protected static boolean func_176346_d(IBlockState p_176346_0_)
|
||||
+ protected static boolean canConnectTo(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
- return func_176343_a(p_176346_0_, (EnumFacing)null);
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176343_a(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_)
|
||||
- {
|
||||
Block block = p_176343_0_.func_177230_c();
|
||||
|
||||
if (block == Blocks.field_150488_af)
|
||||
@@ -457,7 +453,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return p_176343_0_.func_185897_m() && p_176343_1_ != null;
|
||||
+ return p_176343_0_.func_177230_c().canConnectRedstone(p_176343_0_, world, pos, p_176343_1_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockReed extends Block
|
||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
|
||||
@@ -55,6 +55,8 @@
|
||||
{
|
||||
int j = ((Integer)p_180650_3_.func_177229_b(field_176355_a)).intValue();
|
||||
|
||||
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, true))
|
||||
+ {
|
||||
if (j == 15)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_.func_177984_a(), this.func_176223_P());
|
||||
@@ -64,6 +66,8 @@
|
||||
{
|
||||
p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176355_a, Integer.valueOf(j + 1)), 4);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +75,9 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
|
||||
+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
+ Block block = state.func_177230_c();
|
||||
+ if (block.canSustainPlant(state, p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true;
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
@@ -165,6 +171,17 @@
|
||||
return ((Integer)p_176201_1_.func_177229_b(field_176355_a)).intValue();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Beach;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return this.func_176223_P();
|
||||
+ }
|
||||
+
|
||||
protected BlockStateContainer func_180661_e()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {field_176355_a});
|
||||
@@ -0,0 +1,24 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
||||
@@ -28,6 +28,21 @@
|
||||
super(p_i46385_1_, p_i46385_2_);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean rotateBlock(net.minecraft.world.World world, BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos);
|
||||
+ for (net.minecraft.block.properties.IProperty<?> prop : state.func_177228_b().keySet())
|
||||
+ {
|
||||
+ if (prop.func_177701_a().equals("axis"))
|
||||
+ {
|
||||
+ world.func_175656_a(pos, state.func_177231_a(prop));
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
|
||||
{
|
||||
switch (p_185499_2_)
|
||||
@@ -0,0 +1,18 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -53,6 +53,7 @@
|
||||
{
|
||||
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
|
||||
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9 && p_180650_4_.nextInt(7) == 0)
|
||||
{
|
||||
this.func_176478_d(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
@@ -74,6 +75,7 @@
|
||||
|
||||
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
|
||||
{
|
||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return;
|
||||
WorldGenerator worldgenerator = (WorldGenerator)(p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true));
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@@ -0,0 +1,54 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
||||
@@ -128,10 +128,6 @@
|
||||
return new ItemStack(Items.field_151144_bL, 1, i);
|
||||
}
|
||||
|
||||
- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
- {
|
||||
- }
|
||||
-
|
||||
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
|
||||
{
|
||||
if (p_176208_4_.field_71075_bZ.field_75098_d)
|
||||
@@ -139,13 +135,17 @@
|
||||
p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true));
|
||||
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4);
|
||||
}
|
||||
+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0);
|
||||
|
||||
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
|
||||
}
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
{
|
||||
- if (!p_180663_1_.field_72995_K)
|
||||
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
+ }
|
||||
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
|
||||
+ {
|
||||
{
|
||||
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
|
||||
{
|
||||
@@ -154,7 +154,7 @@
|
||||
if (tileentity instanceof TileEntitySkull)
|
||||
{
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
- ItemStack itemstack = this.func_185473_a(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
|
||||
|
||||
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
|
||||
{
|
||||
@@ -164,11 +164,9 @@
|
||||
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
|
||||
}
|
||||
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, itemstack);
|
||||
+ drops.add(itemstack);
|
||||
}
|
||||
}
|
||||
-
|
||||
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 2689 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user