mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff0bb8c83c | ||
|
|
e5acea60e6 | ||
|
|
216b536967 | ||
|
|
0a819da0e7 | ||
|
|
bdad2af27b | ||
|
|
60513446fa | ||
|
|
be415091cd | ||
|
|
9067dbf6a0 | ||
|
|
359be1a880 | ||
|
|
99624bf3b5 | ||
|
|
252b94a110 | ||
|
|
448d996a45 | ||
|
|
b9e5dfd286 | ||
|
|
d966746fbf | ||
|
|
89baeb3d5d | ||
|
|
89006458a2 | ||
|
|
389bc1ecea | ||
|
|
1e0437208b | ||
|
|
256bd01e0c | ||
|
|
ef7b035f02 | ||
|
|
83a0dc2ef9 | ||
|
|
c10174d50d | ||
|
|
5a3b375147 | ||
|
|
656ff25ae1 | ||
|
|
19059b054e | ||
|
|
45bc487fc0 | ||
|
|
9c74a31ca2 | ||
|
|
8c3e511538 | ||
|
|
5fb948fb35 | ||
|
|
a14c2233e0 | ||
|
|
f01b87fac7 | ||
|
|
40bdde2043 | ||
|
|
0a8a601877 | ||
|
|
002e29958e | ||
|
|
604987a005 | ||
|
|
7e3e6b1969 | ||
|
|
d821514372 | ||
|
|
37a896fe1b | ||
|
|
e1cdb2e558 | ||
|
|
c30b27fcfe | ||
|
|
9542f51cd0 | ||
|
|
a7b56f0975 | ||
|
|
ed3dc8c7d3 | ||
|
|
ed6ce87c22 | ||
|
|
4bd7427b70 | ||
|
|
0b1196db3f | ||
|
|
b25ed7ef91 | ||
|
|
dc95130526 | ||
|
|
d5ee80a70a | ||
|
|
5dc944c1c3 | ||
|
|
da22fd40bf | ||
|
|
1434419e47 | ||
|
|
3385e62aa7 | ||
|
|
40f2276e88 | ||
|
|
35cd89c00c | ||
|
|
892fea3df9 | ||
|
|
2d32929dc5 | ||
|
|
728b4857c3 | ||
|
|
9fa4641cb0 | ||
|
|
fc04a65a0f | ||
|
|
a93d7d20ee | ||
|
|
b74b72e44c | ||
|
|
850c73b73f | ||
|
|
d736e26e0c | ||
|
|
d97f47141e | ||
|
|
a7df63e1a1 | ||
|
|
d3e8804dbf | ||
|
|
c509cac02b | ||
|
|
4b5bf760ec | ||
|
|
c57c6213ea | ||
|
|
fb30820e2b | ||
|
|
61b612c88a | ||
|
|
d3edc9dcdc | ||
|
|
ba2485b807 | ||
|
|
60c6635af5 | ||
|
|
9c5134fb6b | ||
|
|
eae0858de6 | ||
|
|
d7949d5316 | ||
|
|
8c44d6d4cb | ||
|
|
049fae5c65 | ||
|
|
41f8459a41 | ||
|
|
5cd82f16f2 | ||
|
|
444ba7a7d5 | ||
|
|
dcd5f1d711 | ||
|
|
18ce494cba | ||
|
|
9e39570d49 | ||
|
|
6a1337aa92 | ||
|
|
605c4a0adf | ||
|
|
7c90d9f3e8 | ||
|
|
01a0674490 | ||
|
|
e482793f69 | ||
|
|
de14670d4d | ||
|
|
9209c3cbfe | ||
|
|
a7204b5cd3 | ||
|
|
616416569b | ||
|
|
cab1b9716c | ||
|
|
bda3f1b7c6 | ||
|
|
416bf9e3bf | ||
|
|
102e0095a7 | ||
|
|
1fcfd54584 | ||
|
|
441a9c9024 | ||
|
|
f68fdcf703 | ||
|
|
d8137f7bcf | ||
|
|
42c27b8845 | ||
|
|
8408539f1c | ||
|
|
1f0467b864 | ||
|
|
1aae18d4bc | ||
|
|
45902676fd | ||
|
|
931105123e | ||
|
|
cf35019d07 | ||
|
|
c636f6edd6 | ||
|
|
58b28569e2 | ||
|
|
73bb013b25 | ||
|
|
d6da893c0c | ||
|
|
47a7d8e2b7 | ||
|
|
cb0cf2f04f | ||
|
|
a4cf5951ca | ||
|
|
822dce47cd | ||
|
|
2ea475ad31 | ||
|
|
eed92ba07c | ||
|
|
a86317efc8 | ||
|
|
ca973f053f | ||
|
|
119e4a6924 | ||
|
|
aef224221f | ||
|
|
18d0f7ba0d | ||
|
|
dd9077d52d | ||
|
|
01cb2117cc | ||
|
|
574f890e58 | ||
|
|
e70cc4fcae | ||
|
|
d02da21a7a | ||
|
|
817546e4c8 | ||
|
|
1a7e05a3da | ||
|
|
f19fed0853 | ||
|
|
06f67f7696 | ||
|
|
501f1dc8dc | ||
|
|
8b5a5ecd74 | ||
|
|
cb3ff19801 | ||
|
|
f30d7bc845 | ||
|
|
c0aa4c8517 | ||
|
|
e868739675 | ||
|
|
991682956d | ||
|
|
e168d8e593 | ||
|
|
273b1b110a | ||
|
|
bbc92fa51c | ||
|
|
8515b9dd10 | ||
|
|
a56f894e39 | ||
|
|
592b957b77 | ||
|
|
65cfef1b2e | ||
|
|
914fe91db5 | ||
|
|
0c19ccc11a | ||
|
|
3560e47a77 | ||
|
|
c33cd678f0 | ||
|
|
a67cce2f91 | ||
|
|
72bc39d831 | ||
|
|
abf010ac48 | ||
|
|
2baa05ace9 | ||
|
|
fa708f93ee | ||
|
|
a0a3f9dbfb | ||
|
|
bda875166a | ||
|
|
e376172312 | ||
|
|
d20b1f271e | ||
|
|
67da3182c1 | ||
|
|
1280dea111 | ||
|
|
3920b7aaa3 | ||
|
|
52890edfac | ||
|
|
ed3aea0980 | ||
|
|
3f70fd49ff | ||
|
|
7496e3dbdf | ||
|
|
7c401e9a35 | ||
|
|
a02bec7ebe | ||
|
|
254c1d1531 | ||
|
|
971de3e1d0 | ||
|
|
7d2c8fa6ef | ||
|
|
ac210a3201 | ||
|
|
a79975b3ea | ||
|
|
aa7380acc6 | ||
|
|
cdbd842494 | ||
|
|
323fdb014d | ||
|
|
3f735b715b | ||
|
|
4ecb04ed9f | ||
|
|
e0361047f7 | ||
|
|
37016ca77f | ||
|
|
98ef5049f4 | ||
|
|
98a470d813 | ||
|
|
944d760855 | ||
|
|
e0e999da0d | ||
|
|
2f486f2bdd | ||
|
|
7e4101b3ad | ||
|
|
d8d30e1f82 | ||
|
|
36470f69ad | ||
|
|
5fa732d223 | ||
|
|
5e7279b0a2 | ||
|
|
4764136d47 | ||
|
|
10a06157aa | ||
|
|
d7ba9a50df | ||
|
|
18400e8457 | ||
|
|
f5375783c6 | ||
|
|
8045e48952 | ||
|
|
be18bdee88 | ||
|
|
1e34f331da | ||
|
|
d99a55a7d1 | ||
|
|
0141a959eb | ||
|
|
d04c849a23 | ||
|
|
329e04b068 | ||
|
|
d0c7a496f7 | ||
|
|
ff6fa31b1d | ||
|
|
554952e02a | ||
|
|
00845d5252 | ||
|
|
7113f4400c | ||
|
|
7292b63052 | ||
|
|
7cfc5c3316 | ||
|
|
1d0c67d67b | ||
|
|
47e6b34d2b | ||
|
|
3003e33074 | ||
|
|
7bd7b059c4 | ||
|
|
230d69b772 | ||
|
|
cbfa572acb | ||
|
|
8f5a2be6fd | ||
|
|
45f5f0904a | ||
|
|
6db8b3c26d | ||
|
|
b4ccafe718 | ||
|
|
3c73dc2d0b | ||
|
|
58494f8878 | ||
|
|
cb70702ab5 | ||
|
|
7f1ea578d6 | ||
|
|
dd7e7fc122 | ||
|
|
0bcc60fbe3 | ||
|
|
7766eed754 | ||
|
|
5fa02f53d9 | ||
|
|
176e331fc4 | ||
|
|
d846f23e80 | ||
|
|
af717ad788 | ||
|
|
2a4e05c982 | ||
|
|
c219416bb8 | ||
|
|
8d1ff45c71 | ||
|
|
245d0b6282 | ||
|
|
bbdf52e038 | ||
|
|
237f9dec5a | ||
|
|
d6dc438859 | ||
|
|
1469df26db | ||
|
|
b7f6fbcfcb | ||
|
|
329f26ee20 | ||
|
|
57cd8324dc | ||
|
|
8aafbb9441 | ||
|
|
e4c2d0a779 | ||
|
|
59a213bdaa | ||
|
|
4b564b91bf | ||
|
|
4abfedea68 | ||
|
|
7d971a3262 | ||
|
|
b4474a4882 | ||
|
|
d1ac90bb3e | ||
|
|
785d9b8deb | ||
|
|
ab92801740 | ||
|
|
1d6536a53b | ||
|
|
60315d079b | ||
|
|
1a833a9267 | ||
|
|
70be790b2a | ||
|
|
2e2c57dbd1 | ||
|
|
3fa507d6d1 | ||
|
|
e47fa70279 | ||
|
|
e248503b0a | ||
|
|
3f2c66dca5 | ||
|
|
bd1769b11f | ||
|
|
af98088d04 | ||
|
|
aa076695b9 | ||
|
|
869964cb2f | ||
|
|
579c3ecc0e | ||
|
|
63b2ad36e1 | ||
|
|
ae01194a5e | ||
|
|
3c006c4ca4 | ||
|
|
738d54ff4c | ||
|
|
044bb1c395 | ||
|
|
180f16161c | ||
|
|
7f9e8d059b | ||
|
|
36ccb3bbfe | ||
|
|
1e6f3fc893 | ||
|
|
b4d0ee9b3b | ||
|
|
3e516e54b2 | ||
|
|
3baa00decb | ||
|
|
09a96670e6 | ||
|
|
78455ac3c0 | ||
|
|
2ec74e5c22 | ||
|
|
9d56309a05 | ||
|
|
4139504202 | ||
|
|
2f547c8c56 |
No files matched your search
+8
-1
@@ -19,9 +19,16 @@
|
||||
/mdk/build
|
||||
|
||||
#occupational hazards
|
||||
/projects/
|
||||
/projects/mcp/
|
||||
/projects/clean/
|
||||
/projects/forge/
|
||||
/projects/**/build/
|
||||
/projects/**/out/
|
||||
/projects/**/run/
|
||||
/projects/**/*.launch
|
||||
/repo/
|
||||
/buildSrc
|
||||
src/generated/resources/.cache/
|
||||
|
||||
#Patch rejects
|
||||
/patches-/
|
||||
|
||||
+4
-1
@@ -29,7 +29,10 @@ script:
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
# skip building travis on 1.13 - it doesn't work there
|
||||
# skip building travis on 1.13+ - it doesn't work there
|
||||
branches:
|
||||
except:
|
||||
- 1.13-pre
|
||||
- 1.13.x
|
||||
- 1.14.x
|
||||
- /^noci-.*$/
|
||||
Vendored
+46
-18
@@ -12,6 +12,9 @@ pipeline {
|
||||
}
|
||||
environment {
|
||||
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
|
||||
DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
|
||||
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -20,6 +23,22 @@ pipeline {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
stage('notify_start') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Started",
|
||||
successful: true,
|
||||
result: 'ABORTED', //White border
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
stage('setup') {
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
|
||||
@@ -27,11 +46,16 @@ pipeline {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
stage('changelog') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
@@ -47,13 +71,8 @@ pipeline {
|
||||
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}'
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
|
||||
}
|
||||
}
|
||||
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
|
||||
@@ -64,19 +83,28 @@ pipeline {
|
||||
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}'
|
||||
}
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true
|
||||
//junit 'build/test-results/*/*.xml'
|
||||
//jacoco sourcePattern: '**/src/*/java'
|
||||
script {
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
|
||||
//junit 'build/test-results/*/*.xml'
|
||||
//jacoco sourcePattern: '**/src/*/java'
|
||||
|
||||
if (env.CHANGE_ID == null) { // This is unset for non-PRs
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
|
||||
description: '```\n' + getChanges(currentBuild) + '\n```',
|
||||
successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"),
|
||||
result: currentBuild.currentResult,
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+216
-178
@@ -23,6 +23,7 @@ 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 org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
import java.util.stream.Collectors
|
||||
|
||||
@@ -30,7 +31,7 @@ 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'
|
||||
id 'com.github.ben-manes.versions' version '0.20.0'
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
@@ -44,13 +45,13 @@ ext {
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20180921-1.13'
|
||||
MC_VERSION = '1.13.2'
|
||||
MCP_VERSION = '20190213.203750'
|
||||
MAPPING_VERSION = '20190621-1.14.2'
|
||||
MC_VERSION = '1.14.3'
|
||||
MCP_VERSION = '20190624.152911'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
|
||||
apply plugin: 'net.minecraftforge.gradle.mcp'
|
||||
mcp {
|
||||
config = MC_VERSION + '-' + MCP_VERSION
|
||||
pipeline = 'joined'
|
||||
@@ -60,24 +61,44 @@ project(':mcp') {
|
||||
project(':clean') {
|
||||
evaluationDependsOn(':mcp')
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'net.minecraftforge:forgespi:0.13.+'
|
||||
}
|
||||
patcher {
|
||||
parent = project(':mcp')
|
||||
patchedSrc = file('src/main/java')
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
mcVersion = MC_VERSION
|
||||
}
|
||||
task runclient(type: JavaExec) {
|
||||
doFirst {
|
||||
mkdir 'runclient'
|
||||
patchedSrc = file('src/main/java')
|
||||
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
|
||||
runs {
|
||||
clean_client {
|
||||
taskName 'clean_client'
|
||||
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDirectory project.file('run')
|
||||
|
||||
args '--gameDir', '.'
|
||||
args '--version', MC_VERSION
|
||||
args '--assetsDir', downloadAssets.output
|
||||
args '--assetIndex', '{asset_index}'
|
||||
args '--accessToken', '0'
|
||||
}
|
||||
|
||||
clean_server {
|
||||
taskName 'clean_server'
|
||||
|
||||
main 'net.minecraft.server.MinecraftServer'
|
||||
workingDirectory project.file('run')
|
||||
}
|
||||
}
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
args = ['--accessToken', '0', '--version', MC_VERSION]
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDir 'runclient'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,61 +107,69 @@ project(':forge') {
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
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.
|
||||
group = 'net.minecraftforge.test' //TODO: remove test when we finish patches and want users to find it
|
||||
group = 'net.minecraftforge'
|
||||
|
||||
sourceSets {
|
||||
fmllauncher {
|
||||
java {
|
||||
srcDir "$rootDir/src/fmllauncher/java"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/fmllauncher/resources"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/resources"]
|
||||
}
|
||||
}
|
||||
main {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/main/java"
|
||||
srcDirs = ["$rootDir/src/main/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/main/resources"
|
||||
srcDirs = [
|
||||
"$rootDir/src/main/resources",
|
||||
"$rootDir/src/generated/resources"
|
||||
]
|
||||
}
|
||||
}
|
||||
test {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
// srcDir "$rootDir/src/test/java" TODO fix later
|
||||
srcDir "$rootDir/src/fmllaunchertest/java"
|
||||
srcDirs = [
|
||||
"$rootDir/src/test/java",
|
||||
"$rootDir/src/fmllaunchertest/java"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/test/resources"
|
||||
srcDirs = ["$rootDir/src/test/resources"]
|
||||
}
|
||||
}
|
||||
userdev {
|
||||
compileClasspath += sourceSets.main.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.main.runtimeClasspath
|
||||
java {
|
||||
srcDir "$rootDir/src/userdev/java"
|
||||
srcDirs = ["$rootDir/src/userdev/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/userdev/resources"
|
||||
srcDirs = ["$rootDir/src/userdev/resources"]
|
||||
}
|
||||
}
|
||||
}
|
||||
//Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
|
||||
eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
ext {
|
||||
SPEC_VERSION = '25.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '27.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.
|
||||
@@ -166,46 +195,104 @@ project(':forge') {
|
||||
version = getVersion()
|
||||
|
||||
patcher {
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
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
|
||||
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
|
||||
|
||||
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_client {
|
||||
taskName 'forge_client'
|
||||
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
workingDirectory project.file('run')
|
||||
|
||||
environment 'target', 'fmldevclient'
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', downloadAssets.output
|
||||
environment 'nativesDirectory', extractNatives.output
|
||||
|
||||
environment 'MC_VERSION', MC_VERSION
|
||||
environment 'MCP_VERSION', MCP_VERSION
|
||||
environment 'FORGE_GROUP', project.group
|
||||
environment 'FORGE_SPEC', SPEC_VERSION
|
||||
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
|
||||
environment 'LAUNCHER_VERSION', SPEC_VERSION
|
||||
property 'terminal.ansi', 'true'
|
||||
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
|
||||
|
||||
ideaModule "${rootProject.name}.${project.name}.userdev"
|
||||
|
||||
source sourceSets.main
|
||||
source sourceSets.userdev
|
||||
}
|
||||
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
|
||||
]
|
||||
|
||||
forge_test_client {
|
||||
parent runs.forge_client
|
||||
taskName 'forge_test_client'
|
||||
|
||||
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
|
||||
|
||||
mods {
|
||||
TestMods { sources sourceSets.test }
|
||||
}
|
||||
}
|
||||
|
||||
forge_server {
|
||||
taskName 'forge_server'
|
||||
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
workingDirectory project.file('run')
|
||||
|
||||
environment 'target', 'fmldevserver'
|
||||
|
||||
environment 'MC_VERSION', MC_VERSION
|
||||
environment 'MCP_VERSION', MCP_VERSION
|
||||
environment 'FORGE_GROUP', project.group
|
||||
environment 'FORGE_SPEC', SPEC_VERSION
|
||||
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
|
||||
environment 'LAUNCHER_VERSION', SPEC_VERSION
|
||||
|
||||
ideaModule "${rootProject.name}.${project.name}.userdev"
|
||||
|
||||
source sourceSets.main
|
||||
source sourceSets.userdev
|
||||
}
|
||||
|
||||
forge_test_server {
|
||||
parent runs.forge_server
|
||||
taskName 'forge_test_server'
|
||||
|
||||
environment 'MOD_CLASSES', 'dummy' // Needed to work around FG limitation, FG will replace this!
|
||||
|
||||
mods {
|
||||
TestMods { sources sourceSets.test }
|
||||
}
|
||||
}
|
||||
|
||||
forge_data {
|
||||
taskName 'forge_data'
|
||||
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
workingDirectory project.file('run')
|
||||
|
||||
environment 'target', 'fmldevdata'
|
||||
|
||||
environment 'MC_VERSION', MC_VERSION
|
||||
environment 'MCP_VERSION', MCP_VERSION
|
||||
environment 'FORGE_GROUP', project.group
|
||||
environment 'FORGE_SPEC', SPEC_VERSION
|
||||
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
|
||||
environment 'LAUNCHER_VERSION', SPEC_VERSION
|
||||
|
||||
ideaModule "${rootProject.name}.${project.name}.userdev"
|
||||
|
||||
source sourceSets.main
|
||||
source sourceSets.userdev
|
||||
|
||||
args '--mod', 'forge', '--all', '--output', rootProject.file('src/generated/resources/')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,67 +352,31 @@ project(':forge') {
|
||||
fmllauncherImplementation.extendsFrom(installer)
|
||||
}
|
||||
dependencies {
|
||||
api 'net.minecraft:client:1.13:extra'
|
||||
installer 'com.paulscode:soundsystem:2018+'
|
||||
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.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 'cpw.mods:modlauncher:2.1.+'
|
||||
installer 'cpw.mods:grossjava9hacks:1.1.+'
|
||||
installer 'net.minecraftforge:accesstransformers:0.16.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.10.+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.13.+'
|
||||
installer 'net.minecraftforge:coremods:0.5.+'
|
||||
installer 'net.minecraftforge:unsafe:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.6.0'
|
||||
installer 'com.electronwill.night-config:toml:3.6.0'
|
||||
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 'org.apache.logging.log4j:log4j-api:2.11.2'
|
||||
installer 'org.apache.logging.log4j:log4j-core:2.11.2'
|
||||
installer 'net.minecrell:terminalconsoleappender:1.1.+'
|
||||
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
|
||||
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"]) {
|
||||
doFirst {
|
||||
mkdir 'runclient'
|
||||
}
|
||||
doFirst {
|
||||
copy {
|
||||
from sourceSets.main.resources
|
||||
into "$buildDir/classes/java/main"
|
||||
}
|
||||
}
|
||||
//jvmArgs = ['-verbose:class']
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
main patcher.runs.forge_client.main
|
||||
systemProperties = patcher.runs.forge_client.properties
|
||||
environment += patcher.runs.forge_client.environment
|
||||
workingDir 'runclient'
|
||||
}
|
||||
|
||||
task runserver(type: JavaExec) {
|
||||
doFirst {
|
||||
mkdir 'runserver'
|
||||
}
|
||||
doFirst {
|
||||
copy {
|
||||
from sourceSets.main.resources
|
||||
into "$buildDir/classes/java/main"
|
||||
}
|
||||
}
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
main patcher.runs.forge_server.main
|
||||
args 'nogui'
|
||||
systemProperties = patcher.runs.forge_server.properties
|
||||
environment += patcher.runs.forge_server.environment
|
||||
workingDir 'runserver'
|
||||
standardInput = System.in
|
||||
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
|
||||
}
|
||||
|
||||
def extraTxts = [
|
||||
@@ -467,18 +518,7 @@ project(':forge') {
|
||||
type: 'release',
|
||||
mainClass: 'cpw.mods.modlauncher.Launcher',
|
||||
inheritsFrom: MC_VERSION,
|
||||
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'
|
||||
],
|
||||
type: 'log4j2-xml'
|
||||
]
|
||||
],
|
||||
logging: {},
|
||||
arguments: [
|
||||
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"]
|
||||
],
|
||||
@@ -511,7 +551,7 @@ project(':forge') {
|
||||
ext {
|
||||
output = file('build/install_profile.json')
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.0.4'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
|
||||
}
|
||||
doFirst {
|
||||
ext.BIN_PATCHER = 'net.minecraftforge:binarypatcher:' + genClientBinPatches.resolvedVersion
|
||||
@@ -562,14 +602,6 @@ project(':forge') {
|
||||
client: "'${sha1(tasks.getByName('downloadClientSlim').output)}'",
|
||||
server: "'${sha1(tasks.getByName('downloadServerSlim').output)}'"
|
||||
],
|
||||
MC_DATA: [
|
||||
client: "[net.minecraft:client:${MC_VERSION}:data]",
|
||||
server: "[net.minecraft:server:${MC_VERSION}:data]"
|
||||
],
|
||||
MC_DATA_SHA: [
|
||||
client: "'${sha1(tasks.getByName('downloadClientData').output)}'",
|
||||
server: "'${sha1(tasks.getByName('downloadServerData').output)}'"
|
||||
],
|
||||
MC_EXTRA: [
|
||||
client: "[net.minecraft:client:${MC_VERSION}:extra]",
|
||||
server: "[net.minecraft:server:${MC_VERSION}:extra]"
|
||||
@@ -607,13 +639,11 @@ project(':forge') {
|
||||
args: [
|
||||
'--input', '{MINECRAFT_JAR}',
|
||||
'--slim', '{MC_SLIM}',
|
||||
'--data', '{MC_DATA}',
|
||||
'--extra', '{MC_EXTRA}',
|
||||
'--srg', '{MAPPINGS}'
|
||||
],
|
||||
outputs: [
|
||||
'{MC_SLIM}': '{MC_SLIM_SHA}',
|
||||
'{MC_DATA}': '{MC_DATA_SHA}',
|
||||
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
|
||||
]
|
||||
], [ // SpecialSource has a bug where it won't create the nessasary directories, remove when they fix that.
|
||||
@@ -653,7 +683,7 @@ project(':forge') {
|
||||
}
|
||||
|
||||
['client', 'server'].each { side ->
|
||||
['slim', 'extra', 'data'].each { type ->
|
||||
['slim', 'extra'].each { type ->
|
||||
def name = "download${side.capitalize()}${type.capitalize()}"
|
||||
task "${name}"(type: DownloadMavenArtifact) {
|
||||
artifact = "net.minecraft:${side}:${MC_VERSION}:${type}"
|
||||
@@ -698,47 +728,30 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
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]) {
|
||||
task launcherJar(type: Jar) {
|
||||
classifier 'launcher'
|
||||
from sourceSets.fmllauncher.output
|
||||
from fmllauncherConfig.outputFile
|
||||
doFirst {
|
||||
def classpath = new StringBuilder()
|
||||
def artifacts = getArtifacts(project, project.configurations.installer, false)
|
||||
artifacts.each { key, lib ->
|
||||
classpath += "libraries/${lib.downloads.artifact.path} "
|
||||
}
|
||||
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-data.jar "
|
||||
classpath += "libraries/net/minecraft/server/${MC_VERSION}/server-${MC_VERSION}-extra.jar"
|
||||
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
if (pkg == '/') {
|
||||
manifest.attributes(values += [
|
||||
'Main-Class': 'net.minecraftforge.server.ServerMain',
|
||||
'Class-Path': classpath.toString()
|
||||
'Class-Path': classpath.toString(),
|
||||
'ServerLaunchArgs': [
|
||||
'--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(' ')
|
||||
])
|
||||
} else {
|
||||
manifest.attributes(values, pkg)
|
||||
@@ -836,27 +849,46 @@ project(':forge') {
|
||||
}
|
||||
addLibrary("${project.group}:${project.name}:${project.version}:launcher")
|
||||
runs {
|
||||
client = {
|
||||
main 'net.minecraftforge.userdev.UserdevLauncher'
|
||||
client {
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
|
||||
environment 'target', 'fmluserdevclient'
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
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 'MC_VERSION', "${MC_VERSION}"
|
||||
environment 'FORGE_GROUP', "${project.group}"
|
||||
environment 'MCP_VERSION', "${MCP_VERSION}"
|
||||
environment 'MOD_CLASSES', '{source_roots}'
|
||||
environment 'MCP_MAPPINGS', '{mcp_mappings}'
|
||||
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
|
||||
}
|
||||
server = {
|
||||
main 'net.minecraftforge.userdev.UserdevLauncher'
|
||||
|
||||
server {
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
|
||||
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 'MC_VERSION', "${MC_VERSION}"
|
||||
environment 'FORGE_GROUP', "${project.group}"
|
||||
environment 'MCP_VERSION', "${MCP_VERSION}"
|
||||
environment 'MOD_CLASSES', '{source_roots}'
|
||||
environment 'MCP_MAPPINGS', '{mcp_mappings}'
|
||||
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
|
||||
}
|
||||
|
||||
data {
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
|
||||
environment 'target', 'fmldevdata'
|
||||
|
||||
environment 'MC_VERSION', "${MC_VERSION}"
|
||||
environment 'FORGE_GROUP', "${project.group}"
|
||||
environment 'MCP_VERSION', "${MCP_VERSION}"
|
||||
environment 'MOD_CLASSES', '{source_roots}'
|
||||
environment 'MCP_MAPPINGS', '{mcp_mappings}'
|
||||
environment 'FORGE_VERSION', "${project.version.substring(MC_VERSION.length() + 1)}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -905,9 +937,15 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
applyRangeMap {
|
||||
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
|
||||
extractRangeMap {
|
||||
addDependencies jar.archivePath
|
||||
addSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
applyRangeMap {
|
||||
setSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn('genEclipseRuns')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
|
||||
+12
-21
@@ -19,35 +19,26 @@ http://mcforge.readthedocs.io/en/latest/gettingstarted/
|
||||
|
||||
Step 1: Open your command-line and browse to the folder where you extracted the zip file.
|
||||
|
||||
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
|
||||
Step 2: You're left with a choice.
|
||||
If you prefer to use Eclipse:
|
||||
1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux)
|
||||
2. Open Eclipse, Import > Existing Gradle Project > Select Folder
|
||||
or run "gradlew eclipse" to generate the project.
|
||||
(Current Issue)
|
||||
4. Open Project > Run/Debug Settings > Edit runClient and runServer > Environment
|
||||
5. Edit MOD_CLASSES to show [modid]%%[Path]; 2 times rather then the generated 4.
|
||||
|
||||
Windows: "gradlew setupDecompWorkspace"
|
||||
Linux/Mac OS: "./gradlew setupDecompWorkspace"
|
||||
|
||||
Step 3: After all that finished, you're left with a choice.
|
||||
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
|
||||
|
||||
If you prefer to use IntelliJ, steps are a little different.
|
||||
If you prefer to use IntelliJ:
|
||||
1. Open IDEA, and import project.
|
||||
2. Select your build.gradle file and have it import.
|
||||
3. Once it's finished you must close IntelliJ and run the following command:
|
||||
|
||||
"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
|
||||
|
||||
Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
|
||||
3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
|
||||
4. Refresh the Gradle Project in IDEA if required.
|
||||
|
||||
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.
|
||||
|
||||
Should it still not work,
|
||||
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
|
||||
|
||||
Tip:
|
||||
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
|
||||
"setupDevWorkspace": Will patch, deobfuscate, and gather required assets to run minecraft, but will not generate human readable source code.
|
||||
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
|
||||
|
||||
Tip:
|
||||
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
|
||||
or the Forge Project Discord discord.gg/UvedJ9m
|
||||
|
||||
Forge source installation
|
||||
=========================
|
||||
|
||||
+79
-40
@@ -9,8 +9,9 @@ buildscript {
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.0'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
@@ -19,34 +20,49 @@ archivesBaseName = 'modid'
|
||||
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.
|
||||
// snapshot_YYYYMMDD snapshot are built nightly.
|
||||
// stable_# stables are built at the discretion of the MCP team.
|
||||
// The mappings can be changed at any time, and must be in the following format.
|
||||
// snapshot_YYYYMMDD Snapshot are built nightly.
|
||||
// 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.
|
||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
|
||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||
|
||||
//accessTransformer = file('my_at.cfg')
|
||||
// accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
|
||||
|
||||
// default run configurations.
|
||||
// these can be tweaked, removed, or duplicated as needed.
|
||||
// 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
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
|
||||
// Recommended logging level for the console
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
mods {
|
||||
examplemod {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,22 +73,21 @@ dependencies {
|
||||
// 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..
|
||||
//compile "some.group:artifact:version:classifier"
|
||||
//compile "some.group:artifact:version"
|
||||
// You may put jars on which you depend on in ./libs or you may define them like so..
|
||||
// compile "some.group:artifact:version:classifier"
|
||||
// compile "some.group:artifact:version"
|
||||
|
||||
// real examples
|
||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
// Real examples
|
||||
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
|
||||
// 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 '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'
|
||||
|
||||
// These dependencies get remapped to your current MCP mappings
|
||||
//deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// for more info...
|
||||
// For more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
@@ -81,12 +96,36 @@ dependencies {
|
||||
// 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")],)
|
||||
attributes([
|
||||
"Specification-Title": "examplemod",
|
||||
"Specification-Vendor": "examplemodsareus",
|
||||
"Specification-Version": "1", // We are version 1 of ourselves
|
||||
"Implementation-Title": project.name,
|
||||
"Implementation-Version": "${version}",
|
||||
"Implementation-Vendor" :"examplemodsareus",
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish task
|
||||
// we define a custom artifact that is sourced from the reobfJar output task
|
||||
// and then declare that to be published
|
||||
// Note you'll need to add a repository here
|
||||
def reobfFile = file("$buildDir/reobfJar/output.jar")
|
||||
def reobfArtifact = artifacts.add('default', reobfFile) {
|
||||
type 'jar'
|
||||
builtBy 'reobfJar'
|
||||
}
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact reobfArtifact
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "file:///${project.projectDir}/mcmodsrepo"
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Binary file not shown.
-4
@@ -1,4 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
version=1
|
||||
eclipse.preferences.version=1
|
||||
refresh.enabled=true
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
#Sun Jun 05 19:03:53 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.debug.ui.UseContextualLaunch=false
|
||||
Console.highWaterMark=88000
|
||||
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
|
||||
org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<viewBindings>\r\n<view id\="org.eclipse.ui.console.ConsoleView">\r\n<perspective id\="org.eclipse.jdt.ui.JavaPerspective" userAction\="opened"/>\r\n</view>\r\n</viewBindings>\r\n
|
||||
StringVariablePreferencePage=130,107,107,86,
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.epp.usagedata.gathering.enabled=false
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
#Sun Sep 18 16:44:39 NZST 2011
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
#Sun Jun 05 18:58:05 CEST 2011
|
||||
spacesForTabs=true
|
||||
eclipse.preferences.version=1
|
||||
overviewRuler_migration=migrated_3.1
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
IMPORT_FILES_AND_FOLDERS_MODE=prompt
|
||||
IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt
|
||||
SAVE_ALL_BEFORE_BUILD=true
|
||||
eclipse.preferences.version=1
|
||||
tipsAndTricks=true
|
||||
platformState=1287081747687
|
||||
quickStart=false
|
||||
PROBLEMS_FILTERS_MIGRATE=true
|
||||
@@ -1,3 +0,0 @@
|
||||
#Sun Jun 05 18:50:08 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
showIntro=false
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/MDKExample"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStart"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="MDKExample"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}/run"/>
|
||||
</launchConfiguration>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/MDKExample"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStartServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="MDKExample"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc}/run"/>
|
||||
</launchConfiguration>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchHistory>
|
||||
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Client"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Server"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Client"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Server"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
</launchHistory>
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.example.examplemod;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
@@ -35,7 +35,7 @@ public class ExampleMod
|
||||
// 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
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@@ -54,28 +54,29 @@ public class ExampleMod
|
||||
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";});
|
||||
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
|
||||
}
|
||||
|
||||
private void processIMC(final InterModProcessEvent event)
|
||||
{
|
||||
// some example code to receive and process InterModComms from other mods
|
||||
LOGGER.info("Got IMC", event.getIMCStream().
|
||||
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 static void onServerStarting(FMLServerStartingEvent event) {
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
// do something when the server starts
|
||||
LOGGER.info("HELLO from server starting");
|
||||
}
|
||||
|
||||
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD event bus
|
||||
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
|
||||
// Event bus for receiving Registry Events)
|
||||
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
|
||||
public static class RegistryEvents {
|
||||
@SubscribeEvent
|
||||
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
}
|
||||
|
||||
@@ -6,17 +6,9 @@
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[24,)" #mandatory (24 is current forge version)
|
||||
loaderVersion="[26,)" #mandatory (26 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
|
||||
displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
logoFile="examplemod.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
credits="Thanks for this example mod goes to Java" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors="Love, Cheese and small house plants" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
@@ -27,6 +19,14 @@ version="${file.jarVersion}" #mandatory
|
||||
displayName="Example Mod" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
logoFile="examplemod.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
credits="Thanks for this example mod goes to Java" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors="Love, Cheese and small house plants" #optional
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description='''
|
||||
This is a long form description of the mod. You can write whatever you want here
|
||||
@@ -42,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="[24,)" #mandatory
|
||||
versionRange="[26,)" #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
|
||||
@@ -51,6 +51,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
||||
[[dependencies.examplemod]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.13]"
|
||||
versionRange="[1.14.2]"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
@@ -0,0 +1,24 @@
|
||||
--- a/com/mojang/blaze3d/platform/GLX.java
|
||||
+++ b/com/mojang/blaze3d/platform/GLX.java
|
||||
@@ -115,6 +115,10 @@
|
||||
p_212906_0_.put(1286, "Operation on incomplete framebuffer");
|
||||
});
|
||||
|
||||
+ /* Stores the last values sent into glMultiTexCoord2f */
|
||||
+ public static float lastBrightnessX = 0.0f;
|
||||
+ public static float lastBrightnessY = 0.0f;
|
||||
+
|
||||
public static void populateSnooperWithOpenGL(IDataHolder p_populateSnooperWithOpenGL_0_) {
|
||||
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_version", GlStateManager.getString(7938));
|
||||
p_populateSnooperWithOpenGL_0_.setFixedData("opengl_vendor", GlStateManager.getString(7936));
|
||||
@@ -913,6 +917,10 @@
|
||||
GL13.glMultiTexCoord2f(p_glMultiTexCoord2f_0_, p_glMultiTexCoord2f_1_, p_glMultiTexCoord2f_2_);
|
||||
}
|
||||
|
||||
+ if (p_glMultiTexCoord2f_0_ == GL_TEXTURE1) {
|
||||
+ lastBrightnessX = p_glMultiTexCoord2f_1_;
|
||||
+ lastBrightnessY = p_glMultiTexCoord2f_2_;
|
||||
+ }
|
||||
}
|
||||
|
||||
public static void glBlendFuncSeparate(int p_glBlendFuncSeparate_0_, int p_glBlendFuncSeparate_1_, int p_glBlendFuncSeparate_2_, int p_glBlendFuncSeparate_3_) {
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/com/mojang/blaze3d/platform/TextureUtil.java
|
||||
+++ b/com/mojang/blaze3d/platform/TextureUtil.java
|
||||
@@ -44,7 +44,10 @@
|
||||
}
|
||||
|
||||
public static void prepareImage(NativeImage.PixelFormatGLCode p_prepareImage_0_, int p_prepareImage_1_, int p_prepareImage_2_, int p_prepareImage_3_, int p_prepareImage_4_) {
|
||||
- bind(p_prepareImage_1_);
|
||||
+ synchronized (net.minecraftforge.fml.client.SplashProgress.class)
|
||||
+ {
|
||||
+ bind(p_prepareImage_1_);
|
||||
+ }
|
||||
if (p_prepareImage_2_ >= 0) {
|
||||
GlStateManager.texParameter(3553, 33085, p_prepareImage_2_);
|
||||
GlStateManager.texParameter(3553, 33082, 0);
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/advancements/AdvancementRewards.java
|
||||
+++ b/net/minecraft/advancements/AdvancementRewards.java
|
||||
@@ -41,7 +41,7 @@
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
public void func_192113_a(EntityPlayerMP p_192113_1_) {
|
||||
public void func_192113_a(ServerPlayerEntity p_192113_1_) {
|
||||
p_192113_1_.func_195068_e(this.field_192115_b);
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_204313_a(new BlockPos(p_192113_1_)).func_186471_a();
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_204313_a(new BlockPos(p_192113_1_)).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // FORGE: add player & luck to LootContext
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_216022_a(LootParameterSets.field_216265_f);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_216015_a(LootParameters.field_216281_a, p_192113_1_).func_216015_a(LootParameters.field_216286_f, new BlockPos(p_192113_1_)).func_216023_a(p_192113_1_.func_70681_au()).func_186469_a(p_192113_1_.func_184817_da()).func_216022_a(LootParameterSets.field_216265_f); // FORGE: luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
for(ResourceLocation resourcelocation : this.field_192116_c) {
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -174,6 +174,8 @@
|
||||
@@ -187,6 +187,8 @@
|
||||
}
|
||||
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
|
||||
@@ -9,9 +9,9 @@
|
||||
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()));
|
||||
@@ -199,6 +201,7 @@
|
||||
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
|
||||
this.field_192756_d.func_184103_al().func_148539_a(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()));
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
@@ -24,6 +24,8 @@
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
@@ -25,6 +25,8 @@
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
public class ItemPredicate {
|
||||
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> custom_predicates = new java.util.HashMap<>();
|
||||
@@ -9,14 +9,14 @@
|
||||
public static final ItemPredicate field_192495_a = new ItemPredicate();
|
||||
@Nullable
|
||||
private final Tag<Item> field_200018_b;
|
||||
@@ -90,6 +92,11 @@
|
||||
@@ -93,6 +95,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");
|
||||
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);
|
||||
+ 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"));
|
||||
@@ -30,7 +30,7 @@
|
||||
+ }
|
||||
+
|
||||
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
|
||||
+ return unmod_predicates;
|
||||
+ return unmod_predicates;
|
||||
+ }
|
||||
+
|
||||
public static class Builder {
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
--- a/net/minecraft/block/AbstractRailBlock.java
|
||||
+++ b/net/minecraft/block/AbstractRailBlock.java
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
public VoxelShape func_220053_a(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_) {
|
||||
- RailShape railshape = p_220053_1_.func_177230_c() == this ? p_220053_1_.func_177229_b(this.func_176560_l()) : null;
|
||||
+ RailShape railshape = p_220053_1_.func_177230_c() == this ? getRailDirection(p_220053_1_, p_220053_2_, p_220053_3_, null) : null;
|
||||
return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public void func_220069_a(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_) {
|
||||
if (!p_220069_2_.field_72995_K) {
|
||||
- RailShape railshape = p_220069_1_.func_177229_b(this.func_176560_l());
|
||||
+ RailShape railshape = getRailDirection(p_220069_1_, p_220069_2_, p_220069_3_, null);
|
||||
boolean flag = false;
|
||||
BlockPos blockpos = p_220069_3_.func_177977_b();
|
||||
if (!func_220064_c(p_220069_2_, blockpos)) {
|
||||
@@ -115,7 +115,7 @@
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
if (!p_196243_5_) {
|
||||
super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_);
|
||||
- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) {
|
||||
+ if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) {
|
||||
p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this);
|
||||
}
|
||||
|
||||
@@ -127,5 +127,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(BlockState state, IBlockReader world, BlockPos pos)
|
||||
+ {
|
||||
+ return !this.field_196277_c;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's direction.
|
||||
+ * Can be used to make the cart think the rail is a different shape,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @param state The BlockState
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @return The direction.
|
||||
+ */
|
||||
+ public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @javax.annotation.Nullable net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return state.func_177229_b(func_176560_l());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pos Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(BlockState state, World world, BlockPos pos, net.minecraft.entity.item.minecart.AbstractMinecartEntity cart) { }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/net/minecraft/block/BedBlock.java
|
||||
+++ b/net/minecraft/block/BedBlock.java
|
||||
@@ -85,7 +85,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (p_220051_2_.field_73011_w.func_76567_e() && p_220051_2_.func_180494_b(p_220051_3_) != Biomes.field_76778_j) {
|
||||
+ net.minecraftforge.common.extensions.IForgeDimension.SleepResult sleepResult = p_220051_2_.field_73011_w.canSleepAt(p_220051_4_, p_220051_3_);
|
||||
+ if (sleepResult != net.minecraftforge.common.extensions.IForgeDimension.SleepResult.BED_EXPLODES) {
|
||||
+ if (sleepResult == net.minecraftforge.common.extensions.IForgeDimension.SleepResult.DENY) return true;
|
||||
if (p_220051_1_.func_177229_b(field_176471_b)) {
|
||||
p_220051_4_.func_146105_b(new TranslationTextComponent("block.minecraft.bed.occupied"), true);
|
||||
return true;
|
||||
@@ -7,22 +7,22 @@
|
||||
-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();
|
||||
- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<>();
|
||||
- public static final ObjectIntIdentityMap<BlockState> 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 @@
|
||||
+ public static final ObjectIntIdentityMap<BlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
|
||||
private static final Direction[] field_212556_a = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
|
||||
private static final LoadingCache<VoxelShape, Boolean> field_223006_b = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader<VoxelShape, Boolean>() {
|
||||
public Boolean load(VoxelShape p_load_1_) {
|
||||
@@ -291,7 +292,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();
|
||||
public boolean func_196253_a(BlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
|
||||
- return this.field_149764_J.func_76222_j() && (p_196253_2_.func_195996_i().func_190926_b() || 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_190926_b() || p_196253_2_.func_195996_i().func_77973_b() != this.func_199767_j());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -310,8 +311,9 @@
|
||||
@@ -303,8 +304,9 @@
|
||||
return this.field_149789_z;
|
||||
}
|
||||
|
||||
@@ -33,34 +33,28 @@
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -322,11 +324,11 @@
|
||||
@@ -315,7 +317,7 @@
|
||||
@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 @@
|
||||
public int func_220058_a(BlockState p_220058_1_, IEnviromentBlockReader p_220058_2_, BlockPos p_220058_3_) {
|
||||
- return p_220058_2_.func_217338_b(p_220058_3_, p_220058_1_.func_185906_d());
|
||||
+ return p_220058_2_.func_217338_b(p_220058_3_, p_220058_1_.getLightValue(p_220058_2_, p_220058_3_));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -460,10 +462,9 @@
|
||||
|
||||
@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_);
|
||||
+ }
|
||||
public void func_196243_a(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_) {
|
||||
- if (this.func_149716_u() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
+ if (p_196243_1_.hasTileEntity() && p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
|
||||
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 @@
|
||||
@Deprecated
|
||||
@@ -472,8 +473,8 @@
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
@@ -71,41 +65,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
-
|
||||
}
|
||||
@@ -553,7 +554,7 @@
|
||||
}
|
||||
|
||||
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;
|
||||
+ }
|
||||
- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
|
||||
+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180635_0_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
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 @@
|
||||
@@ -565,7 +566,7 @@
|
||||
}
|
||||
|
||||
public void func_180637_b(World p_180637_1_, BlockPos p_180637_2_, int p_180637_3_) {
|
||||
- if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f)) {
|
||||
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_223586_b(GameRules.field_223603_f) && !p_180637_1_.restoringBlockSnapshots) { // do not drop items while restoring blockstates, prevents item dupe
|
||||
while(p_180637_3_ > 0) {
|
||||
int i = ExperienceOrbEntity.func_70527_a(p_180637_3_);
|
||||
p_180637_3_ -= i;
|
||||
@@ -575,6 +576,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -113,57 +91,39 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+ @Deprecated //Use state sensitive version
|
||||
protected boolean func_149700_E() {
|
||||
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
|
||||
}
|
||||
@@ -663,6 +676,7 @@
|
||||
p_176216_2_.field_70181_x = 0.0D;
|
||||
@@ -677,6 +679,7 @@
|
||||
p_176216_2_.func_213317_d(p_176216_2_.func_213322_ci().func_216372_d(1.0D, 0.0D, 1.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_) {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
|
||||
return new ItemStack(this);
|
||||
@@ -691,6 +694,7 @@
|
||||
return Fluids.field_204541_a.func_207188_f();
|
||||
}
|
||||
@@ -737,6 +751,7 @@
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version
|
||||
public float func_208618_m() {
|
||||
return this.field_149765_K;
|
||||
}
|
||||
@@ -711,6 +715,7 @@
|
||||
public void func_176224_k(World p_176224_1_, BlockPos p_176224_2_) {
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version
|
||||
public boolean func_149659_a(Explosion p_149659_1_) {
|
||||
return true;
|
||||
}
|
||||
@@ -755,6 +760,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version {@link IForgeBlockState#getSoundType(IWorldReader, BlockPos, Entity) }
|
||||
public SoundType func_185467_w() {
|
||||
public SoundType func_220072_p(BlockState p_220072_1_) {
|
||||
return this.field_149762_H;
|
||||
}
|
||||
@@ -758,11 +773,11 @@
|
||||
@@ -780,13 +786,80 @@
|
||||
}
|
||||
|
||||
public static boolean func_196252_e(Block p_196252_0_) {
|
||||
@@ -176,72 +136,32 @@
|
||||
+ 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 =====================================*/
|
||||
+ 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);
|
||||
+ protected static ThreadLocal<NonNullList<ItemStack>> capturedDrops = ThreadLocal.withInitial(NonNullList::func_191196_a);
|
||||
+ protected NonNullList<ItemStack> captureDrops(boolean start)
|
||||
+ {
|
||||
+ if (start) {
|
||||
+ captureDrops.set(true);
|
||||
+ capturedDrops.get().clear();
|
||||
+ return NonNullList.func_191196_a();
|
||||
+ } else {
|
||||
+ captureDrops.set(false);
|
||||
+ return capturedDrops.get();
|
||||
+ }
|
||||
+ }
|
||||
+ private final net.minecraftforge.common.util.ReverseTagWrapper<Block> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, BlockTags::getGeneration, BlockTags::func_199896_a);
|
||||
+
|
||||
+ @Override
|
||||
+ public float getSlipperiness(IBlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
|
||||
+ public float getSlipperiness(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
|
||||
+ return this.field_149765_K;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSilkHarvest(IBlockState state, IWorldReader world, BlockPos pos, EntityPlayer player) {
|
||||
+ return this.func_149700_E() && !state.hasTileEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(IBlockState state) {
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(BlockState state) {
|
||||
+ return harvestTool; //TODO: RE-Evaluate
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getHarvestLevel(IBlockState state) {
|
||||
+ public int getHarvestLevel(BlockState state) {
|
||||
+ 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));
|
||||
+ public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, net.minecraftforge.common.IPlantable plantable) {
|
||||
+ BlockState plant = plantable.getPlant(world, pos.func_177972_a(facing));
|
||||
+ net.minecraftforge.common.PlantType 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;
|
||||
@@ -249,16 +169,16 @@
|
||||
+ 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))
|
||||
+ if (plantable instanceof BushBlock && ((BushBlock)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 Desert: return this.getBlock() == Blocks.field_150354_m || this.getBlock() == Blocks.field_150405_ch || this.getBlock() instanceof GlazedTerracottaBlock;
|
||||
+ 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 Crop: return this.getBlock() == Blocks.field_150458_ak;
|
||||
+ case Cave: return Block.func_220056_d(state, world, pos, Direction.UP);
|
||||
+ 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 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 ||
|
||||
@@ -270,6 +190,11 @@
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public final java.util.Set<ResourceLocation> getTags() {
|
||||
+ return reverseTags.getTagNames();
|
||||
+ }
|
||||
+
|
||||
+ static {
|
||||
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
|
||||
+ block.harvestTool = tool;
|
||||
@@ -277,4 +202,7 @@
|
||||
+ });
|
||||
+ }
|
||||
+ /* ========================================= FORGE END ======================================*/
|
||||
}
|
||||
+
|
||||
public static enum OffsetType {
|
||||
NONE,
|
||||
XZ,
|
||||
@@ -1,22 +0,0 @@
|
||||
--- 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));
|
||||
+ }
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
--- 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;
|
||||
@@ -1,13 +0,0 @@
|
||||
--- 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) {
|
||||
@@ -1,32 +0,0 @@
|
||||
--- 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;
|
||||
+ }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--- 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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
--- 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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
--- 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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--- 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));
|
||||
+ }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- 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 {
|
||||
@@ -1,19 +0,0 @@
|
||||
--- 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 {
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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;
|
||||
@@ -1,21 +0,0 @@
|
||||
--- 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.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
--- 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);
|
||||
+ }
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--- 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;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
--- 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());
|
||||
@@ -1,12 +0,0 @@
|
||||
--- 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;
|
||||
+ }
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
--- 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));
|
||||
+ }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--- 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;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
--- 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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
--- 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_) {
|
||||
@@ -1,50 +0,0 @@
|
||||
--- 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);
|
||||
+ }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
--- 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)));
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--- 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();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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 {
|
||||
@@ -1,25 +0,0 @@
|
||||
--- 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())];
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
--- 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) { }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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();
|
||||
@@ -1,29 +0,0 @@
|
||||
--- 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);
|
||||
@@ -1,19 +0,0 @@
|
||||
--- 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);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--- 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);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
--- 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)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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_);
|
||||
@@ -1,71 +0,0 @@
|
||||
--- 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
--- 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));
|
||||
+ }
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
--- 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,26 @@
|
||||
--- a/net/minecraft/block/BlockState.java
|
||||
+++ b/net/minecraft/block/BlockState.java
|
||||
@@ -51,7 +51,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class BlockState extends StateHolder<Block, BlockState> implements IStateHolder<BlockState> {
|
||||
+public class BlockState extends StateHolder<Block, BlockState> implements IStateHolder<BlockState>, net.minecraftforge.common.extensions.IForgeBlockState {
|
||||
@Nullable
|
||||
private BlockState.Cache field_215707_c;
|
||||
private final int field_215708_d;
|
||||
@@ -106,10 +106,14 @@
|
||||
return this.field_215708_d;
|
||||
}
|
||||
|
||||
+ /** @deprecated use {@link BlockState#isAir(IBlockReader, BlockPos) */
|
||||
+ @Deprecated
|
||||
public boolean func_196958_f() {
|
||||
return this.func_177230_c().func_196261_e(this);
|
||||
}
|
||||
|
||||
+ /** @deprecated use {@link BlockState#rotate(IWorld, BlockPos, Rotation) */
|
||||
+ @Deprecated
|
||||
public MaterialColor func_185909_g(IBlockReader p_185909_1_, BlockPos p_185909_2_) {
|
||||
return this.func_177230_c().func_180659_g(this, p_185909_1_, p_185909_2_);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
--- 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
--- 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);
|
||||
+ }
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
--- 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)
|
||||
@@ -1,17 +0,0 @@
|
||||
--- 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;
|
||||
+ }
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
--- 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));
|
||||
+ }
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
--- 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));
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--- 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,36 @@
|
||||
--- a/net/minecraft/block/Blocks.java
|
||||
+++ b/net/minecraft/block/Blocks.java
|
||||
@@ -13,6 +13,7 @@
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
[email protected]("minecraft")
|
||||
public class Blocks {
|
||||
public static final Block field_150350_a = func_222382_a("air", new AirBlock(Block.Properties.func_200945_a(Material.field_151579_a).func_200942_a().func_222380_e()));
|
||||
public static final Block field_150348_b = func_222382_a("stone", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151665_m).func_200948_a(1.5F, 6.0F)));
|
||||
@@ -104,7 +105,7 @@
|
||||
public static final Block field_196601_az = func_222382_a("green_bed", new BedBlock(DyeColor.GREEN, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F)));
|
||||
public static final Block field_196550_aA = func_222382_a("red_bed", new BedBlock(DyeColor.RED, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F)));
|
||||
public static final Block field_196551_aB = func_222382_a("black_bed", new BedBlock(DyeColor.BLACK, Block.Properties.func_200945_a(Material.field_151580_n).func_200947_a(SoundType.field_185848_a).func_200943_b(0.2F)));
|
||||
- public static final Block field_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
|
||||
+ public static final Block field_196552_aC = func_222382_a("powered_rail", new PoweredRailBlock(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));
|
||||
public static final Block field_150319_E = func_222382_a("detector_rail", new DetectorRailBlock(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e)));
|
||||
public static final Block field_150320_F = func_222382_a("sticky_piston", new PistonBlock(true, Block.Properties.func_200945_a(Material.field_76233_E).func_200943_b(0.5F)));
|
||||
public static final Block field_196553_aF = func_222382_a("cobweb", new WebBlock(Block.Properties.func_200945_a(Material.field_151569_G).func_200942_a().func_200943_b(4.0F)));
|
||||
@@ -694,16 +695,4 @@
|
||||
private static Block func_222382_a(String p_222382_0_, Block p_222382_1_) {
|
||||
return Registry.func_218325_a(Registry.field_212618_g, p_222382_0_, p_222382_1_);
|
||||
}
|
||||
-
|
||||
- static {
|
||||
- for(Block block : Registry.field_212618_g) {
|
||||
- for(BlockState blockstate : block.func_176194_O().func_177619_a()) {
|
||||
- blockstate.func_215692_c();
|
||||
- Block.field_176229_d.func_195867_b(blockstate);
|
||||
- }
|
||||
-
|
||||
- block.func_220068_i();
|
||||
- }
|
||||
-
|
||||
- }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/block/BushBlock.java
|
||||
+++ b/net/minecraft/block/BushBlock.java
|
||||
@@ -7,7 +7,7 @@
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
|
||||
-public class BushBlock extends Block {
|
||||
+public class BushBlock extends Block implements net.minecraftforge.common.IPlantable {
|
||||
protected BushBlock(Block.Properties p_i48437_1_) {
|
||||
super(p_i48437_1_);
|
||||
}
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader 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, Direction.UP, this);
|
||||
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
|
||||
}
|
||||
|
||||
@@ -33,4 +35,11 @@
|
||||
public boolean func_200123_i(BlockState p_200123_1_, IBlockReader p_200123_2_, BlockPos p_200123_3_) {
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public BlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ BlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ }
|
||||
}
|
||||
+22
-22
@@ -1,31 +1,31 @@
|
||||
--- a/net/minecraft/block/BlockCactus.java
|
||||
+++ b/net/minecraft/block/BlockCactus.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraft.world.IWorldReaderBase;
|
||||
--- a/net/minecraft/block/CactusBlock.java
|
||||
+++ b/net/minecraft/block/CactusBlock.java
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockCactus extends Block {
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable {
|
||||
-public class CactusBlock extends Block {
|
||||
+public class CactusBlock 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 @@
|
||||
@@ -30,6 +30,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
|
||||
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
+ if (!p_196267_2_.isAreaLoaded(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 @@
|
||||
@@ -42,6 +43,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 @@
|
||||
BlockState blockstate = p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(0));
|
||||
@@ -50,7 +52,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);
|
||||
}
|
||||
@@ -35,29 +35,29 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,8 +94,8 @@
|
||||
@@ -85,8 +88,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();
|
||||
+ BlockState 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(), Direction.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_) {
|
||||
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
|
||||
@@ -104,4 +107,14 @@
|
||||
public boolean func_196266_a(BlockState 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;
|
||||
+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) {
|
||||
+ return net.minecraftforge.common.PlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ return func_176223_P();
|
||||
+ public BlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
--- a/net/minecraft/block/ChorusFlowerBlock.java
|
||||
+++ b/net/minecraft/block/ChorusFlowerBlock.java
|
||||
@@ -30,9 +30,9 @@
|
||||
p_196267_2_.func_175655_b(p_196267_3_, true);
|
||||
} else {
|
||||
BlockPos blockpos = p_196267_3_.func_177984_a();
|
||||
- if (p_196267_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < 256) {
|
||||
+ if (p_196267_2_.func_175623_d(blockpos) && blockpos.func_177956_o() < p_196267_2_.func_201675_m().getHeight()) {
|
||||
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;
|
||||
BlockState blockstate = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b());
|
||||
@@ -57,7 +57,7 @@
|
||||
if (j < 2 || j <= p_196267_4_.nextInt(flag1 ? 5 : 4)) {
|
||||
flag = true;
|
||||
}
|
||||
- } else if (blockstate.func_196958_f()) {
|
||||
+ } else if (blockstate.isAir(p_196267_2_, p_196267_3_.func_177977_b())) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@
|
||||
BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
Block block = blockstate.func_177230_c();
|
||||
if (block != this.field_196405_b && block != Blocks.field_150377_bs) {
|
||||
- if (!blockstate.func_196958_f()) {
|
||||
+ if (!blockstate.isAir(p_196260_2_, p_196260_3_.func_177977_b())) {
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = false;
|
||||
@@ -140,7 +140,7 @@
|
||||
}
|
||||
|
||||
flag = true;
|
||||
- } else if (!blockstate1.func_196958_f()) {
|
||||
+ } else if (!blockstate1.isAir(p_196260_2_, p_196260_3_.func_177972_a(direction))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/net/minecraft/block/CocoaBlock.java
|
||||
+++ b/net/minecraft/block/CocoaBlock.java
|
||||
@@ -30,10 +30,11 @@
|
||||
}
|
||||
|
||||
public void func_196267_b(BlockState 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_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--- a/net/minecraft/block/ComparatorBlock.java
|
||||
+++ b/net/minecraft/block/ComparatorBlock.java
|
||||
@@ -66,7 +66,7 @@
|
||||
blockstate = p_176397_1_.func_180495_p(blockpos);
|
||||
if (blockstate.func_185912_n()) {
|
||||
i = blockstate.func_185888_a(p_176397_1_, blockpos);
|
||||
- } else if (blockstate.func_196958_f()) {
|
||||
+ } else if (blockstate.isAir(p_176397_1_, blockpos)) {
|
||||
ItemFrameEntity itemframeentity = this.func_176461_a(p_176397_1_, direction, blockpos);
|
||||
if (itemframeentity != null) {
|
||||
i = itemframeentity.func_174866_q();
|
||||
@@ -152,4 +152,16 @@
|
||||
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
|
||||
p_206840_1_.func_206894_a(field_185512_D, field_176463_b, field_196348_c);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onNeighborChange(BlockState 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()) {
|
||||
+ state.func_215697_a((World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor, false);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
--- a/net/minecraft/block/CropsBlock.java
|
||||
+++ b/net/minecraft/block/CropsBlock.java
|
||||
@@ -59,12 +59,14 @@
|
||||
|
||||
public void func_196267_b(BlockState 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_.isAreaLoaded(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_, 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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,9 +95,9 @@
|
||||
for(int j = -1; j <= 1; ++j) {
|
||||
float f1 = 0.0F;
|
||||
BlockState blockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
|
||||
- if (blockstate.func_177230_c() == Blocks.field_150458_ak) {
|
||||
+ if (blockstate.canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.Direction.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) {
|
||||
f1 = 1.0F;
|
||||
- if (blockstate.func_177229_b(FarmlandBlock.field_176531_a) > 0) {
|
||||
+ if (blockstate.isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) {
|
||||
f1 = 3.0F;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +133,7 @@
|
||||
}
|
||||
|
||||
public void func_196262_a(BlockState p_196262_1_, World p_196262_2_, BlockPos p_196262_3_, Entity p_196262_4_) {
|
||||
- if (p_196262_4_ instanceof RavagerEntity && p_196262_2_.func_82736_K().func_223586_b(GameRules.field_223599_b)) {
|
||||
+ if (p_196262_4_ instanceof RavagerEntity && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_196262_2_, p_196262_4_)) {
|
||||
p_196262_2_.func_175655_b(p_196262_3_, true);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/DeadBushBlock.java
|
||||
+++ b/net/minecraft/block/DeadBushBlock.java
|
||||
@@ -5,7 +5,7 @@
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
-public class DeadBushBlock extends BushBlock {
|
||||
+public class DeadBushBlock extends BushBlock 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 DeadBushBlock(Block.Properties p_i48418_1_) {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/DetectorRailBlock.java
|
||||
+++ b/net/minecraft/block/DetectorRailBlock.java
|
||||
@@ -126,6 +126,8 @@
|
||||
|
||||
public int func_180641_l(BlockState p_180641_1_, World p_180641_2_, BlockPos p_180641_3_) {
|
||||
if (p_180641_1_.func_177229_b(field_176574_M)) {
|
||||
+ List<AbstractMinecartEntity> carts = this.func_200878_a(p_180641_2_, p_180641_3_, AbstractMinecartEntity.class, null);
|
||||
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
|
||||
List<MinecartCommandBlockEntity> list = this.func_200878_a(p_180641_2_, p_180641_3_, MinecartCommandBlockEntity.class, (Predicate<Entity>)null);
|
||||
if (!list.isEmpty()) {
|
||||
return list.get(0).func_145822_e().func_145760_g();
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/block/DoublePlantBlock.java
|
||||
+++ b/net/minecraft/block/DoublePlantBlock.java
|
||||
@@ -39,7 +39,7 @@
|
||||
@Nullable
|
||||
public BlockState 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_201675_m().getHeight() - 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_, BlockState p_180633_3_, LivingEntity p_180633_4_, ItemStack p_180633_5_) {
|
||||
@@ -51,6 +51,7 @@
|
||||
return super.func_196260_a(p_196260_1_, p_196260_2_, p_196260_3_);
|
||||
} else {
|
||||
BlockState blockstate = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
+ 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.
|
||||
return blockstate.func_177230_c() == this && blockstate.func_177229_b(field_176492_b) == DoubleBlockHalf.LOWER;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/DropperBlock.java
|
||||
+++ b/net/minecraft/block/DropperBlock.java
|
||||
@@ -37,7 +37,7 @@
|
||||
p_176439_1_.func_217379_c(1001, p_176439_2_, 0);
|
||||
} else {
|
||||
ItemStack itemstack = dispensertileentity.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_, dispensertileentity, i, itemstack)) {
|
||||
Direction direction = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a);
|
||||
IInventory iinventory = HopperTileEntity.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(direction));
|
||||
ItemStack itemstack1;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/block/BlockEnchantmentTable.java
|
||||
+++ b/net/minecraft/block/BlockEnchantmentTable.java
|
||||
@@ -49,7 +49,7 @@
|
||||
--- a/net/minecraft/block/EnchantingTableBlock.java
|
||||
+++ b/net/minecraft/block/EnchantingTableBlock.java
|
||||
@@ -53,7 +53,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);
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/block/FallingBlock.java
|
||||
+++ b/net/minecraft/block/FallingBlock.java
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_) {
|
||||
- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0) {
|
||||
+ if (p_176503_1_.func_175623_d(p_176503_2_.func_177977_b()) || func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0) {
|
||||
if (!p_176503_1_.field_72995_K) {
|
||||
FallingBlockEntity fallingblockentity = new FallingBlockEntity(p_176503_1_, (double)p_176503_2_.func_177958_n() + 0.5D, (double)p_176503_2_.func_177956_o(), (double)p_176503_2_.func_177952_p() + 0.5D, p_176503_1_.func_180495_p(p_176503_2_));
|
||||
this.func_149829_a(fallingblockentity);
|
||||
@@ -68,7 +68,7 @@
|
||||
public void func_180655_c(BlockState p_180655_1_, World p_180655_2_, BlockPos p_180655_3_, Random p_180655_4_) {
|
||||
if (p_180655_4_.nextInt(16) == 0) {
|
||||
BlockPos blockpos = p_180655_3_.func_177977_b();
|
||||
- if (func_185759_i(p_180655_2_.func_180495_p(blockpos))) {
|
||||
+ if (p_180655_2_.func_175623_d(blockpos) || func_185759_i(p_180655_2_.func_180495_p(blockpos))) {
|
||||
double d0 = (double)((float)p_180655_3_.func_177958_n() + p_180655_4_.nextFloat());
|
||||
double d1 = (double)p_180655_3_.func_177956_o() - 0.05D;
|
||||
double d2 = (double)((float)p_180655_3_.func_177952_p() + p_180655_4_.nextFloat());
|
||||
+18
-9
@@ -1,24 +1,33 @@
|
||||
--- a/net/minecraft/block/BlockFarmland.java
|
||||
+++ b/net/minecraft/block/BlockFarmland.java
|
||||
@@ -79,7 +79,7 @@
|
||||
--- a/net/minecraft/block/FarmlandBlock.java
|
||||
+++ b/net/minecraft/block/FarmlandBlock.java
|
||||
@@ -73,7 +73,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 && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_223586_b(GameRules.field_223599_b)) && p_180658_3_.func_213311_cf() * p_180658_3_.func_213311_cf() * p_180658_3_.func_213302_cg() > 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 @@
|
||||
@@ -84,9 +84,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;
|
||||
- return block instanceof CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock;
|
||||
+ 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());
|
||||
+ BlockState 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_, Direction.UP, (net.minecraftforge.common.IPlantable)state.func_177230_c());
|
||||
}
|
||||
|
||||
private static boolean func_176530_e(IWorldReaderBase p_176530_0_, BlockPos p_176530_1_) {
|
||||
private static boolean func_176530_e(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return false;
|
||||
+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_0_, p_176530_1_);
|
||||
}
|
||||
|
||||
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
|
||||
+72
-79
@@ -1,55 +1,47 @@
|
||||
--- a/net/minecraft/block/BlockFire.java
|
||||
+++ b/net/minecraft/block/BlockFire.java
|
||||
--- a/net/minecraft/block/FireBlock.java
|
||||
+++ b/net/minecraft/block/FireBlock.java
|
||||
@@ -64,13 +64,13 @@
|
||||
public BlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) {
|
||||
BlockPos blockpos = p_196448_2_.func_177977_b();
|
||||
BlockState blockstate = p_196448_1_.func_180495_p(blockpos);
|
||||
- if (!this.func_196446_i(blockstate) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) {
|
||||
+ if (!this.canCatchFire(p_196448_1_, p_196448_2_, Direction.UP) && !Block.func_220056_d(blockstate, p_196448_1_, blockpos, Direction.UP)) {
|
||||
BlockState blockstate1 = this.func_176223_P();
|
||||
|
||||
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);
|
||||
for(Direction direction : Direction.values()) {
|
||||
BooleanProperty booleanproperty = field_196449_B.get(direction);
|
||||
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())));
|
||||
- blockstate1 = blockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.func_196446_i(p_196448_1_.func_180495_p(p_196448_2_.func_177972_a(direction)))));
|
||||
+ blockstate1 = blockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.canCatchFire(p_196448_1_, p_196448_2_.func_177972_a(direction), direction.func_176734_d())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,12 +98,13 @@
|
||||
@@ -91,12 +91,14 @@
|
||||
|
||||
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
|
||||
public void func_196267_b(BlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) {
|
||||
if (p_196267_2_.func_82736_K().func_223586_b(GameRules.field_223598_a)) {
|
||||
+ if (!p_196267_2_.isAreaLoaded(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_);
|
||||
p_196267_2_.func_217377_a(p_196267_3_, false);
|
||||
}
|
||||
|
||||
- Block block = p_196267_2_.func_180495_p(p_196267_3_.func_177977_b()).func_177230_c();
|
||||
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);
|
||||
+ BlockState 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(), Direction.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_);
|
||||
}
|
||||
|
||||
p_196267_2_.func_217377_a(p_196267_3_, false);
|
||||
@@ -118,7 +120,7 @@
|
||||
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_);
|
||||
+ if (i == 15 && p_196267_4_.nextInt(4) == 0 && !this.canCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), Direction.UP)) {
|
||||
p_196267_2_.func_217377_a(p_196267_3_, false);
|
||||
return;
|
||||
}
|
||||
@@ -132,12 +133,12 @@
|
||||
@@ -126,12 +128,12 @@
|
||||
|
||||
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
|
||||
int k = flag1 ? -50 : 0;
|
||||
@@ -59,110 +51,111 @@
|
||||
- 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);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i, Direction.WEST);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i, Direction.EAST);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i, Direction.UP);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i, Direction.DOWN);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i, Direction.SOUTH);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i, Direction.NORTH);
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
|
||||
for(int l = -1; l <= 1; ++l) {
|
||||
@@ -175,16 +176,18 @@
|
||||
@@ -169,16 +171,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_);
|
||||
- private int func_220274_q(BlockState p_220274_1_) {
|
||||
+ @Deprecated //Forge: Use IForgeBlockState.getFlammability, Public for default implementation only.
|
||||
+ public int func_220274_q(BlockState p_220274_1_) {
|
||||
return p_220274_1_.func_196959_b(BlockStateProperties.field_208198_y) && p_220274_1_.func_177229_b(BlockStateProperties.field_208198_y) ? 0 : this.field_149848_b.getInt(p_220274_1_.func_177230_c());
|
||||
}
|
||||
|
||||
- private int func_220275_r(BlockState p_220275_1_) {
|
||||
+ @Deprecated //Forge: Use IForgeBlockState.getFireSpreadSpeed
|
||||
public int func_176534_d(Block p_176534_1_) {
|
||||
return this.field_149849_a.getInt(p_176534_1_);
|
||||
+ public int func_220275_r(BlockState p_220275_1_) {
|
||||
return p_220275_1_.func_196959_b(BlockStateProperties.field_208198_y) && p_220275_1_.func_177229_b(BlockStateProperties.field_208198_y) ? 0 : this.field_149849_a.getInt(p_220275_1_.func_177230_c());
|
||||
}
|
||||
|
||||
- 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 = this.func_220274_q(p_176536_1_.func_180495_p(p_176536_2_));
|
||||
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, Direction 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_);
|
||||
BlockState blockstate = 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 @@
|
||||
@@ -199,7 +203,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())) {
|
||||
for(Direction direction : Direction.values()) {
|
||||
- if (this.func_196446_i(p_196447_1_.func_180495_p(p_196447_2_.func_177972_a(direction)))) {
|
||||
+ if (this.canCatchFire(p_196447_1_, p_196447_2_.func_177972_a(direction), direction.func_176734_d())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +222,7 @@
|
||||
int i = 0;
|
||||
@@ -215,13 +219,14 @@
|
||||
|
||||
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);
|
||||
for(Direction direction : Direction.values()) {
|
||||
BlockState blockstate = p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(direction));
|
||||
- i = Math.max(this.func_220275_r(blockstate), i);
|
||||
+ i = Math.max(blockstate.getFlammability(p_176538_1_, p_176538_2_.func_177972_a(direction), direction.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;
|
||||
public boolean func_196446_i(BlockState p_196446_1_) {
|
||||
return this.func_220275_r(p_196446_1_) > 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);
|
||||
}
|
||||
@@ -246,8 +251,8 @@
|
||||
|
||||
- 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()))) {
|
||||
BlockPos blockpos = p_180655_3_.func_177977_b();
|
||||
BlockState blockstate = p_180655_2_.func_180495_p(blockpos);
|
||||
- if (!this.func_196446_i(blockstate) && !Block.func_220056_d(blockstate, p_180655_2_, blockpos, Direction.UP)) {
|
||||
- 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)) {
|
||||
+ if (!this.canCatchFire(p_180655_2_, blockpos, Direction.UP) && !Block.func_220056_d(blockstate, p_180655_2_, blockpos, Direction.UP)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, blockpos.func_177976_e(), Direction.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 @@
|
||||
@@ -256,7 +261,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)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), Direction.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 @@
|
||||
@@ -265,7 +270,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)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), Direction.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 @@
|
||||
@@ -274,7 +279,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)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), Direction.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 @@
|
||||
@@ -283,7 +288,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)) {
|
||||
+ if (this.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), Direction.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 @@
|
||||
@@ -311,10 +316,23 @@
|
||||
}
|
||||
|
||||
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
|
||||
@@ -179,10 +172,10 @@
|
||||
+ * @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) {
|
||||
+ public boolean canCatchFire(IBlockReader world, BlockPos pos, Direction 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);
|
||||
FireBlock fireblock = (FireBlock)Blocks.field_150480_ab;
|
||||
fireblock.func_180686_a(Blocks.field_196662_n, 5, 20);
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ b/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -22,7 +22,7 @@
|
||||
import net.minecraft.world.World;
|
||||
--- a/net/minecraft/block/FlowerPotBlock.java
|
||||
+++ b/net/minecraft/block/FlowerPotBlock.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockFlowerPot extends Block {
|
||||
public class FlowerPotBlock 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);
|
||||
@@ -4,7 +4,7 @@
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
+@Deprecated //Forge: Do not use, use IBlockState.hasTileEntity/Blocks.createTileEntity
|
||||
+@Deprecated //Forge: Do not use, use BlockState.hasTileEntity/Block.createTileEntity
|
||||
public interface ITileEntityProvider {
|
||||
@Nullable
|
||||
TileEntity func_196283_a_(IBlockReader p_196283_1_);
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/block/LadderBlock.java
|
||||
+++ b/net/minecraft/block/LadderBlock.java
|
||||
@@ -94,6 +94,11 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean isLadder(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
public BlockRenderLayer func_180664_k() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/LeavesBlock.java
|
||||
+++ b/net/minecraft/block/LeavesBlock.java
|
||||
@@ -18,7 +18,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public class LeavesBlock extends Block {
|
||||
+public class LeavesBlock 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;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/MushroomBlock.java
|
||||
+++ b/net/minecraft/block/MushroomBlock.java
|
||||
@@ -62,7 +62,7 @@
|
||||
BlockState blockstate = p_196260_2_.func_180495_p(blockpos);
|
||||
Block block = blockstate.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_(blockstate, p_196260_2_, blockpos);
|
||||
+ return p_196260_2_.func_201669_a(p_196260_3_, 0) < 13 && blockstate.canSustainPlant(p_196260_2_, blockpos, net.minecraft.util.Direction.UP, this);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/NetherPortalBlock.java
|
||||
+++ b/net/minecraft/block/NetherPortalBlock.java
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
public boolean func_176548_d(IWorld p_176548_1_, BlockPos p_176548_2_) {
|
||||
NetherPortalBlock.Size netherportalblock$size = this.func_201816_b(p_176548_1_, p_176548_2_);
|
||||
- if (netherportalblock$size != null) {
|
||||
+ if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_1_, p_176548_2_, netherportalblock$size)) {
|
||||
netherportalblock$size.func_150859_c();
|
||||
return true;
|
||||
} else {
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/block/NetherWartBlock.java
|
||||
+++ b/net/minecraft/block/NetherWartBlock.java
|
||||
@@ -33,9 +33,10 @@
|
||||
|
||||
public void func_196267_b(BlockState 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_);
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
--- a/net/minecraft/block/BlockNote.java
|
||||
+++ b/net/minecraft/block/BlockNote.java
|
||||
--- a/net/minecraft/block/NoteBlock.java
|
||||
+++ b/net/minecraft/block/NoteBlock.java
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
@@ -10,23 +10,23 @@
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
if (p_196250_2_.field_72995_K) {
|
||||
if (p_220051_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));
|
||||
- p_220051_1_ = p_220051_1_.func_177231_a(field_196485_c);
|
||||
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_220051_2_, p_220051_3_, p_220051_1_, p_220051_1_.func_177229_b(field_196485_c), p_220051_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);
|
||||
+ p_220051_1_ = (BlockState)p_220051_1_.func_206870_a(field_196485_c, _new);
|
||||
p_220051_2_.func_180501_a(p_220051_3_, p_220051_1_, 3);
|
||||
this.func_196482_a(p_220051_2_, p_220051_3_);
|
||||
p_220051_4_.func_195066_a(Stats.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_) {
|
||||
public boolean func_189539_a(BlockState 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);
|
||||
p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, p_189539_1_.func_177229_b(field_196483_a).func_208088_a(), SoundCategory.RECORDS, 3.0F, f);
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/block/OreBlock.java
|
||||
+++ b/net/minecraft/block/OreBlock.java
|
||||
@@ -29,12 +29,10 @@
|
||||
|
||||
public void func_220062_a(BlockState p_220062_1_, World p_220062_2_, BlockPos p_220062_3_, ItemStack p_220062_4_) {
|
||||
super.func_220062_a(p_220062_1_, p_220062_2_, p_220062_3_, p_220062_4_);
|
||||
- if (EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_220062_4_) == 0) {
|
||||
- int i = this.func_220281_a(p_220062_2_.field_73012_v);
|
||||
- if (i > 0) {
|
||||
- this.func_180637_b(p_220062_2_, p_220062_3_, i);
|
||||
- }
|
||||
- }
|
||||
+ }
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune, int silktouch) {
|
||||
+ return silktouch == 0 ? this.func_220281_a(RANDOM) : 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
--- a/net/minecraft/block/PistonBlock.java
|
||||
+++ b/net/minecraft/block/PistonBlock.java
|
||||
@@ -197,7 +197,7 @@
|
||||
}
|
||||
|
||||
if (!flag1) {
|
||||
- if (p_189539_4_ != 1 || blockstate.func_196958_f() || !func_185646_a(blockstate, p_189539_2_, blockpos, direction.func_176734_d(), false, direction) || blockstate.func_185905_o() != PushReaction.NORMAL && block != Blocks.field_150331_J && block != Blocks.field_150320_F) {
|
||||
+ if (p_189539_4_ != 1 || blockstate.isAir(p_189539_2_, blockpos) || !func_185646_a(blockstate, p_189539_2_, blockpos, direction.func_176734_d(), false, direction) || blockstate.func_185905_o() != PushReaction.NORMAL && block != Blocks.field_150331_J && block != Blocks.field_150320_F) {
|
||||
p_189539_2_.func_217377_a(p_189539_3_.func_177972_a(direction), false);
|
||||
} else {
|
||||
this.func_176319_a(p_189539_2_, p_189539_3_, direction, false);
|
||||
@@ -238,7 +238,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !block.func_149716_u();
|
||||
+ return !p_185646_0_.hasTileEntity();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -274,7 +274,7 @@
|
||||
for(int j = list2.size() - 1; j >= 0; --j) {
|
||||
BlockPos blockpos2 = list2.get(j);
|
||||
BlockState blockstate = p_176319_1_.func_180495_p(blockpos2);
|
||||
- TileEntity tileentity = blockstate.func_177230_c().func_149716_u() ? p_176319_1_.func_175625_s(blockpos2) : null;
|
||||
+ TileEntity tileentity = blockstate.hasTileEntity() ? p_176319_1_.func_175625_s(blockpos2) : null;
|
||||
func_220059_a(blockstate, p_176319_1_, blockpos2, tileentity);
|
||||
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
|
||||
--k;
|
||||
@@ -328,6 +328,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 BlockState rotate(BlockState 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 BlockState func_185471_a(BlockState 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,29 @@
|
||||
--- a/net/minecraft/block/PoweredRailBlock.java
|
||||
+++ b/net/minecraft/block/PoweredRailBlock.java
|
||||
@@ -14,10 +14,16 @@
|
||||
public class PoweredRailBlock extends AbstractRailBlock {
|
||||
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 PoweredRailBlock(Block.Properties p_i48349_1_) {
|
||||
- super(true, p_i48349_1_);
|
||||
+ this(p_i48349_1_, false);
|
||||
+ }
|
||||
+
|
||||
+ protected PoweredRailBlock(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_, BlockState p_176566_3_, boolean p_176566_4_, int p_176566_5_) {
|
||||
@@ -105,7 +111,7 @@
|
||||
RailShape railshape = blockstate.func_177229_b(field_176568_b);
|
||||
if (p_208071_5_ != RailShape.EAST_WEST || railshape != RailShape.NORTH_SOUTH && railshape != RailShape.ASCENDING_NORTH && railshape != RailShape.ASCENDING_SOUTH) {
|
||||
if (p_208071_5_ != RailShape.NORTH_SOUTH || railshape != RailShape.EAST_WEST && railshape != RailShape.ASCENDING_EAST && railshape != RailShape.ASCENDING_WEST) {
|
||||
- if (blockstate.func_177229_b(field_176569_M)) {
|
||||
+ if (!(blockstate.func_177230_c() instanceof PoweredRailBlock) || isActivator != ((PoweredRailBlock)blockstate.func_177230_c()).isActivator) {
|
||||
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
|
||||
} else {
|
||||
return false;
|
||||
+15
-15
@@ -1,57 +1,57 @@
|
||||
--- a/net/minecraft/block/BlockRailState.java
|
||||
+++ b/net/minecraft/block/BlockRailState.java
|
||||
@@ -16,14 +16,16 @@
|
||||
private IBlockState field_196923_d;
|
||||
--- a/net/minecraft/block/RailState.java
|
||||
+++ b/net/minecraft/block/RailState.java
|
||||
@@ -15,14 +15,16 @@
|
||||
private BlockState 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_) {
|
||||
public RailState(World p_i47755_1_, BlockPos p_i47755_2_, BlockState 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();
|
||||
this.field_196922_c = (AbstractRailBlock)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.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 @@
|
||||
@@ -178,7 +180,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())) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -189,7 +191,7 @@
|
||||
@@ -188,7 +190,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())) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
@@ -299,7 +301,7 @@
|
||||
@@ -298,7 +300,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())) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -309,7 +311,7 @@
|
||||
@@ -308,7 +310,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())) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
Loaded 100 of 1479 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user