mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca72710937 | ||
|
|
9a1688599a | ||
|
|
d6c3df32d6 | ||
|
|
28c0ffe333 | ||
|
|
586c24f9d6 | ||
|
|
31c0a70f8e | ||
|
|
64a92530d9 | ||
|
|
4441935a4a | ||
|
|
f1feac76b3 | ||
|
|
d9c4446ccc | ||
|
|
f83500db11 | ||
|
|
fd02d81e73 | ||
|
|
0d379fdd6b | ||
|
|
f6fd800242 | ||
|
|
c25214aaf4 | ||
|
|
c6afb2be3f | ||
|
|
13501a8b05 | ||
|
|
dae5994e9d | ||
|
|
b28a418bd9 | ||
|
|
64f69cf5c9 | ||
|
|
8084ca43b9 | ||
|
|
2e5f25d8ae | ||
|
|
04b0d24678 | ||
|
|
153e7a1806 | ||
|
|
065ebd748a | ||
|
|
79c17cb542 | ||
|
|
9245975955 | ||
|
|
6ea19ec8bf | ||
|
|
b527bf8ab3 | ||
|
|
0b1b3c68fa | ||
|
|
d930c8ae8b | ||
|
|
053c5300ed | ||
|
|
e8ae18efda | ||
|
|
39965c55ac | ||
|
|
f87dca2ad4 | ||
|
|
3e02903d19 | ||
|
|
febae7f8f2 | ||
|
|
71dd5c9f4d | ||
|
|
aa91af865d | ||
|
|
9119e395d4 | ||
|
|
68433924c7 | ||
|
|
87b67cb45a | ||
|
|
77dd9eb883 | ||
|
|
e000fd2f8f | ||
|
|
e4d20a80ed | ||
|
|
36866fed10 | ||
|
|
55691fce4e | ||
|
|
d2a3b5bed8 | ||
|
|
6365674a2a | ||
|
|
7a02ccc3a8 | ||
|
|
2918864248 | ||
|
|
9fbfe2b98e | ||
|
|
b40e2cc59e | ||
|
|
3eac9c536b | ||
|
|
ad32b01d85 | ||
|
|
da33233762 | ||
|
|
c2a7fe4019 | ||
|
|
0067d3edce | ||
|
|
ebf038231e | ||
|
|
f767b7096c | ||
|
|
161227b1de | ||
|
|
8e43dfa7a6 | ||
|
|
0a11ffb827 | ||
|
|
3c55b46ca0 | ||
|
|
7d21e5d328 | ||
|
|
043069dc8a | ||
|
|
ea26434987 | ||
|
|
9ee34f57f5 | ||
|
|
d539dc12a1 | ||
|
|
c578cae676 | ||
|
|
8b74b32909 | ||
|
|
1d1133123b | ||
|
|
0bdafb976e | ||
|
|
13f9418201 | ||
|
|
a771a3ea06 | ||
|
|
39633eef4f | ||
|
|
1f11ac76fa | ||
|
|
2e1456517a | ||
|
|
4db208332e | ||
|
|
659091c565 | ||
|
|
c8c54113d0 | ||
|
|
69f8e57cea | ||
|
|
06a6fac23a | ||
|
|
fa939a890c | ||
|
|
2c8ab76240 | ||
|
|
7a651b8c1f | ||
|
|
d04df43b27 | ||
|
|
d3c9db906f | ||
|
|
f6e2c5c1f0 | ||
|
|
cc682fd786 | ||
|
|
6643997304 | ||
|
|
7b867d0069 | ||
|
|
a15c4dc9b0 | ||
|
|
7c11fe1022 | ||
|
|
66f816971f | ||
|
|
98c6d5a5f6 | ||
|
|
0b2a98f956 | ||
|
|
c01b336095 | ||
|
|
040cc4bf16 | ||
|
|
eefc4d3e84 | ||
|
|
c3c979f11a | ||
|
|
276d0c49c1 | ||
|
|
7c840dce35 | ||
|
|
2bee5f7ac6 | ||
|
|
60524f0f3e | ||
|
|
1170772a4f | ||
|
|
f4d2d1a24b | ||
|
|
ff2e35c243 | ||
|
|
0d1a2f2af3 | ||
|
|
3b029ba031 | ||
|
|
cd21f7b927 | ||
|
|
755eff7415 | ||
|
|
0d3f28bd52 | ||
|
|
56a3926b86 | ||
|
|
220bf8730a | ||
|
|
118eac8f39 | ||
|
|
99452a8b45 | ||
|
|
eb42614288 | ||
|
|
5238eca241 | ||
|
|
94af6c7f9d | ||
|
|
f2b54acd67 | ||
|
|
497bc10d0a | ||
|
|
c1bb5cb250 | ||
|
|
51910fe83b | ||
|
|
958bbf6c9a | ||
|
|
e98951ee65 | ||
|
|
3765d912a5 | ||
|
|
849bc00b46 | ||
|
|
f3715c3e2e | ||
|
|
985a48f02e | ||
|
|
4e196a445a | ||
|
|
36d2e67b07 | ||
|
|
34568a0a74 | ||
|
|
f7acc73282 | ||
|
|
60926ad6ea | ||
|
|
f734e614e4 | ||
|
|
997a15c0f2 | ||
|
|
1b40618f02 | ||
|
|
58c78560fa | ||
|
|
1d1ec57909 | ||
|
|
fd9c83b65f | ||
|
|
6baddc7e26 | ||
|
|
e9580877b4 | ||
|
|
440649bb95 | ||
|
|
48846bc0ba | ||
|
|
558e1d2fb0 | ||
|
|
0b26047ea8 | ||
|
|
7f5a57f4af | ||
|
|
dc12cda505 | ||
|
|
b4cf6f7f36 | ||
|
|
f2f04407a4 | ||
|
|
8a11e3bac4 | ||
|
|
4879b0611a | ||
|
|
d11a67499d | ||
|
|
b3b8c78527 | ||
|
|
0bfa76251d | ||
|
|
a992a4325b | ||
|
|
c1225f3876 | ||
|
|
152836c907 | ||
|
|
e47a4ea514 | ||
|
|
52b6da1759 | ||
|
|
f13465012b | ||
|
|
b7b5dd5bea | ||
|
|
7265900c62 | ||
|
|
7a77298a60 | ||
|
|
0177e7558e | ||
|
|
719ea50d1a | ||
|
|
bbf1ea41b8 | ||
|
|
eb22f42fea | ||
|
|
dd32e74e34 | ||
|
|
e1b4a150c3 | ||
|
|
76d912c0ba | ||
|
|
a3c8e04ee6 | ||
|
|
bf9158172f | ||
|
|
b687180e12 | ||
|
|
47a11b9a7e | ||
|
|
b6ddb0a7cf | ||
|
|
acb7acd661 | ||
|
|
7c0d94ce9c | ||
|
|
763b3e806e | ||
|
|
b5264cacf0 | ||
|
|
f1552ef20d | ||
|
|
de7eeed916 | ||
|
|
93eabce1bc | ||
|
|
e693dd4923 | ||
|
|
7f9acac469 | ||
|
|
506d5b18de | ||
|
|
5110796591 | ||
|
|
eafeba9fed | ||
|
|
b7a1676b15 | ||
|
|
72b63e7b36 | ||
|
|
fe3fcef7a9 | ||
|
|
714b09ddcb |
No files matched your search
@@ -13,3 +13,4 @@
|
||||
*.pyd binary
|
||||
*.cfg text eol=lf
|
||||
*.py text eol=lf
|
||||
*.jks binary
|
||||
+3
-5
@@ -6,15 +6,15 @@ staleLabel: Stale
|
||||
unmarkComment: false
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 1
|
||||
# Issues with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- Assigned
|
||||
|
||||
pulls:
|
||||
# Number of days of inactivity before a Pull Request becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale Pull Request is closed
|
||||
daysUntilClose: 14
|
||||
# Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- Assigned
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not had recent
|
||||
@@ -30,8 +30,6 @@ issues:
|
||||
daysUntilStale: 180
|
||||
# Number of days of inactivity before a stale Issue is closed
|
||||
daysUntilClose: 14
|
||||
# Issues with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels: []
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had activity
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
/patches_old/
|
||||
/patches_old_bak/
|
||||
/patches/minecraft.old/
|
||||
/projects.old/
|
||||
*.py
|
||||
*.7z
|
||||
/logs/
|
||||
|
||||
@@ -28,3 +28,8 @@ script:
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
# skip building travis on 1.13 - it doesn't work there
|
||||
branches:
|
||||
except:
|
||||
- 1.13-pre
|
||||
+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 he as functional, and as simple as it is, cpw. For developing
|
||||
that allow modding to be 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.
|
||||
|
||||
|
||||
Vendored
+52
-35
@@ -1,6 +1,9 @@
|
||||
@Library('forge-shared-library')_
|
||||
|
||||
pipeline {
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'gradlewrapper:latest'
|
||||
@@ -8,58 +11,72 @@ pipeline {
|
||||
}
|
||||
}
|
||||
environment {
|
||||
GRADLE_ARGS = --no-daemon' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('fetch') {
|
||||
steps {
|
||||
git(url: 'https://github.com/MinecraftForge/MinecraftForge.git', changelog: true)
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
stage('buildandtest') {
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
|
||||
script {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
|
||||
}
|
||||
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('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
post {
|
||||
success {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
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')
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
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}'
|
||||
//We're testing so use the test group
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.forge/${MYVERSION}'
|
||||
}
|
||||
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 {
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
//We're testing so use the test group
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.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 {
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
|
||||
junit 'build/test-results/*/*.xml'
|
||||
jacoco sourcePattern: '**/src/*/java'
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true
|
||||
//junit 'build/test-results/*/*.xml'
|
||||
//jacoco sourcePattern: '**/src/*/java'
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
Minecraft Forge
|
||||
Copyright (c) 2016-2018.
|
||||
Copyright (c) 2016-2019.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
+2
-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/
|
||||
http://github.com/MinecraftForge/MinecraftForge
|
||||
Homepage: http://minecraftforge.net/
|
||||
https://github.com/MinecraftForge/MinecraftForge
|
||||
|
||||
|
||||
A note on authorship:
|
||||
|
||||
+347
-164
@@ -1,7 +1,7 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = 'http://files.minecraftforge.net/maven' }
|
||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -22,18 +22,37 @@ import net.minecraftforge.gradle.common.task.SignJar
|
||||
import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
|
||||
|
||||
import java.util.stream.Collectors
|
||||
|
||||
plugins {
|
||||
id 'net.minecrell.licenser' version '0.4'
|
||||
id 'org.ajoberstar.grgit' version '2.3.0'
|
||||
id 'de.undercouch.download' version '3.3.0'
|
||||
id "com.github.ben-manes.versions" version '0.20.0'
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
ext {
|
||||
JAR_SIGNER = null
|
||||
if (project.hasProperty('keystore')) {
|
||||
JAR_SIGNER = [
|
||||
storepass: project.properties.keystoreStorePass,
|
||||
keypass: project.properties.keystoreKeyPass,
|
||||
keystore: project.properties.keystore
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20180921-1.13'
|
||||
MC_VERSION = '1.13.2'
|
||||
MCP_VERSION = '20190213.203750'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
|
||||
mcp {
|
||||
config = '1.13-2018.09.12.04.11.00'
|
||||
config = MC_VERSION + '-' + MCP_VERSION
|
||||
pipeline = 'joined'
|
||||
}
|
||||
}
|
||||
@@ -48,15 +67,15 @@ project(':clean') {
|
||||
patcher {
|
||||
parent = project(':mcp')
|
||||
patchedSrc = file('src/main/java')
|
||||
mappings channel: 'snapshot', version: '20180921-1.13'
|
||||
mcVersion = '1.13'
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
mcVersion = MC_VERSION
|
||||
}
|
||||
task runclient(type: JavaExec) {
|
||||
doFirst {
|
||||
mkdir 'runclient'
|
||||
}
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
args = ['--accessToken', '0', '--version', '1.13']
|
||||
args = ['--accessToken', '0', '--version', MC_VERSION]
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDir 'runclient'
|
||||
}
|
||||
@@ -71,10 +90,21 @@ project(':forge') {
|
||||
apply plugin: 'net.minecrell.licenser'
|
||||
apply plugin: 'de.undercouch.download'
|
||||
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
group = 'net.minecraftforge.test' //TODO: remove test when we finish patches and want users to find it
|
||||
|
||||
sourceSets {
|
||||
fmllauncher {
|
||||
java {
|
||||
srcDir "$rootDir/src/fmllauncher/java"
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/fmllauncher/resources"
|
||||
}
|
||||
}
|
||||
main {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/main/java"
|
||||
}
|
||||
@@ -82,53 +112,41 @@ project(':forge') {
|
||||
srcDir "$rootDir/src/main/resources"
|
||||
}
|
||||
}
|
||||
test {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
// srcDir "$rootDir/src/test/java" TODO fix later
|
||||
srcDir "$rootDir/src/fmllaunchertest/java"
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/test/resources"
|
||||
}
|
||||
}
|
||||
userdev {
|
||||
compileClasspath += sourceSets.main.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.main.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/userdev/java"
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/userdev/resources"
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
ext {
|
||||
MC_VERSION = '1.13'
|
||||
SPEC_VERSION = '24.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '25.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
|
||||
// ForgeMC is a unique identifier for every MC version we have supported.
|
||||
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
|
||||
MCP_ARTIFACT = project(':mcp').mcp.config
|
||||
MCP_VERSION = project(':mcp').mcp.config.version.split('-')[1] // The timestamp only.
|
||||
|
||||
if (project.hasProperty('keystore')) {
|
||||
jarsigner = [
|
||||
storepass: project.properties.keystoreStorePass,
|
||||
keypass: project.properties.keystoreKeyPass,
|
||||
keystore: project.properties.keystore
|
||||
]
|
||||
}
|
||||
}
|
||||
patcher {
|
||||
parent = project(':clean')
|
||||
patches = file("$rootDir/patches/minecraft")
|
||||
patchedSrc = file('src/main/java')
|
||||
accessTransformer = file("$rootDir/src/main/resources/forge_at.cfg")
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
srgPatches = true
|
||||
clientRun {
|
||||
main = 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevclient'
|
||||
]
|
||||
properties = [
|
||||
target: 'fmldevclient',
|
||||
assetDirectory: downloadAssets.output
|
||||
]
|
||||
}
|
||||
serverRun {
|
||||
main = 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevserver'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def getVersion = {
|
||||
//TAG-offset-hash
|
||||
def raw = grgit.describe(longDescr: true)
|
||||
@@ -142,11 +160,98 @@ project(':forge') {
|
||||
if (branch != null && branch.endsWith('.x') && MC_VERSION.startsWith(branch.substring(0, branch.length() - 2))) //1.13.x
|
||||
branch = null
|
||||
SPEC_VERSION = tag
|
||||
return "${tag}.${offset}${t -> if (branch != null) t << '-' + branch}"
|
||||
return "${MC_VERSION}-${tag}.${offset}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
|
||||
}
|
||||
|
||||
version = getVersion()
|
||||
|
||||
patcher {
|
||||
parent = project(':clean')
|
||||
patches = file("$rootDir/patches/minecraft")
|
||||
patchedSrc = file('src/main/java')
|
||||
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
srgPatches = true
|
||||
runs {
|
||||
forge_client = {
|
||||
main 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevclient',
|
||||
assetDirectory: downloadAssets.output,
|
||||
nativesDirectory: extractNatives.output
|
||||
]
|
||||
properties = [
|
||||
// 'org.lwjgl.util.Debug': 'true',
|
||||
// 'org.lwjgl.util.DebugLoader': 'true',
|
||||
'org.lwjgl.system.SharedLibraryExtractDirectory': 'lwjgl_dll',
|
||||
'mc.version': MC_VERSION,
|
||||
'mcp.version': MCP_VERSION,
|
||||
'forge.version': project.version.substring(MC_VERSION.length() + 1),
|
||||
'forge.spec': SPEC_VERSION,
|
||||
'forge.group': project.group,
|
||||
'fmllauncher.version': SPEC_VERSION,
|
||||
'terminal.ansi': 'true'
|
||||
]
|
||||
}
|
||||
forge_server = {
|
||||
main 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevserver'
|
||||
]
|
||||
properties = [
|
||||
'mc.version': MC_VERSION,
|
||||
'mcp.version': MCP_VERSION,
|
||||
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
||||
'forge.spec': SPEC_VERSION,
|
||||
'forge.group': project.group,
|
||||
'fmllauncher.version': SPEC_VERSION
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
MANIFESTS = [
|
||||
'/': [
|
||||
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'GitCommit': grgit.head().abbreviatedId,
|
||||
'Git-Branch': grgit.branch.current().getName()
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/versions/forge/': [
|
||||
'Specification-Title': 'Forge',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': SPEC_VERSION,
|
||||
'Implementation-Title': project.group,
|
||||
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
||||
'Implementation-Vendor': 'Forge Development LLC'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/versions/mcp/': [
|
||||
'Specification-Title': 'Minecraft',
|
||||
'Specification-Vendor': 'Mojang',
|
||||
'Specification-Version': MC_VERSION,
|
||||
'Implementation-Title': 'MCP',
|
||||
'Implementation-Version': MCP_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/fml/javafmlmod/': [
|
||||
'Specification-Title': 'Mod Language Provider',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': '1',
|
||||
'Implementation-Title': 'FML Java Mod',
|
||||
'Implementation-Version': SPEC_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/fml/loading/': [
|
||||
'Specification-Title': 'Launcher',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': '1',
|
||||
'Implementation-Title': 'FML Launcher',
|
||||
'Implementation-Version': SPEC_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap
|
||||
]
|
||||
}
|
||||
|
||||
group = 'net.minecraftforge.test' //TODO: remove when we jenkins is working
|
||||
version = getVersion()
|
||||
applyPatches {
|
||||
canonicalizeAccess true
|
||||
canonicalizeWhitespace true
|
||||
@@ -157,6 +262,7 @@ project(':forge') {
|
||||
transitive = false //Don't pull all libraries, if we're missing something, add it to the installer list so the installer knows to download it.
|
||||
}
|
||||
api.extendsFrom(installer)
|
||||
fmllauncherImplementation.extendsFrom(installer)
|
||||
}
|
||||
dependencies {
|
||||
api 'net.minecraft:client:1.13:extra'
|
||||
@@ -164,19 +270,25 @@ project(':forge') {
|
||||
installer 'org.ow2.asm:asm:6.2'
|
||||
installer 'org.ow2.asm:asm-commons:6.2'
|
||||
installer 'org.ow2.asm:asm-tree:6.2'
|
||||
installer 'cpw.mods:modlauncher:0.1.0'
|
||||
installer 'net.minecraftforge:accesstransformers:0.10+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.1+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.1+'
|
||||
installer 'net.minecraftforge:coremods:0.1+'
|
||||
installer 'com.electronwill.night-config:core:3.4.0'
|
||||
installer 'com.electronwill.night-config:toml:3.4.0'
|
||||
installer 'org.jline:jline:3.5.1'
|
||||
installer 'org.apache.maven:maven-artifact:3.5.3'
|
||||
installer 'net.jodah:typetools:0.5.0'
|
||||
installer 'cpw.mods:modlauncher:0.9.+'
|
||||
installer 'net.minecraftforge:accesstransformers:0.14.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.6.+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.6.+'
|
||||
installer 'net.minecraftforge:coremods:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.4.2'
|
||||
installer 'com.electronwill.night-config:toml:3.4.2'
|
||||
installer 'org.jline:jline:3.9.0'
|
||||
installer 'org.apache.maven:maven-artifact:3.6.0'
|
||||
installer 'net.jodah:typetools:0.6.0'
|
||||
installer 'java3d:vecmath:1.5.2'
|
||||
installer 'org.apache.logging.log4j:log4j-api:2.11.1'
|
||||
installer 'org.apache.logging.log4j:log4j-core:2.11.1'
|
||||
installer 'net.minecrell:terminalconsoleappender:1.1.+'
|
||||
fmllauncherImplementation 'com.google.guava:guava:21.0'
|
||||
fmllauncherImplementation 'com.google.code.gson:gson:2.8.0'
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:5.0.0"
|
||||
testImplementation "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
|
||||
testImplementation "org.hamcrest:hamcrest-all:1.3" // needs advanced matching for list order
|
||||
}
|
||||
|
||||
task runclient(type: JavaExec, dependsOn: [":forge:downloadAssets", ":forge:extractNatives"]) {
|
||||
@@ -191,20 +303,9 @@ project(':forge') {
|
||||
}
|
||||
//jvmArgs = ['-verbose:class']
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
main 'net.minecraftforge.fml.LaunchTesting'
|
||||
systemProperties = [
|
||||
"org.lwjgl.util.Debug": "true",
|
||||
"org.lwjgl.util.DebugLoader": "true",
|
||||
"mc.version": "${MC_VERSION}",
|
||||
"mcp.version": "${MCP_VERSION}",
|
||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||
"forge.spec":"${SPEC_VERSION}"
|
||||
]
|
||||
environment += [
|
||||
target:'fmldevclient',
|
||||
assetDirectory: file("${gradle.getGradleUserHomeDir()}/caches/forge_gradle/assets/"),
|
||||
nativesDirectory: extractNatives.output
|
||||
]
|
||||
main patcher.runs.forge_client.main
|
||||
systemProperties = patcher.runs.forge_client.properties
|
||||
environment += patcher.runs.forge_client.environment
|
||||
workingDir 'runclient'
|
||||
}
|
||||
|
||||
@@ -219,15 +320,10 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
main 'net.minecraftforge.fml.LaunchTesting'
|
||||
main patcher.runs.forge_server.main
|
||||
args 'nogui'
|
||||
systemProperties = [
|
||||
"mc.version": "${MC_VERSION}",
|
||||
"mcp.version": "${MCP_VERSION}",
|
||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||
"forge.spec":"${SPEC_VERSION}"
|
||||
]
|
||||
environment target:'fmldevserver'
|
||||
systemProperties = patcher.runs.forge_server.properties
|
||||
environment += patcher.runs.forge_server.environment
|
||||
workingDir 'runserver'
|
||||
standardInput = System.in
|
||||
}
|
||||
@@ -236,10 +332,10 @@ project(':forge') {
|
||||
rootProject.file('CREDITS.txt'),
|
||||
rootProject.file('LICENSE.txt')
|
||||
]
|
||||
/* TODO: Changelog
|
||||
if (project.hasProperty('forgeJenkinsPass'))
|
||||
|
||||
def changelog = rootProject.file('build/changelog.txt')
|
||||
if (changelog.exists())
|
||||
extraTxts += changelog
|
||||
*/
|
||||
|
||||
task downloadCrowdin() {
|
||||
ext {
|
||||
@@ -345,10 +441,10 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
task launcherJson(dependsOn: 'signUniversal') {
|
||||
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
|
||||
inputs.file universalJar.archivePath
|
||||
ext {
|
||||
output = file('build/libs/version.json')
|
||||
output = file('build/version.json')
|
||||
vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
|
||||
timestamp = dateToIso8601(new Date())
|
||||
comment = [
|
||||
@@ -371,28 +467,31 @@ project(':forge') {
|
||||
type: 'release',
|
||||
mainClass: 'cpw.mods.modlauncher.Launcher',
|
||||
inheritsFrom: MC_VERSION,
|
||||
logging: [ client: [
|
||||
logging: [
|
||||
client: [
|
||||
argument: '-Dlog4j.configurationFile=${path}',
|
||||
file: [
|
||||
id:'client-1.12.xml',
|
||||
sha1:'ef4f57b922df243d0cef096efe808c72db042149',
|
||||
size:877,
|
||||
url:'https://launcher.mojang.com/v1/objects/ef4f57b922df243d0cef096efe808c72db042149/client-1.12.xml'
|
||||
id:'client-1.12.xml',
|
||||
sha1:'ef4f57b922df243d0cef096efe808c72db042149',
|
||||
size:877,
|
||||
url:'https://launcher.mojang.com/v1/objects/ef4f57b922df243d0cef096efe808c72db042149/client-1.12.xml'
|
||||
],
|
||||
type: 'log4j2-xml'
|
||||
]],
|
||||
]
|
||||
],
|
||||
arguments: [
|
||||
game: ['--launchTarget', 'fmlclient']
|
||||
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"]
|
||||
],
|
||||
libraries: [
|
||||
[
|
||||
//Package our launcher jar as the 'main' jar Mojang's launcher loads. It will in turn load Forge's regular jars itself.
|
||||
name: "${project.group}:${project.name}:${project.version}",
|
||||
downloads: [
|
||||
artifact: [
|
||||
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
|
||||
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
|
||||
sha1: sha1(universalJar.archivePath),
|
||||
size: universalJar.archivePath.length()
|
||||
sha1: sha1(launcherJar.archivePath),
|
||||
size: launcherJar.archivePath.length()
|
||||
]
|
||||
]
|
||||
]
|
||||
@@ -410,7 +509,7 @@ project(':forge') {
|
||||
|
||||
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches]) {
|
||||
ext {
|
||||
output = file('build/libs/install_profile.json')
|
||||
output = file('build/install_profile.json')
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.0.4'
|
||||
}
|
||||
@@ -423,9 +522,22 @@ project(':forge') {
|
||||
inputs.file launcherJson.output
|
||||
outputs.file output
|
||||
doLast {
|
||||
def libs = [:]
|
||||
def libs = [
|
||||
"${project.group}:${project.name}:${project.version}:universal": [
|
||||
name: "${project.group}:${project.name}:${project.version}:universal",
|
||||
downloads: [
|
||||
artifact: [
|
||||
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}-universal.jar",
|
||||
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
|
||||
sha1: sha1(universalJar.archivePath),
|
||||
size: universalJar.archivePath.length()
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
def json = [
|
||||
_comment_: launcherJson.comment,
|
||||
spec: 0,
|
||||
profile: project.name,
|
||||
version: launcherJson.id,
|
||||
json: '/version.json',
|
||||
@@ -575,6 +687,44 @@ project(':forge') {
|
||||
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
|
||||
dependsOn crowdin
|
||||
|
||||
doFirst {
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
if (pkg == '/') {
|
||||
manifest.attributes(values)
|
||||
} else {
|
||||
manifest.attributes(values, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task fmllauncherConfig(type: WriteProperties) {
|
||||
outputFile file('build/server_launcher.properties')
|
||||
encoding 'UTF8'
|
||||
doFirst {
|
||||
def artifacts = getArtifacts(project, project.configurations.installer, false).values().stream().map{a -> a.downloads.artifact.path}.sorted().collect() + [
|
||||
"net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-data.jar",
|
||||
"net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
|
||||
]
|
||||
for (int x = 0; x < artifacts.size(); x++) {
|
||||
property 'library.' + x.toString().padLeft(3, '0'), "libraries/${artifacts.get(x)}"
|
||||
}
|
||||
property 'library.count', artifacts.size()
|
||||
property 'args', [
|
||||
'--gameDir', '.',
|
||||
'--launchTarget', 'fmlserver',
|
||||
'--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
||||
'--fml.mcpVersion', MCP_VERSION,
|
||||
'--fml.mcVersion', MC_VERSION,
|
||||
'--fml.forgeGroup', project.group
|
||||
].join(' ')
|
||||
}
|
||||
}
|
||||
|
||||
task launcherJar(type: Jar, dependsOn: [fmllauncherConfig]) {
|
||||
classifier 'launcher'
|
||||
from sourceSets.fmllauncher.output
|
||||
from fmllauncherConfig.outputFile
|
||||
doFirst {
|
||||
def classpath = new StringBuilder()
|
||||
def artifacts = getArtifacts(project, project.configurations.installer, false)
|
||||
@@ -584,62 +734,28 @@ project(':forge') {
|
||||
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-data.jar "
|
||||
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
|
||||
|
||||
|
||||
manifest.attributes([
|
||||
'Main-Class': 'net.minecraftforge.server.ServerMain',
|
||||
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'GitCommit': grgit.head().getAbbreviatedId(8),
|
||||
'Git-Branch': grgit.branch.current().getName(),
|
||||
'Class-Path': classpath.toString()
|
||||
] as LinkedHashMap)
|
||||
manifest.attributes([
|
||||
'Specification-Title': 'Forge',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': SPEC_VERSION,
|
||||
'Implementation-Title': 'Forge',
|
||||
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
||||
'Implementation-Vendor': 'Forge Development LLC'
|
||||
] as LinkedHashMap, 'net/minecraftforge/versions/forge/')
|
||||
manifest.attributes([
|
||||
'Specification-Title': 'Minecraft',
|
||||
'Specification-Vendor': 'Mojang',
|
||||
'Specification-Version': MC_VERSION,
|
||||
'Implementation-Title': 'MCP',
|
||||
'Implementation-Version': MCP_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap, 'net/minecraftforge/versions/mcp/')
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
if (pkg == '/') {
|
||||
manifest.attributes(values += [
|
||||
'Main-Class': 'net.minecraftforge.server.ServerMain',
|
||||
'Class-Path': classpath.toString()
|
||||
])
|
||||
} else {
|
||||
manifest.attributes(values, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task signUniversal(type: SignJar, dependsOn: universalJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('jarsigner') && universalJar.state.failure == null
|
||||
}
|
||||
|
||||
def jarsigner = [:];
|
||||
if (project.hasProperty('jarsigner'))
|
||||
jarsigner = project.jarsigner;
|
||||
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = universalJar.archivePath
|
||||
outputFile = universalJar.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
}
|
||||
}
|
||||
universalJar.finalizedBy(signUniversal)
|
||||
|
||||
task downloadInstaller(type: DownloadMavenArtifact) {
|
||||
artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
|
||||
changing = true
|
||||
}
|
||||
|
||||
task installerJar(type: Zip, dependsOn: [downloadInstaller, signUniversal, installerJson, launcherJson, genClientBinPatches, genServerBinPatches]) {
|
||||
task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) {
|
||||
classifier = 'installer'
|
||||
extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
|
||||
destinationDir = file('build/libs')
|
||||
from(extraTxts)
|
||||
from(rootProject.file('/src/main/resources/forge_logo.png')) {
|
||||
rename{'big_logo.png'}
|
||||
@@ -653,6 +769,9 @@ project(':forge') {
|
||||
}
|
||||
from(universalJar) {
|
||||
into "/maven/${project.group.replace('.', '/')}/${project.name}/${project.version}/"
|
||||
}
|
||||
from(launcherJar) {
|
||||
into "/maven/${project.group.replace('.', '/')}/${project.name}/${project.version}/"
|
||||
rename { "${project.name}-${project.version}.jar" }
|
||||
}
|
||||
from(installerJson.output)
|
||||
@@ -661,32 +780,31 @@ project(':forge') {
|
||||
duplicatesStrategy = 'exclude'
|
||||
}
|
||||
}
|
||||
task signInstaller(type: SignJar, dependsOn: installerJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('jarsigner') && installerJar.state.failure == null
|
||||
}
|
||||
|
||||
def jarsigner = [:];
|
||||
if (project.hasProperty('jarsigner'))
|
||||
jarsigner = project.jarsigner;
|
||||
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = installerJar.archivePath
|
||||
outputFile = installerJar.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
|
||||
[universalJar, launcherJar, installerJar].each { t ->
|
||||
task "sign${t.name.capitalize()}"(type: SignJar, dependsOn: t) {
|
||||
onlyIf {
|
||||
JAR_SIGNER != null && t.state.failure == null
|
||||
}
|
||||
def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = t.archivePath
|
||||
outputFile = t.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
}
|
||||
}
|
||||
t.finalizedBy(tasks.getByName("sign${t.name.capitalize()}"))
|
||||
}
|
||||
installerJar.finalizedBy(signInstaller)
|
||||
|
||||
task makeMdk(type: Zip) {
|
||||
baseName = project.name
|
||||
classifier = 'mdk'
|
||||
version = project.version
|
||||
destinationDir = file('build/distributions')
|
||||
destinationDir = file('build/libs')
|
||||
|
||||
from rootProject.file('gradlew')
|
||||
from rootProject.file('gradlew.bat')
|
||||
@@ -695,10 +813,18 @@ project(':forge') {
|
||||
into('gradle/')
|
||||
}
|
||||
from(rootProject.file('mdk/')){
|
||||
/* filter(ReplaceTokens, tokens: [
|
||||
VERSION: project.version
|
||||
rootProject.file('mdk/gitignore.txt').eachLine{
|
||||
if (!it.trim().isEmpty() && !it.trim().startsWith('#'))
|
||||
exclude it
|
||||
}
|
||||
filter(ReplaceTokens, tokens: [
|
||||
FORGE_VERSION: project.version,
|
||||
FORGE_GROUP: project.group,
|
||||
FORGE_NAME: project.name,
|
||||
MC_VERSION: MC_VERSION,
|
||||
MAPPING_CHANNEL: MAPPING_CHANNEL,
|
||||
MAPPING_VERSION: MAPPING_VERSION
|
||||
])
|
||||
*/
|
||||
rename 'gitignore\\.txt', '.gitignore'
|
||||
}
|
||||
}
|
||||
@@ -708,6 +834,31 @@ project(':forge') {
|
||||
artifacts.each { key, lib ->
|
||||
addLibrary(lib.name)
|
||||
}
|
||||
addLibrary("${project.group}:${project.name}:${project.version}:launcher")
|
||||
runs {
|
||||
client = {
|
||||
main 'net.minecraftforge.userdev.UserdevLauncher'
|
||||
environment 'target', 'fmluserdevclient'
|
||||
environment 'assetDirectory', '{assets_root}'
|
||||
environment 'nativesDirectory', '{natives}'
|
||||
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
|
||||
environment 'FORGE_GROUP', project.group
|
||||
environment 'MCP_VERSION', MCP_VERSION
|
||||
environment 'MC_VERSION', MC_VERSION
|
||||
environment 'MOD_CLASSES', '{source_roots}'
|
||||
environment 'MCP_MAPPINGS', '{mcp_mappings}'
|
||||
}
|
||||
server = {
|
||||
main 'net.minecraftforge.userdev.UserdevLauncher'
|
||||
environment 'target', 'fmluserdevserver'
|
||||
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1)
|
||||
environment 'FORGE_GROUP', project.group
|
||||
environment 'MCP_VERSION', MCP_VERSION
|
||||
environment 'MC_VERSION', MC_VERSION
|
||||
environment 'MOD_CLASSES', '{source_roots}'
|
||||
environment 'MCP_MAPPINGS', '{mcp_mappings}'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
license {
|
||||
@@ -731,16 +882,48 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
task userdevExtras(type:Jar) {
|
||||
dependsOn classes
|
||||
from sourceSets.userdev.output
|
||||
classifier 'userdev-temp'
|
||||
}
|
||||
|
||||
task userdevExtrasReobf(type:TaskReobfuscateJar) {
|
||||
dependsOn userdevExtras, createMcp2Srg
|
||||
input = tasks.userdevExtras.archivePath
|
||||
classpath = project.configurations.compile
|
||||
srg = tasks.createMcp2Srg.output
|
||||
}
|
||||
|
||||
userdevJar {
|
||||
dependsOn userdevExtrasReobf
|
||||
from (zipTree(tasks.userdevExtrasReobf.output)) {
|
||||
into '/inject/'
|
||||
}
|
||||
from (sourceSets.userdev.output.resourcesDir) {
|
||||
into '/inject/'
|
||||
}
|
||||
}
|
||||
|
||||
applyRangeMap {
|
||||
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact universalJar
|
||||
//TODO: changelog
|
||||
if (changelog.exists()) {
|
||||
artifact(changelog) {
|
||||
classifier = 'changelog'
|
||||
}
|
||||
}
|
||||
artifact installerJar
|
||||
//TODO: installer-win
|
||||
artifact makeMdk
|
||||
artifact userdevJar
|
||||
artifact sourcesJar
|
||||
artifact launcherJar
|
||||
|
||||
pom {
|
||||
name = 'forge'
|
||||
@@ -775,7 +958,7 @@ project(':forge') {
|
||||
username project.properties.forgeMavenUser
|
||||
password project.properties.forgeMavenPassword
|
||||
}
|
||||
url 'http://files.minecraftforge.net/maven/manage/upload'
|
||||
url 'https://files.minecraftforge.net/maven/manage/upload'
|
||||
} else {
|
||||
url 'file://' + rootProject.file('repo').getAbsolutePath()
|
||||
}
|
||||
|
||||
+42
-42
@@ -1,36 +1,22 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = 'http://files.minecraftforge.net/maven' }
|
||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
// This is only here while i'm activly developing FG, Remind me to remove when we publically release
|
||||
configurations {
|
||||
classpath.resolutionStrategy {
|
||||
cacheDynamicVersionsFor 10, 'seconds'
|
||||
cacheChangingModulesFor 0, 'seconds'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
|
||||
repositories {
|
||||
maven { url ='file://' + file('../repo').absolutePath } //Used by Forge development testing only, you can delete this.
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
version = '1.0'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'modid'
|
||||
|
||||
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = '1.8'
|
||||
}
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
minecraft {
|
||||
// the mappings can be changed at any time, and must be in the following format.
|
||||
@@ -38,16 +24,38 @@ 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: 'snapshot', version: '20180921-1.13'
|
||||
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
|
||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||
|
||||
accessTransformer = file('test_at.cfg')
|
||||
//accessTransformer = file('my_at.cfg')
|
||||
|
||||
// default run configurations.
|
||||
// these can be tweaked, removed, or duplicated as needed.
|
||||
runs {
|
||||
client = {
|
||||
// recommended logging data for a userdev environment
|
||||
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
// recommended logging level for the console
|
||||
properties 'forge.logging.console.level': 'debug'
|
||||
workingDirectory project.file('run').canonicalPath
|
||||
source sourceSets.main
|
||||
}
|
||||
server = {
|
||||
// recommended logging data for a userdev environment
|
||||
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
// recommended logging level for the console
|
||||
properties 'forge.logging.console.level': 'debug'
|
||||
workingDirectory project.file('run').canonicalPath
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
minecraft 'net.minecraftforge:forge:1.13-15.24.0.0-1.13-pre'
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
|
||||
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
@@ -61,10 +69,8 @@ dependencies {
|
||||
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
|
||||
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
|
||||
// except that these dependencies get remapped to your current MCP mappings
|
||||
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
// These dependencies get remapped to your current MCP mappings
|
||||
//deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// for more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
@@ -72,21 +78,15 @@ dependencies {
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property 'version', project.version
|
||||
inputs.property 'mcversion', '1.13'
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion': '1.13'
|
||||
// Example for how to get properties into the manifest for reading by the runtime..
|
||||
jar {
|
||||
manifest {
|
||||
attributes(["Specification-Title": "examplemod",
|
||||
"Specification-Vendor": "examplemodsareus",
|
||||
"Specification-Version": "24.0", // We are version 1 of the modlauncher specification
|
||||
"Implementation-Title": project.name,
|
||||
"Implementation-Version": "${version}",
|
||||
"Implementation-Vendor" :"examplemodsareus",
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
|
||||
}
|
||||
|
||||
// copy everything else except the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,3 +20,6 @@ build
|
||||
# other
|
||||
eclipse
|
||||
run
|
||||
|
||||
# Files from Forge MDK
|
||||
forge*changelog.txt
|
||||
@@ -1,3 +1,4 @@
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
@@ -5,14 +5,19 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLModLoadingContext;
|
||||
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 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")
|
||||
public class ExampleMod
|
||||
@@ -21,36 +26,58 @@ public class ExampleMod
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public ExampleMod() {
|
||||
// Register the preInit method for modloading
|
||||
FMLModLoadingContext.get().getModEventBus().addListener(this::preInit);
|
||||
// Register the init method for modloading
|
||||
FMLModLoadingContext.get().getModEventBus().addListener(this::init);
|
||||
// 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);
|
||||
|
||||
// Register ourselves for server, registry and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
private void preInit(final FMLPreInitializationEvent event)
|
||||
private void setup(final FMLCommonSetupEvent event)
|
||||
{
|
||||
// some preinit code
|
||||
LOGGER.info("HELLO FROM PREINIT");
|
||||
}
|
||||
|
||||
private void init(final FMLInitializationEvent event)
|
||||
{
|
||||
// some example code
|
||||
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
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)
|
||||
{
|
||||
// some example code to dispatch IMC to another mod
|
||||
InterModComms.sendTo("forge", "helloworld", () -> { LOGGER.info("Hello world"); 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) {
|
||||
public static 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
|
||||
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
|
||||
public static class RegistryEvents {
|
||||
@SubscribeEvent
|
||||
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,8 @@
|
||||
# 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 minecraft version (without the 1.)
|
||||
loaderVersion="[13,)" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[24,)" #mandatory (24 is current forge version)
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
@@ -24,9 +22,11 @@ authors="Love, Cheese and small house plants" #optional
|
||||
# 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="1.0" #mandatory
|
||||
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
|
||||
# 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
|
||||
@@ -35,7 +35,6 @@ 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
|
||||
@@ -43,7 +42,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[14.23.2.0,)" #mandatory
|
||||
versionRange="[24,)" #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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
public net.minecraft.block.Block field_196273_d # LOGGER
|
||||
@@ -7,7 +7,7 @@ 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
|
||||
randomScalaProperty="fishy"
|
||||
# Arbitrary key-value property pairs available to mods
|
||||
[properties]
|
||||
key="value"
|
||||
@@ -25,13 +25,16 @@ key="value"
|
||||
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
|
||||
randomExtraProperty="somevalue"
|
||||
# Arbitrary key-value pairs
|
||||
[inventorysorter.properties]
|
||||
[modproperties.inventorysorter]
|
||||
key="value"
|
||||
# A list of dependencies
|
||||
[[inventorysorter.dependencies]]
|
||||
[[dependencies.inventorysorter]]
|
||||
# the modid of the dependency
|
||||
modid="forge"
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
@@ -39,22 +42,23 @@ key="value"
|
||||
# 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
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side=BOTH
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
[[inventorysorter.dependencies]]
|
||||
[[dependencies.inventorysorter]]
|
||||
modid="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.12.2]"
|
||||
ordering=NONE
|
||||
side=BOTH
|
||||
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"
|
||||
# ${jarVersion} will read the Implementation-Version of the jar file
|
||||
version="${jarVersion}"
|
||||
# ${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
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -174,6 +174,8 @@
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -186,6 +188,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_82766_b("announceAdvancements")) {
|
||||
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(), 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_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
@@ -24,6 +24,8 @@
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
|
||||
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;
|
||||
@@ -90,6 +92,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")) {
|
||||
@@ -181,6 +188,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();
|
||||
@Nullable
|
||||
@@ -1,15 +1,66 @@
|
||||
--- a/net/minecraft/block/Block.java
|
||||
+++ b/net/minecraft/block/Block.java
|
||||
@@ -74,7 +74,7 @@
|
||||
@@ -75,9 +75,10 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
-public class Block implements IItemProvider {
|
||||
+public class Block extends net.minecraftforge.registries.ForgeRegistryEntry<Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock {
|
||||
protected static final Logger field_196273_d = LogManager.getLogger();
|
||||
private static final ResourceLocation field_176230_a = new ResourceLocation("air");
|
||||
public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = new RegistryNamespacedDefaultedByKey<ResourceLocation, Block>(field_176230_a);
|
||||
@@ -502,8 +502,8 @@
|
||||
- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<>();
|
||||
+ @Deprecated //Forge: Do not use, use GameRegistry
|
||||
+ public static final ObjectIntIdentityMap<IBlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
|
||||
private static final EnumFacing[] field_212556_a = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.UP};
|
||||
protected final int field_149784_t;
|
||||
protected final float field_149782_v;
|
||||
@@ -298,7 +299,7 @@
|
||||
|
||||
@Deprecated
|
||||
public boolean func_196253_a(IBlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
|
||||
- return this.field_149764_J.func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
|
||||
+ return p_196253_1_.func_185904_a().func_76222_j() && p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -310,8 +311,9 @@
|
||||
return this.field_149789_z;
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: New State sensitive version.
|
||||
public boolean func_149716_u() {
|
||||
- return this instanceof ITileEntityProvider;
|
||||
+ return hasTileEntity(func_176223_P());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -322,11 +324,11 @@
|
||||
@Deprecated
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public int func_185484_c(IBlockState p_185484_1_, IWorldReader p_185484_2_, BlockPos p_185484_3_) {
|
||||
- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
|
||||
+ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
|
||||
if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab) {
|
||||
p_185484_3_ = p_185484_3_.func_177977_b();
|
||||
p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_);
|
||||
- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
|
||||
+ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
|
||||
} else {
|
||||
return i;
|
||||
}
|
||||
@@ -468,8 +470,12 @@
|
||||
|
||||
@Deprecated
|
||||
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
|
||||
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer)) {
|
||||
+ p_196243_2_.func_175713_t(p_196243_3_);
|
||||
+ }
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use fortune/location sensitive version
|
||||
public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
|
||||
return 1;
|
||||
}
|
||||
@@ -484,30 +490,30 @@
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
@@ -20,7 +71,75 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,6 +625,7 @@
|
||||
@Deprecated
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_196251_a(p_196255_1_, p_196255_5_, p_196255_2_, p_196255_3_, p_196255_2_.field_73012_v);
|
||||
-
|
||||
- for(int j = 0; j < i; ++j) {
|
||||
- if (!(p_196255_4_ < 1.0F) || !(p_196255_2_.field_73012_v.nextFloat() > p_196255_4_)) {
|
||||
- Item item = this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_).func_199767_j();
|
||||
- if (item != Items.field_190931_a) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(item));
|
||||
- }
|
||||
- }
|
||||
+ if (!p_196255_2_.field_72995_K && !p_196255_2_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
+ NonNullList<ItemStack> drops = NonNullList.func_191196_a();
|
||||
+ getDrops(p_196255_1_, drops, p_196255_2_, p_196255_3_, p_196255_5_);
|
||||
+ p_196255_4_ = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(drops, p_196255_2_, p_196255_3_, p_196255_1_, p_196255_5_, p_196255_4_, false, harvesters.get());
|
||||
+ for (ItemStack stack : drops) {
|
||||
+ if (p_196255_2_.field_73012_v.nextFloat() <= p_196255_4_)
|
||||
+ func_180635_a(p_196255_2_, p_196255_3_, stack);
|
||||
}
|
||||
-
|
||||
}
|
||||
}
|
||||
|
||||
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) {
|
||||
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) {
|
||||
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) {// do not drop items while restoring blockstates, prevents item dupe
|
||||
+ if (captureDrops.get()) {
|
||||
+ capturedDrops.get().add(p_180635_2_);
|
||||
+ return;
|
||||
+ }
|
||||
float f = 0.5F;
|
||||
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
||||
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
||||
@@ -529,6 +535,7 @@
|
||||
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: State sensitive version
|
||||
public float func_149638_a() {
|
||||
return this.field_149781_w;
|
||||
}
|
||||
@@ -543,7 +550,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return raytraceresult;
|
||||
+ return p_180636_0_.func_177230_c().getRayTraceResult(p_180636_0_, p_180636_1_, p_180636_2_, p_180636_3_, p_180636_4_, raytraceresult);
|
||||
}
|
||||
|
||||
public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
|
||||
@@ -597,16 +604,22 @@
|
||||
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_) {
|
||||
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(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_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ NonNullList<ItemStack> items = NonNullList.func_191196_a();
|
||||
ItemStack itemstack = this.func_180643_i(p_180657_4_);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
|
||||
+ if (!itemstack.func_190926_b()) items.add(itemstack);
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
|
||||
+ items.forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
|
||||
} else {
|
||||
+ harvesters.set(p_180657_2_);
|
||||
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, i);
|
||||
+ harvesters.set(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +147,15 @@
|
||||
protected boolean func_149700_E() {
|
||||
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
|
||||
}
|
||||
@@ -755,6 +756,7 @@
|
||||
@@ -663,6 +676,7 @@
|
||||
p_176216_2_.field_70181_x = 0.0D;
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use more sensitive version below: getPickBlock
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
|
||||
return new ItemStack(this);
|
||||
}
|
||||
@@ -737,6 +751,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +163,44 @@
|
||||
public SoundType func_185467_w() {
|
||||
return this.field_149762_H;
|
||||
}
|
||||
@@ -1604,4 +1606,56 @@
|
||||
@@ -758,11 +773,11 @@
|
||||
}
|
||||
|
||||
public static boolean func_196252_e(Block p_196252_0_) {
|
||||
- return p_196252_0_ == Blocks.field_150348_b || p_196252_0_ == Blocks.field_196650_c || p_196252_0_ == Blocks.field_196654_e || p_196252_0_ == Blocks.field_196656_g;
|
||||
+ return net.minecraftforge.common.Tags.Blocks.STONE.func_199685_a_(p_196252_0_);
|
||||
}
|
||||
|
||||
public static boolean func_196245_f(Block p_196245_0_) {
|
||||
- return p_196245_0_ == Blocks.field_150346_d || p_196245_0_ == Blocks.field_196660_k || p_196245_0_ == Blocks.field_196661_l;
|
||||
+ return net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(p_196245_0_);
|
||||
}
|
||||
|
||||
public static void func_149671_p() {
|
||||
@@ -1129,7 +1144,7 @@
|
||||
func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
|
||||
func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
|
||||
func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42)));
|
||||
- func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
|
||||
+ func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true));
|
||||
func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F)));
|
||||
func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F)));
|
||||
func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F)));
|
||||
@@ -1455,6 +1470,7 @@
|
||||
func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a()));
|
||||
func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F)));
|
||||
|
||||
+ if(false) // Processed in GameData.BlockCallbacks#onBake
|
||||
for(Block block85 : IRegistry.field_212618_g) {
|
||||
for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) {
|
||||
field_176229_d.func_195867_b(iblockstate);
|
||||
@@ -1594,4 +1610,83 @@
|
||||
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
|
||||
}
|
||||
}
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ private ThreadLocal<IBlockState> silkCheck = new ThreadLocal<>();
|
||||
+ protected Random RANDOM = new Random();
|
||||
+ protected ThreadLocal<EntityPlayer> harvesters = new ThreadLocal<>();
|
||||
+ private net.minecraftforge.common.ToolType harvestTool;
|
||||
+ private int harvestLevel;
|
||||
+ protected static ThreadLocal<Boolean> captureDrops = ThreadLocal.withInitial(() -> false);
|
||||
@@ -68,12 +227,6 @@
|
||||
+ return this.func_149700_E() && !state.hasTileEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onBlockExploded(IBlockState state, World world, BlockPos pos, Explosion explosion) {
|
||||
+ world.func_175698_g(pos);
|
||||
+ func_180652_a(world, pos, explosion);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(IBlockState state) {
|
||||
@@ -85,6 +238,38 @@
|
||||
+ return harvestLevel; //TODO: RE-Evaluate
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSustainPlant(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing, net.minecraftforge.common.IPlantable plantable) {
|
||||
+ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
|
||||
+ net.minecraftforge.common.EnumPlantType type = plantable.getPlantType(world, pos.func_177972_a(facing));
|
||||
+
|
||||
+ if (plant.func_177230_c() == Blocks.field_150434_aF)
|
||||
+ return this.getBlock() == Blocks.field_150434_aF || this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_196611_F;
|
||||
+
|
||||
+ if (plant.func_177230_c() == Blocks.field_196608_cF && this == Blocks.field_196608_cF)
|
||||
+ return true;
|
||||
+
|
||||
+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_200014_a_(state, world, pos))
|
||||
+ return true;
|
||||
+
|
||||
+ switch (type) {
|
||||
+ case Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof BlockGlazedTerracotta;
|
||||
+ case Nether: return this.getBlock() == Blocks.field_150425_aM;
|
||||
+ case Crop: return this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Cave: return state.func_185896_q();
|
||||
+ case Plains: return this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Water: return state.func_185904_a() == Material.field_151586_h; //&& state.getValue(BlockLiquidWrapper)
|
||||
+ case Beach:
|
||||
+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150354_m;
|
||||
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177968_d()).func_185904_a() == Material.field_151586_h);
|
||||
+ return isBeach && hasWater;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ static {
|
||||
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
|
||||
+ block.harvestTool = tool;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/block/BlockAbstractBanner.java
|
||||
+++ b/net/minecraft/block/BlockAbstractBanner.java
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, this.func_185473_a(p_196255_2_, p_196255_3_, p_196255_1_));
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
}
|
||||
|
||||
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_) {
|
||||
@@ -75,4 +75,10 @@
|
||||
public EnumDyeColor func_196285_M_() {
|
||||
return this.field_196286_a;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ TileEntity te = world.func_175625_s(pos);
|
||||
+ drops.add((te instanceof TileEntityBanner) ? ((TileEntityBanner)te).func_190615_l(state) : func_185473_a(world, pos, state));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
--- a/net/minecraft/block/BlockAbstractSkull.java
|
||||
+++ b/net/minecraft/block/BlockAbstractSkull.java
|
||||
@@ -38,6 +38,7 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
}
|
||||
|
||||
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) {
|
||||
@@ -45,6 +46,7 @@
|
||||
TileEntitySkull.func_195486_a(p_176208_1_, p_176208_2_);
|
||||
}
|
||||
|
||||
+ this.func_196255_a(p_176208_3_, p_176208_1_, p_176208_2_, 1.0f, 0);
|
||||
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
|
||||
}
|
||||
|
||||
@@ -55,7 +57,7 @@
|
||||
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
|
||||
if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c() && !p_196243_2_.field_72995_K) {
|
||||
TileEntity tileentity = p_196243_2_.func_175625_s(p_196243_3_);
|
||||
- if (tileentity instanceof TileEntitySkull) {
|
||||
+ if (false && tileentity instanceof TileEntitySkull) { //Forge: Moved to getDrops
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
if (tileentityskull.func_195487_d()) {
|
||||
ItemStack itemstack = this.func_185473_a(p_196243_2_, p_196243_3_, p_196243_1_);
|
||||
@@ -74,6 +76,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ TileEntity te = world.func_175625_s(pos);
|
||||
+ if (te instanceof TileEntitySkull) {
|
||||
+ TileEntitySkull skull = (TileEntitySkull)te;
|
||||
+ if (skull.func_195487_d()) {
|
||||
+ ItemStack ret = func_185473_a(world, pos, state);
|
||||
+ Block block = skull.func_195044_w().func_177230_c();
|
||||
+ if ((block == Blocks.field_196710_eS || block == Blocks.field_196709_eR) && skull.func_152108_a() != null) {
|
||||
+ NBTTagCompound nbt = new NBTTagCompound();
|
||||
+ NBTUtil.func_180708_a(nbt, skull.func_152108_a());
|
||||
+ ret.func_196082_o().func_74782_a("SkullOwner", nbt);
|
||||
+ }
|
||||
+ drops.add(ret);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public BlockSkull.ISkullType func_196292_N_() {
|
||||
return this.field_196293_a;
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/net/minecraft/block/BlockBed.java
|
||||
+++ b/net/minecraft/block/BlockBed.java
|
||||
@@ -67,7 +67,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_196250_2_.field_73011_w.func_76567_e() && p_196250_2_.func_180494_b(p_196250_3_) != Biomes.field_76778_j) {
|
||||
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_196250_2_.field_73011_w.canSleepAt(p_196250_4_, p_196250_3_);
|
||||
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
|
||||
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
|
||||
if (p_196250_1_.func_177229_b(field_176471_b)) {
|
||||
EntityPlayer entityplayer = this.func_176470_e(p_196250_2_, p_196250_3_);
|
||||
if (entityplayer != null) {
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/block/BlockBush.java
|
||||
+++ b/net/minecraft/block/BlockBush.java
|
||||
@@ -10,7 +10,7 @@
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
|
||||
-public class BlockBush extends Block {
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable {
|
||||
protected BlockBush(Block.Properties p_i48437_1_) {
|
||||
super(p_i48437_1_);
|
||||
}
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
BlockPos blockpos = p_196260_3_.func_177977_b();
|
||||
+ if (p_196260_1_.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.
|
||||
+ return p_196260_2_.func_180495_p(blockpos).canSustainPlant(p_196260_2_, blockpos, EnumFacing.UP, this);
|
||||
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
|
||||
}
|
||||
|
||||
@@ -44,4 +46,11 @@
|
||||
public int func_200011_d(IBlockState p_200011_1_, IBlockReader p_200011_2_, BlockPos p_200011_3_) {
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
--- a/net/minecraft/block/BlockCactus.java
|
||||
+++ b/net/minecraft/block/BlockCactus.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockCactus extends Block {
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable {
|
||||
public static final IntegerProperty field_176587_a = BlockStateProperties.field_208171_X;
|
||||
protected static final VoxelShape field_196400_b = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D);
|
||||
protected static final VoxelShape field_196401_c = Block.func_208617_a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
|
||||
@@ -32,6 +32,7 @@
|
||||
}
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update
|
||||
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
|
||||
p_196267_2_.func_175655_b(p_196267_3_, true);
|
||||
} else {
|
||||
@@ -44,6 +45,7 @@
|
||||
|
||||
if (i < 3) {
|
||||
int j = p_196267_1_.func_177229_b(field_176587_a);
|
||||
+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) {
|
||||
if (j == 15) {
|
||||
p_196267_2_.func_175656_a(blockpos, this.func_176223_P());
|
||||
IBlockState iblockstate = p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(0));
|
||||
@@ -52,7 +54,8 @@
|
||||
} else {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4);
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,8 +94,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c();
|
||||
- return (block == Blocks.field_150434_aF || block == Blocks.field_150354_m || block == Blocks.field_196611_F) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d();
|
||||
+ IBlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
+ return soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP, this) && !p_196260_2_.func_180495_p(p_196260_3_.func_177984_a()).func_185904_a().func_76224_d();
|
||||
}
|
||||
|
||||
public void func_196262_a(IBlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
|
||||
@@ -114,4 +117,14 @@
|
||||
public boolean func_196266_a(IBlockState p_196266_1_, IBlockReader p_196266_2_, BlockPos p_196266_3_, PathType p_196266_4_) {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockReader world, BlockPos pos) {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockChest.java
|
||||
+++ b/net/minecraft/block/BlockChest.java
|
||||
@@ -258,7 +258,7 @@
|
||||
}
|
||||
|
||||
private boolean func_176456_n(IBlockReader 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_) {
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/block/BlockChorusFlower.java
|
||||
+++ b/net/minecraft/block/BlockChorusFlower.java
|
||||
@@ -42,7 +42,7 @@
|
||||
BlockPos blockpos = p_196267_3_.func_177984_a();
|
||||
if (p_196267_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) {
|
||||
int i = p_196267_1_.func_177229_b(field_185607_a);
|
||||
- if (i < 5) {
|
||||
+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) {
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
IBlockState iblockstate = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
|
||||
@@ -99,7 +99,7 @@
|
||||
} else {
|
||||
this.func_185605_c(p_196267_2_, p_196267_3_);
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/net/minecraft/block/BlockCocoa.java
|
||||
+++ b/net/minecraft/block/BlockCocoa.java
|
||||
@@ -34,10 +34,11 @@
|
||||
}
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
- if (p_196267_2_.field_73012_v.nextInt(5) == 0) {
|
||||
+ if (true) {
|
||||
int i = p_196267_1_.func_177229_b(field_176501_a);
|
||||
- if (i < 2) {
|
||||
+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_2_.field_73012_v.nextInt(5) == 0)) {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,14 +91,20 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- int i = p_196255_1_.func_177229_b(field_176501_a);
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ super.getDrops(state, drops, world, pos, fortune);
|
||||
+ int i = state.func_177229_b(field_176501_a);
|
||||
int j = 1;
|
||||
if (i >= 2) {
|
||||
j = 3;
|
||||
}
|
||||
|
||||
for(int k = 0; k < j; ++k) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_196130_bo));
|
||||
+ drops.add(new ItemStack(Items.field_196130_bo));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
--- a/net/minecraft/block/BlockCrops.java
|
||||
+++ b/net/minecraft/block/BlockCrops.java
|
||||
@@ -55,12 +55,14 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
|
||||
int i = this.func_185527_x(p_196267_1_);
|
||||
if (i < this.func_185526_g()) {
|
||||
float f = func_180672_a(this, p_196267_2_, p_196267_3_);
|
||||
- if (p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0) {
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, this.func_185528_e(i + 1), 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,9 +91,9 @@
|
||||
for(int j = -1; j <= 1; ++j) {
|
||||
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.canSustainPlant(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 (iblockstate.func_177229_b(BlockFarmland.field_176531_a) > 0) {
|
||||
+ if (iblockstate.isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) {
|
||||
f1 = 3.0F;
|
||||
}
|
||||
}
|
||||
@@ -135,15 +137,19 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, 0);
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_185527_x(p_196255_1_);
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ {
|
||||
+ int i = this.func_185527_x(state);
|
||||
if (i >= this.func_185526_g()) {
|
||||
- int j = 3 + p_196255_5_;
|
||||
+ int j = 3 + fortune;
|
||||
|
||||
for(int k = 0; k < j; ++k) {
|
||||
- if (p_196255_2_.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199772_f()));
|
||||
+ if (world.field_73012_v.nextInt(2 * this.func_185526_g()) <= i) {
|
||||
+ drops.add(new ItemStack(this.func_199772_f()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/block/BlockDeadBush.java
|
||||
+++ b/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -14,7 +14,7 @@
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush {
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable {
|
||||
protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
|
||||
|
||||
protected BlockDeadBush(Block.Properties p_i48418_1_) {
|
||||
@@ -46,4 +46,10 @@
|
||||
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, flag ? Blocks.field_150350_a.func_176223_P() : p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_196555_aI));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/block/BlockDirtSnowySpreadable.java
|
||||
+++ b/net/minecraft/block/BlockDirtSnowySpreadable.java
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
if (!p_196267_2_.field_72995_K) {
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
|
||||
if (!func_196383_a(p_196267_2_, p_196267_3_)) {
|
||||
p_196267_2_.func_175656_a(p_196267_3_, Blocks.field_150346_d.func_176223_P());
|
||||
} else {
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ b/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -43,7 +43,7 @@
|
||||
@Nullable
|
||||
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
- return blockpos.func_177956_o() < 255 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
|
||||
+ return blockpos.func_177956_o() < p_196258_1_.func_195991_k().func_72800_K() - 1 && p_196258_1_.func_195991_k().func_180495_p(blockpos.func_177984_a()).func_196953_a(p_196258_1_) ? super.func_196258_a(p_196258_1_) : null;
|
||||
}
|
||||
|
||||
public void func_180633_a(World p_180633_1_, BlockPos p_180633_2_, IBlockState p_180633_3_, EntityLivingBase p_180633_4_, ItemStack p_180633_5_) {
|
||||
@@ -51,6 +51,7 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
+ if (p_196260_1_.func_177230_c() != this) return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_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_196260_1_.func_177229_b(field_176492_b) != DoubleBlockHalf.UPPER) {
|
||||
return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_);
|
||||
} else {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockDropper.java
|
||||
+++ b/net/minecraft/block/BlockDropper.java
|
||||
@@ -37,7 +37,7 @@
|
||||
p_176439_1_.func_175718_b(1001, p_176439_2_, 0);
|
||||
} else {
|
||||
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 = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
|
||||
IInventory iinventory = TileEntityHopper.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(enumfacing));
|
||||
ItemStack itemstack1;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockEnchantmentTable.java
|
||||
+++ b/net/minecraft/block/BlockEnchantmentTable.java
|
||||
@@ -49,7 +49,7 @@
|
||||
if (p_180655_4_.nextInt(16) == 0) {
|
||||
for(int k = 0; k <= 1; ++k) {
|
||||
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 (p_180655_2_.func_180495_p(blockpos).getEnchantPowerBonus(p_180655_2_, p_180655_3_) > 0) {
|
||||
if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2))) {
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockEnderChest.java
|
||||
+++ b/net/minecraft/block/BlockEnderChest.java
|
||||
@@ -81,7 +81,7 @@
|
||||
InventoryEnderChest inventoryenderchest = p_196250_4_.func_71005_bN();
|
||||
TileEntity tileentity = p_196250_2_.func_175625_s(p_196250_3_);
|
||||
if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) {
|
||||
- if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).func_185915_l()) {
|
||||
+ if (p_196250_2_.func_180495_p(p_196250_3_.func_177984_a()).doesSideBlockChestOpening(p_196250_2_, p_196250_3_.func_177984_a(), EnumFacing.DOWN)) {
|
||||
return true;
|
||||
} else if (p_196250_2_.field_72995_K) {
|
||||
return true;
|
||||
@@ -0,0 +1,21 @@
|
||||
--- a/net/minecraft/block/BlockFalling.java
|
||||
+++ b/net/minecraft/block/BlockFalling.java
|
||||
@@ -48,7 +48,9 @@
|
||||
p_176503_1_.func_72838_d(entityfallingblock);
|
||||
}
|
||||
} else {
|
||||
+ IBlockState state = func_176223_P();
|
||||
if (p_176503_1_.func_180495_p(p_176503_2_).func_177230_c() == this) {
|
||||
+ state = p_176503_1_.func_180495_p(p_176503_2_);
|
||||
p_176503_1_.func_175698_g(p_176503_2_);
|
||||
}
|
||||
|
||||
@@ -58,7 +60,7 @@
|
||||
}
|
||||
|
||||
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,24 @@
|
||||
--- a/net/minecraft/block/BlockFarmland.java
|
||||
+++ b/net/minecraft/block/BlockFarmland.java
|
||||
@@ -79,7 +79,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 (!p_180658_1_.field_72995_K && 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_199610_d(p_180658_1_.func_180495_p(p_180658_2_), p_180658_1_, p_180658_2_);
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@
|
||||
p_199610_1_.func_175656_a(p_199610_2_, func_199601_a(p_199610_0_, Blocks.field_150346_d.func_176223_P(), p_199610_1_, p_199610_2_));
|
||||
}
|
||||
|
||||
- private static boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
|
||||
- Block block = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a()).func_177230_c();
|
||||
- return block instanceof BlockCrops || block instanceof BlockStem || block instanceof BlockAttachedStem;
|
||||
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
|
||||
+ IBlockState state = p_176529_0_.func_180495_p(p_176529_1_.func_177984_a());
|
||||
+ return state.func_177230_c() instanceof net.minecraftforge.common.IPlantable && canSustainPlant(state, p_176529_0_, p_176529_1_, EnumFacing.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
|
||||
}
|
||||
|
||||
private static boolean func_176530_e(IWorldReaderBase p_176530_0_, BlockPos p_176530_1_) {
|
||||
@@ -0,0 +1,50 @@
|
||||
--- a/net/minecraft/block/BlockFence.java
|
||||
+++ b/net/minecraft/block/BlockFence.java
|
||||
@@ -64,15 +64,12 @@
|
||||
IBlockReader iblockreader = p_196258_1_.func_195991_k();
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
|
||||
- BlockPos blockpos1 = blockpos.func_177978_c();
|
||||
- BlockPos blockpos2 = blockpos.func_177974_f();
|
||||
- BlockPos blockpos3 = blockpos.func_177968_d();
|
||||
- BlockPos blockpos4 = blockpos.func_177976_e();
|
||||
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
|
||||
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
|
||||
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
|
||||
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
|
||||
- return super.func_196258_a(p_196258_1_).func_206870_a(field_196409_a, Boolean.valueOf(this.func_196416_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196416_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.WEST)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196416_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196416_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.EAST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
+ return super.func_196258_a(p_196258_1_)
|
||||
+ .func_206870_a(field_196409_a, canFenceConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
|
||||
+ .func_206870_a(field_196411_b, canFenceConnectTo(iblockreader, blockpos, EnumFacing.EAST))
|
||||
+ .func_206870_a(field_196413_c, canFenceConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
|
||||
+ .func_206870_a(field_196414_y, canFenceConnectTo(iblockreader, blockpos, EnumFacing.WEST))
|
||||
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
}
|
||||
|
||||
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
|
||||
@@ -80,7 +77,7 @@
|
||||
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
|
||||
}
|
||||
|
||||
- return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196416_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
+ return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canFenceConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
}
|
||||
|
||||
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
|
||||
@@ -90,4 +87,16 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader 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;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
|
||||
+ return func_196416_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
+ private boolean canFenceConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ IBlockState other = world.func_180495_p(offset);
|
||||
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/net/minecraft/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/block/BlockFenceGate.java
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
|
||||
private boolean func_196380_i(IBlockState p_196380_1_) {
|
||||
- return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg;
|
||||
+ return p_196380_1_.func_177230_c() == Blocks.field_150463_bK || p_196380_1_.func_177230_c() == Blocks.field_196723_eg || p_196380_1_.func_177230_c() instanceof BlockWall;
|
||||
}
|
||||
|
||||
public boolean func_196250_a(IBlockState p_196250_1_, World p_196250_2_, BlockPos p_196250_3_, EntityPlayer p_196250_4_, EnumHand p_196250_5_, EnumFacing p_196250_6_, float p_196250_7_, float p_196250_8_, float p_196250_9_) {
|
||||
@@ -145,4 +145,14 @@
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ if (state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE) {
|
||||
+ Block other = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c();
|
||||
+ return other instanceof BlockFence || other instanceof BlockWall;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
--- a/net/minecraft/block/BlockFire.java
|
||||
+++ b/net/minecraft/block/BlockFire.java
|
||||
@@ -64,13 +64,13 @@
|
||||
|
||||
public IBlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
|
||||
IBlockState iblockstate = p_196448_1_.func_180495_p(p_196448_2_.func_177977_b());
|
||||
- if (!iblockstate.func_185896_q() && !this.func_196446_i(iblockstate)) {
|
||||
+ if (!iblockstate.func_185896_q() && !this.canCatchFire(p_196448_1_, p_196448_2_, EnumFacing.UP)) {
|
||||
IBlockState iblockstate1 = this.func_176223_P();
|
||||
|
||||
for(EnumFacing enumfacing : EnumFacing.values()) {
|
||||
BooleanProperty booleanproperty = field_196449_B.get(enumfacing);
|
||||
if (booleanproperty != null) {
|
||||
- iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.func_196446_i(p_196448_1_.func_180495_p(p_196448_2_.func_177972_a(enumfacing)))));
|
||||
+ iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.canCatchFire(p_196448_1_, p_196448_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,12 +98,13 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) {
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire
|
||||
if (!p_196267_1_.func_196955_c(p_196267_2_, p_196267_3_)) {
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
}
|
||||
|
||||
- Block block = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_177230_c();
|
||||
- boolean flag = p_196267_2_.field_73011_w instanceof EndDimension && block == Blocks.field_150357_h || block == Blocks.field_150424_aL || block == Blocks.field_196814_hQ;
|
||||
+ IBlockState other = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
|
||||
+ boolean flag = other.isFireSource(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP);
|
||||
int i = p_196267_1_.func_177229_b(field_176543_a);
|
||||
if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) {
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
@@ -117,14 +118,14 @@
|
||||
if (!flag) {
|
||||
p_196267_2_.func_205220_G_().func_205360_a(p_196267_3_, this, this.func_149738_a(p_196267_2_) + p_196267_4_.nextInt(10));
|
||||
if (!this.func_196447_a(p_196267_2_, p_196267_3_)) {
|
||||
- if (!p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_185896_q() || i > 3) {
|
||||
+ if (p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_193401_d(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID || i > 3) {
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
- if (i == 15 && p_196267_4_.nextInt(4) == 0 && !this.func_196446_i(p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()))) {
|
||||
+ if (i == 15 && p_196267_4_.nextInt(4) == 0 && !this.canCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), EnumFacing.UP)) {
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
return;
|
||||
}
|
||||
@@ -132,12 +133,12 @@
|
||||
|
||||
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
|
||||
int k = flag1 ? -50 : 0;
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i, EnumFacing.WEST);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i, EnumFacing.EAST);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i, EnumFacing.UP);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i, EnumFacing.DOWN);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i, EnumFacing.SOUTH);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i, EnumFacing.NORTH);
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
|
||||
for(int l = -1; l <= 1; ++l) {
|
||||
@@ -175,16 +176,18 @@
|
||||
return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d());
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use IForgeBlockState.getFlammability
|
||||
public int func_176532_c(Block p_176532_1_) {
|
||||
return this.field_149848_b.getInt(p_176532_1_);
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use IForgeBlockState.getFireSpreadSpeed
|
||||
public int func_176534_d(Block p_176534_1_) {
|
||||
return this.field_149849_a.getInt(p_176534_1_);
|
||||
}
|
||||
|
||||
- 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());
|
||||
+ 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_).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_);
|
||||
if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) {
|
||||
@@ -204,7 +207,7 @@
|
||||
|
||||
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
|
||||
for(EnumFacing enumfacing : EnumFacing.values()) {
|
||||
- if (this.func_196446_i(p_196447_1_.func_180495_p(p_196447_2_.func_177972_a(enumfacing)))) {
|
||||
+ if (this.canCatchFire(p_196447_1_, p_196447_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +222,7 @@
|
||||
int i = 0;
|
||||
|
||||
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)).getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
|
||||
}
|
||||
|
||||
return i;
|
||||
@@ -230,6 +233,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use canCatchFire with more context
|
||||
public boolean func_196446_i(IBlockState p_196446_1_) {
|
||||
return this.func_176534_d(p_196446_1_.func_177230_c()) > 0;
|
||||
}
|
||||
@@ -252,8 +256,8 @@
|
||||
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() && !this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()))) {
|
||||
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177976_e()))) {
|
||||
+ if (p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_193401_d(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID && !this.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST)) {
|
||||
for(int j = 0; j < 2; ++j) {
|
||||
double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F;
|
||||
double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
|
||||
@@ -262,7 +266,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177974_f()))) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST)) {
|
||||
for(int k = 0; k < 2; ++k) {
|
||||
double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
|
||||
double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
|
||||
@@ -271,7 +275,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177978_c()))) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH)) {
|
||||
for(int l = 0; l < 2; ++l) {
|
||||
double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
|
||||
double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
|
||||
@@ -280,7 +284,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177968_d()))) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH)) {
|
||||
for(int i1 = 0; i1 < 2; ++i1) {
|
||||
double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
|
||||
double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble();
|
||||
@@ -289,7 +293,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.func_196446_i(p_180655_2_.func_180495_p(p_180655_3_.func_177984_a()))) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN)) {
|
||||
for(int j1 = 0; j1 < 2; ++j1) {
|
||||
double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble();
|
||||
double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F;
|
||||
@@ -321,10 +325,23 @@
|
||||
}
|
||||
|
||||
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_, p_180686_2_);
|
||||
this.field_149848_b.put(p_180686_1_, p_180686_3_);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * 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(IBlockReader world, BlockPos pos, EnumFacing face) {
|
||||
+ return world.func_180495_p(pos).isFlammable(world, pos, face);
|
||||
+ }
|
||||
+
|
||||
public static void func_149843_e() {
|
||||
BlockFire blockfire = (BlockFire)Blocks.field_150480_ab;
|
||||
blockfire.func_180686_a(Blocks.field_196662_n, 5, 20);
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ b/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -22,7 +22,7 @@
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockFlowerPot extends Block {
|
||||
- private static final Map<Block, Block> field_196451_b = Maps.newHashMap();
|
||||
+ private static final Map<Block, Block> field_196451_b = Maps.newHashMap(); //TODO: Delegates
|
||||
protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
|
||||
private final Block field_196452_c;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--- a/net/minecraft/block/BlockIce.java
|
||||
+++ b/net/minecraft/block/BlockIce.java
|
||||
@@ -34,8 +34,10 @@
|
||||
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_) {
|
||||
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(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) {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
|
||||
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ net.minecraft.util.NonNullList<ItemStack> items = net.minecraft.util.NonNullList.func_193580_a(ItemStack.field_190927_a, 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_);
|
||||
+ items.stream().filter(e -> !e.func_190926_b()).forEach(e -> func_180635_a(p_180657_1_, p_180657_3_, e));
|
||||
} else {
|
||||
if (p_180657_1_.field_73011_w.func_177500_n()) {
|
||||
p_180657_1_.func_175698_g(p_180657_3_);
|
||||
@@ -43,7 +45,9 @@
|
||||
}
|
||||
|
||||
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
+ harvesters.set(p_180657_2_);
|
||||
p_180657_4_.func_196949_c(p_180657_1_, p_180657_3_, 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()) {
|
||||
p_180657_1_.func_175656_a(p_180657_3_, Blocks.field_150355_j.func_176223_P());
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/net/minecraft/block/BlockLadder.java
|
||||
+++ b/net/minecraft/block/BlockLadder.java
|
||||
@@ -151,4 +151,9 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
--- a/net/minecraft/block/BlockLeaves.java
|
||||
+++ b/net/minecraft/block/BlockLeaves.java
|
||||
@@ -26,7 +26,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class BlockLeaves extends Block {
|
||||
+public class BlockLeaves extends Block implements net.minecraftforge.common.IShearable {
|
||||
public static final IntegerProperty field_208494_a = BlockStateProperties.field_208514_aa;
|
||||
public static final BooleanProperty field_208495_b = BlockStateProperties.field_208515_s;
|
||||
protected static boolean field_196478_c;
|
||||
@@ -122,28 +122,37 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
- int i = this.func_196472_i(p_196255_1_);
|
||||
- if (p_196255_5_ > 0) {
|
||||
- i -= 2 << p_196255_5_;
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World worldIn, BlockPos pos, int fortune) {
|
||||
+ {
|
||||
+ int i = this.func_196472_i(state);
|
||||
+ if (fortune > 0) {
|
||||
+ i -= 2 << fortune;
|
||||
if (i < 10) {
|
||||
i = 10;
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_196255_2_.field_73012_v.nextInt(i) == 0) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_)));
|
||||
+ if (worldIn.field_73012_v.nextInt(i) == 0) {
|
||||
+ ItemStack drop = new ItemStack(this.func_199769_a(state, worldIn, pos, fortune));
|
||||
+ if (!drop.func_190926_b())
|
||||
+ drops.add(drop);
|
||||
}
|
||||
|
||||
i = 200;
|
||||
- if (p_196255_5_ > 0) {
|
||||
- i -= 10 << p_196255_5_;
|
||||
+ if (fortune > 0) {
|
||||
+ i -= 10 << fortune;
|
||||
if (i < 40) {
|
||||
i = 40;
|
||||
}
|
||||
}
|
||||
|
||||
- this.func_196474_a(p_196255_2_, p_196255_3_, p_196255_1_, i);
|
||||
+ captureDrops(true);
|
||||
+ this.func_196474_a(worldIn, pos, state, i);
|
||||
+ drops.addAll(captureDrops(false));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,13 +182,7 @@
|
||||
}
|
||||
|
||||
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_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
||||
- p_180657_2_.func_71020_j(0.005F);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(this));
|
||||
- } else {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
|
||||
- }
|
||||
}
|
||||
|
||||
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
|
||||
@@ -189,4 +192,10 @@
|
||||
public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) {
|
||||
return func_208493_b(this.func_176223_P().func_206870_a(field_208495_b, Boolean.valueOf(true)), p_196258_1_.func_195991_k(), p_196258_1_.func_195995_a());
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(@javax.annotation.Nonnull ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
--- a/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ b/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -13,6 +13,8 @@
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMobSpawner extends BlockContainer {
|
||||
+ private static final java.util.Random RAND = new java.util.Random();
|
||||
+
|
||||
protected BlockMobSpawner(Block.Properties p_i48364_1_) {
|
||||
super(p_i48364_1_);
|
||||
}
|
||||
@@ -27,10 +29,13 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- int i = 15 + p_196255_2_.field_73012_v.nextInt(15) + p_196255_2_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune) {
|
||||
+ return 15 + RAND.nextInt(15) + RAND.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public EnumBlockRenderType func_149645_b(IBlockState p_149645_1_) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockMushroom.java
|
||||
+++ b/net/minecraft/block/BlockMushroom.java
|
||||
@@ -64,7 +64,7 @@
|
||||
IBlockState iblockstate = p_196260_2_.func_180495_p(blockpos);
|
||||
Block block = iblockstate.func_177230_c();
|
||||
if (block != Blocks.field_150391_bh && block != Blocks.field_196661_l) {
|
||||
- return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && this.func_200014_a_(iblockstate, p_196260_2_, blockpos);
|
||||
+ return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && iblockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.EnumFacing.UP, this);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
--- a/net/minecraft/block/BlockNetherWart.java
|
||||
+++ b/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -33,16 +33,22 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
int i = p_196267_1_.func_177229_b(field_176486_a);
|
||||
- if (i < 3 && p_196267_4_.nextInt(10) == 0) {
|
||||
+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt(10) == 0)) {
|
||||
p_196267_1_ = p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1));
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2);
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState p_196255_1_, net.minecraft.util.NonNullList<ItemStack> drops, World p_196255_2_, BlockPos p_196255_3_, int p_196255_5_) {
|
||||
+ {
|
||||
int i = 1;
|
||||
if (p_196255_1_.func_177229_b(field_176486_a) >= 3) {
|
||||
i = 2 + p_196255_2_.field_73012_v.nextInt(3);
|
||||
@@ -52,7 +58,7 @@
|
||||
}
|
||||
|
||||
for(int j = 0; j < i; ++j) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_151075_bm));
|
||||
+ drops.add(new ItemStack(Items.field_151075_bm));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/block/BlockNote.java
|
||||
+++ b/net/minecraft/block/BlockNote.java
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) {
|
||||
- if (p_196482_1_.func_180495_p(p_196482_2_.func_177984_a()).func_196958_f()) {
|
||||
+ if (p_196482_1_.func_175623_d(p_196482_2_.func_177984_a())) {
|
||||
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
if (p_196250_2_.field_72995_K) {
|
||||
return true;
|
||||
} else {
|
||||
- p_196250_1_ = p_196250_1_.func_177231_a(field_196485_c);
|
||||
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_196250_2_, p_196250_3_, p_196250_1_, p_196250_1_.func_177229_b(field_196485_c), p_196250_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c));
|
||||
+ if (_new == -1) return false;
|
||||
+ p_196250_1_ = (IBlockState)p_196250_1_.func_206870_a(field_196485_c, _new);
|
||||
p_196250_2_.func_180501_a(p_196250_3_, p_196250_1_, 3);
|
||||
this.func_196482_a(p_196250_2_, p_196250_3_);
|
||||
p_196250_4_.func_195066_a(StatList.field_188087_U);
|
||||
@@ -75,6 +77,9 @@
|
||||
}
|
||||
|
||||
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_1_.func_177229_b(field_196485_c), p_189539_1_.func_177229_b(field_196483_a));
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
||||
+ p_189539_1_ = p_189539_1_.func_206870_a(field_196485_c, e.getVanillaNoteId()).func_206870_a(field_196483_a, e.getInstrument());
|
||||
int i = p_189539_1_.func_177229_b(field_196485_c);
|
||||
float f = (float)Math.pow(2.0D, (double)(i - 12) / 12.0D);
|
||||
p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, p_189539_1_.func_177229_b(field_196483_a).func_208088_a(), SoundCategory.RECORDS, 3.0F, f);
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/net/minecraft/block/BlockOre.java
|
||||
+++ b/net/minecraft/block/BlockOre.java
|
||||
@@ -49,23 +49,27 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- if (this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune) {
|
||||
+ World world = reader instanceof World ? (World)reader : null;
|
||||
+ if (world == null || this.func_199769_a(state, world, pos, fortune) != this) {
|
||||
int i = 0;
|
||||
if (this == Blocks.field_150365_q) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 0, 2);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 0, 2);
|
||||
} else if (this == Blocks.field_150482_ag) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
|
||||
} else if (this == Blocks.field_150412_bA) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 3, 7);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 3, 7);
|
||||
} else if (this == Blocks.field_150369_x) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
|
||||
} else if (this == Blocks.field_196766_fg) {
|
||||
- i = MathHelper.func_76136_a(p_196255_2_.field_73012_v, 2, 5);
|
||||
+ i = MathHelper.func_76136_a(RANDOM, 2, 5);
|
||||
}
|
||||
-
|
||||
- this.func_180637_b(p_196255_2_, p_196255_3_, i);
|
||||
+ return i;
|
||||
}
|
||||
-
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
|
||||
@@ -0,0 +1,50 @@
|
||||
--- a/net/minecraft/block/BlockPane.java
|
||||
+++ b/net/minecraft/block/BlockPane.java
|
||||
@@ -25,15 +25,12 @@
|
||||
IBlockReader iblockreader = p_196258_1_.func_195991_k();
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
|
||||
- BlockPos blockpos1 = blockpos.func_177978_c();
|
||||
- BlockPos blockpos2 = blockpos.func_177968_d();
|
||||
- BlockPos blockpos3 = blockpos.func_177976_e();
|
||||
- BlockPos blockpos4 = blockpos.func_177974_f();
|
||||
- IBlockState iblockstate = iblockreader.func_180495_p(blockpos1);
|
||||
- IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2);
|
||||
- IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3);
|
||||
- IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4);
|
||||
- return this.func_176223_P().func_206870_a(field_196409_a, Boolean.valueOf(this.func_196417_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196417_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196417_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.EAST)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196417_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.WEST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
+ return this.func_176223_P()
|
||||
+ .func_206870_a(field_196409_a, canPaneConnectTo(iblockreader, blockpos, EnumFacing.NORTH))
|
||||
+ .func_206870_a(field_196413_c, canPaneConnectTo(iblockreader, blockpos, EnumFacing.SOUTH))
|
||||
+ .func_206870_a(field_196414_y, canPaneConnectTo(iblockreader, blockpos, EnumFacing.WEST))
|
||||
+ .func_206870_a(field_196411_b, canPaneConnectTo(iblockreader, blockpos, EnumFacing.EAST))
|
||||
+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
}
|
||||
|
||||
public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) {
|
||||
@@ -41,7 +38,7 @@
|
||||
p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_));
|
||||
}
|
||||
|
||||
- return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196417_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
+ return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canPaneConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
}
|
||||
|
||||
public boolean func_149686_d(IBlockState p_149686_1_) {
|
||||
@@ -87,4 +84,16 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader 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;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
|
||||
+ return func_196417_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
+ private boolean canPaneConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ BlockPos offset = pos.func_177972_a(facing);
|
||||
+ IBlockState other = world.func_180495_p(offset);
|
||||
+ return other.canBeConnectedTo(world, offset, facing.func_176734_d()) || func_176223_P().canBeConnectedTo(world, pos, facing);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/block/BlockPistonBase.java
|
||||
+++ b/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -244,7 +244,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !block.func_149716_u();
|
||||
+ return !p_185646_0_.hasTileEntity();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -280,7 +280,9 @@
|
||||
for(int j = list2.size() - 1; j >= 0; --j) {
|
||||
BlockPos blockpos2 = list2.get(j);
|
||||
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos2);
|
||||
- iblockstate.func_196949_c(p_176319_1_, blockpos2, 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_196941_a(p_176319_1_, blockpos2, chance, 0);
|
||||
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
|
||||
--k;
|
||||
aiblockstate[k] = iblockstate;
|
||||
@@ -333,6 +335,10 @@
|
||||
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
|
||||
}
|
||||
|
||||
+ public IBlockState rotate(IBlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) {
|
||||
+ return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction);
|
||||
+ }
|
||||
+
|
||||
public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) {
|
||||
return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176387_N)));
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ b/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -86,14 +86,22 @@
|
||||
}
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
+ if (false && !p_196255_2_.field_72995_K) { //Forge: Noop this out
|
||||
TileEntityPiston tileentitypiston = this.func_196342_a(p_196255_2_, p_196255_3_);
|
||||
if (tileentitypiston != null) {
|
||||
tileentitypiston.func_200230_i().func_196949_c(p_196255_2_, p_196255_3_, 0);
|
||||
}
|
||||
}
|
||||
+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, 1, p_196255_5_); // mimic vanilla behavior from above and ignore chance
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ TileEntityPiston te = this.func_196342_a(world, pos);
|
||||
+ if (te != null)
|
||||
+ te.func_200230_i().getDrops(drops, world, pos, fortune);
|
||||
+ }
|
||||
+
|
||||
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
|
||||
return VoxelShapes.func_197880_a();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockPortal.java
|
||||
+++ b/net/minecraft/block/BlockPortal.java
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) {
|
||||
BlockPortal.Size blockportal$size = this.func_201816_b(p_176548_1_, p_176548_2_);
|
||||
- if (blockportal$size != null) {
|
||||
+ if (blockportal$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, blockportal$size)) {
|
||||
blockportal$size.func_150859_c();
|
||||
return true;
|
||||
} else {
|
||||
@@ -0,0 +1,25 @@
|
||||
--- a/net/minecraft/block/BlockPotato.java
|
||||
+++ b/net/minecraft/block/BlockPotato.java
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
+ if (false && !p_196255_2_.field_72995_K) { //Forge: Moved to getDrops
|
||||
if (this.func_185525_y(p_196255_1_) && p_196255_2_.field_73012_v.nextInt(50) == 0) {
|
||||
func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(Items.field_151170_bI));
|
||||
}
|
||||
@@ -34,6 +34,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ super.getDrops(state, drops, world, pos, fortune);
|
||||
+ if (this.func_185525_y(state) && world.field_73012_v.nextInt(50) == 0)
|
||||
+ drops.add(new ItemStack(Items.field_151170_bI));
|
||||
+ }
|
||||
+
|
||||
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
|
||||
return field_196396_a[p_196244_1_.func_177229_b(this.func_185524_e())];
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
--- a/net/minecraft/block/BlockRailBase.java
|
||||
+++ b/net/minecraft/block/BlockRailBase.java
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) {
|
||||
- RailShape railshape = p_196244_1_.func_177230_c() == this ? p_196244_1_.func_177229_b(this.func_176560_l()) : null;
|
||||
+ RailShape railshape = p_196244_1_.func_177230_c() == this ? getRailDirection(p_196244_1_, p_196244_2_, p_196244_3_, null) : null;
|
||||
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
- return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q();
|
||||
+ return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
|
||||
}
|
||||
|
||||
public void func_196259_b(IBlockState p_196259_1_, World p_196259_2_, BlockPos p_196259_3_, IBlockState p_196259_4_) {
|
||||
@@ -67,19 +67,19 @@
|
||||
|
||||
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_.field_72995_K) {
|
||||
- RailShape railshape = p_189540_1_.func_177229_b(this.func_176560_l());
|
||||
+ RailShape railshape = getRailDirection(p_189540_1_, p_189540_2_, p_189540_3_, 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()).func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q()) {
|
||||
+ if (railshape == RailShape.ASCENDING_EAST && p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_193401_d(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP) != BlockFaceShape.SOLID) {
|
||||
flag = true;
|
||||
- } else if (railshape == RailShape.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q()) {
|
||||
+ } else if (railshape == RailShape.ASCENDING_WEST && p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_193401_d(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP) != BlockFaceShape.SOLID) {
|
||||
flag = true;
|
||||
- } else if (railshape == RailShape.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q()) {
|
||||
+ } else if (railshape == RailShape.ASCENDING_NORTH && p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_193401_d(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP) != BlockFaceShape.SOLID) {
|
||||
flag = true;
|
||||
- } else if (railshape == RailShape.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q()) {
|
||||
+ } else if (railshape == RailShape.ASCENDING_SOUTH && p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_193401_d(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP) != BlockFaceShape.SOLID) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState 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);
|
||||
}
|
||||
|
||||
@@ -123,5 +123,66 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ //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(IBlockState 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(IBlockState 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(IBlockState state, IBlockReader world, BlockPos pos, @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(IBlockState state, World world, BlockPos pos, net.minecraft.entity.item.EntityMinecart 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(IBlockState state, World world, BlockPos pos, net.minecraft.entity.item.EntityMinecart cart) { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockRailDetector.java
|
||||
+++ b/net/minecraft/block/BlockRailDetector.java
|
||||
@@ -127,6 +127,8 @@
|
||||
|
||||
public int func_180641_l(IBlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
|
||||
if (p_180641_1_.func_177229_b(field_176574_M)) {
|
||||
+ List<EntityMinecart> carts = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecart.class, null);
|
||||
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
|
||||
List<EntityMinecartCommandBlock> list = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class, (Predicate<Entity>)null);
|
||||
if (!list.isEmpty()) {
|
||||
return list.get(0).func_145822_e().func_145760_g();
|
||||
@@ -0,0 +1,29 @@
|
||||
--- a/net/minecraft/block/BlockRailPowered.java
|
||||
+++ b/net/minecraft/block/BlockRailPowered.java
|
||||
@@ -15,10 +15,16 @@
|
||||
public class BlockRailPowered extends BlockRailBase {
|
||||
public static final EnumProperty<RailShape> field_176568_b = BlockStateProperties.field_208166_S;
|
||||
public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u;
|
||||
+ private final boolean isActivator;
|
||||
|
||||
protected BlockRailPowered(Block.Properties p_i48349_1_) {
|
||||
- super(true, p_i48349_1_);
|
||||
+ this(p_i48349_1_, false);
|
||||
+ }
|
||||
+
|
||||
+ protected BlockRailPowered(Block.Properties builder, boolean isActivator) {
|
||||
+ super(true, builder);
|
||||
this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176568_b, RailShape.NORTH_SOUTH).func_206870_a(field_176569_M, Boolean.valueOf(false)));
|
||||
+ this.isActivator = isActivator;
|
||||
}
|
||||
|
||||
protected boolean func_176566_a(World p_176566_1_, BlockPos p_176566_2_, IBlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
|
||||
@@ -100,7 +106,7 @@
|
||||
|
||||
protected boolean func_208071_a(World p_208071_1_, BlockPos p_208071_2_, boolean p_208071_3_, int p_208071_4_, RailShape p_208071_5_) {
|
||||
IBlockState iblockstate = p_208071_1_.func_180495_p(p_208071_2_);
|
||||
- if (iblockstate.func_177230_c() != this) {
|
||||
+ if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator) {
|
||||
return false;
|
||||
} else {
|
||||
RailShape railshape = iblockstate.func_177229_b(field_176568_b);
|
||||
@@ -0,0 +1,57 @@
|
||||
--- a/net/minecraft/block/BlockRailState.java
|
||||
+++ b/net/minecraft/block/BlockRailState.java
|
||||
@@ -16,14 +16,16 @@
|
||||
private IBlockState field_196923_d;
|
||||
private final boolean field_208513_e;
|
||||
private final List<BlockPos> field_196924_e = Lists.newArrayList();
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public BlockRailState(World p_i47755_1_, BlockPos p_i47755_2_, IBlockState p_i47755_3_) {
|
||||
this.field_196920_a = p_i47755_1_;
|
||||
this.field_196921_b = p_i47755_2_;
|
||||
this.field_196923_d = p_i47755_3_;
|
||||
this.field_196922_c = (BlockRailBase)p_i47755_3_.func_177230_c();
|
||||
- RailShape railshape = p_i47755_3_.func_177229_b(this.field_196922_c.func_176560_l());
|
||||
- this.field_208513_e = this.field_196922_c.func_208490_b();
|
||||
+ RailShape railshape = this.field_196922_c.getRailDirection(field_196923_d, p_i47755_1_, p_i47755_2_, null);
|
||||
+ this.field_208513_e = this.field_196922_c.isFlexibleRail(field_196923_d, p_i47755_1_, p_i47755_2_);
|
||||
+ this.canMakeSlopes = this.field_196922_c.canMakeSlopes(field_196923_d, p_i47755_1_, p_i47755_2_);
|
||||
this.func_208509_a(railshape);
|
||||
}
|
||||
|
||||
@@ -179,7 +181,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.NORTH_SOUTH) {
|
||||
+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) {
|
||||
if (BlockRailBase.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -189,7 +191,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.EAST_WEST) {
|
||||
+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) {
|
||||
if (BlockRailBase.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
@@ -299,7 +301,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.NORTH_SOUTH) {
|
||||
+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) {
|
||||
if (BlockRailBase.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -309,7 +311,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.EAST_WEST) {
|
||||
+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) {
|
||||
if (BlockRailBase.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ b/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -156,4 +156,16 @@
|
||||
protected void func_206840_a(StateContainer.Builder<Block, IBlockState> p_206840_1_) {
|
||||
p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onNeighborChange(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, BlockPos neighbor) {
|
||||
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World)world).func_201670_d()) {
|
||||
+ func_189540_a(state, (World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/block/BlockRedstoneDiode.java
|
||||
+++ b/net/minecraft/block/BlockRedstoneDiode.java
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
- return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q();
|
||||
+ return p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_185896_q() || p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
|
||||
}
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
@@ -172,6 +172,8 @@
|
||||
protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, IBlockState p_176400_3_) {
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
--- a/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ b/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -72,11 +72,17 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- if (this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
|
||||
+ if (false && this.func_199769_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_5_) != this) {
|
||||
int i = 1 + p_196255_2_.field_73012_v.nextInt(5);
|
||||
this.func_180637_b(p_196255_2_, p_196255_3_, i);
|
||||
}
|
||||
+ }
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune) {
|
||||
+ if (!(world instanceof World) || func_199769_a(state, (World)world, pos, fortune) != this)
|
||||
+ return 1 + RANDOM.nextInt(5);
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/BlockRedstoneTorch.java
|
||||
+++ b/net/minecraft/block/BlockRedstoneTorch.java
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
public class BlockRedstoneTorch extends BlockTorch {
|
||||
public static final BooleanProperty field_196528_a = BlockStateProperties.field_208190_q;
|
||||
- private static final Map<IBlockReader, List<BlockRedstoneTorch.Toggle>> field_196529_b = Maps.newHashMap();
|
||||
+ private static final Map<IBlockReader, List<BlockRedstoneTorch.Toggle>> field_196529_b = new java.util.WeakHashMap<IBlockReader, List<BlockRedstoneTorch.Toggle>>(); // FORGE - fix vanilla MC-101233
|
||||
|
||||
protected BlockRedstoneTorch(Block.Properties p_i48342_1_) {
|
||||
super(p_i48342_1_);
|
||||
@@ -0,0 +1,71 @@
|
||||
--- a/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ b/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -124,8 +124,8 @@
|
||||
IBlockState iblockstate = p_208074_1_.func_180495_p(p_208074_2_.func_177972_a(p_208074_3_));
|
||||
IBlockState iblockstate1 = p_208074_1_.func_180495_p(p_208074_2_.func_177984_a());
|
||||
if (!iblockstate1.func_185915_l()) {
|
||||
- boolean flag = p_208074_1_.func_180495_p(blockpos).func_185896_q() || p_208074_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
|
||||
- if (flag && func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177984_a()))) {
|
||||
+ boolean flag = iblockstate.func_193401_d(p_208074_1_, blockpos, EnumFacing.UP) == BlockFaceShape.SOLID || iblockstate.func_177230_c() == Blocks.field_150426_aN;
|
||||
+ if (flag && canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177984_a()), p_208074_1_, blockpos.func_177984_a(), null)) {
|
||||
if (iblockstate.func_185898_k()) {
|
||||
return RedstoneSide.UP;
|
||||
}
|
||||
@@ -134,7 +134,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return !func_176343_a(p_208074_1_.func_180495_p(blockpos), p_208074_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177977_b()))) ? RedstoneSide.NONE : RedstoneSide.SIDE;
|
||||
+ return !canConnectTo(p_208074_1_.func_180495_p(blockpos), p_208074_1_, blockpos, p_208074_3_) && (iblockstate.func_185915_l() || !canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177977_b()), p_208074_1_, blockpos.func_177977_b(), null)) ? RedstoneSide.NONE : RedstoneSide.SIDE;
|
||||
}
|
||||
|
||||
public boolean func_149686_d(IBlockState p_149686_1_) {
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
IBlockState iblockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
- return iblockstate.func_185896_q() || iblockstate.func_177230_c() == Blocks.field_150426_aN;
|
||||
+ return iblockstate.func_185896_q() || iblockstate.func_177230_c() == Blocks.field_150426_aN || iblockstate.func_193401_d(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID;
|
||||
}
|
||||
|
||||
private IBlockState func_176338_e(World p_176338_1_, BlockPos p_176338_2_, IBlockState p_176338_3_) {
|
||||
@@ -338,26 +338,18 @@
|
||||
IBlockState iblockstate = p_176339_1_.func_180495_p(blockpos);
|
||||
boolean flag = iblockstate.func_185915_l();
|
||||
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_185915_l();
|
||||
- if (!flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a())) {
|
||||
+ if (!flag1 && flag && canConnectTo(p_176339_1_.func_180495_p(blockpos.func_177984_a()), p_176339_1_, blockpos.func_177984_a(), null)) {
|
||||
return true;
|
||||
- } else if (func_176343_a(iblockstate, p_176339_3_)) {
|
||||
+ } else if (canConnectTo(iblockstate, p_176339_1_, blockpos, p_176339_3_)) {
|
||||
return true;
|
||||
} else if (iblockstate.func_177230_c() == Blocks.field_196633_cV && iblockstate.func_177229_b(BlockRedstoneDiode.field_196348_c) && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_) {
|
||||
return true;
|
||||
} else {
|
||||
- return !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b());
|
||||
+ return !flag && canConnectTo(p_176339_1_.func_180495_p(blockpos.func_177977_b()), p_176339_1_, blockpos.func_177977_b(), null);
|
||||
}
|
||||
}
|
||||
|
||||
- protected static boolean func_176340_e(IBlockReader p_176340_0_, BlockPos p_176340_1_) {
|
||||
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176346_d(IBlockState p_176346_0_) {
|
||||
- return func_176343_a(p_176346_0_, (EnumFacing)null);
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176343_a(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_) {
|
||||
+ protected boolean canConnectTo(IBlockState p_176343_0_, IBlockReader world, BlockPos pos, @Nullable EnumFacing p_176343_1_) {
|
||||
Block block = p_176343_0_.func_177230_c();
|
||||
if (block == Blocks.field_150488_af) {
|
||||
return true;
|
||||
@@ -367,7 +359,7 @@
|
||||
} else if (Blocks.field_190976_dk == p_176343_0_.func_177230_c()) {
|
||||
return p_176343_1_ == p_176343_0_.func_177229_b(BlockObserver.field_176387_N);
|
||||
} else {
|
||||
- return p_176343_0_.func_185897_m() && p_176343_1_ != null;
|
||||
+ return p_176343_0_.canConnectRedstone(world, pos, p_176343_1_) && p_176343_1_ != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
--- a/net/minecraft/block/BlockReed.java
|
||||
+++ b/net/minecraft/block/BlockReed.java
|
||||
@@ -18,7 +18,7 @@
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockReed extends Block {
|
||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable {
|
||||
public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X;
|
||||
protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D);
|
||||
|
||||
@@ -40,12 +40,15 @@
|
||||
|
||||
if (i < 3) {
|
||||
int j = p_196267_1_.func_177229_b(field_176355_a);
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, true)) {
|
||||
if (j == 15) {
|
||||
p_196267_2_.func_175656_a(p_196267_3_.func_177984_a(), this.func_176223_P());
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4);
|
||||
} else {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +59,9 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
+ IBlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
+ if (soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), EnumFacing.UP, this)) return true;
|
||||
+
|
||||
Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c();
|
||||
if (block == this) {
|
||||
return true;
|
||||
@@ -91,4 +97,14 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockReader world, BlockPos pos) {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Beach;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/block/BlockSapling.java
|
||||
+++ b/net/minecraft/block/BlockSapling.java
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_196267_2_.func_201696_r(p_196267_3_.func_177984_a()) >= 9 && p_196267_4_.nextInt(7) == 0) {
|
||||
this.func_176478_d(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_);
|
||||
}
|
||||
@@ -39,6 +40,7 @@
|
||||
if (p_176478_3_.func_177229_b(field_176479_b) == 0) {
|
||||
p_176478_1_.func_180501_a(p_176478_2_, p_176478_3_.func_177231_a(field_176479_b), 4);
|
||||
} else {
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_176478_1_, p_176478_4_, p_176478_2_)) return;
|
||||
this.field_196387_c.func_196935_a(p_176478_1_, p_176478_2_, p_176478_3_, p_176478_4_);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/block/BlockShearableDoublePlant.java
|
||||
+++ b/net/minecraft/block/BlockShearableDoublePlant.java
|
||||
@@ -11,7 +11,7 @@
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockShearableDoublePlant extends BlockDoublePlant {
|
||||
+public class BlockShearableDoublePlant extends BlockDoublePlant implements net.minecraftforge.common.IShearable {
|
||||
public static final EnumProperty<DoubleBlockHalf> field_208063_b = BlockDoublePlant.field_176492_b;
|
||||
private final Block field_196392_b;
|
||||
|
||||
@@ -26,9 +26,7 @@
|
||||
}
|
||||
|
||||
protected void func_196391_a(IBlockState p_196391_1_, World p_196391_2_, BlockPos p_196391_3_, ItemStack p_196391_4_) {
|
||||
- if (p_196391_4_.func_77973_b() == Items.field_151097_aZ) {
|
||||
- func_180635_a(p_196391_2_, p_196391_3_, new ItemStack(this.field_196392_b, 2));
|
||||
- } else {
|
||||
+ {
|
||||
super.func_196391_a(p_196391_1_, p_196391_2_, p_196391_3_, p_196391_4_);
|
||||
}
|
||||
|
||||
@@ -37,4 +35,15 @@
|
||||
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
|
||||
return p_199769_1_.func_177229_b(field_208063_b) == DoubleBlockHalf.LOWER && this == Blocks.field_196804_gh && p_199769_2_.field_73012_v.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, net.minecraft.world.IWorldReader world, BlockPos pos) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this.field_196392_b, 2));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
--- a/net/minecraft/block/BlockSnowLayer.java
|
||||
+++ b/net/minecraft/block/BlockSnowLayer.java
|
||||
@@ -84,30 +84,45 @@
|
||||
|
||||
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_) {
|
||||
Integer integer = p_180657_4_.func_177229_b(field_176315_a);
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
+ net.minecraft.util.NonNullList<ItemStack> items = net.minecraft.util.NonNullList.func_191196_a();
|
||||
+ int fortune = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
|
||||
+ float chance = 1.0f;
|
||||
+
|
||||
+ if (this.canSilkHarvest(p_180657_4_, p_180657_1_, p_180657_3_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) {
|
||||
if (integer == 8) {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_196604_cC));
|
||||
+ items.add(new ItemStack(Blocks.field_196604_cC));
|
||||
} else {
|
||||
for(int i = 0; i < integer; ++i) {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_));
|
||||
+ items.add(this.func_180643_i(p_180657_4_));
|
||||
}
|
||||
}
|
||||
+ chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
|
||||
} else {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, integer));
|
||||
+ getDrops(p_180657_4_, items, p_180657_1_, p_180657_3_, fortune);
|
||||
+ chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, fortune, 1.0f, false, p_180657_2_);
|
||||
}
|
||||
|
||||
+ for (ItemStack item : items) {
|
||||
+ if (p_180657_1_.field_73012_v.nextFloat() <= chance)
|
||||
+ func_180635_a(p_180657_1_, p_180657_3_, item);
|
||||
+ }
|
||||
+
|
||||
p_180657_1_.func_175698_g(p_180657_3_);
|
||||
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
||||
p_180657_2_.func_71020_j(0.005F);
|
||||
}
|
||||
|
||||
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
|
||||
- return Items.field_190931_a;
|
||||
+ return Items.field_151126_ay;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int func_196264_a(IBlockState state, Random random) {
|
||||
+ return state.func_177229_b(field_176315_a) + 1;
|
||||
+ }
|
||||
+
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
if (p_196267_2_.func_175642_b(EnumLightType.BLOCK, p_196267_3_) > 11) {
|
||||
- p_196267_1_.func_196949_c(p_196267_2_, p_196267_3_, 0);
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--- a/net/minecraft/block/BlockStem.java
|
||||
+++ b/net/minecraft/block/BlockStem.java
|
||||
@@ -39,22 +39,24 @@
|
||||
|
||||
public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_);
|
||||
+ if (!p_196267_2_.func_205050_e(p_196267_3_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light
|
||||
if (p_196267_2_.func_201669_a(p_196267_3_.func_177984_a(), 0) >= 9) {
|
||||
float f = BlockCrops.func_180672_a(this, p_196267_2_, p_196267_3_);
|
||||
- if (p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0) {
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) {
|
||||
int i = p_196267_1_.func_177229_b(field_176484_a);
|
||||
if (i < 7) {
|
||||
- p_196267_1_ = p_196267_1_.func_206870_a(field_176484_a, Integer.valueOf(i + 1));
|
||||
- p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2);
|
||||
+ p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176484_a, i + 1), 2);
|
||||
} else {
|
||||
EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_196267_4_);
|
||||
BlockPos blockpos = p_196267_3_.func_177972_a(enumfacing);
|
||||
- Block block = p_196267_2_.func_180495_p(blockpos.func_177977_b()).func_177230_c();
|
||||
- if (p_196267_2_.func_180495_p(blockpos).func_196958_f() && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_196660_k || block == Blocks.field_196661_l || block == Blocks.field_196658_i)) {
|
||||
+ IBlockState soil = p_196267_2_.func_180495_p(blockpos.func_177977_b());
|
||||
+ Block block = soil.func_177230_c();
|
||||
+ if (p_196267_2_.func_180495_p(blockpos).isAir(p_196267_2_, blockpos) && (soil.canSustainPlant(p_196267_2_, blockpos.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_196660_k || block == Blocks.field_196661_l || block == Blocks.field_196658_i)) {
|
||||
p_196267_2_.func_175656_a(blockpos, this.field_149877_a.func_176223_P());
|
||||
p_196267_2_.func_175656_a(p_196267_3_, this.field_149877_a.func_196523_e().func_176223_P().func_206870_a(BlockHorizontal.field_185512_D, enumfacing));
|
||||
}
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,14 +64,18 @@
|
||||
|
||||
public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) {
|
||||
super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_);
|
||||
- if (!p_196255_2_.field_72995_K) {
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ {
|
||||
Item item = this.func_176481_j();
|
||||
if (item != null) {
|
||||
- int i = p_196255_1_.func_177229_b(field_176484_a);
|
||||
+ int i = state.func_177229_b(field_176484_a);
|
||||
|
||||
for(int j = 0; j < 3; ++j) {
|
||||
- if (p_196255_2_.field_73012_v.nextInt(15) <= i) {
|
||||
- func_180635_a(p_196255_2_, p_196255_3_, new ItemStack(item));
|
||||
+ if (world.field_73012_v.nextInt(15) <= i) {
|
||||
+ drops.add(new ItemStack(item));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/net/minecraft/block/BlockTallGrass.java
|
||||
+++ b/net/minecraft/block/BlockTallGrass.java
|
||||
@@ -15,7 +15,7 @@
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockTallGrass extends BlockBush implements IGrowable {
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable {
|
||||
protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D);
|
||||
|
||||
protected BlockTallGrass(Block.Properties p_i48310_1_) {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
|
||||
- return p_199769_2_.field_73012_v.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a;
|
||||
+ return Items.field_190931_a;
|
||||
}
|
||||
|
||||
public int func_196251_a(IBlockState p_196251_1_, int p_196251_2_, World p_196251_3_, BlockPos p_196251_4_, Random p_196251_5_) {
|
||||
@@ -64,4 +64,18 @@
|
||||
public Block.EnumOffsetType func_176218_Q() {
|
||||
return Block.EnumOffsetType.XYZ;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList<ItemStack> drops, World world, BlockPos pos, int fortune) {
|
||||
+ if (world.field_73012_v.nextInt(8) != 0) return;
|
||||
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(world.field_73012_v, fortune);
|
||||
+ if (!seed.func_190926_b())
|
||||
+ drops.add(seed);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/net/minecraft/block/BlockTorch.java
|
||||
+++ b/net/minecraft/block/BlockTorch.java
|
||||
@@ -37,9 +37,7 @@
|
||||
|
||||
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
|
||||
IBlockState iblockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
- Block block = iblockstate.func_177230_c();
|
||||
- boolean flag = block instanceof BlockFence || block instanceof BlockStainedGlass || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_196723_eg || iblockstate.func_185896_q();
|
||||
- return flag && block != Blocks.field_185775_db;
|
||||
+ return iblockstate.canPlaceTorchOnTop(p_196260_2_, p_196260_3_);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/block/BlockTrapDoor.java
|
||||
+++ b/net/minecraft/block/BlockTrapDoor.java
|
||||
@@ -186,4 +186,14 @@
|
||||
|
||||
return super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
|
||||
+ if (state.func_177229_b(field_176283_b)) {
|
||||
+ IBlockState down = world.func_180495_p(pos.func_177977_b());
|
||||
+ if (down.func_177230_c() == net.minecraft.init.Blocks.field_150468_ap)
|
||||
+ return down.func_177229_b(BlockLadder.field_176382_a) == state.func_177229_b(field_185512_D);
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
--- a/net/minecraft/block/BlockVine.java
|
||||
+++ b/net/minecraft/block/BlockVine.java
|
||||
@@ -29,7 +29,7 @@
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockVine extends Block {
|
||||
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable {
|
||||
public static final BooleanProperty field_176277_a = BlockSixWay.field_196496_z;
|
||||
public static final BooleanProperty field_176273_b = BlockSixWay.field_196488_a;
|
||||
public static final BooleanProperty field_176278_M = BlockSixWay.field_196490_b;
|
||||
@@ -171,7 +171,7 @@
|
||||
p_196267_2_.func_175698_g(p_196267_3_);
|
||||
}
|
||||
|
||||
- } else if (p_196267_2_.field_73012_v.nextInt(4) == 0) {
|
||||
+ } else if (p_196267_2_.field_73012_v.nextInt(4) == 0 && p_196267_2_.func_205050_e(p_196267_3_, 4)) { // Forge: check area to prevent loading unloaded chunks
|
||||
EnumFacing enumfacing = EnumFacing.func_176741_a(p_196267_4_);
|
||||
BlockPos blockpos = p_196267_3_.func_177984_a();
|
||||
if (enumfacing.func_176740_k().func_176722_c() && !p_196267_1_.func_177229_b(func_176267_a(enumfacing))) {
|
||||
@@ -365,4 +365,15 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.EntityLivingBase entity) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
--- a/net/minecraft/block/BlockWall.java
|
||||
+++ b/net/minecraft/block/BlockWall.java
|
||||
@@ -51,6 +51,18 @@
|
||||
return !func_194143_e(block) && p_196421_2_ == BlockFaceShape.SOLID || flag;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean canBeConnectedTo(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ IBlockState other = world.func_180495_p(pos.func_177972_a(facing));
|
||||
+ return func_196421_a(other, other.func_193401_d(world, pos.func_177972_a(facing), facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
+ private boolean canWallConnectTo(IBlockReader world, BlockPos pos, EnumFacing facing) {
|
||||
+ BlockPos off = pos.func_177972_a(facing);
|
||||
+ IBlockState other = world.func_180495_p(off);
|
||||
+ return other.canBeConnectedTo(world, off, facing.func_176734_d()) || func_196421_a(other, other.func_193401_d(world, off, facing.func_176734_d()));
|
||||
+ }
|
||||
+
|
||||
public static boolean func_194143_e(Block p_194143_0_) {
|
||||
return Block.func_193382_c(p_194143_0_) || p_194143_0_ == Blocks.field_180401_cv || p_194143_0_ == Blocks.field_150440_ba || p_194143_0_ == Blocks.field_150423_aK || p_194143_0_ == Blocks.field_196625_cS || p_194143_0_ == Blocks.field_196628_cT || p_194143_0_ == Blocks.field_185778_de || p_194143_0_ == Blocks.field_150335_W;
|
||||
}
|
||||
@@ -59,18 +71,10 @@
|
||||
IWorldReaderBase iworldreaderbase = p_196258_1_.func_195991_k();
|
||||
BlockPos blockpos = p_196258_1_.func_195995_a();
|
||||
IFluidState ifluidstate = p_196258_1_.func_195991_k().func_204610_c(p_196258_1_.func_195995_a());
|
||||
- BlockPos blockpos1 = blockpos.func_177978_c();
|
||||
- BlockPos blockpos2 = blockpos.func_177974_f();
|
||||
- BlockPos blockpos3 = blockpos.func_177968_d();
|
||||
- BlockPos blockpos4 = blockpos.func_177976_e();
|
||||
- IBlockState iblockstate = iworldreaderbase.func_180495_p(blockpos1);
|
||||
- IBlockState iblockstate1 = iworldreaderbase.func_180495_p(blockpos2);
|
||||
- IBlockState iblockstate2 = iworldreaderbase.func_180495_p(blockpos3);
|
||||
- IBlockState iblockstate3 = iworldreaderbase.func_180495_p(blockpos4);
|
||||
- boolean flag = this.func_196421_a(iblockstate, iblockstate.func_193401_d(iworldreaderbase, blockpos1, EnumFacing.SOUTH));
|
||||
- boolean flag1 = this.func_196421_a(iblockstate1, iblockstate1.func_193401_d(iworldreaderbase, blockpos2, EnumFacing.WEST));
|
||||
- boolean flag2 = this.func_196421_a(iblockstate2, iblockstate2.func_193401_d(iworldreaderbase, blockpos3, EnumFacing.NORTH));
|
||||
- boolean flag3 = this.func_196421_a(iblockstate3, iblockstate3.func_193401_d(iworldreaderbase, blockpos4, EnumFacing.EAST));
|
||||
+ boolean flag = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.NORTH);
|
||||
+ boolean flag1 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.EAST);
|
||||
+ boolean flag2 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.SOUTH);
|
||||
+ boolean flag3 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.WEST);
|
||||
boolean flag4 = (!flag || flag1 || !flag2 || flag3) && (flag || !flag1 || flag2 || !flag3);
|
||||
return this.func_176223_P().func_206870_a(field_176256_a, Boolean.valueOf(flag4 || !iworldreaderbase.func_175623_d(blockpos.func_177984_a()))).func_206870_a(field_196409_a, Boolean.valueOf(flag)).func_206870_a(field_196411_b, Boolean.valueOf(flag1)).func_206870_a(field_196413_c, Boolean.valueOf(flag2)).func_206870_a(field_196414_y, Boolean.valueOf(flag3)).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a));
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
--- a/net/minecraft/block/BlockWeb.java
|
||||
+++ b/net/minecraft/block/BlockWeb.java
|
||||
@@ -5,6 +5,7 @@
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
+import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
@@ -16,7 +17,7 @@
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockWeb extends Block {
|
||||
+public class BlockWeb extends Block implements net.minecraftforge.common.IShearable {
|
||||
public BlockWeb(Block.Properties p_i48296_1_) {
|
||||
super(p_i48296_1_);
|
||||
}
|
||||
@@ -54,4 +55,10 @@
|
||||
public BlockFaceShape func_193383_a(IBlockReader p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IWorld world, BlockPos pos, int fortune) {
|
||||
+ world.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11);
|
||||
+ return java.util.Arrays.asList(new ItemStack(this));
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/block/ITileEntityProvider.java
|
||||
+++ b/net/minecraft/block/ITileEntityProvider.java
|
||||
@@ -4,6 +4,7 @@
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
+@Deprecated //Forge: Do not use, use IBlockState.hasTileEntity/Blocks.createTileEntity
|
||||
public interface ITileEntityProvider {
|
||||
@Nullable
|
||||
TileEntity func_196283_a_(IBlockReader p_196283_1_);
|
||||
@@ -0,0 +1,27 @@
|
||||
--- a/net/minecraft/block/SoundType.java
|
||||
+++ b/net/minecraft/block/SoundType.java
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
-import net.minecraftforge.api.distmarker.Dist;
|
||||
-import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class SoundType {
|
||||
public static final SoundType field_185848_a = new SoundType(1.0F, 1.0F, SoundEvents.field_187881_gQ, SoundEvents.field_187897_gY, SoundEvents.field_187891_gV, SoundEvents.field_187889_gU, SoundEvents.field_187887_gT);
|
||||
@@ -46,7 +44,6 @@
|
||||
return this.field_185861_n;
|
||||
}
|
||||
|
||||
- @OnlyIn(Dist.CLIENT)
|
||||
public SoundEvent func_185845_c() {
|
||||
return this.field_185862_o;
|
||||
}
|
||||
@@ -59,7 +56,6 @@
|
||||
return this.field_185864_q;
|
||||
}
|
||||
|
||||
- @OnlyIn(Dist.CLIENT)
|
||||
public SoundEvent func_185846_f() {
|
||||
return this.field_185865_r;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
--- a/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
+++ b/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
@@ -51,7 +51,7 @@
|
||||
} else {
|
||||
for(int i = 0; i < this.field_177258_e.size(); ++i) {
|
||||
BlockPos blockpos = this.field_177258_e.get(i);
|
||||
- if (this.field_177261_a.func_180495_p(blockpos).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos)) {
|
||||
+ if (this.field_177261_a.func_180495_p(blockpos).isStickyBlock() && !this.func_177250_b(blockpos)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -62,8 +62,7 @@
|
||||
|
||||
private boolean func_177251_a(BlockPos p_177251_1_, EnumFacing p_177251_2_) {
|
||||
IBlockState iblockstate = this.field_177261_a.func_180495_p(p_177251_1_);
|
||||
- Block block = iblockstate.func_177230_c();
|
||||
- if (iblockstate.func_196958_f()) {
|
||||
+ if (iblockstate.isAir(field_177261_a, p_177251_1_)) {
|
||||
return true;
|
||||
} else if (!BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, p_177251_1_, this.field_177257_d, false, p_177251_2_)) {
|
||||
return true;
|
||||
@@ -76,11 +75,10 @@
|
||||
if (i + this.field_177258_e.size() > 12) {
|
||||
return false;
|
||||
} else {
|
||||
- while(block == Blocks.field_180399_cE) {
|
||||
+ while(iblockstate.isStickyBlock()) {
|
||||
BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
|
||||
iblockstate = this.field_177261_a.func_180495_p(blockpos);
|
||||
- block = iblockstate.func_177230_c();
|
||||
- if (iblockstate.func_196958_f() || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) {
|
||||
+ if (iblockstate.isAir(field_177261_a, blockpos) || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -107,7 +105,7 @@
|
||||
|
||||
for(int l = 0; l <= k + i1; ++l) {
|
||||
BlockPos blockpos2 = this.field_177258_e.get(l);
|
||||
- if (this.field_177261_a.func_180495_p(blockpos2).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos2)) {
|
||||
+ if (this.field_177261_a.func_180495_p(blockpos2).isStickyBlock() && !this.func_177250_b(blockpos2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +114,7 @@
|
||||
}
|
||||
|
||||
iblockstate = this.field_177261_a.func_180495_p(blockpos1);
|
||||
- if (iblockstate.func_196958_f()) {
|
||||
+ if (iblockstate.isAir(field_177261_a, blockpos1)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,22 @@
|
||||
|
||||
-public interface IBlockState extends IStateHolder<IBlockState> {
|
||||
+public interface IBlockState extends IStateHolder<IBlockState>, net.minecraftforge.common.extensions.IForgeBlockState {
|
||||
ThreadLocal<Object2ByteMap<IBlockState>> field_208776_a = ThreadLocal.<Object2ByteMap<IBlockState>>withInitial(() -> {
|
||||
Object2ByteOpenHashMap<IBlockState> object2byteopenhashmap = new Object2ByteOpenHashMap<IBlockState>();
|
||||
ThreadLocal<Object2ByteMap<IBlockState>> field_208776_a = ThreadLocal.withInitial(() -> {
|
||||
Object2ByteOpenHashMap<IBlockState> object2byteopenhashmap = new Object2ByteOpenHashMap<>();
|
||||
object2byteopenhashmap.defaultReturnValue((byte)127);
|
||||
@@ -97,6 +97,7 @@
|
||||
return this.func_177230_c().func_149750_m(this);
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use position sensitive version
|
||||
default boolean func_196958_f() {
|
||||
return this.func_177230_c().func_196261_e(this);
|
||||
}
|
||||
@@ -109,6 +110,7 @@
|
||||
return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_);
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use position sensitive version
|
||||
default IBlockState func_185907_a(Rotation p_185907_1_) {
|
||||
return this.func_177230_c().func_185499_a(this, p_185907_1_);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/net/minecraft/block/trees/JungleTree.java
|
||||
+++ b/net/minecraft/block/trees/JungleTree.java
|
||||
@@ -11,11 +11,11 @@
|
||||
public class JungleTree extends AbstractBigTree {
|
||||
@Nullable
|
||||
protected AbstractTreeFeature<NoFeatureConfig> func_196936_b(Random p_196936_1_) {
|
||||
- return new TreeFeature(true, 4 + p_196936_1_.nextInt(7), Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P(), false);
|
||||
+ return new TreeFeature(true, 4 + p_196936_1_.nextInt(7), Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P(), false).setSapling((net.minecraft.block.BlockSapling)Blocks.field_196678_w);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected AbstractTreeFeature<NoFeatureConfig> func_196938_a(Random p_196938_1_) {
|
||||
- return new MegaJungleFeature(true, 10, 20, Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P());
|
||||
+ return new MegaJungleFeature(true, 10, 20, Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P()).setSapling((net.minecraft.block.BlockSapling)Blocks.field_196678_w);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
--- a/net/minecraft/client/GameSettings.java
|
||||
+++ b/net/minecraft/client/GameSettings.java
|
||||
@@ -167,6 +167,7 @@
|
||||
public boolean field_211842_aO;
|
||||
|
||||
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
|
||||
+ setForgeKeybindProperties();
|
||||
this.field_74317_L = p_i46326_1_;
|
||||
this.field_74354_ai = new File(p_i46326_2_, "options.txt");
|
||||
if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
|
||||
@@ -180,6 +181,7 @@
|
||||
}
|
||||
|
||||
public GameSettings() {
|
||||
+ setForgeKeybindProperties();
|
||||
}
|
||||
|
||||
public void func_198014_a(KeyBinding p_198014_1_, InputMappings.Input p_198014_2_) {
|
||||
@@ -236,7 +238,7 @@
|
||||
this.field_74317_L.func_147117_R().func_147633_a(this.field_151442_I);
|
||||
this.field_74317_L.func_110434_K().func_110577_a(TextureMap.field_110575_b);
|
||||
this.field_74317_L.func_147117_R().func_174937_a(false, this.field_151442_I > 0);
|
||||
- this.field_74317_L.func_175603_A();
|
||||
+ this.needsBlockModelRefresh = true; // FORGE: fix for MC-64581 very laggy mipmap slider
|
||||
}
|
||||
}
|
||||
|
||||
@@ -846,7 +848,11 @@
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
if (s1.equals("key_" + keybinding.func_151464_g())) {
|
||||
- keybinding.func_197979_b(InputMappings.func_197955_a(s2));
|
||||
+ if (s2.indexOf(':') != -1) {
|
||||
+ String[] pts = s2.split(":");
|
||||
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(pts[1]), InputMappings.func_197955_a(pts[0]));
|
||||
+ } else
|
||||
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, InputMappings.func_197955_a(s2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,6 +900,7 @@
|
||||
}
|
||||
|
||||
public void func_74303_b() {
|
||||
+ if (net.minecraftforge.fml.client.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
|
||||
PrintWriter printwriter = null;
|
||||
|
||||
try {
|
||||
@@ -971,7 +978,7 @@
|
||||
printwriter.println("glDebugVerbosity:" + this.field_209231_W);
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
- printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m());
|
||||
+ printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m() + (keybinding.getKeyModifier() != net.minecraftforge.client.settings.KeyModifier.NONE ? ":" + keybinding.getKeyModifier() : ""));
|
||||
}
|
||||
|
||||
for(SoundCategory soundcategory : SoundCategory.values()) {
|
||||
@@ -1073,6 +1080,33 @@
|
||||
p_198017_1_.func_198985_a(set);
|
||||
}
|
||||
|
||||
+ private void setForgeKeybindProperties() {
|
||||
+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
|
||||
+ field_74351_w.setKeyConflictContext(inGame);
|
||||
+ field_74370_x.setKeyConflictContext(inGame);
|
||||
+ field_74368_y.setKeyConflictContext(inGame);
|
||||
+ field_74366_z.setKeyConflictContext(inGame);
|
||||
+ field_74314_A.setKeyConflictContext(inGame);
|
||||
+ field_74311_E.setKeyConflictContext(inGame);
|
||||
+ field_151444_V.setKeyConflictContext(inGame);
|
||||
+ field_74312_F.setKeyConflictContext(inGame);
|
||||
+ field_74310_D.setKeyConflictContext(inGame);
|
||||
+ field_74321_H.setKeyConflictContext(inGame);
|
||||
+ field_74323_J.setKeyConflictContext(inGame);
|
||||
+ field_151457_aa.setKeyConflictContext(inGame);
|
||||
+ field_151458_ab.setKeyConflictContext(inGame);
|
||||
+ field_186718_X.setKeyConflictContext(inGame);
|
||||
+ }
|
||||
+
|
||||
+ // FORGE: fix for MC-64581 very laggy mipmap slider
|
||||
+ private boolean needsBlockModelRefresh = false;
|
||||
+ public void onGuiClosed() {
|
||||
+ if (needsBlockModelRefresh) {
|
||||
+ this.field_74317_L.func_152344_a(() -> net.minecraftforge.client.ForgeHooksClient.refreshResources(this.field_74317_L, net.minecraftforge.resource.VanillaResourceType.MODELS));
|
||||
+ this.needsBlockModelRefresh = false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static enum Options {
|
||||
INVERT_MOUSE("options.invertMouse", false, true),
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/client/KeyboardListener.java
|
||||
+++ b/net/minecraft/client/KeyboardListener.java
|
||||
@@ -271,10 +271,14 @@
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
|
||||
if (p_197961_5_ == 0) {
|
||||
- aboolean[0] = iguieventlistener.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = iguieventlistener.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
}
|
||||
} else {
|
||||
- aboolean[0] = iguieventlistener.keyPressed(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = iguieventlistener.keyPressed(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
}
|
||||
|
||||
}, "keyPressed event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
@@ -351,12 +355,16 @@
|
||||
if (iguieventlistener != null) {
|
||||
if (Character.charCount(p_197963_3_) == 1) {
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
- iguieventlistener.charTyped((char)p_197963_3_, p_197963_4_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.field_197972_a.field_71462_r, (char)p_197963_3_, p_197963_4_)) return;
|
||||
+ if (iguieventlistener.charTyped((char)p_197963_3_, p_197963_4_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.field_197972_a.field_71462_r, (char)p_197963_3_, p_197963_4_);
|
||||
}, "charTyped event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
} else {
|
||||
for(char c0 : Character.toChars(p_197963_3_)) {
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
- iguieventlistener.charTyped(c0, p_197963_4_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.field_197972_a.field_71462_r, c0, p_197963_4_)) return;
|
||||
+ if (iguieventlistener.charTyped(c0, p_197963_4_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.field_197972_a.field_71462_r, c0, p_197963_4_);
|
||||
}, "charTyped event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -405,6 +405,7 @@
|
||||
@@ -322,7 +322,6 @@
|
||||
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
|
||||
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
|
||||
- field_147123_G.debug("(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_147129_ai = func_147122_X();
|
||||
this.field_71437_Z = null;
|
||||
@@ -409,9 +408,11 @@
|
||||
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
|
||||
this.field_110451_am.func_199006_a(this.field_135017_as);
|
||||
this.field_71474_y.func_198017_a(this.field_110448_aq);
|
||||
@@ -8,15 +16,57 @@
|
||||
this.func_110436_a();
|
||||
this.field_71446_o = new TextureManager(this.field_110451_am);
|
||||
this.field_110451_am.func_199006_a(this.field_71446_o);
|
||||
@@ -461,6 +462,7 @@
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.textureManager);
|
||||
this.field_195558_d.func_198098_h();
|
||||
this.func_147108_a(new GuiScreenLoading());
|
||||
this.func_195547_ap();
|
||||
@@ -429,6 +430,8 @@
|
||||
|
||||
this.field_110451_am.func_199006_a(new GrassColorReloadListener());
|
||||
this.field_110451_am.func_199006_a(new FoliageColorReloadListener());
|
||||
+ try (net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Rendering Setup", 5, true)) {
|
||||
+ bar.step("GL Setup");
|
||||
this.field_195558_d.func_198076_a("Startup");
|
||||
GlStateManager.func_179098_w();
|
||||
GlStateManager.func_179103_j(7425);
|
||||
@@ -442,19 +445,24 @@
|
||||
GlStateManager.func_179096_D();
|
||||
GlStateManager.func_179128_n(5888);
|
||||
this.field_195558_d.func_198076_a("Post startup");
|
||||
+ bar.step("Loading Texture Map");
|
||||
this.field_147128_au = new TextureMap("textures");
|
||||
this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
|
||||
this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
|
||||
this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
|
||||
this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
|
||||
+ bar.step("Loading Model Manager");
|
||||
this.field_175617_aL = new ModelManager(this.field_147128_au);
|
||||
this.field_110451_am.func_199006_a(this.field_175617_aL);
|
||||
this.field_184127_aH = BlockColors.func_186723_a();
|
||||
this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
|
||||
+ bar.step("Loading Item Renderer");
|
||||
this.field_175621_X = new ItemRenderer(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
|
||||
this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
|
||||
this.field_175620_Y = new FirstPersonRenderer(this);
|
||||
this.field_110451_am.func_199006_a(this.field_175621_X);
|
||||
+ bar.step("Loading Entity Renderer");
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.pause();
|
||||
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
|
||||
this.field_110451_am.func_199006_a(this.field_71460_t);
|
||||
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
|
||||
@@ -465,7 +473,10 @@
|
||||
this.field_110451_am.func_199006_a(this.field_193995_ae);
|
||||
GlStateManager.func_179083_b(0, 0, this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
|
||||
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
|
||||
- this.field_71456_v = new GuiIngame(this);
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.resume();
|
||||
+ }; // Forge: end progress bar
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.end();
|
||||
this.field_71456_v = new GuiIngame(this);
|
||||
+ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this);
|
||||
if (this.field_71475_ae != null) {
|
||||
this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
|
||||
@@ -470,6 +472,7 @@
|
||||
} else {
|
||||
@@ -474,6 +485,7 @@
|
||||
|
||||
this.field_184132_p = new DebugRenderer(this);
|
||||
GLFW.glfwSetErrorCallback(this::func_195545_a).free();
|
||||
@@ -24,20 +74,325 @@
|
||||
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
|
||||
this.field_195558_d.func_198077_g();
|
||||
}
|
||||
@@ -485,7 +488,7 @@
|
||||
@@ -489,7 +501,7 @@
|
||||
});
|
||||
List<String> list = Lists.<String>newArrayList();
|
||||
List<String> list = Lists.newArrayList();
|
||||
GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> {
|
||||
- list.add(String.format("GLFW error during init: [0x%X]%s", p_211100_1_, p_211100_2_));
|
||||
+ list.add(String.format("GLFW error during init: [0x%X] %s", p_211100_1_, GLFWErrorCallback.getDescription(p_211100_2_)));
|
||||
});
|
||||
if (!GLFW.glfwInit()) {
|
||||
throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list));
|
||||
@@ -1392,6 +1395,7 @@
|
||||
@@ -599,7 +611,7 @@
|
||||
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
|
||||
if (p_71377_1_.func_71497_f() != null) {
|
||||
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
|
||||
- System.exit(-1);
|
||||
+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleExit(-1);
|
||||
} else if (p_71377_1_.func_147149_a(file2)) {
|
||||
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
|
||||
System.exit(-1);
|
||||
@@ -614,6 +626,7 @@
|
||||
return this.field_71474_y.field_211842_aO;
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use selective refreshResources method in FMLClientHandler
|
||||
public void func_110436_a() {
|
||||
this.field_110448_aq.func_198983_a();
|
||||
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
|
||||
@@ -668,16 +681,20 @@
|
||||
}
|
||||
|
||||
public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
|
||||
- if (this.field_71462_r != null) {
|
||||
- this.field_71462_r.func_146281_b();
|
||||
- }
|
||||
-
|
||||
if (p_147108_1_ == null && this.field_71441_e == null) {
|
||||
p_147108_1_ = new GuiMainMenu();
|
||||
} else if (p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
|
||||
p_147108_1_ = new GuiGameOver((ITextComponent)null);
|
||||
}
|
||||
|
||||
+ GuiScreen old = this.field_71462_r;
|
||||
+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+
|
||||
+ p_147108_1_ = event.getGui();
|
||||
+ if (old != null && p_147108_1_ != old)
|
||||
+ old.func_146281_b();
|
||||
+
|
||||
if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
|
||||
this.field_71474_y.field_74330_P = false;
|
||||
this.field_71456_v.func_146158_b().func_146231_a(true);
|
||||
@@ -761,7 +778,7 @@
|
||||
GLFW.glfwPollEvents();
|
||||
long i1 = Util.func_211178_c() - l;
|
||||
this.field_71424_I.func_76318_c("sound");
|
||||
- this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b);
|
||||
+ this.field_147127_av.setListener(this.func_175606_aa(), this.field_71428_T.field_194147_b); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before
|
||||
this.field_71424_I.func_76319_b();
|
||||
this.field_71424_I.func_76320_a("render");
|
||||
GlStateManager.func_179094_E();
|
||||
@@ -771,11 +788,13 @@
|
||||
GlStateManager.func_179098_w();
|
||||
this.field_71424_I.func_76319_b();
|
||||
if (!this.field_71454_w) {
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71428_T.field_194147_b);
|
||||
this.field_71424_I.func_76318_c("gameRenderer");
|
||||
this.field_71460_t.func_195458_a(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b, i, p_195542_1_);
|
||||
this.field_71424_I.func_76318_c("toasts");
|
||||
this.field_193034_aS.func_195625_a();
|
||||
this.field_71424_I.func_76319_b();
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71428_T.field_194147_b);
|
||||
}
|
||||
|
||||
this.field_71424_I.func_76319_b();
|
||||
@@ -994,8 +1013,8 @@
|
||||
if (this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
|
||||
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
|
||||
BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f() && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) {
|
||||
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
|
||||
+ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) {
|
||||
+ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x);
|
||||
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
|
||||
}
|
||||
|
||||
@@ -1020,7 +1039,7 @@
|
||||
break;
|
||||
case BLOCK:
|
||||
BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
|
||||
+ if (!this.field_71441_e.func_175623_d(blockpos)) {
|
||||
this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
|
||||
break;
|
||||
}
|
||||
@@ -1030,6 +1049,7 @@
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184821_cY();
|
||||
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.field_71439_g);
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
|
||||
@@ -1060,7 +1080,7 @@
|
||||
break;
|
||||
case BLOCK:
|
||||
BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
|
||||
+ if (!this.field_71441_e.func_180495_p(blockpos).isAir(field_71441_e, blockpos)) {
|
||||
int i = itemstack.func_190916_E();
|
||||
EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand);
|
||||
if (enumactionresult == EnumActionResult.SUCCESS) {
|
||||
@@ -1079,6 +1099,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (itemstack.func_190926_b() && (this.field_71476_x == null || this.field_71476_x.field_72313_a == RayTraceResult.Type.MISS))
|
||||
+ net.minecraftforge.common.ForgeHooks.onEmptyClick(this.field_71439_g, enumhand);
|
||||
+
|
||||
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
|
||||
this.field_71460_t.field_78516_c.func_187460_a(enumhand);
|
||||
return;
|
||||
@@ -1098,6 +1121,8 @@
|
||||
--this.field_71467_ac;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPreClientTick();
|
||||
+
|
||||
this.field_71424_I.func_76320_a("gui");
|
||||
if (!this.field_71445_n) {
|
||||
this.field_71456_v.func_73831_a();
|
||||
@@ -1220,6 +1245,8 @@
|
||||
this.field_71424_I.func_76318_c("keyboard");
|
||||
this.field_195559_v.func_204870_b();
|
||||
this.field_71424_I.func_76319_b();
|
||||
+
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
|
||||
}
|
||||
|
||||
private void func_184117_aA() {
|
||||
@@ -1396,8 +1423,14 @@
|
||||
NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
|
||||
networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
|
||||
}));
|
||||
+ net.minecraftforge.fml.network.NetworkHooks.registerClientLoginChannel(networkmanager);
|
||||
networkmanager.func_179290_a(new CPacketHandshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN));
|
||||
networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
|
||||
- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
|
||||
+ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e();
|
||||
+ if (!this.func_110432_I().hasCachedProperties()) {
|
||||
+ gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974.
|
||||
+ this.func_110432_I().setProperties(gameProfile.getProperties());
|
||||
+ }
|
||||
+ networkmanager.func_179290_a(new CPacketLoginStart(gameProfile));
|
||||
this.field_71453_ak = networkmanager;
|
||||
}
|
||||
|
||||
@@ -1411,6 +1444,7 @@
|
||||
}
|
||||
|
||||
public void func_205055_a(@Nullable WorldClient p_205055_1_, GuiScreen p_205055_2_) {
|
||||
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
|
||||
if (p_205055_1_ == null) {
|
||||
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
|
||||
if (nethandlerplayclient != null) {
|
||||
@@ -1447,6 +1481,7 @@
|
||||
}
|
||||
|
||||
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_205055_1_);
|
||||
+ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
|
||||
if (p_205055_1_ != null) {
|
||||
if (!this.field_71455_al) {
|
||||
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
|
||||
@@ -1493,6 +1528,7 @@
|
||||
EntityPlayerSP entityplayersp = this.field_71439_g;
|
||||
this.field_71439_g = this.field_71442_b.func_199681_a(this.field_71441_e, this.field_71439_g == null ? new StatisticsManager() : this.field_71439_g.func_146107_m(), this.field_71439_g == null ? new RecipeBookClient(new RecipeManager()) : this.field_71439_g.func_199507_B());
|
||||
this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
|
||||
+ this.field_71439_g.updateSyncFields(entityplayersp); // Forge: fix MC-10657
|
||||
this.field_71439_g.field_71093_bK = p_212315_1_;
|
||||
this.field_175622_Z = this.field_71439_g;
|
||||
this.field_71439_g.func_70065_x();
|
||||
@@ -1532,110 +1568,8 @@
|
||||
|
||||
private void func_147112_ai() {
|
||||
if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
|
||||
- boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
|
||||
- TileEntity tileentity = null;
|
||||
- ItemStack itemstack;
|
||||
- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
|
||||
- BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
|
||||
- Block block = iblockstate.func_177230_c();
|
||||
- if (iblockstate.func_196958_f()) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
|
||||
- if (itemstack.func_190926_b()) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (flag && GuiScreen.func_146271_m() && block.func_149716_u()) {
|
||||
- tileentity = this.field_71441_e.func_175625_s(blockpos);
|
||||
- }
|
||||
- } else {
|
||||
- if (this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !flag) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (this.field_71476_x.field_72308_g instanceof EntityPainting) {
|
||||
- itemstack = new ItemStack(Items.field_151159_an);
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) {
|
||||
- itemstack = new ItemStack(Items.field_151058_ca);
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) {
|
||||
- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
|
||||
- ItemStack itemstack1 = entityitemframe.func_82335_i();
|
||||
- if (itemstack1.func_190926_b()) {
|
||||
- itemstack = new ItemStack(Items.field_151160_bD);
|
||||
- } else {
|
||||
- itemstack = itemstack1.func_77946_l();
|
||||
- }
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) {
|
||||
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
|
||||
- Item item;
|
||||
- switch(entityminecart.func_184264_v()) {
|
||||
- case FURNACE:
|
||||
- item = Items.field_151109_aJ;
|
||||
- break;
|
||||
- case CHEST:
|
||||
- item = Items.field_151108_aI;
|
||||
- break;
|
||||
- case TNT:
|
||||
- item = Items.field_151142_bV;
|
||||
- break;
|
||||
- case HOPPER:
|
||||
- item = Items.field_151140_bW;
|
||||
- break;
|
||||
- case COMMAND_BLOCK:
|
||||
- item = Items.field_151095_cc;
|
||||
- break;
|
||||
- default:
|
||||
- item = Items.field_151143_au;
|
||||
- }
|
||||
-
|
||||
- itemstack = new ItemStack(item);
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityBoat) {
|
||||
- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand) {
|
||||
- itemstack = new ItemStack(Items.field_179565_cj);
|
||||
- } else if (this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) {
|
||||
- itemstack = new ItemStack(Items.field_185158_cP);
|
||||
- } else {
|
||||
- ItemSpawnEgg itemspawnegg = ItemSpawnEgg.func_200889_b(this.field_71476_x.field_72308_g.func_200600_R());
|
||||
- if (itemspawnegg == null) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- itemstack = new ItemStack(itemspawnegg);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (itemstack.func_190926_b()) {
|
||||
- String s = "";
|
||||
- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
|
||||
- s = IRegistry.field_212618_g.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c()).toString();
|
||||
- } else if (this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) {
|
||||
- s = IRegistry.field_212629_r.func_177774_c(this.field_71476_x.field_72308_g.func_200600_R()).toString();
|
||||
- }
|
||||
-
|
||||
- field_147123_G.warn("Picking on: [{}] {} gave null item", this.field_71476_x.field_72313_a, s);
|
||||
- } else {
|
||||
- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
|
||||
- if (tileentity != null) {
|
||||
- this.func_184119_a(itemstack, tileentity);
|
||||
- }
|
||||
-
|
||||
- int i = inventoryplayer.func_184429_b(itemstack);
|
||||
- if (flag) {
|
||||
- inventoryplayer.func_184434_a(itemstack);
|
||||
- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
|
||||
- } else if (i != -1) {
|
||||
- if (InventoryPlayer.func_184435_e(i)) {
|
||||
- inventoryplayer.field_70461_c = i;
|
||||
- } else {
|
||||
- this.field_71442_b.func_187100_a(i);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- }
|
||||
+ net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e);
|
||||
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1712,6 +1646,7 @@
|
||||
return field_71432_P;
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use selective scheduleResourceRefresh method in FMLClientHandler
|
||||
public ListenableFuture<Object> func_175603_A() {
|
||||
return this.func_152344_a(this::func_110436_a);
|
||||
}
|
||||
@@ -1871,6 +1806,8 @@
|
||||
}
|
||||
|
||||
public MusicTicker.MusicType func_147109_W() {
|
||||
+ MusicTicker.MusicType type = this.field_71441_e == null || this.field_71441_e.field_73011_w == null ? null : this.field_71441_e.field_73011_w.getMusicType();
|
||||
+ if (type != null) return type;
|
||||
if (this.field_71462_r instanceof GuiWinGame) {
|
||||
return MusicTicker.MusicType.CREDITS;
|
||||
} else if (this.field_71439_g == null) {
|
||||
@@ -2010,4 +1947,12 @@
|
||||
public FontResourceManager func_211500_ak() {
|
||||
return this.field_211501_aD;
|
||||
}
|
||||
+
|
||||
+ public ItemColors getItemColors() {
|
||||
+ return this.field_184128_aI;
|
||||
+ }
|
||||
+
|
||||
+ public SearchTreeManager getSearchTreeManager() {
|
||||
+ return this.field_193995_ae;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
--- a/net/minecraft/client/MouseHelper.java
|
||||
+++ b/net/minecraft/client/MouseHelper.java
|
||||
@@ -76,11 +76,15 @@
|
||||
final int pFinal = p_198023_3_;
|
||||
if (flag) {
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
- aboolean[0] = this.field_198036_a.field_71462_r.mouseClicked(d0, d1, pFinal);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPre(this.field_198036_a.field_71462_r, d0, d1, pFinal);
|
||||
+ if (!aboolean[0]) aboolean[0] = this.field_198036_a.field_71462_r.mouseClicked(d0, d1, pFinal);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPost(this.field_198036_a.field_71462_r, d0, d1, pFinal);
|
||||
}, "mouseClicked event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
|
||||
} else {
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
- aboolean[0] = this.field_198036_a.field_71462_r.mouseReleased(d0, d1, pFinal);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPre(this.field_198036_a.field_71462_r, d0, d1, pFinal);
|
||||
+ if (!aboolean[0]) aboolean[0] = this.field_198036_a.field_71462_r.mouseReleased(d0, d1, pFinal);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPost(this.field_198036_a.field_71462_r, d0, d1, pFinal);
|
||||
}, "mouseReleased event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -111,7 +115,9 @@
|
||||
if (p_198020_1_ == Minecraft.func_71410_x().field_195558_d.func_198092_i()) {
|
||||
double d0 = p_198020_5_ * this.field_198036_a.field_71474_y.field_208033_V;
|
||||
if (this.field_198036_a.field_71462_r != null) {
|
||||
- this.field_198036_a.field_71462_r.mouseScrolled(d0);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPre(this, this.field_198036_a.field_71462_r, d0)) return;
|
||||
+ if (this.field_198036_a.field_71462_r.mouseScrolled(d0)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPost(this, this.field_198036_a.field_71462_r, d0);
|
||||
} else if (this.field_198036_a.field_71439_g != null) {
|
||||
if (this.field_200542_o != 0.0D && Math.signum(d0) != Math.signum(this.field_200542_o)) {
|
||||
this.field_200542_o = 0.0D;
|
||||
@@ -160,7 +166,9 @@
|
||||
double d2 = (p_198022_3_ - this.field_198040_e) * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
|
||||
double d3 = (p_198022_5_ - this.field_198041_f) * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
|
||||
GuiScreen.func_195121_a(() -> {
|
||||
- iguieventlistener.mouseDragged(d0, d1, this.field_198042_g, d2, d3);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPre(this.field_198036_a.field_71462_r, d0, d1, this.field_198042_g, d2, d3)) return;
|
||||
+ if (iguieventlistener.mouseDragged(d0, d1, this.field_198042_g, d2, d3)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPost(this.field_198036_a.field_71462_r, d0, d1, this.field_198042_g, d2, d3);
|
||||
}, "mouseDragged event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
--- a/net/minecraft/client/audio/SoundHandler.java
|
||||
+++ b/net/minecraft/client/audio/SoundHandler.java
|
||||
@@ -64,6 +64,7 @@
|
||||
public void func_195410_a(IResourceManager p_195410_1_) {
|
||||
this.field_147697_e.clear();
|
||||
|
||||
+ java.util.List<net.minecraft.util.Tuple<ResourceLocation, SoundList>> resources = new java.util.LinkedList<>();
|
||||
for(String s : p_195410_1_.func_199001_a()) {
|
||||
try {
|
||||
for(IResource iresource : p_195410_1_.func_199004_b(new ResourceLocation(s, "sounds.json"))) {
|
||||
@@ -71,7 +72,7 @@
|
||||
Map<String, SoundList> map = this.func_175085_a(iresource.func_199027_b());
|
||||
|
||||
for(Entry<String, SoundList> entry : map.entrySet()) {
|
||||
- this.func_147693_a(new ResourceLocation(s, entry.getKey()), entry.getValue());
|
||||
+ resources.add(new net.minecraft.util.Tuple<>(new ResourceLocation(s, entry.getKey()), entry.getValue()));
|
||||
}
|
||||
} catch (RuntimeException runtimeexception) {
|
||||
field_147698_b.warn("Invalid sounds.json in resourcepack: '{}'", iresource.func_199026_d(), runtimeexception);
|
||||
@@ -81,7 +82,18 @@
|
||||
;
|
||||
}
|
||||
}
|
||||
+ try (net.minecraftforge.fml.common.progress.ProgressBar resourcesBar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Loading sounds", resources.size())) {
|
||||
+ resources.forEach(entry -> {
|
||||
+ resourcesBar.step(entry.func_76341_a().toString());
|
||||
+ try {
|
||||
+ this.func_147693_a(entry.func_76341_a(), entry.func_76340_b());
|
||||
+ } catch (RuntimeException e) {
|
||||
+ field_147698_b.warn("Invalid sounds.json", e);
|
||||
+ }
|
||||
+ });
|
||||
+ }; // Forge: end progress bar
|
||||
|
||||
+
|
||||
for(ResourceLocation resourcelocation : this.field_147697_e.keySet()) {
|
||||
SoundEventAccessor soundeventaccessor = this.field_147697_e.get(resourcelocation);
|
||||
if (soundeventaccessor.func_188712_c() instanceof TextComponentTranslation) {
|
||||
@@ -211,6 +223,10 @@
|
||||
this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_);
|
||||
}
|
||||
|
||||
+ public void setListener(net.minecraft.entity.Entity entity, float partialTicks) {
|
||||
+ this.field_147694_f.setListener(entity, partialTicks);
|
||||
+ }
|
||||
+
|
||||
public void func_147689_b() {
|
||||
this.field_147694_f.func_148610_e();
|
||||
}
|
||||
@@ -258,4 +274,9 @@
|
||||
public void func_195478_a(@Nullable ResourceLocation p_195478_1_, @Nullable SoundCategory p_195478_2_) {
|
||||
this.field_147694_f.func_195855_a(p_195478_1_, p_195478_2_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.resource.IResourceType getResourceType() {
|
||||
+ return net.minecraftforge.resource.VanillaResourceType.SOUNDS;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
--- a/net/minecraft/client/audio/SoundManager.java
|
||||
+++ b/net/minecraft/client/audio/SoundManager.java
|
||||
@@ -69,6 +69,7 @@
|
||||
try {
|
||||
SoundSystemConfig.addLibrary(LibraryLWJGL3.class);
|
||||
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this));
|
||||
} catch (SoundSystemException soundsystemexception) {
|
||||
field_148621_b.error(field_148623_a, "Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception);
|
||||
}
|
||||
@@ -88,6 +89,7 @@
|
||||
|
||||
this.func_148613_b();
|
||||
this.func_148608_i();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
|
||||
}
|
||||
|
||||
private synchronized void func_148608_i() {
|
||||
@@ -293,6 +295,8 @@
|
||||
|
||||
public void func_148611_c(ISound p_148611_1_) {
|
||||
if (this.field_148617_f) {
|
||||
+ p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_);
|
||||
+ if (p_148611_1_ == null) return;
|
||||
SoundEventAccessor soundeventaccessor = p_148611_1_.func_184366_a(this.field_148622_c);
|
||||
ResourceLocation resourcelocation = p_148611_1_.func_147650_b();
|
||||
if (soundeventaccessor == null) {
|
||||
@@ -334,8 +338,10 @@
|
||||
ResourceLocation resourcelocation1 = sound.func_188721_b();
|
||||
if (sound.func_188723_h()) {
|
||||
this.field_148620_e.newStreamingSource(p_148611_1_.func_204200_l(), s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, p_148611_1_, s));
|
||||
} else {
|
||||
this.field_148620_e.newSource(p_148611_1_.func_204200_l(), s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, p_148611_1_, s));
|
||||
}
|
||||
|
||||
field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", sound.func_188719_a(), resourcelocation, s);
|
||||
@@ -423,12 +429,16 @@
|
||||
}
|
||||
|
||||
public void func_148615_a(EntityPlayer p_148615_1_, float p_148615_2_) {
|
||||
- if (this.field_148617_f && p_148615_1_ != null) {
|
||||
- float f = p_148615_1_.field_70127_C + (p_148615_1_.field_70125_A - p_148615_1_.field_70127_C) * p_148615_2_;
|
||||
- float f1 = p_148615_1_.field_70126_B + (p_148615_1_.field_70177_z - p_148615_1_.field_70126_B) * p_148615_2_;
|
||||
- double d0 = p_148615_1_.field_70169_q + (p_148615_1_.field_70165_t - p_148615_1_.field_70169_q) * (double)p_148615_2_;
|
||||
- double d1 = p_148615_1_.field_70167_r + (p_148615_1_.field_70163_u - p_148615_1_.field_70167_r) * (double)p_148615_2_ + (double)p_148615_1_.func_70047_e();
|
||||
- double d2 = p_148615_1_.field_70166_s + (p_148615_1_.field_70161_v - p_148615_1_.field_70166_s) * (double)p_148615_2_;
|
||||
+ setListener((net.minecraft.entity.Entity)p_148615_1_, p_148615_2_);
|
||||
+ }
|
||||
+
|
||||
+ public void setListener(net.minecraft.entity.Entity player, float partialTicks) {
|
||||
+ if (this.field_148617_f && player != null) {
|
||||
+ float f = player.field_70127_C + (player.field_70125_A - player.field_70127_C) * partialTicks;
|
||||
+ float f1 = player.field_70126_B + (player.field_70177_z - player.field_70126_B) * partialTicks;
|
||||
+ double d0 = player.field_70169_q + (player.field_70165_t - player.field_70169_q) * (double)partialTicks;
|
||||
+ double d1 = player.field_70167_r + (player.field_70163_u - player.field_70167_r) * (double)partialTicks + (double)player.func_70047_e();
|
||||
+ double d2 = player.field_70166_s + (player.field_70161_v - player.field_70166_s) * (double)partialTicks;
|
||||
float f2 = MathHelper.func_76134_b((f1 + 90.0F) * ((float)Math.PI / 180F));
|
||||
float f3 = MathHelper.func_76126_a((f1 + 90.0F) * ((float)Math.PI / 180F));
|
||||
float f4 = MathHelper.func_76134_b(-f * ((float)Math.PI / 180F));
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
+++ b/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
@@ -126,6 +126,6 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
+++ b/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
@@ -29,6 +29,7 @@
|
||||
}
|
||||
|
||||
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--- a/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
+++ b/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
@@ -139,6 +139,7 @@
|
||||
}
|
||||
|
||||
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -468,6 +469,11 @@
|
||||
}
|
||||
|
||||
public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
|
||||
+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_);
|
||||
+ if (event.isCanceled() || event.getSound() == null) return;
|
||||
+ p_184185_1_ = event.getSound();
|
||||
+ p_184185_2_ = event.getVolume();
|
||||
+ p_184185_3_ = event.getPitch();
|
||||
this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false);
|
||||
}
|
||||
|
||||
@@ -673,6 +679,7 @@
|
||||
float f = 0.8F;
|
||||
boolean flag2 = this.field_71158_b.field_192832_b >= 0.8F;
|
||||
this.field_71158_b.func_78898_a();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onInputUpdate(this, this.field_71158_b);
|
||||
this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b);
|
||||
if (this.func_184587_cr() && !this.func_184218_aH()) {
|
||||
this.field_71158_b.field_78902_a *= 0.2F;
|
||||
@@ -688,10 +695,14 @@
|
||||
}
|
||||
|
||||
AxisAlignedBB axisalignedbb = this.func_174813_aQ();
|
||||
+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this, axisalignedbb);
|
||||
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
|
||||
+ axisalignedbb = event.getEntityBoundingBox();
|
||||
this.func_145771_j(this.field_70165_t - (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.field_70130_N * 0.35D);
|
||||
this.func_145771_j(this.field_70165_t - (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.field_70130_N * 0.35D);
|
||||
this.func_145771_j(this.field_70165_t + (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.field_70130_N * 0.35D);
|
||||
this.func_145771_j(this.field_70165_t + (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.field_70130_N * 0.35D);
|
||||
+ }
|
||||
boolean flag4 = (float)this.func_71024_bL().func_75116_a() > 6.0F || this.field_71075_bZ.field_75101_c;
|
||||
if ((this.field_70122_E || this.func_204231_K()) && !flag1 && !flag2 && this.field_71158_b.field_192832_b >= 0.8F && !this.func_70051_ag() && flag4 && !this.func_184587_cr() && !this.func_70644_a(MobEffects.field_76440_q)) {
|
||||
if (this.field_71156_d <= 0 && !this.field_71159_c.field_71474_y.field_151444_V.func_151470_d()) {
|
||||
@@ -979,4 +990,16 @@
|
||||
return this.field_204230_bP;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public void updateSyncFields(EntityPlayerSP old) {
|
||||
+ this.field_175172_bI = old.field_175172_bI;
|
||||
+ this.field_175166_bJ = old.field_175166_bJ;
|
||||
+ this.field_175167_bK = old.field_175167_bK;
|
||||
+ this.field_175164_bL = old.field_175164_bL;
|
||||
+ this.field_175165_bM = old.field_175165_bM;
|
||||
+ this.field_184841_cd = old.field_184841_cd;
|
||||
+ this.field_175170_bN = old.field_175170_bN;
|
||||
+ this.field_175171_bO = old.field_175171_bO;
|
||||
+ this.field_175168_bP = old.field_175168_bP;
|
||||
+ }
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/GuiButton.java
|
||||
+++ b/net/minecraft/client/gui/GuiButton.java
|
||||
@@ -22,6 +22,7 @@
|
||||
public boolean field_146125_m;
|
||||
public boolean field_146125_m = true;
|
||||
protected boolean field_146123_n;
|
||||
private boolean field_194832_o;
|
||||
+ public int packedFGColor; // FML
|
||||
|
||||
public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) {
|
||||
this(p_i1020_1_, p_i1020_2_, p_i1020_3_, 200, 20, p_i1020_4_);
|
||||
@@ -66,6 +67,11 @@
|
||||
@@ -62,6 +63,11 @@
|
||||
this.func_73729_b(this.field_146128_h + this.field_146120_f / 2, this.field_146129_i, 200 - this.field_146120_f / 2, 46 + i * 20, this.field_146120_f / 2, this.field_146121_g);
|
||||
this.func_146119_b(minecraft, p_194828_1_, p_194828_2_);
|
||||
int j = 14737632;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ b/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -158,14 +158,7 @@
|
||||
this.field_146321_E.field_146125_m = false;
|
||||
this.field_146322_F = this.func_189646_b(new GuiButton(8, this.field_146294_l / 2 + 5, 120, 150, 20, I18n.func_135052_a("selectWorld.customizeType")) {
|
||||
public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
- if (WorldType.field_77139_a[GuiCreateWorld.this.field_146331_K] == WorldType.field_77138_c) {
|
||||
- GuiCreateWorld.this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(GuiCreateWorld.this, GuiCreateWorld.this.field_146334_a));
|
||||
- }
|
||||
-
|
||||
- if (WorldType.field_77139_a[GuiCreateWorld.this.field_146331_K] == WorldType.field_205394_h) {
|
||||
- GuiCreateWorld.this.field_146297_k.func_147108_a(new GuiCreateBuffetWorld(GuiCreateWorld.this, GuiCreateWorld.this.field_146334_a));
|
||||
- }
|
||||
-
|
||||
+ WorldType.field_77139_a[GuiCreateWorld.this.field_146331_K].onCustomizeButton(GuiCreateWorld.this.field_146297_k, GuiCreateWorld.this);
|
||||
}
|
||||
});
|
||||
this.field_146322_F.field_146125_m = false;
|
||||
@@ -257,6 +250,7 @@
|
||||
i = (long)s.hashCode();
|
||||
}
|
||||
}
|
||||
+ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress();
|
||||
|
||||
WorldSettings worldsettings = new WorldSettings(i, GameType.func_77142_a(this.field_146342_r), this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]);
|
||||
worldsettings.func_205390_a(Dynamic.convert(NBTDynamicOps.field_210820_a, JsonOps.INSTANCE, this.field_146334_a));
|
||||
@@ -0,0 +1,27 @@
|
||||
--- a/net/minecraft/client/gui/GuiEnchantment.java
|
||||
+++ b/net/minecraft/client/gui/GuiEnchantment.java
|
||||
@@ -153,7 +153,7 @@
|
||||
String s1 = EnchantmentNameParts.func_178176_a().func_148334_a(this.field_146289_q, i2);
|
||||
FontRenderer fontrenderer = this.field_146297_k.func_211500_ak().func_211504_a(Minecraft.field_71464_q);
|
||||
int j2 = 6839882;
|
||||
- if ((l < i1 + 1 || this.field_146297_k.field_71439_g.field_71068_ca < l1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) {
|
||||
+ if (((l < i1 + 1 || this.field_146297_k.field_71439_g.field_71068_ca < l1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) || this.field_147075_G.field_185001_h[l] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
|
||||
this.func_73729_b(j1, j + 14 + 19 * i1, 0, 185, 108, 19);
|
||||
this.func_73729_b(j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16);
|
||||
fontrenderer.func_78279_b(s1, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1);
|
||||
@@ -193,10 +193,12 @@
|
||||
Enchantment enchantment = Enchantment.func_185262_c(this.field_147075_G.field_185001_h[j]);
|
||||
int l = this.field_147075_G.field_185002_i[j];
|
||||
int i1 = j + 1;
|
||||
- if (this.func_195359_a(60, 14 + 19 * j, 108, 17, (double)p_73863_1_, (double)p_73863_2_) && k > 0 && l >= 0 && enchantment != null) {
|
||||
+ if (this.func_195359_a(60, 14 + 19 * j, 108, 17, (double)p_73863_1_, (double)p_73863_2_) && k > 0) {
|
||||
List<String> list = Lists.newArrayList();
|
||||
- list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment.func_200305_d(l).func_150254_d()));
|
||||
- if (!flag) {
|
||||
+ list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment == null ? "" : enchantment.func_200305_d(l).func_150254_d()));
|
||||
+ if (enchantment == null) {
|
||||
+ java.util.Collections.addAll(list, "", TextFormatting.RED + I18n.func_135052_a("forge.container.enchant.limitedEnchantability"));
|
||||
+ } else if (!flag) {
|
||||
list.add("");
|
||||
if (this.field_146297_k.field_71439_g.field_71068_ca < k) {
|
||||
list.add(TextFormatting.RED + I18n.func_135052_a("container.enchant.level.requirement", this.field_147075_G.field_75167_g[j]));
|
||||
@@ -1,6 +1,38 @@
|
||||
--- a/net/minecraft/client/gui/GuiIngame.java
|
||||
+++ b/net/minecraft/client/gui/GuiIngame.java
|
||||
@@ -548,7 +548,13 @@
|
||||
@@ -323,7 +323,7 @@
|
||||
}
|
||||
|
||||
BlockPos blockpos = raytraceresult.func_178782_a();
|
||||
- if (!this.field_73839_d.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149716_u() || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) {
|
||||
+ if (!this.field_73839_d.field_71441_e.func_180495_p(blockpos).hasTileEntity() || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -374,7 +374,10 @@
|
||||
|
||||
for(PotionEffect potioneffect : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
Potion potion = potioneffect.func_188419_a();
|
||||
- if (potion.func_76400_d() && potioneffect.func_205348_f()) {
|
||||
+ if (!potion.shouldRenderHUD(potioneffect)) continue;
|
||||
+ // Rebind in case previous renderHUDEffect changed texture
|
||||
+ this.field_73839_d.func_110434_K().func_110577_a(GuiContainer.field_147001_a);
|
||||
+ if (potioneffect.func_205348_f()) {
|
||||
int k = this.field_194811_H;
|
||||
int l = 1;
|
||||
if (this.field_73839_d.func_71355_q()) {
|
||||
@@ -406,7 +409,10 @@
|
||||
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, f);
|
||||
int l1 = i1 % 12;
|
||||
int k1 = i1 / 12;
|
||||
+ // FORGE - Move status icon check down from above so renderHUDEffect will still be called without a status icon
|
||||
+ if (potion.func_76400_d())
|
||||
this.func_73729_b(k + 3, l + 3, l1 * 18, 198 + k1 * 18, 18, 18);
|
||||
+ potion.renderHUDEffect(k, l, potioneffect, field_73839_d, f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +554,13 @@
|
||||
GlStateManager.func_179094_E();
|
||||
GlStateManager.func_179147_l();
|
||||
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/GuiLanguage.java
|
||||
+++ b/net/minecraft/client/gui/GuiLanguage.java
|
||||
@@ -82,7 +82,7 @@
|
||||
Language language = this.field_148177_m.get(this.field_148176_l.get(p_195078_1_));
|
||||
GuiLanguage.this.field_146454_h.func_135045_a(language);
|
||||
GuiLanguage.this.field_146451_g.field_74363_ab = language.func_135034_a();
|
||||
- this.field_148161_k.func_110436_a();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.refreshResources(GuiLanguage.this.field_146297_k, net.minecraftforge.resource.VanillaResourceType.LANGUAGES);
|
||||
GuiLanguage.this.field_146289_q.func_78275_b(GuiLanguage.this.field_146454_h.func_135044_b());
|
||||
GuiLanguage.this.field_146452_r.field_146126_j = I18n.func_135052_a("gui.done");
|
||||
GuiLanguage.this.field_211832_i.field_146126_j = GuiLanguage.this.field_146451_g.func_74297_c(GameSettings.Options.FORCE_UNICODE_FONT);
|
||||
@@ -1,6 +1,23 @@
|
||||
--- a/net/minecraft/client/gui/GuiMainMenu.java
|
||||
+++ b/net/minecraft/client/gui/GuiMainMenu.java
|
||||
@@ -192,12 +192,18 @@
|
||||
@@ -59,6 +59,7 @@
|
||||
private int field_193978_M;
|
||||
private int field_193979_N;
|
||||
private final RenderSkybox field_209101_K = new RenderSkybox(new RenderSkyboxCube(new ResourceLocation("textures/gui/title/background/panorama")));
|
||||
+ private net.minecraftforge.client.gui.NotificationModUpdateScreen modUpdateNotification;
|
||||
|
||||
public GuiMainMenu() {
|
||||
this.field_73975_c = "missingno";
|
||||
@@ -176,7 +177,7 @@
|
||||
if (this.func_183501_a()) {
|
||||
this.field_183503_M.func_146280_a(this.field_146297_k, this.field_146294_l, this.field_146295_m);
|
||||
}
|
||||
-
|
||||
+ modUpdateNotification = net.minecraftforge.client.gui.NotificationModUpdateScreen.init(this, field_146292_n.stream().filter(b -> b.field_146127_k == 6).findFirst().orElse(null)); // The Mobs button is id 6
|
||||
}
|
||||
|
||||
private void func_73969_a(int p_73969_1_, int p_73969_2_) {
|
||||
@@ -190,11 +191,17 @@
|
||||
GuiMainMenu.this.field_146297_k.func_147108_a(new GuiMultiplayer(GuiMainMenu.this));
|
||||
}
|
||||
});
|
||||
@@ -14,13 +31,12 @@
|
||||
+ @Override
|
||||
+ public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
+ GuiMainMenu.this.field_146297_k.func_147108_a(new net.minecraftforge.fml.client.gui.GuiModList(GuiMainMenu.this));
|
||||
}
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
|
||||
private void func_73972_b(int p_73972_1_, int p_73972_2_) {
|
||||
this.func_189646_b(new GuiButton(11, this.field_146294_l / 2 - 100, p_73972_1_, I18n.func_135052_a("menu.playdemo")) {
|
||||
@@ -206,7 +212,7 @@
|
||||
@@ -204,7 +211,7 @@
|
||||
}
|
||||
});
|
||||
this.field_73973_d = this.func_189646_b(new GuiButton(12, this.field_146294_l / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.func_135052_a("menu.resetdemo")) {
|
||||
@@ -29,15 +45,33 @@
|
||||
ISaveFormat isaveformat1 = GuiMainMenu.this.field_146297_k.func_71359_d();
|
||||
WorldInfo worldinfo1 = isaveformat1.func_75803_c("Demo_World");
|
||||
if (worldinfo1 != null) {
|
||||
@@ -283,7 +289,10 @@
|
||||
@@ -266,6 +273,9 @@
|
||||
|
||||
this.field_146297_k.func_110434_K().func_110577_a(field_194400_H);
|
||||
func_146110_a(j + 88, 67, 0.0F, 0.0F, 98, 14, 128.0F, 16.0F);
|
||||
+
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m);
|
||||
+
|
||||
GlStateManager.func_179094_E();
|
||||
GlStateManager.func_179109_b((float)(this.field_146294_l / 2 + 90), 70.0F, 0.0F);
|
||||
GlStateManager.func_179114_b(-20.0F, 0.0F, 0.0F, 1.0F);
|
||||
@@ -281,7 +291,10 @@
|
||||
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
|
||||
}
|
||||
|
||||
- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1);
|
||||
+ net.minecraftforge.fml.BrandingControl.forEachLine(true, true, (brdline, brd) ->
|
||||
+ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + brdline * (this.field_146289_q.field_78288_b + 1)), 16777215)
|
||||
+ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + brdline * (this.field_146289_q.field_78288_b + 1)), 16777215)
|
||||
+ );
|
||||
+
|
||||
this.func_73731_b(this.field_146289_q, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_146295_m - 10, -1);
|
||||
if (p_73863_1_ > this.field_193979_N && p_73863_1_ < this.field_193979_N + this.field_193978_M && p_73863_2_ > this.field_146295_m - 10 && p_73863_2_ < this.field_146295_m) {
|
||||
func_73734_a(this.field_193979_N, this.field_146295_m - 1, this.field_193979_N + this.field_193978_M, this.field_146295_m, -1);
|
||||
@@ -297,6 +310,7 @@
|
||||
if (this.func_183501_a()) {
|
||||
this.field_183503_M.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
}
|
||||
+ modUpdateNotification.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
--- a/net/minecraft/client/gui/GuiScreen.java
|
||||
+++ b/net/minecraft/client/gui/GuiScreen.java
|
||||
@@ -87,7 +87,10 @@
|
||||
}
|
||||
|
||||
protected void func_146285_a(ItemStack p_146285_1_, int p_146285_2_, int p_146285_3_) {
|
||||
- this.func_146283_a(this.func_191927_a(p_146285_1_), p_146285_2_, p_146285_3_);
|
||||
+ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_);
|
||||
+ net.minecraftforge.fml.client.config.GuiUtils.preItemToolTip(p_146285_1_);
|
||||
+ this.drawHoveringText(this.func_191927_a(p_146285_1_), p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
|
||||
+ net.minecraftforge.fml.client.config.GuiUtils.postItemToolTip();
|
||||
}
|
||||
|
||||
public List<String> func_191927_a(ItemStack p_191927_1_) {
|
||||
@@ -106,25 +109,30 @@
|
||||
}
|
||||
|
||||
public void func_146283_a(List<String> p_146283_1_, int p_146283_2_, int p_146283_3_) {
|
||||
- if (!p_146283_1_.isEmpty()) {
|
||||
+ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q);
|
||||
+ }
|
||||
+
|
||||
+ public void drawHoveringText(List<String> textLines, int x, int y, FontRenderer font) {
|
||||
+ net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(textLines, x, y, field_146294_l, field_146295_m, -1, font);
|
||||
+ if (false && !textLines.isEmpty()) {
|
||||
GlStateManager.func_179101_C();
|
||||
RenderHelper.func_74518_a();
|
||||
GlStateManager.func_179140_f();
|
||||
GlStateManager.func_179097_i();
|
||||
int i = 0;
|
||||
|
||||
- for(String s : p_146283_1_) {
|
||||
+ for(String s : textLines) {
|
||||
int j = this.field_146289_q.func_78256_a(s);
|
||||
if (j > i) {
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
|
||||
- int l1 = p_146283_2_ + 12;
|
||||
- int i2 = p_146283_3_ - 12;
|
||||
+ int l1 = x + 12;
|
||||
+ int i2 = y - 12;
|
||||
int k = 8;
|
||||
- if (p_146283_1_.size() > 1) {
|
||||
- k += 2 + (p_146283_1_.size() - 1) * 10;
|
||||
+ if (textLines.size() > 1) {
|
||||
+ k += 2 + (textLines.size() - 1) * 10;
|
||||
}
|
||||
|
||||
if (l1 + i > this.field_146294_l) {
|
||||
@@ -150,8 +158,8 @@
|
||||
this.func_73733_a(l1 - 3, i2 - 3, l1 + i + 3, i2 - 3 + 1, 1347420415, 1347420415);
|
||||
this.func_73733_a(l1 - 3, i2 + k + 2, l1 + i + 3, i2 + k + 3, 1344798847, 1344798847);
|
||||
|
||||
- for(int k1 = 0; k1 < p_146283_1_.size(); ++k1) {
|
||||
- String s1 = p_146283_1_.get(k1);
|
||||
+ for(int k1 = 0; k1 < textLines.size(); ++k1) {
|
||||
+ String s1 = textLines.get(k1);
|
||||
this.field_146289_q.func_175063_a(s1, (float)l1, (float)i2, -1);
|
||||
if (k1 == 0) {
|
||||
i2 += 2;
|
||||
@@ -279,9 +287,12 @@
|
||||
}
|
||||
|
||||
public void func_175281_b(String p_175281_1_, boolean p_175281_2_) {
|
||||
+ p_175281_1_ = net.minecraftforge.event.ForgeEventFactory.onClientSendMessage(p_175281_1_);
|
||||
+ if (p_175281_1_.isEmpty()) return;
|
||||
if (p_175281_2_) {
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
|
||||
}
|
||||
+ //if (net.minecraftforge.client.ClientCommandHandler.instance.executeCommand(mc.player, msg) != 0) return; //Forge: TODO Client command re-write
|
||||
|
||||
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
|
||||
}
|
||||
@@ -292,9 +303,13 @@
|
||||
this.field_146289_q = p_146280_1_.field_71466_p;
|
||||
this.field_146294_l = p_146280_2_;
|
||||
this.field_146295_m = p_146280_3_;
|
||||
+ java.util.function.Consumer<GuiButton> remove = (b) -> { field_146292_n.remove(b); field_195124_j.remove(b); };
|
||||
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.field_146292_n, this::func_189646_b, remove))) {
|
||||
this.field_146292_n.clear();
|
||||
this.field_195124_j.clear();
|
||||
this.func_73866_w_();
|
||||
+ }
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.field_146292_n, this::func_189646_b, remove));
|
||||
}
|
||||
|
||||
public List<? extends IGuiEventListener> func_195074_b() {
|
||||
@@ -318,6 +333,7 @@
|
||||
public void func_146270_b(int p_146270_1_) {
|
||||
if (this.field_146297_k.field_71441_e != null) {
|
||||
this.func_73733_a(0, 0, this.field_146294_l, this.field_146295_m, -1072689136, -804253680);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
|
||||
} else {
|
||||
this.func_146278_c(p_146270_1_);
|
||||
}
|
||||
@@ -338,6 +354,7 @@
|
||||
bufferbuilder.func_181662_b((double)this.field_146294_l, 0.0D, 0.0D).func_187315_a((double)((float)this.field_146294_l / 32.0F), (double)p_146278_1_).func_181669_b(64, 64, 64, 255).func_181675_d();
|
||||
bufferbuilder.func_181662_b(0.0D, 0.0D, 0.0D).func_187315_a(0.0D, (double)p_146278_1_).func_181669_b(64, 64, 64, 255).func_181675_d();
|
||||
tessellator.func_78381_a();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this));
|
||||
}
|
||||
|
||||
public boolean func_73868_f() {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/GuiSleepMP.java
|
||||
+++ b/net/minecraft/client/gui/GuiSleepMP.java
|
||||
@@ -27,7 +27,7 @@
|
||||
} else if (p_keyPressed_1_ == 257 || p_keyPressed_1_ == 335) {
|
||||
String s = this.field_146415_a.func_146179_b().trim();
|
||||
if (!s.isEmpty()) {
|
||||
- this.field_146297_k.field_71439_g.func_71165_d(s);
|
||||
+ this.func_175275_f(s); // Forge: fix vanilla not adding messages to the sent list while sleeping
|
||||
}
|
||||
|
||||
this.field_146415_a.func_146180_a("");
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/client/gui/GuiSlot.java
|
||||
+++ b/net/minecraft/client/gui/GuiSlot.java
|
||||
@@ -144,15 +144,8 @@
|
||||
GlStateManager.func_179106_n();
|
||||
Tessellator tessellator = Tessellator.func_178181_a();
|
||||
BufferBuilder bufferbuilder = tessellator.func_178180_c();
|
||||
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- float f = 32.0F;
|
||||
- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i);
|
||||
- bufferbuilder.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / 32.0F), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
- bufferbuilder.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / 32.0F), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
- bufferbuilder.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / 32.0F), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
- bufferbuilder.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / 32.0F), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
- tessellator.func_78381_a();
|
||||
+ // Forge: background rendering moved into separate method.
|
||||
+ this.drawContainerBackground(tessellator);
|
||||
int k = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
|
||||
int l = this.field_148153_b + 4 - (int)this.field_148169_q;
|
||||
if (this.field_148165_u) {
|
||||
@@ -369,4 +362,17 @@
|
||||
public int func_148146_j() {
|
||||
return this.field_148149_f;
|
||||
}
|
||||
+
|
||||
+ protected void drawContainerBackground(Tessellator tessellator) {
|
||||
+ BufferBuilder buffer = tessellator.func_178180_c();
|
||||
+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ float scale = 32.0F;
|
||||
+ buffer.func_181668_a(7, DefaultVertexFormats.field_181709_i);
|
||||
+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a(this.field_148152_e / scale, (this.field_148154_c + (int)this.field_148169_q) / scale).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a(this.field_148151_d / scale, (this.field_148154_c + (int)this.field_148169_q) / scale).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a(this.field_148151_d / scale, (this.field_148153_b + (int)this.field_148169_q) / scale).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a(this.field_148152_e / scale, (this.field_148153_b + (int)this.field_148169_q) / scale).func_181669_b(32, 32, 32, 255).func_181675_d();
|
||||
+ tessellator.func_78381_a();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/gui/GuiUtilRenderComponents.java
|
||||
+++ b/net/minecraft/client/gui/GuiUtilRenderComponents.java
|
||||
@@ -54,6 +54,7 @@
|
||||
s2 = "";
|
||||
s3 = s4;
|
||||
}
|
||||
+ s3 = TextFormatting.func_211164_a(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping.
|
||||
|
||||
ITextComponent itextcomponent4 = (new TextComponentString(s3)).func_150255_a(itextcomponent1.func_150256_b().func_150232_l());
|
||||
list1.add(j + 1, itextcomponent4);
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/net/minecraft/client/gui/GuiVideoSettings.java
|
||||
+++ b/net/minecraft/client/gui/GuiVideoSettings.java
|
||||
@@ -94,4 +94,10 @@
|
||||
this.func_73732_a(this.field_146289_q, this.field_146500_a, this.field_146294_l / 2, 5, 16777215);
|
||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
}
|
||||
+
|
||||
+ @Override // FORGE: fix for MC-64581 very laggy mipmap slider
|
||||
+ public void func_146281_b() {
|
||||
+ super.func_146281_b();
|
||||
+ this.field_146297_k.field_71474_y.onGuiClosed();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/gui/MapItemRenderer.java
|
||||
+++ b/net/minecraft/client/gui/MapItemRenderer.java
|
||||
@@ -118,6 +118,7 @@
|
||||
|
||||
for(MapDecoration mapdecoration : this.field_148242_b.field_76203_h.values()) {
|
||||
if (!p_148237_1_ || mapdecoration.func_191180_f()) {
|
||||
+ if (mapdecoration.render(k)) { k++; continue; }
|
||||
MapItemRenderer.this.field_148251_b.func_110577_a(MapItemRenderer.field_148253_a);
|
||||
GlStateManager.func_179094_E();
|
||||
GlStateManager.func_179109_b(0.0F + (float)mapdecoration.func_176112_b() / 2.0F + 64.0F, 0.0F + (float)mapdecoration.func_176113_c() / 2.0F + 64.0F, -0.02F);
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/net/minecraft/client/gui/achievement/GuiStats.java
|
||||
+++ b/net/minecraft/client/gui/achievement/GuiStats.java
|
||||
@@ -122,8 +122,8 @@
|
||||
public void func_193026_g() {
|
||||
if (this.field_146543_v) {
|
||||
this.func_193028_a();
|
||||
- this.func_193029_f();
|
||||
this.field_146545_u = this.field_146550_h;
|
||||
+ this.func_193029_f(); //Forge: Bugfix, initButtons adds displaySlot to children, so set it first to prevent NPE
|
||||
this.field_146543_v = false;
|
||||
}
|
||||
|
||||
Loaded 100 of 1314 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user